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