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.

Render unknown facets as plain text

Grace Kind (Jul 15, 2026, 7:58 PM -0500) 0be60015 4895ac23

+19 -2
+1 -1
package.json
··· 1 1 { 2 2 "name": "impro", 3 - "version": "0.17.172", 3 + "version": "0.17.173", 4 4 "type": "module", 5 5 "scripts": { 6 6 "start": "rm -rf \"${BUILD_DIR:-build}\" && NODE_ENV=development eleventy --serve",
+1 -1
src/js/templates/richText.template.js
··· 49 49 if (!KNOWN_UNSUPPORTED_FACET_TYPES.includes(feature.$type)) { 50 50 console.warn("unknown facet type " + feature.$type, feature); 51 51 } 52 - return null; 52 + return wrappedText; 53 53 } 54 54 } 55 55
+17
tests/unit/specs/templates/richText.template.test.js
··· 213 213 const richText = container.querySelector("[data-testid='rich-text']"); 214 214 assert.deepEqual(richText.textContent, text); 215 215 }); 216 + 217 + it("should render a facet with an unknown type as plain text", (t) => { 218 + t.mock.method(console, "warn", () => {}); 219 + const text = "before unknown after"; 220 + const facets = [ 221 + { 222 + index: { byteStart: 7, byteEnd: 14 }, 223 + features: [{ $type: "com.example.facet#mystery" }], 224 + }, 225 + ]; 226 + const result = richTextTemplate({ text, facets }); 227 + const container = document.createElement("div"); 228 + render(result, container); 229 + const richText = container.querySelector("[data-testid='rich-text']"); 230 + assert.deepEqual(richText.textContent, text); 231 + assert.deepEqual(container.querySelector("a"), null); 232 + }); 216 233 }); 217 234 218 235 describe("richTextTokensTemplate", () => {