Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ Application screens (`type: "desktop-app"`) are built from eight primitives on t
| `link` | `label`, `icon`, `iconPosition`, `external`, `ariaLabel`, `state` | A standalone text action, at least 24 tall. With no `label` it hugs its glyphs (14px wide, 30 with `external`) and needs an `ariaLabel` (rendered as `aria-label` and `title`). A `text` node can hold inline links instead: `links: [{ start, end }]` character ranges of its content, drawn underlined and exempt from the 24px floor |
| `text-input` | `value`, `placeholder`, `icon`, `size` (`sm` 32 / `md` 40), `rows`, `error` (a message), `disabled`, `state` | A field whose border (`$border-strong` when the design system has it) is its only boundary; `error` draws an icon and the message below and turns the border `$danger` |
| `nav-item` | `label`, `icon`, `count`, `dotColor`, `active`, `depth` (0 / 1), `collapsed`, `state` | A 32px sidebar row. `active` draws an `$accent-tint` fill, a 2px `$accent` bar and a heavier label; `collapsed` is the 32×32 rail form, with the label as its accessible name; `dotColor` is an identity dot, never counted as an accent |
| `tabs` | `items: [{ label, count?, active?, disabled?, state? }]`, `variant` (`line` / `contained`), `size` (`sm` 32 / `md` 40) | One tablist; each tab is its own target. The active tab gets an indicator (`line`) or an `$accent-tint` fill (`contained`) |
| `tree-row` | `label`, `depth`, `expanded` (absent for a leaf), `icon`, `active`, `state` | A 32px row indented 16px per level, with a chevron when `expanded` is set |
| `tabs` | `items: [{ label, count?, active?, disabled?, state? }]`, `variant` (`line` / `contained`), `size` (`sm` 32 / `md` 40) | One tablist; each tab is its own target. The active tab gets an indicator (`line`) or an `$accent-tint` fill (`contained`); only the line underline is measured by `desktop-app-state-contrast` |
| `tree-row` | `label`, `depth`, `expanded` (absent for a leaf), `icon`, `active`, `state` | A 32px row indented 16px per level, with a chevron when `expanded` is set; `active` draws an `$accent-tint` fill, a 2px bar in `iconColor` (`$accent` by default) at the row's left edge at every depth, and a heavier label |
| `menu-row` | `label`, `icon`, `shortcut`, `checked`, `destructive`, `disabled`, `submenu`, `state` | A 32px menu item; the shortcut right-aligns in a muted `kbd` style, `destructive` uses `$danger` |
| `property-row` | `label`, `labelWidth` (96), one child | An inspector row: a muted label column, then its value (a control, a `text-input`, a `button`, a text). A control that is its only target is measured by the row's box. The row's `label` names a control directly inside it; with a blank label only text inside the row itself does (a sibling row's text does not count). The other desktop-app primitives drop any children |
| `divider` | `orientation` (`horizontal` / `vertical`), `inset` | A 1px `$border` hairline; vertical dividers separate panes |
Expand Down Expand Up @@ -933,8 +933,8 @@ Every result also carries a **`surface`** field: `{ type, device, source, rulesO
| `desktop-app-primary-count` | structure | info | Desktop-app only: two or more primary `button`s in one pane (any variant but `secondary`, `ghost` or `destructive` renders filled, so it counts; no variant included). A modal's `actions` with `variant: "primary"` count in the modal's pane. Primaries inside three or more same-shaped sibling frames, such as a card grid, don't count. |
| `desktop-app-overlay` | usability | warning / info | Desktop-app only: warns on a second `modal`; a `tooltip` with children; inside a modal, a table of more than ten body rows or a frame with `overflow: "auto"` that renders wider than the modal or scrolls sideways; an overlay that leaves the viewport (the root's size, else the window's; a modal wider than the viewport less 32px in both modes, in fast mode a popover or menu with numeric `x`/`y`/`width`/`height` and a placed modal's sides, in detailed mode every rendered overlay); a `popover` or `menu` on a canvas with a modal or a scrimmed drawer, which renders under the scrim. Infos: a second `toast`, a `danger` toast, an `anchor` naming no node or nothing clickable. |
| `desktop-app-focus-visible` | color | error / info | Desktop-app only, in each theme: a focus ring (`$focus-ring`, else `$accent`) below 3:1 against the pixels it covers unfocused (the backdrop behind the target; a tab's own fill for its inset ring). One error per ring and backdrop, with `nodeIds` and `count`; a target whose backdrop or ring cannot be read is listed in one info. Disabled targets are skipped. |
| `desktop-app-state-contrast` | color | warning | Desktop-app only, in each theme: an active `nav-item`'s bar or an active line tab's underline below 3:1 against its active fill, at rest or in hover. |
| `desktop-app-boundary` | color | warning | Desktop-app only, in each theme: a `text-input` border, an unchecked `checkbox` or `radio` outline, or an unchecked `toggle` track below 3:1 against what is behind it. A border that draws nothing (`transparent`, an unresolved token) counts as invisible; a field whose own fill clears 3:1 passes. `$border-strong` clears it on `bg-primary` and `bg-surface`. |
| `desktop-app-state-contrast` | color | warning | Desktop-app only, in each theme: an active `nav-item`'s or `tree-row`'s 2px bar, or an active line tab's underline, below 3:1 against its active fill, at rest or in hover. A contained tab draws no mark and is not measured. |
| `desktop-app-boundary` | color | warning | Desktop-app only, in each theme: a `text-input` or `select` border, an unchecked `checkbox` or `radio` outline, or an unchecked `toggle` track below 3:1 against what is behind it. A border that draws nothing (`transparent`, an unresolved token) counts as invisible; a field whose own fill clears 3:1 passes. `$border-strong` clears it on `bg-primary` and `bg-surface`. Not measured: a disabled control, a gradient or unreadable backdrop or colour. |
| `desktop-app-disabled` | color | info | Desktop-app only, when the `state` tokens set the disabled opacities: targets whose disabled content would draw within 1.1:1 of their enabled content. On every type, text inside a disabled clickable primitive is exempt from the text-contrast error. |

Repeated findings fold in this result: three or more warnings or infos with the same severity, category, rule (or tell) and theme come back as one entry when they also share their message — on its shape for members that carry a fix (each fix op holds its node's specifics), word for word apart from quoted node text for members without one. The entry keeps the first one's message and adds `nodeIds` (distinct), `count` and, when they had fixes, `fixes: [{ nodeId, op }]`. Errors never fold, and `canvas_autofix` works from the unfolded list.
Expand Down Expand Up @@ -1081,7 +1081,7 @@ Content stress test — does the design survive real data? Re-renders the canvas
|---|---|
| `long-text` | Non-data text ×2.2 plus one long unbroken token (the wrap-breaker) |
| `i18n` | Text ×1.4 — the German/Finnish expansion rule |
| `big-numbers` | Data-like text to its widest realistic form: `9` → `999+`, `$1.5M` → `$1,520,847.33` |
| `big-numbers` | Data-like text to its widest realistic form: `9` → `999+`, `$1.5M` → `$1,520,847.33`; also a `nav-item`'s and a tab's `count` (numbers included; `42` or `1.2K` → `999+`, a word such as `New` untouched), which only this perturbation touches |
| `empty` | Detected tables lose their data rows (and runs of two or more consecutive `list-row`s are emptied; on a desktop-app canvas also runs of `nav-item`, `tree-row`, `menu-row` or `property-row`, and card grids) |
| `many` | Data rows ×3 (and `list-row` runs ×3; on a desktop-app canvas also runs of `nav-item`, `tree-row`, `menu-row` or `property-row`, and card grids, a grid of three or more same-shaped children). Copies drop `active`, so a tripled list keeps one current row |

Expand Down Expand Up @@ -1233,7 +1233,7 @@ I("parent", { type: "select" }) # renders a muted "Select
I("parent", { type: "toggle", checked: true, disabled: true }) # 38% in $text-primary with disabled state tokens, else 50%
```

Colors default from the design system — `$accent` (falling back to `$primary`) for active states, `$border` for outlines, `$bg-surface` / `$text-primary` for the select — with neutral fallbacks on unthemed canvases. Explicit `fill` / `stroke` / `color` override. Defaults: toggle 44×24, checkbox/radio 18×18, select `fit-content` (give it a `width` for form layouts).
Colors default from the design system — `$accent` (falling back to `$primary`) for active states, `$border-strong` (else `$border`) for an unchecked control's outline or track and the select's border, `$bg-surface` / `$text-primary` for the select — with neutral fallbacks on unthemed canvases. Explicit `fill` / `stroke` / `color` override. Defaults: toggle 44×24, checkbox/radio 18×18, select `fit-content` (give it a `width` for form layouts).

All four controls are keyboard-focusable in the live viewer (`tabindex="0"`, a `:focus-visible` ring in `$focus-ring`, else `$accent`). A live focus never changes a capture, since nothing is focused in one; to draw the ring in a screenshot, set `state: "focus"` (see Element states above). `canvas_evaluate`'s `usability` category checks the things the renderer can't guarantee on its own: hit-target size, label association, and honest action copy — see the categories table below.

Expand Down
6 changes: 3 additions & 3 deletions VISION.md
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,10 @@ Run on its own viewer (2026-11-08), framesmith scored every page's usability 100
- [x] Slice G — element states: hover, focus, pressed and disabled as a primitive property (and on the items of tabs, tab-bar, nav-bar, modal and toast), drawn from state tokens; focus is a 2px ring at a 2px gap, disabled renders in the on-surface colour, and `state: "disabled"` counts as disabled in the 24px census and the primary count
- [x] Follow-up — a disabled control inside a component instance renders undimmed, because instances render after variable resolution (`resolveInstance`); resolve instance subtrees too, so `disabled` and `state` dim inside components as they do outside (done in Phase 32 slice B)
- [x] Slice H — state checks: focus rings, active indicators, disabled renders and control boundaries checked analytically on every interactive primitive, without being drawn, in each theme; text inside a disabled target is exempt from text contrast on every type
- [ ] Follow-up — `select` is not in the boundary check, though its `$border` is its only boundary too; and `tree-row` and the contained `tabs` draw no indicator mark when active (a tint and a heavier weight only), so the active-indicator check has nothing to measure on them
- [x] Follow-up — `select` is not in the boundary check, though its `$border` is its only boundary too; and `tree-row` and the contained `tabs` draw no indicator mark when active (a tint and a heavier weight only), so the active-indicator check has nothing to measure on them (done in Phase 32 slice D: `select` and an active `tree-row`'s new bar are measured; contained tabs stay unmeasured by decision, documented)
- [x] Slice I — the acceptance re-run: the viewer's gallery, detail with inspector and archive rebuilt as canvases, with the comment popover and delete-confirm states and the empty archive, all six CLEAN in fast and detailed mode in both themes with a CLEAN stress run, and the six baseline defects fixed (`test/e2e/test-viewer-rebuild.ts`); detailed evaluate now lays out in the design system's own fonts, and a drawer or a scrolling popover reads as scrolling under stress
- [x] Follow-up — a misspelt `$token` in a non-colour prop (`gap: "$space-xxs"`, which does not exist) resolves to nothing and evaluate says nothing; the slice I rebuild caught one only through its own resolved-tree check. Warn on any `$ref` the merged tokens do not define (done in Phase 32 slice C)
- [ ] Follow-up — `nav-item.count` is not a stress slot, so a sidebar count of "999+" is never exercised; add it (and `tabs.items[].count`) to the big-numbers perturbation
- [x] Follow-up — `nav-item.count` is not a stress slot, so a sidebar count of "999+" is never exercised; add it (and `tabs.items[].count`) to the big-numbers perturbation (done in Phase 32 slice D)

All nine slices are merged and the acceptance re-run passed. The phase is closed.

Expand All @@ -590,7 +590,7 @@ Phases 30 and 31 closed with seven follow-ups open, and five of them are quiet f
- [x] Slice A — tests in folders: `test/unit`, `test/browser`, `test/e2e` and `test/manual` set the tier, a Chrome guard on `test/unit` proves it at run time, tests are type-checked under `strict`, and files are named by subject, not phase or issue
- [x] Slice B — one tree: instances expanded and resolved once, so the renderer and every rule (contrast, spacing and cliché included) see the same thing inside a component, and findings there name the instance
- [x] Slice C — tokens: an `unknown-token` warning for any `$ref` the merged tokens do not define or that is the wrong kind, with a rename autofix when only one name is close; copy props never resolve; tints and `danger` derive from the applied palette, on new stamps and on canvases holding the old seeds
- [ ] Slice D — desktop-app checks: `select` gets a `$border-strong` boundary and joins the boundary check, an active `tree-row` draws a bar the indicator check measures, and stress widens `nav-item` and `tabs` counts
- [x] Slice D — desktop-app checks: `select` gets a `$border-strong` boundary and joins the boundary check, an active `tree-row` draws a bar the indicator check measures, and stress widens `nav-item` and `tabs` counts
- [ ] Slice E — phone targets: `link` and `text-input` (with a new 44px `size: "lg"`) join the 44px census, and `modal` and `toast` take a `controlSize` the census measures

_Full spec-driven breakdown in [`docs/specs/PHASE-32-SPEC.md`](docs/specs/PHASE-32-SPEC.md). Deliberately out of scope: a test framework, splitting `src/index.ts` and `src/evaluate.ts`, rewriting "Phase N" comments in `src/`, cross-instance autofix, and an indicator bar on contained tabs._
Expand Down
Loading
Loading