Mirror of https://github.com/improsocial/impro An extensible Bluesky client for web impro.social
5

Configure Feed

Select the types of activity you want to include in your feed.

Use global preferences for global label types

Grace Kind (Jan 27, 2026, 10:41 PM -0600) 32facc0f f114b0f6

+17 -11
.prettierrc

This is a binary file and will not be displayed.

+1 -1
package.json
··· 1 1 { 2 2 "name": "impro", 3 - "version": "0.6.15", 3 + "version": "0.6.17", 4 4 "type": "module", 5 5 "scripts": { 6 6 "start": "rm -rf build && NODE_ENV=development eleventy --serve",
+1 -1
src/js/components/report-dialog.js
··· 2 2 import { Component } from "/js/components/component.js"; 3 3 import { ScrollLock } from "/js/scrollLock.js"; 4 4 import { avatarTemplate } from "/js/templates/avatar.template.js"; 5 + import { BSKY_LABELER_DID } from "/js/config.js"; 5 6 6 - const BSKY_LABELER_DID = "did:plc:ar7c4by46qjdydhdevvrndac"; 7 7 const BSKY_ONLY_CATEGORIES = ["childSafety"]; 8 8 const BSKY_ONLY_REASON_TYPES = [ 9 9 "tools.ozone.report.defs#reasonViolenceExtremistContent",
+1
src/js/config.js
··· 8 8 export const DISCOVER_FEED_URI = 9 9 "at://did:plc:z72i7hdynmk6r22z27h6tvur/app.bsky.feed.generator/whats-hot"; 10 10 export const CHAT_MESSAGES_PAGE_SIZE = 100; 11 + export const BSKY_LABELER_DID = "did:plc:ar7c4by46qjdydhdevvrndac";
+4
src/js/dataHelpers.js
··· 532 532 return GLOBAL_LABELS.find((label) => label.identifier === labelValue) ?? null; 533 533 } 534 534 535 + export function isGlobalLabel(labelValue) { 536 + return GLOBAL_LABELS.some((label) => label.identifier === labelValue); 537 + } 538 + 535 539 export function isPinnedPost(feedItem) { 536 540 return feedItem.reason?.$type === "app.bsky.feed.defs#reasonPin"; 537 541 }
+3 -2
src/js/preferences.js
··· 6 6 getLabelNameAndDescription, 7 7 getGlobalLabelDefinition, 8 8 getDefaultLabelSetting, 9 + isGlobalLabel, 9 10 } from "/js/dataHelpers.js"; 10 11 import { deepClone } from "/js/utils.js"; 11 - import { DISCOVER_FEED_URI } from "/js/config.js"; 12 + import { DISCOVER_FEED_URI, BSKY_LABELER_DID } from "/js/config.js"; 12 13 import { getTagsFromFacets } from "/js/facetHelpers.js"; 13 14 14 15 function getContentTextFromEmbed(embed) { ··· 215 216 } 216 217 const pref = this.getContentLabelPref({ 217 218 label: label.val, 218 - labelerDid: label.src, 219 + labelerDid: isGlobalLabel(label.val) ? BSKY_LABELER_DID : label.src, 219 220 }); 220 221 return pref?.visibility ?? getDefaultLabelSetting(labelDefinition); 221 222 }
+7 -7
tests/specs/preferences.test.js
··· 1460 1460 policies: { 1461 1461 labelValueDefinitions: [ 1462 1462 { 1463 - identifier: "nudity", 1463 + identifier: "nudity_custom", 1464 1464 blurs: "media", 1465 1465 defaultSetting: "warn", 1466 1466 locales: [{ lang: "en", name: "Nudity" }], ··· 1472 1472 const obj = [ 1473 1473 { 1474 1474 $type: "app.bsky.actor.defs#contentLabelPref", 1475 - label: "nudity", 1475 + label: "nudity_custom", 1476 1476 labelerDid: "did:labeler1", 1477 1477 visibility: "hide", 1478 1478 }, ··· 1480 1480 1481 1481 const preferences = new Preferences(obj, labelerDefs); 1482 1482 const post = { 1483 - labels: [{ src: "did:labeler1", val: "nudity" }], 1483 + labels: [{ src: "did:labeler1", val: "nudity_custom" }], 1484 1484 }; 1485 1485 const result = preferences.getMediaLabel(post); 1486 1486 1487 1487 assertEquals(result.visibility, "hide"); 1488 - assertEquals(result.labelDefinition.identifier, "nudity"); 1488 + assertEquals(result.labelDefinition.identifier, "nudity_custom"); 1489 1489 }); 1490 1490 1491 1491 it("should ignore content labels (blurs: content)", () => { ··· 1968 1968 }); 1969 1969 1970 1970 it("should allow user to change self-label visibility", () => { 1971 - // User sets porn to "warn" instead of default "hide" 1971 + // User sets porn to "warn" instead of default "hide" on the global labeler 1972 1972 const obj = [ 1973 1973 { 1974 1974 $type: "app.bsky.actor.defs#contentLabelPref", 1975 1975 label: "porn", 1976 - labelerDid: "did:plc:author123", 1976 + labelerDid: "did:plc:ar7c4by46qjdydhdevvrndac", 1977 1977 visibility: "warn", 1978 1978 }, 1979 1979 ]; ··· 2218 2218 { 2219 2219 $type: "app.bsky.actor.defs#contentLabelPref", 2220 2220 label: "porn", 2221 - labelerDid: "did:plc:author123", 2221 + labelerDid: "did:plc:ar7c4by46qjdydhdevvrndac", 2222 2222 visibility: "warn", 2223 2223 }, 2224 2224 {