Repository navigation
style hooks S2: web tags parts as-<finish>, finish CSS, worn.json (#399) - #431
Merged
Merged
Conversation
…e classes, worn.json and the finish fact (#399)
# Conflicts: # .drover/arch-baseline.txt # web/dist/blocks.js # web/dist/import.js # web/dist/play.js
# Conflicts: # web/dist/blocks.css # web/dist/blocks.js # web/dist/blocks.scoped.css # web/dist/react.js
# Conflicts: # fixtures/html/chart-targets.html # web/dist/blocks.js
This was referenced Nov 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #399
Slice S2 of the style-hooks ADR (
docs/architecture/style-hooks/adr.md, decision parts 2, 4, 6 and 7).For humans
Nothing on screen changes: every look draws exactly as before.
The parts a look restyles (tiles, tinted chips and step marks, the labels) now carry a public name in the page, so an app's stylesheet can style them, and a look setting can only reach parts by those names.
A new check proves each look setting actually changes the parts it names, and a list records the few settings that change nothing in the browser today.
What changed
web/src/render, Reactweb/react/src, the crate's site writer) tag partsas-<finish>, exactly the parts the old private selectors reached:as-surface(cards, chart/plot/boxplot/heat cards, stat tiles, a list's own rows, a form with no submit, config, choice, secret, run, table, the timeline's draw ghost, the shell's sheet-list rows),as-tint(a chip while on, a done step mark),as-mark+data-mark="done", and the label finishes (header, section, title, button, chip, picked, screen).Finish::selectoris now the class (.as-surface, …);buttonstays thebutton/a.btnelements.marks: textwritescontent:attr(data-mark), so the word "done" is gone from the crate's CSS.sections: quiethas rows on both header and section labels (the section'sh3is a header label only, per shapes.md §3).web/src/css/look/tiles.css→look/surface.css: its 9-selector list is now.as-surface.fixtures/look/worn.json(generated byjust genfrom the site's HTML of everyfixtures/blocksandfixtures/fieldsfile): each kind's finishes, and each style value's finishes. Codegen fails on anas-class that is no worn finish.blocks-shotreports what it drew:report.jsongainsworn(kind → finishes);tree::Reportgains the optional field.look: <axis> <value> changes no <finish>(web/shot/look.tsunchanged), measured on the kinds page plus steps, a scene, a button and a picked diagram; its forced-defect test pins the surface and seessurface dashed/surface solidfail.ci/tokens/finishes.txt: the firstweblines (fills solid,labels back|group|kind|said); the measured test holds the fact list to exactly these lines.web/lint.mjsfails an.as-<x>that is no finish (fixtureweb/lint-fixtures/unknown-finish.css)..drover/arch.toml: S2'sgeneratedline and thegen/schemesban from the ADR;arch-baseline.txt673 → 679.For apps: parts now carry
as-<finish>classes an app's CSS may style (owner's answer to open question 1);labels.sectionno longer reaches a section's header (labels.headerdoes, as before). The harnessReportgains an optionalworn. No wire or style.json change.Decisions
surface.cssselects.as-surface.as-surface: two classes keep the old:is(…)list's specificity, so kind rules that lost to it today (.card.accent,.row.sticky,.imp>.tbl,.tmgh.st) still lose. One class would change those pixels; that is S5's call..row/.rwchildren and aMutationObservertags rows a patch redraws or inserts (the old.list>.rowselector did this for free); React passes the list's rows through aTilescontext; the site writer marks a list's direct children.look.test.tsnow asserts a patched list keeps its tiles; it fails with the observer removed.web/test/dom.tsgets an inertMutationObserver.surface.csswas added undercss/look/: the other finishes' base declarations differ per kind today and moving them changes specificity; S5 owns that.finishes.txtyet: it would refuse S3'sswiftlines. The measured test already pins theweblines to the facts.worn.test.tsallows live-only extras: buttons of controls the static site does not write (table, timeline, tool) and the timeline's draw ghost;site.test.tscomparesas-elements too, skipping the ghost and the lazy import chunk's inside.src/ net +190 (budget +40): the worn generator (≈95) and the finish fact (≈45) are bigger than the README's estimate; no other path makes either.Evidence (head 7e4e263, after merging origin/staging 5c8bbc8; pixel run at 8f0086c, whose renderers and CSS these merges leave as they were)
Pixel run: every
fixtures/blocksfile (54) under everyfixtures/stylesfile (filled, modern, still, terminal), HTML and React adapters, 390×844, animations frozen (*{animation:none;transition:none}on both sides): 432 PNGs at base5851193vs 432 at head; 431 byte-equal, 1 (still/html/heat-sleep) differed, and head's equals two later redraws of base (base's first draw was the odd one: run-to-run dot-grid flake). Without freezing, the only differences were the spinning↻intoolandtable-ot.node --test test/measured.test.ts test/worn.test.ts→ exit 0 (5 pass, incl. the finish fact and its forced defect)node --test test/site.test.ts test/axes.test.ts test/look.test.ts→ site/render parity, axes, look pass; "the fixture site is the same PNG … before and after blocks.js" fails here and fails identically on untouched base (local, pre-existing)node --test web/react/test/markup.test.ts→ exit 0 (new case: a list of plain, swiped, linked rows and a card's row; a picked chip)node --test --test-name-pattern "one --plan launch, each run" test/shot.test.ts→ exit 0cargo test -p blocks --no-fail-fast→ all pass after updating 5 tests that pinned old markupcargo clippy -p blocks -p blocks-desk --features blocks/schema -- -D warnings→ 0;cargo check -p blocks-desk --tests→ 0sh scripts/gen.sh→ 0 (worn.json regenerates byte-equal);npm run lint→ 0;tsc --noEmit→ 0;scripts/lint-fixtures.sh ts→ 0 (unknown-finish refused, clean passes);cargo fmt --check→ 0;drover arch-check→ 0 violationsAfter the staging merge (new
glancekind;fixtures/html/glance*.htmlandworn.jsonregenerate with its row title'sas-title-label):sh scripts/gen.sh→ 0;cargo test -p blocks --no-fail-fast→ 0;node --test test/worn.test.ts test/measured.test.ts react/test/markup.test.ts→ 0; site/render parity test → 0; lint, tsc, fmt, arch-check (713-linearch.tomlbaseline) → 0At head 3ef710f (merged origin/staging e1aa341, the table spark column): rebuilt
web/distwithnpm run build→ exit 0 (the dist conflicts are build output);sh scripts/arch-gen.sh→ exit 0, regeneratingfixtures/html/table-trend.htmlwith the table'sas-surface(worn.json unchanged);drover arch-check→ 0 violations after that;npm run lint→ 0;cargo fmt --check→ 0CI's red
local/webat 2974ca6 was kind tests pinning pre-S2 class lists (secret, config, scene); updated to theas-classes.node --test test/kind/*.test.ts test/worn.test.ts test/hooks.test.ts→ 106 pass, 1 fail: the browser-driven React search typing test lost its report under host load; rerun alone (--test-name-pattern "in HTML and React" test/kind/search.test.ts) → exit 0, 3 passAt head 7e4e263 (merged origin/staging 5c8bbc8, chart money): the conflicts in
fixtures/html/chart-targets.htmlandweb/dist/blocks.jsare generated;npm run build→ 0 andsh scripts/arch-gen.sh→ 0 rewrite them (the chart card gainsas-surface, nothing else);node --test test/kind/chart*.test.ts→ exit 0, 2 pass;npm run lint→ 0;cargo fmt --check→ 0