Redesign the Storage Monitor as a storage-composition breakdown (snippets · datasets · app)

This commit is contained in:
2026-06-10 01:32:22 +03:00
parent e7de0cbb8a
commit 7599acd25e
12 changed files with 438 additions and 481 deletions
@@ -263,6 +263,31 @@ relative date and size), in a fixed-width leading slot so it never shifts adjace
_(Consulted via /council → GOV.UK Tag, Carbon status-indicator-pattern, APG. This bullet is the
contract; cite it, not the external source.)_
**Resolved — storage composition indicator.** The library-footer Storage Monitor (spec §02)
shows what storage is **made of** — Snippets · Datasets · App — as a proportional bar plus a
labelled legend, **not** a "used of quota" gauge. The browser quota is a padded, unreliable
approximation (web.dev → _storage-for-the-web_), so a budget fraction is false precision; we
show real measured sizes instead.
- **Not a meter.** No `role="meter"`/`progressbar`: a meter needs a meaningful maximum, and a
composition with no trustworthy ceiling has none (APG → `meter`: _"should not be used to
represent a value … [without] a meaningful maximum"_). The visual bar is **decorative**
(`aria-hidden`); the **legend's text labels + sizes are the accessible source of truth**, so
meaning never rests on hue (WCAG 1.4.1).
- **Part-to-whole in a tiny space.** A single proportional stacked bar suits a **few** segments
(we have three) — FT Visual Vocabulary (Part-to-whole) + Datawrapper (stacked bar for "a few
shares"; bar "when precise reading matters") — paired with absolute byte labels for the precise read.
- **Unavailable degrades, not disappears.** Snippets + datasets are measured from our own data, so
they always show; only the **App** segment (which needs the origin estimate) drops out when the
Storage Manager API is absent.
- **No proactive "almost full" warning.** Dropping the old 0.8/0.95 thresholds is intentional —
they keyed off the untrustworthy quota, and a fake fuel gauge fails NN/g #1 (_visibility of system
status_) more than it serves it. The genuine out-of-room event surfaces at **save time** as an
actionable error (`services/storage-errors.ts` → recover by deleting), satisfying NN/g #9.
_(Consulted via /council → WAI-ARIA APG `meter`, FT Visual Vocabulary + Datawrapper (part-to-whole),
web.dev storage, NN/g #1/#9, WCAG 1.4.1. This bullet is the contract; cite it, not the sources.)_
**Resolved — library search (Carbon active-search).** The snippet-library search (spec
§02) is an **unlabelled active-search input** pinned above the list: `type="search"` with a
leading magnifier and `aria-label="Search snippets"` (no visible label — the icon +