From b913ff67f5aea6157d3b7907b6513045f1dd0ad7 Mon Sep 17 00:00:00 2001 From: Krzysztof kuhy Rudnicki Date: Mon, 16 Nov 2026 10:51:26 +0100 Subject: [PATCH] Route gaming, backlog and library icons Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01WzxdWYNS1qAMRdgAtbr5Rq --- web/src/lib/charts/timeline.ts | 14 ++- web/src/library/browserState.ts | 11 +- web/src/library/browserToolbar.ts | 15 ++- web/src/library/gameCard.ts | 4 +- web/src/library/library.icons.test.ts | 55 +++++++++ web/src/library/searchBox.ts | 3 +- web/src/library/view.test.ts | 25 ++++- web/src/library/view.ts | 40 +++---- web/src/sections/backlog/filterPanel.ts | 82 +++++++------- web/src/sections/backlog/glyphs.ts | 78 +++++++------ web/src/sections/backlog/icons.test.ts | 104 ++++++++++++++++++ web/src/sections/backlog/planner.ts | 8 +- web/src/sections/backlog/plannerTable.test.ts | 3 +- web/src/sections/backlog/plannerTable.ts | 52 +++++---- web/src/sections/backlog/stats.ts | 25 +++-- web/src/sections/backlog/summary.ts | 48 ++++---- web/src/sections/backlog/textgate.test.ts | 18 +-- web/src/sections/dashboard.test.ts | 5 +- web/src/sections/dashboard.ts | 54 ++++----- web/src/sections/gaming/cards.ts | 83 ++++++++------ web/src/sections/gaming/icons.test.ts | 82 ++++++++++++++ web/src/sections/gaming/panel.ts | 7 +- web/src/sections/library.ts | 30 ++--- web/src/sections/picks.ts | 11 +- web/src/sections/store.ts | 9 +- 25 files changed, 603 insertions(+), 263 deletions(-) create mode 100644 web/src/library/library.icons.test.ts create mode 100644 web/src/sections/backlog/icons.test.ts create mode 100644 web/src/sections/gaming/icons.test.ts diff --git a/web/src/lib/charts/timeline.ts b/web/src/lib/charts/timeline.ts index e6c5a83..79ded9b 100644 --- a/web/src/lib/charts/timeline.ts +++ b/web/src/lib/charts/timeline.ts @@ -3,7 +3,9 @@ import type { EstimateResult } from '../../estimate' import { isoDate } from '../../format' +import { iconInline } from '../../icons/render' import type { Filters, WebStateInfo } from '../../types' +import { h } from '../dom' const W = 820 const H = 320 @@ -83,10 +85,14 @@ export function timelineChart( const box = document.createElement('div') box.className = 'chart' if (pts.length < 2) { - const hint = document.createElement('p') - hint.className = 'hint empty-state' - hint.innerHTML = 'Not enough games in scope to draw a timeline.' - box.append(hint) + box.append( + h( + 'p', + { class: 'hint empty-state' }, + iconInline('state.empty', 'empty-icon'), + h('span', { class: 'sr-only' }, 'Not enough games in scope to draw a timeline.'), + ), + ) return box } box.append(timelineSvg(pts, now)) diff --git a/web/src/library/browserState.ts b/web/src/library/browserState.ts index 755d806..154fe12 100644 --- a/web/src/library/browserState.ts +++ b/web/src/library/browserState.ts @@ -2,14 +2,15 @@ // `hash-state` (the Library page only) they live in the URL hash, so a // reload restores them. +import type { IconId } from '../icons/registry' import { readHash } from './hashState' import { NO_FILTERS, SORTS, type Filters, type SortKey } from './view' -/** Filter key, spoken checkbox label, its token in the hash's `f=` list, painted glyph. */ -export const FILTERS: [keyof Filters, string, string, string][] = [ - ['hideCompleted', 'Hide completed', 'completed', '๐Ÿ™ˆ๐Ÿ†'], - ['installedOnly', 'Installed only', 'installed', '๐Ÿ’พ'], - ['pickableOnly', 'Pickable only', 'pickable', '๐ŸŽฏ'], +/** Filter key, spoken checkbox label, its token in the hash's `f=` list, painted icon. */ +export const FILTERS: [keyof Filters, string, string, IconId][] = [ + ['hideCompleted', 'Hide completed', 'completed', 'lib.hide-completed'], + ['installedOnly', 'Installed only', 'installed', 'dash.installed'], + ['pickableOnly', 'Pickable only', 'pickable', 'lib.pickable'], ] export interface BrowserState { diff --git a/web/src/library/browserToolbar.ts b/web/src/library/browserToolbar.ts index 14d545d..2feebe1 100644 --- a/web/src/library/browserToolbar.ts +++ b/web/src/library/browserToolbar.ts @@ -3,6 +3,8 @@ // caret; the browser only writes values into it and hears every edit back. import type { LibraryGame } from '../api/contract' +import { iconText } from '../icons/iconText' +import { iconInline } from '../icons/render' import { h } from '../lib/dom' import { glyph } from '../ui/build' import { FILTERS, type BrowserState } from './browserState' @@ -31,7 +33,8 @@ export class BrowserToolbar { opts.onSort(this.sortSelect.value as SortKey) }, }, - SORTS.map((s) => h('option', { value: s.key, 'aria-label': s.label }, s.icon)), + // An