Skip to content

Phase 32 slice D: select boundaries, tree-row bars, stress counts - #258

Merged
vicmaster merged 4 commits into
masterfrom
phase-32-slice-d
Nov 22, 2026
Merged

vicmaster merged 4 commits into
masterfrom
phase-32-slice-d

Conversation

@vicmaster

Copy link
Copy Markdown
Owner

Phase 32 slice D (docs/specs/PHASE-32-SPEC.md, FR-D1 to FR-D4, with the contracts pinned in the spec's Q1 to Q8 block and both verify rounds recorded after it).

The problem

Three desktop-app checks skipped things they should measure. A select drew its border in $border, which is 1.46:1 on white under a generated system, and desktop-app-boundary did not look at it, so canvas_evaluate said READY. An active tree-row showed where you are only by a tint and a heavier label, so desktop-app-state-contrast had nothing to measure on it. canvas_stress never touched a nav-item's or a tab's count, so a sidebar badge growing from 42 to 999+ was never tried. Phase 31 recorded the first two as scope decisions (its R4 and R7); this slice reverses them.

What changed

  • A select's border is its boundary. An unset select stroke takes $border-strong when the design system defines it, on every type, as text inputs and unchecked controls already do. Without the token it keeps $border, so a preset or unthemed canvas renders unchanged. desktop-app-boundary measures a select the way it measures a text-input: its border against what is behind it, passing when its own fill already stands out by 3:1. A border that draws nothing counts as invisible. The finding's suggestion now says to define $border-strong first when the canvas has none.
  • An active tree-row draws a bar. It is the nav-item bar: 2px, in iconColor ($accent by default), at the row's left edge at every depth. desktop-app-state-contrast measures it at rest and with the hover layer, like a nav-item's. Only an active row gets position: relative (the bar's anchor), so inactive rows render byte-identical to before.
  • Contained tabs stay as they are, and the docs say so. Their active fill and heavier label are the indicator. The rule measures the line variant's underline only. A contained tab whose tint is indistinguishable from the tablist is not reported; the docs name that gap and say to check by eye or use the line variant.
  • Counts are stress slots. big-numbers widens a nav-item's count and a tab's count, numbers included, to 999+. Nothing else touches them: long-text and i18n leave a count alone, and a word count such as New is untouched. A number on any other stress path (a numeric button label) is now a slot too.

Decisions the spec text did not settle

  • Word counts are not copy. The first draft let long-text stretch a count such as New. A count badge never truncates, so the stretched badge clipped and canvas_stress went FRAGILE with nothing the author could fix. Counts are touched by big-numbers only.
  • A count widens to 999+, never a long figure. Counts went through the same widening as stat figures, which turns 1.2K into 1,520,847.33. Four tabs at 432px with K counts then went FRAGILE, and a tablist has no fluid-width fix. A text node reading 1.2K still takes the long figure.
  • Only an active tree-row is position: relative. Giving every row relative moved an inactive row that set x and y without position. An active row with x and y but no position shifts, as an active nav-item already does.

Verdicts that moved

Test Before Now
test/unit/test-state-checks.ts Pinned that a tree-row draws no indicator and that a select is not measured. Pins the tree-row bar's measurement (with failing, inactive, disabled and hover twins) and the select's (generated system passes, $border warns at 1.46:1, a fill that stands out passes, disabled and web are skipped, an unset stroke is measured as invisible).
test/e2e/test-viewer-rebuild.ts The Archive-empty canvas expected big-numbers to find nothing to widen. Its sidebar counts are now widened, so it runs every perturbation and stays CLEAN.

The desktop and web pattern gates are unchanged and pass. A desktop-app realisation stamped after apply_preset gains one desktop-app-boundary warning for its select, beside the text inputs and toggles that already warned there, so no stamp that was READY stops being READY.

Not fixed here

  • A stamp seeds $border-strong only on a canvas with no $border, so a realisation stamped after a preset has no $border-strong and its controls warn until it is defined. The docs and the finding's suggestion say so.
  • $border-strong is generated to clear 3:1 against bg-primary and bg-surface only, so a control on an *-tint backdrop warns. A select now joins the text inputs and controls that already did.
  • Not measured by design, and named in the docs: disabled controls, web and mobile canvases, and controls on a gradient or a colour the checker cannot read.

Tests

  • test/unit/test-state-checks.ts, test/unit/test-desktop-primitives.ts (the select default, the bar's markup, the realisations' seeding) and test/unit/test-stress.ts (counts, numbers, word counts, 1.2K, NaN).
  • test/browser/test-state-model-render.ts: the tree-row bar and fill at rest and in hover, and the select border, against the rendered pixels in three themes. test/browser/test-desktop-primitives-render.ts: the bar at x = 0 at depth 0, 1 and 2, no bar on an inactive row, and the bar inside a positioned row.
  • New test/e2e/test-stress-counts.ts: canvas_stress through the MCP server reports touchedCount 2 for big-numbers on the FR-D4 canvas, and nothing for word counts.
  • Full tier 148/148 on 271662d; type check of the tests is clean.
  • Verification: a pre-freeze verifier broke the draft contracts on paper (9 findings, 7 confirmed, all folded in before the build). Round 1 ran four verifiers (spec conformance, mutation testing over 49 mutants, a review attacking the gates, the docs-steward) and a cold-reader. Round 2 re-verified the fix diff and found nothing above informational. Every fix landed with a test that fails on the previous snapshot.

Docs

The canvas_evaluate, canvas_stress and apply_structure docstrings, the input-control and desktop-app primitive docs (tabs, tree-row), the INSTRUCTIONS and init gotchas, GUIDELINES (both rules, tabs, tree-row, the controls line, the stress list), README (the two rule rows, the tabs and tree-row rows, the input-control defaults, the big-numbers row) and VISION (slice D ticked, plus the two follow-ups it closes).

@vicmaster
vicmaster merged commit 744b56f into master Nov 22, 2026
3 checks passed
@vicmaster
vicmaster deleted the phase-32-slice-d branch November 22, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant