Skip to content

Renderer checks: touching and repeated-headers, and craft notes that advise rather than fail - #281

Merged
agorischek merged 7 commits into
mainfrom
renderer-craft-checks
Dec 3, 2026
Merged

agorischek merged 7 commits into
mainfrom
renderer-craft-checks

Conversation

@agorischek

@agorischek agorischek commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Agent assessment

Self-reported assessment, not an independent review.

Assessed revision: 3cb76c52dababf0548721a6322448e796dcd5da6

Dimension Assessment Rationale
Change confidence 8.5/10 ↑ Calibrated on all 89 built-in scenarios, and recalibrated after each probe fix: touching and repeated-headers find nothing, and only agentic-workflows' pill cards get craft notes (chip-density), as intended.
↑ Copilot's later points are fixed, each with a fixture in the harness spec that the old probe got wrong: text nested in sr-only, empty and short-heading cells in the denominator, text split by inline markup, and changed chips (unpainted or filled).
↑ Testing unit tests and the CLI checks_step test pass; rebased onto main, which carries #285's fix for the graph/mcp-tools harness timeout seen on earlier runs.
↓ Heuristic checks; false positives in custom renderers are possible, which is why two of them only advise.

Step 5 of the kit typography rollout. Adds automated craft checks beside the existing styling checks, and a way for heuristic checks to advise without failing a renderer.

  • advice status. A CheckResult can now have status advice. adviceChecks lists the checks that use it. projections check turns craft notes into a warn step with each note in its details, not a failure. The workbench shows them with their own icon and label.
  • touching (fails). No two boxed values in a unit (chips, pills, tags: a box about a line tall around text, edged on all four sides or a rounded fill) sit less than 1.5 px apart or overlap. A value change's two pills and word highlights in a change hue may touch.
  • repeated-headers (fails). More than half of a table's cells repeat both their row and column heading in their visible text (sr-only text doesn't count, so a cell drawn as a mark with its name for screen readers passes).
  • chip-density (advice). A unit with more than six boxed values that aren't change marks, or at least four and one per 15 characters of text; a selectable chip counts half.
  • mixed-treatments (advice). A line that adds a decorative color (a hue that isn't a change's or a category's) to code or bold, or uses all three. Muted text counts as plain.

Calibration

Every built-in scenario, diff mode (or progress 1), at full width (and phone width for touching):

Check Scenarios flagged What it flagged
touching 0 of 89
repeated-headers 0 (fails: promoted from advice after calibration)
chip-density 4 agentic-workflows: 9 to 18 pills per card, 57 in one group. Intended: the migration PR in this series moves them to text
mixed-treatments 0

False positives found while calibrating and fixed before this PR: a box inside a changed card counted as a change mark (all of a modified card's pills were skipped); muted text counted as an emphasis (every "value · muted note" line was flagged); text-diff's word highlights counted as chips; and github-actions' matrix cells counted as repeating their headings, though they show only a dot and carry the run's name for screen readers.

Mono share, distinct type styles and sizes per card don't separate renderers that read well from ones that don't (database is 96% monospace; runtime-policy has 16 styles in a card), so there are no checks on them.

Calibrated and left out

Two more checks from the proposal were built and calibrated on every built-in scenario, then dropped because they mostly flagged intended design:

Check Scenarios flagged What it flagged
prose-in-mono (monospace text that reads as words) 15 Code that reads like words: signatures (export class Client implements AsyncDisposable, impl Send for Limiter), SQL types (timestamp with time zone), commands (make examples, parcel help report), text-diff output. Nothing a person would set in sans.
small-emphasis (bold at the smallest size) 31 Deliberate labels: PK/IX/UK key markers, runtime-policy's column labels, agentic-workflows' section titles, compatibility labels, diff signs.

The authoring guide's checklist covers both by eye. With roles in the kit (#282), a narrower version (bold text whose computed style matches no type role) could be tried later.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Chips inside native table cells are excluded from measurement, leaving touching, overlaps, and chip density unchecked. Separately, abutting old/new pills in the same ValueChange incorrectly fail touching checks, and distinct blocks with identical descriptions on the same baseline can trigger mixed-treatment advice even when neither line mixes treatments.

3 open issues
What changed in this PR

Adds visual craft checks to Projections’ renderer validation, separating actionable failures from advisory feedback.

Changes:

  • Adds touching plus three advisory checks for repeated headings, chip density and mixed emphasis.
  • Introduces advice results, displayed as CLI warnings and workbench craft notes.
  • Adds probe fixtures, status tests and documentation.
File Description
packages/​renderers/​testing/​test/​helpers.test.mjs Updates the expected check count.
packages/​renderers/​testing/​src/​types.ts Defines craft measurements and advisory results.
packages/​renderers/​testing/​src/​probe.ts Registers the craft probe.
packages/​renderers/​testing/​src/​measure/​craft/​tables.ts Detects repeated table headings.
packages/​renderers/​testing/​src/​measure/​craft/​shared.ts Shares visibility and text helpers.
packages/​renderers/​testing/​src/​measure/​craft/​lines.ts Detects mixed text emphasis.
packages/​renderers/​testing/​src/​measure/​craft/​boxes.ts Measures boxed values and touching pairs.
packages/​renderers/​testing/​src/​measure/​craft.ts Assembles craft measurements.
packages/​renderers/​testing/​src/​measure.ts Exports the craft measurement function.
packages/​renderers/​testing/​src/​index.ts Exports advisory check IDs publicly.
packages/​renderers/​testing/​src/​checks/​runner.ts Runs craft checks with advisory outcomes.
packages/​renderers/​testing/​src/​checks/​craft.ts Converts measurements into check feedback.
packages/​renderers/​testing/​src/​checks/​catalog.ts Registers check titles and contracts.
packages/​renderers/​testing/​src/​checks.ts Re-exports advisory check IDs.
packages/​renderers/​testing/​README.md Documents craft checks and advice.
packages/​renderers/​harness/​browser/​craft.spec.ts Adds positive and negative probe fixtures.
packages/​host/​inspector/​src/​fixtures/​workbench/​checks.tsx Displays craft-note icons and labels.
packages/​cli/​src/​check/​render.rs Reports advisory warnings and tests their handling.
changelog.d/​craft-checks.md Announces the new checks and status.

Review effort: Balanced

@agorischek
agorischek force-pushed the renderer-craft-checks branch from ffbcf04 to 4c16875 Compare December 2, 2026 22:42
@agorischek agorischek changed the title Renderer checks: touching, and three craft notes that advise rather than fail Renderer checks: touching and repeated-headers, and craft notes that advise rather than fail Dec 2, 2026
@agorischek
agorischek requested a balanced review from Copilot December 2, 2026 23:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The repeated-headers check excludes empty visible cells from its denominator, so two repeated headings among ten visible data cells incorrectly trigger a majority failure. Separately, shown() ignores visually hidden ancestors, allowing nested screen-reader-only text to cause false repeated-headers failures and affect other craft measurements.

2 open issues
3 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Changed chips rendered with paint={false} can spuriously trigger chip-density advice because their data-chip-change marker is not recognized. Separately, inserting spaces between inline text nodes can hide repeated headers, and excluding cells with short headings from the table denominator can falsely report a repetition majority.

No open issues 🎉

3 previously missed issues

In code that hasn't changed since last review

Medium severity Exclude changed chips from chip-density advice

packages/​renderers/​testing/​src/​measure/​craft/​boxes.ts:64

Chip retains data-chip-change when paint={false} but omits data-change (kit/src/react/chip.tsx:102–105). Such changed chips therefore count as ordinary boxes here, so seven signed added/removed chips produce chip-density advice despite the change-mark exclusion. Recognize the chip's own change attribute as well, without excluding unchanged chips inside a changed card.

Medium severity Preserve text adjacency across inline markup

packages/​renderers/​testing/​src/​measure/​craft/​shared.ts:25

Adding a space before every text node changes the painted text when inline markup splits a word. For example, a heading TransparentCompiler and a cell windows · Transparent<strong>Compiler</strong> become TransparentCompiler and windows · Transparent Compiler, so repeated-headers misses the repetition. Preserve adjacency across inline text nodes while retaining actual whitespace and block boundaries.

Medium severity Count all visible data cells in repetition denominator

packages/​renderers/​testing/​src/​measure/​craft/​tables.ts:22

The heading-length filter still removes visible data cells from the majority denominator. For example, a row with columns Compiler, Mode, #, and %, where only the first two cells repeat their headings, is reported as 2 of 2 and fails even though only half of its four cells repeat. Count every shown data cell first, and apply the heading-length guards only to repetition matching; the early return for short row headings has the same denominator problem.

2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The touching check excludes rounded, borderless chips marked data-chip-change="added", so an added chip can touch an unrelated chip without failing the check.

1 open issue

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The checks may miss small overlaps, heading repetition in tables with empty corner cells, or mixed styling in same-baseline text of different sizes, warranting human review.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

agorischek and others added 7 commits December 2, 2026 18:28
…han fail

touching fails when two boxed values in a unit sit less than 1.5px apart or
overlap. repeated-headers, chip-density and mixed-treatments report with a new
advice status: projections check warns on them and the workbench shows them
apart from failures. Calibrated on every built-in scenario.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ouch, lines group by their own block

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…t notes

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… its headings

Calibrated two more craft notes, prose-in-mono and small-emphasis, and left
them out: on the built-ins they flagged code that reads like words and bold
key markers and section labels drawn that way on purpose.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…ells count toward a table's repeated headings

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…p stays joined, and every shown cell counts

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
… a box like any other

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@agorischek
agorischek force-pushed the renderer-craft-checks branch from f1bc51a to 3cb76c5 Compare December 3, 2026 02:30
@agorischek
agorischek merged commit 011c0c8 into main Dec 3, 2026
98 of 100 checks passed
@agorischek
agorischek deleted the renderer-craft-checks branch December 3, 2026 03:40
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.

2 participants