From 6aa40636e75fa59d5f47f948e4af31ad3a220f83 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 16 Nov 2026 10:50:45 +0100 Subject: [PATCH] Register every UI icon word in the registry Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WzxdWYNS1qAMRdgAtbr5Rq --- DOCS-icon-words.md | 2 +- .../tests/test_real_icon_registry.py | 59 +++++ web/src/icons/coverage.test.ts | 56 +++++ web/src/icons/iconText.ts | 11 + web/src/icons/inline.test.ts | 72 ++++++ web/src/icons/registry.json | 220 +++++++++++++++++- web/src/icons/registry.test.ts | 13 +- web/src/icons/render.test.ts | 9 +- web/src/icons/render.ts | 18 +- web/src/icons/staticIcons.test.ts | 34 +++ web/src/icons/wiring.test.ts | 8 +- web/src/ui/build.test.ts | 15 +- web/src/ui/build.ts | 54 ++--- 13 files changed, 505 insertions(+), 66 deletions(-) create mode 100644 steam_backlog_enforcer/tests/test_real_icon_registry.py create mode 100644 web/src/icons/coverage.test.ts create mode 100644 web/src/icons/iconText.ts create mode 100644 web/src/icons/inline.test.ts create mode 100644 web/src/icons/staticIcons.test.ts diff --git a/DOCS-icon-words.md b/DOCS-icon-words.md index 4b04445..c32bf4d 100644 --- a/DOCS-icon-words.md +++ b/DOCS-icon-words.md @@ -7,7 +7,7 @@ Part of the web control API ([DOCS-web-control-api.md](DOCS-web-control-api.md)) `GET /api/icon-words` → `IconLedger`; `POST` or `PUT /api/icon-words/{icon_id}` with `{word?, glyph?}` → `IconLedger` (200). Writes need Host, Origin and `X-SBE-Token` like every non-GET. TS mirror: `web/src/api/iconWordsContract.ts`. - **Ledger** `web/src/ui/icon_words.json` (a repo file the user commits; `SBE_ICON_WORDS` overrides the path): `{"version":1,"icons":{"":{"word":""|null,"glyph":""|null}}}`. Absent id = unanswered; no `word` key = only a glyph chosen; `word: null` = skipped (no label); `glyph: null` = default. The server reads it per request and never builds from it (`_web_build` ignores it); writes go to a sibling temp file, then rename. -- **Registry** `web/src/icons/registry.json`: id → default glyph, spoken name, description, 3 suggested words, 3 alternative glyphs (`registry.ts` types it). +- **Registry** `web/src/icons/registry.json`: id → default glyph, spoken name, description, 3 suggested words, 3 alternative glyphs (`registry.ts` types it). It lists every icon the UI paints, in picker order: new ids go at the end so answered icons keep their place and the picker opens at the first unanswered one. Ids match `[a-z][a-z0-9_.-]{0,63}`. `web/src/icons/coverage.test.ts` fails on any pictograph or icon symbol typed as a literal in non-test source; draw icons with `glyph(id)`, `iconInline(id)`, `iconMark(id)` or `pill(tone, text, id)`. - **`word`**: any text; casing kept, whitespace runs collapsed; 1–40 characters, no control characters, else `invalid_params`. `null` skips. **`glyph`**: the default or one of the icon's 3 alternatives (the default is stored as `null`), else `invalid_params`. Unknown id → `not_found`; empty body or unknown key → `invalid_params`. - Every served `.html` page carries the ledger as `