From 3c37145bd0c95961f52a966ea352f5c30db804e7 Mon Sep 17 00:00:00 2001 From: bailey <74082460+bmjcoding@users.noreply.github.com> Date: Sun, 22 Nov 2026 16:29:20 -0600 Subject: [PATCH 1/5] AF: the agnosticism audit's fixes (work in progress: behaviour, docs, rounds, lint, tests) Co-Authored-By: Claude Opus 5.5 --- .agent/skills/basalt-html/SKILL.md | 2 +- .../basalt-html/examples/sales.body.html | 76 +++ .../basalt-html/parts/usage/dialog-form.md | 8 +- .../skills/basalt-html/parts/usage/forms.md | 9 + docs/foundations.md | 97 +-- packages/react/README.md | 41 +- packages/react/src/back-to-top.tsx | 33 +- packages/react/src/dialog.tsx | 43 +- packages/react/src/display.tsx | 6 +- packages/react/src/feedback.tsx | 9 +- packages/react/src/field.tsx | 11 +- packages/react/src/filter-toolbar.tsx | 4 +- packages/react/src/form-grid.tsx | 13 +- packages/react/src/index.ts | 6 +- packages/react/src/list-band.tsx | 116 ++-- packages/react/src/loading-shape.tsx | 2 +- packages/react/src/scroll-owner.ts | 51 ++ packages/react/src/shape-data.ts | 85 ++- packages/react/src/styles/components.css | 19 +- packages/react/src/table-explainer.tsx | 31 +- packages/react/src/tabs.tsx | 4 +- packages/react/src/wait.ts | 11 +- packages/react/test/agnostic.test.mjs | 624 ++++++++++++++++++ packages/react/test/loading-shape.test.mjs | 16 +- scripts/check-vocabulary.mjs | 203 ++++++ scripts/lint.mjs | 3 +- tools/html-skill/README.md | 2 +- tools/html-skill/build.mjs | 2 +- tools/html-skill/src/examples/sales.body.html | 76 +++ tools/html-skill/src/usage/dialog-form.md | 8 +- tools/html-skill/src/usage/forms.md | 9 + tools/review/af-demos.tsx | 375 +++++++++++ tools/review/build.mjs | 4 +- tools/review/round51.tsx | 16 + tools/review/round52.tsx | 16 + tools/review/round53.tsx | 16 + tools/review/round54.tsx | 16 + tools/review/round57.tsx | 113 ++++ tools/review/rounds.tsx | 2 + 39 files changed, 1985 insertions(+), 193 deletions(-) create mode 100644 .agent/skills/basalt-html/examples/sales.body.html create mode 100644 packages/react/src/scroll-owner.ts create mode 100644 packages/react/test/agnostic.test.mjs create mode 100644 scripts/check-vocabulary.mjs create mode 100644 tools/html-skill/src/examples/sales.body.html create mode 100644 tools/review/af-demos.tsx create mode 100644 tools/review/round57.tsx diff --git a/.agent/skills/basalt-html/SKILL.md b/.agent/skills/basalt-html/SKILL.md index bb34f77a..f256f91c 100644 --- a/.agent/skills/basalt-html/SKILL.md +++ b/.agent/skills/basalt-html/SKILL.md @@ -14,7 +14,7 @@ Standalone HTML that looks and behaves like Basalt: one file, no network, dark a 3. Run `node .agent/skills/basalt-html/compose.mjs report.body.html` (writes `report.html`; `--out ` names it). It wraps the body in the doctype, meta and theme bootstrap, inlines Geist, and adds the core CSS and script plus only the modules your classes, attributes and tags use, and the icons you name in quotes. It prints what it added, and one warning line for each module added. `--no-fonts` skips Geist (only for a file a tool reads, never a file a person opens), `--lang fr` sets the language, `--all` adds every module. 4. Open the page in both themes at 1440 and 390 wide before you hand it over. It follows the system theme; the toggle or `Basalt.toggleTheme()` switches it. -`examples/static.body.html` (a report) and `examples/interactive.body.html` (inputs, tabs, a palette) are bodies to copy from. Never open or paste `parts/`: it is minified output. +`examples/static.body.html` and `examples/sales.body.html` (two reports of unlike kinds: a service's reliability, a shop's month) and `examples/interactive.body.html` (inputs, tabs, a palette) are bodies to copy from. Never open or paste `parts/`: it is minified output. ## Modules diff --git a/.agent/skills/basalt-html/examples/sales.body.html b/.agent/skills/basalt-html/examples/sales.body.html new file mode 100644 index 00000000..234983b8 --- /dev/null +++ b/.agent/skills/basalt-html/examples/sales.body.html @@ -0,0 +1,76 @@ +Shop report, October 2026 + + + +
+
+ Larch and Loom + + +
+
+ +
+
+

October 2026 · Online shop

+

Monthly shop report

+

Orders rose for the third month running, led by the autumn textiles. Returns stayed under target, and every order left the workshop within two working days.

+
+ +
+

Summary

Scope. Online orders only. Market stalls and wholesale are reported separately.

+
+
+ Orders + 1,284 + Up 9% from September +
+
+ Average order + $46.20 + Up $2.10 +
+
+ Shipped on time + 100% +
+
+
+
+ +
+

Best sellers

By units sold in the month.

+
+ + + + + + + + + + +
ProductStockUnitsRevenueReturns
Wool throwIn stock212$18,0203
Linen tea towelIn stock390$5,8501
Stoneware mugRunning low264$6,3366
Cedar planterSold out88$4,8400
+
+
+ +
+

Notes

+
+

The cedar planter sold out on October 24; the next batch is due mid-November. Mugs are being restocked from the kiln this week.

+
    +
  • Free returns on textiles stay through December
  • +
  • Gift wrap is now offered at checkout
  • +
+
+
+ + +
+
+ +
Larch and Loom · October 2026 · Generated with the Basalt HTML skill
+
diff --git a/.agent/skills/basalt-html/parts/usage/dialog-form.md b/.agent/skills/basalt-html/parts/usage/dialog-form.md index 98132a7a..247691a8 100644 --- a/.agent/skills/basalt-html/parts/usage/dialog-form.md +++ b/.agent/skills/basalt-html/parts/usage/dialog-form.md @@ -4,13 +4,13 @@ A form or task in the center (React's `DialogContent form`): a dialog with the s ```html -

Declare an incident

+

Invite a teammate

-

Say what is happening.

…fields…
-
+

They get an email with a link to join.

…fields…
+
``` -- 480 wide, head and foot held, the body scrolls and opens with the description. At most the window less 16px above and below; its top is held where it opened. +- Any task with an end takes it: an invite, a delivery slot to book, a payee to add. 480 wide, head and foot held, the body scrolls and opens with the description. At most the window less 16px above and below; its top is held where it opened. - First focus: the first field for a key or a mouse, the title for a touch. Under 720 it is a full-screen modal, the foot's two actions equal 44px buttons. - React's alone: the top re-measured on a resize, and a scrim press that closes only while nothing is entered. Here the scrim closes it. diff --git a/.agent/skills/basalt-html/parts/usage/forms.md b/.agent/skills/basalt-html/parts/usage/forms.md index fcb81481..9e74c571 100644 --- a/.agent/skills/basalt-html/parts/usage/forms.md +++ b/.agent/skills/basalt-html/parts/usage/forms.md @@ -5,3 +5,12 @@ `type=file` and `type=search` are styled bare. Date and time pickers stay native: Basalt has no design for them. Required: end the label with `` and put `required` on the input. "Optional" likewise; neither shows nothing. Never an asterisk. + +Two fields from unlike forms (an account, an order), each hint and error linked by `aria-describedby`: + +```html +
+ Sign-in links go here.
+
+ Order at least one.
+``` diff --git a/docs/foundations.md b/docs/foundations.md index c1351175..204ce390 100644 --- a/docs/foundations.md +++ b/docs/foundations.md @@ -269,8 +269,8 @@ kept as a rule so both themes behave alike (DECISIONS 166). Four text levels wer Text starts ascending; a numeric column, or one with `firstSort="descending"` (a time), starts descending. Rows always sort from the table's own order, never from the order on screen, so ties keep it and the third press gives it back row for row (`sortRows`, and the HTML skill's own sort). An app may load the table sorted on a named column; the third press still returns its own order. - The header band is 32px, and 44 on touch. **A column explainer** (`TableHeadExplainer`, given to a sortable `TableHead` as - `explainer`; the HTML skill's `.explainer` inside the `th`) says what a column means. It is only for a column a reader could + The header band is 32px, and 44 on touch. **A column explainer** (`TableHeadExplainer`, given to a `TableHead` as + `explainer`; the HTML skill's `.explainer` inside a sortable `th`) says what a column means. It is only for a column a reader could misread without it (a term of art, a coined name, a measurement whose method changes the reading), never a plain name; one to three sentences and at most one link, never a control; if most headers need one, the table needs a better caption. It is a popover, not a Tooltip (it can hold a link): the opener's level plus one, the neutral rim, radius 12, `shadow-overlay`, @@ -285,7 +285,12 @@ kept as a rule so both themes behave alike (DECISIONS 166). Four text levels wer move onto it (a pause in the gap between header and card keeps it), and it stays until hover and focus have both left. Inside a modal it is written into the modal's own layer, so its link stays reachable. Its words are the sort button's description; the button's name stays the label and it is never a popup trigger. Tab from an open - header goes into its link, then on. A header with one is sized for its label under WCAG 1.4.12, as every header is. A table + header goes into its link, then on. **On a header that does not sort** the opener is the header cell itself: it becomes a focus stop + (`tabindex="0"`) described by the card's words, with the −2 inset ring of the still table's other stops, and opens the same way + (hover after the wait, keyboard focus, a long press); a press there does nothing else. The cell keeps its role and its name, the + column header, so a screen reader hears the column and then what it means, and nothing new is drawn in the header (a small trigger + would need a seat that every header of its kind then reserves, and a second stop in a sortable header). The HTML skill's explainer + stays on sortable headers; this form is React's alone. A header with one is sized for its label under WCAG 1.4.12, as every header is. A table without explainers loads none of its code. **Status:** the three states, the arrow after the label and the explainer were picked by the owner (DECISIONS 257, 261), built by Opus, reviewed by Astra. When no row matches, one row spans every column under the unchanged header with a sentence and an action that names what hid the rows (`TableEmpty`; DECISIONS 207): a search alone gets a sentence that names the term @@ -701,7 +706,7 @@ every device. The CommandMenu input carries `aria-describedby` for its footer on show; `aria-keyshortcuts` always stays. A hybrid device shows chips after its first hardware key. **One modifier across platforms.** **Status:** decided by the owner (DECISIONS 244: "we just need to add device detection and account for windows machines vs. macos (and I guess linux too lol) -wth the keybindings like this", on the ⌘↵ chips beside Declare incident) and taken into Basalt without a vote; the implementation hasn't been reviewed. A shortcut is written once with `Mod` +wth the keybindings like this"; found by the first app's ⌘↵ chips in a form dialog's foot) and taken into Basalt without a vote; the implementation hasn't been reviewed. A shortcut is written once with `Mod` (`"Mod+Enter"`, `"Mod K"`): the platform's modifier, **Command on Apple's systems** (macOS, and iPadOS or iOS with a keyboard) and **Control on Windows, Linux and ChromeOS**. `Kbd`, `ActionShortcut`, `Menu` and `CommandMenu` rows, `Tooltip` and `useShortcuts` take it. The chips are ⌘ on Apple's systems and the word "Ctrl" elsewhere; beside `Mod`, Enter is ↵ on Apple's systems and "Enter" elsewhere ("Mod+Enter" is ⌘↵ or Ctrl Enter). `aria-keyshortcuts` is `Meta+Enter` or `Control+Enter`, and the words a screen reader says are "Command" or "Control" ("Command Return", "Control Enter"). @@ -1981,21 +1986,28 @@ a form or task opens as a centered modal over a darkened page, not a side panel. ### Everything that changes a list sits above it The filters come first (`FilterToolbar`), then one band (`ListBand`) with the count, the pager and the page size. Only the rows below change, so nothing above can be pushed. A bar -under the list moves whenever the list's height does (891px across the pages of the incident rows, 7,939px across every action), drops 25 rows away from the pointer when the -reader picks 50 per page, and leaves a keyboard's next Tab outside the new page. It is for a list of rows in a rimmed panel and for a still table alike. +under the list moves whenever the list's height does, drops rows away from the pointer when the reader picks a larger page, and leaves a keyboard's next Tab outside the new page +(found by: the first app's lists, where a bar under the rows moved 891px across their pages). It is for a list of rows in a rimmed panel and for a still table alike. - **The band** is one row on the page's own fill, with no rim: the count at the start, the pager in the centre, the page size at the end (`size-select-min` is not for a number). From 720 it is `position: sticky` under the app's bar, opaque in the page colour (it is not the one smoked surface), at `layer-sticky`, with a `border-divider` line under it only while it is stuck (an observed sentinel says so; in forced colours the line is `CanvasText`). When the page or the size changes while it is stuck, the window returns to where the band rests (one helper in `ListBand`, not one per list), so the new page's first row shows under the band and Next, Next, Next is one place on screen. Under 720 it does not stick: the bar and the tab bar already take 112 of a phone's height. It is `container-type: inline-size`; in print it is static. +- **The scroller** is the window unless the app names one (`scroller`, an element or a ref): a list in a pane that scrolls on its own sticks to that pane's top, returns that pane to + where the band rests after a page change, and its Back to top watches and moves that pane. In a pane the band rests at the pane's top edge (`--basalt-sticky-offset` is 0 there; + an app with a sticky header of its own inside the pane sets the property in its own CSS). The return waits for the page or size the press asked for, however long the app takes to + load it, and forgets the press when a filter changes or the app moves somewhere else. - **The count** is "1–25 of 214", `text-sm`, secondary, tabular, in a seat as wide as its widest form for the unfiltered total ("888–888 of 888"), so a shorter count moves nothing. It is blank for no matches. -- **The page size** is a `Select` of 10, 25, 50 and 100 (default 25; the app remembers it for each list) followed by the words "per page", named "Incidents per page": the visible - words are inside the name (WCAG 2.5.3), the noun is the app's. A new size keeps the reader's first row in view (page 3 at 25 per page is page 6 at 10). -- **It is spoken once.** A page or size change is said by the band's own polite status line after 400ms of stillness ("Page 2 of 9. Incidents 26 to 50 of 214."). A change of the - total (a search or a filter) clears the line, and only `FilterResult` speaks a filter ("Showing 37 of 214 incidents"): two numbers with two jobs, each beside the control that drives it. -- **Narrow.** Under `size-breakpoint-container-lg` (640) of the band's own width the numbers go (under `size-breakpoint-md`, 720, on a coarse pointer, where the wide form's three tracks cannot hold 44px targets and the page size covered Next from 640 to 690): Previous, the count and Next, with the page size after them. It is a row that wraps by what it measures, and both parts are reserved widths, so it never changes with its content: one row where they fit (a 193px pager and a 132px page size in 358), and where they do not (a 343 band on touch needs 340.1, and the 292px card) the page size is the end of a second row, so nothing overflows. The count is centred between the arrows (its seat holds the widest form and the text sits in the middle of it). The page size is a `sm` Select with a real `