Repository navigation
[Component Audit] ListItem: slot docs say where content sits, and right-to-left chevrons point the right way - #11336
Conversation
…tyle and xstyle tests; mirrored story chevrons
…-audit/ListItem/2026-11-12
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| CheckboxListItem | 74.4 kB (0) · 11.5 kB CSS (0) | — | — · — · — |
| ContextMenu | 113.2 kB (0) · 17.5 kB CSS (0) | — | — · — · — |
| DropdownMenu | 102.3 kB (0) · 17.6 kB CSS (0) | — | — · — · — |
13 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| List | 18.9 kB (0) · 790 B CSS (0) | — | ✓ · ✓ · — |
| ListItem | 73.6 kB (0) · 11.5 kB CSS (0) | — | ✓ · ✓ · ✓ |
| Markdown | 193.4 kB (0) · 20.8 kB CSS (0) | — | — · — · — |
| MoreMenu | 102.5 kB (0) · 17.6 kB CSS (0) | — | — · — · — |
| PowerSearch | 299.1 kB (0) · 24.7 kB CSS (0) | — | — · — · — |
| Table | 130.4 kB (0) · 18.5 kB CSS (0) | — | — · — · — |
| TableCell | 114.5 kB (0) · 18.0 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 114.0 kB (0) · 17.7 kB CSS (0) | — | — · — · — |
| lab/Comments | 358.8 kB (0) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 352.0 kB (0) · 2.4 kB CSS (0) | — | — · — · — |
| lab/TabBarMoreList | 96.0 kB (0) · 1.8 kB CSS (0) | — | — · — · — |
| lab/TransferList | 105.7 kB (0) · 1.2 kB CSS (0) | — | — · — · — |
| lab/TransferListSelector | 114.5 kB (0) · 1.4 kB CSS (0) | — | — · — · — |
Package size: @astryxdesign/core 7.36 MB packed (+28 B); no new dependencies.
Touched components checked; add ci:run-visual to run the full suite.
Generated by PR Enrichment workflow | View full report
…nd link cases in dark too
There was a problem hiding this comment.
Approved pending CI: CI has not run on this draft head yet, so merging waits on the required checks, including the unit tests and the ListItem audit's browser spec.
The startContent and endContent JSDoc now matches where Item renders those slots. The Interactive story's chevrons mirror in right-to-left, as the With End Controls story's do. The three new tests cover ref, the className/style merge and the xstyle order. No blocking findings.
Claims and files checked
- Changeset: the slot docs now place the content inside the row, before the label or after the label and description. Verified in
ListItem.tsxand against Item's render order. - The old JSDoc said "before/after the item". Verified in the diff.
- The Interactive story's three chevrons now mirror, matching the With End Controls story. Verified in
List.stories.tsx. - No component runtime change. Verified: the
ListItem.tsxchange is comments only. refreaches the<li>inside and outside a List. Verified by the new test and the merged ref.classNameandstylemerge beside thelist-itemanditemtargets. Verified by the new test.xstyleapplies after ListItem's own styles, so the caller wins. Verified by the new test and the style order.- These behaviors had no focused test before. Verified against the base tests.
- The mutation checks would fail as described. Verified by reading; CI runs the tests.
- The browser spec's before/after result, the frame counts and the 204 passing List cases are run results; CI runs the List tests and the audit spec at this head. The spec's structure (8 cases, 18 frames) matches the description.
- The open items (markers as extra elements, the
targettype cast) are as described in the source and the component record. - The axe-pass entry makes the ListItem audit scan the List stories. Verified in the audit routing scripts.
- Files:
.changeset/list-item-audit-docs.md,.github/a11y-audit-axe.json,apps/storybook/stories/List.stories.tsx,packages/core/src/List/List.test.tsx,packages/core/src/List/ListItem.tsx,packages/core/src/List/__tests__/ListItemAudit.a11y.chromium.spec.ts: all clear.
There was a problem hiding this comment.
Approved. One CI job, test-node (4/4), failed in a CLI theme-editor test (packages/cli/host/door-conformance.test.mjs) that this pull request does not touch, so merging waits for that job to pass on a rerun.
No blocking findings: the slot docs now match where Item renders startContent and endContent, the Interactive story's chevrons mirror once in right-to-left, and the three new tests cover ref, the className/style merge and the xstyle order. Optional follow-up: ListItem.spec.md still lists ref, the list-item target and the xstyle order as having no focused test, which this pull request now provides.
Claims and files checked
- Changeset: the slot docs now place
startContentandendContentinside the row, before the label or after the label and description. Verified inListItem.tsxagainst Item's render order. - The old JSDoc said "before the item" and "after the item". Verified in the diff.
- The Interactive story's three chevrons now mirror in right-to-left, as the With End Controls story's already did. Verified in
List.stories.tsxand in CI's audit receipt at this head. - ListItem's runtime is unchanged. Verified: the source change is comments only, and CI's API diff for this head is empty.
refreaches the<li>inside and outside a List. Verified by the new test, which passes in CI.classNameandstylemerge onto the row beside itslist-itemanditemtargets. Verified by the new test, which passes in CI.xstyleapplies after ListItem's own styles, so the caller wins. Verified by the new test and the style order inListItem.tsx.- These three behaviors had no focused test before. Verified against the base tests and the component record.
- Dropping
refor movingxstylefirst would fail the new tests. Verified by reading the tests against the code. - ListItem ships in Core under the List entry point, and its component record is current and unchanged. Verified.
- The base commit, the merge with main and the exact head named in the description. Verified in the history.
- The audit's per-section facts (an
<li>row,aria-currenton the selected row, a disabled row that keeps its focusable control and its tab stop,noopener noreferrerfor_blank, named marker sizes, memoized marker and handle, no Effect) match the source and CI's receipts; the scores are the audit's own grading. - The open items left as is (markers as extra elements, the
targettype cast, noswipeprop yet, the selected-row fill, the unmirrored send icon) match the source, the component record and CI's receipts. - The browser spec drives the Interactive, Disabled Items, Ordered List (disc, circle, decimal) and Links stories in light and dark, with the interactive states in right-to-left too. Verified in the spec; all 13 receipts and 24 frames pass in CI at this head.
- Hover and press paint translucent overlays (alpha 0.05 and 0.1) and the focused row shows a 2 px solid ring. Verified in CI's receipts.
- The red-before, green-after runs and the byte-identical left-to-right frames are the author's runs; not reproduced here, and consistent with the spec's check and the base story.
- The List folder's tests pass. Verified in CI: 203 UI cases across 8 files, plus a source-build test.
- The axe-pass entry makes the ListItem audit scan the List stories that render its rows. Verified in the audit routing script and CI's report.
- Auto-merge is not eligible because its activation has not shipped. Verified against the audit record's phase.
- Files:
.changeset/list-item-audit-docs.md,.github/a11y-audit-axe.json,apps/storybook/stories/List.stories.tsx,packages/core/src/List/List.test.tsx,packages/core/src/List/ListItem.tsxandpackages/core/src/List/__tests__/ListItemAudit.a11y.chromium.spec.ts: each clear.
Main brings in meta#11336, which changes List/ListItem.tsx, the row that renders the reorder handle. The merge needs no hand edit.
…10815) * refactor(List): write the reorder refs at commit, not in render Conformance tidy, no visible change. The reorder session's list getter and the mode hint's layer handle were copied into refs during render. Each is now written in a one-line layout effect, so a render React discards leaves nothing behind. No failure is reachable today. Every list getter returns the same element. The layer ref's only reader is the hint's layout effect. It reads the ref at the commit, right after the committed render wrote it. The cleanup uses the handle it captured. * fix(List): a reorder handle's name follows its row's place and label A reorder handle named itself from the DOM in a passive effect: after Item's label element when that element shows a name, else after the row's place ("Reorder item N"). The effect ran only when the handle rendered. A memoized row whose place changed, because a row above it went or the rows reordered, kept the old place in its handle's name. A label that gained or lost its text through its own state left the handle named the old way. The reorder session now reads both from the DOM, outside React. It registers the list's rows and its handles' label elements with Core's shared mutation observer, and releases them with the list. It keeps each handle's label naming, and the place only for a handle named after it. The handle reads them through useSyncExternalStore, as it reads reorder mode, and renders its name from them. Only a change renders the handle again, so its passive effect is gone. A row named after its place still warns in development, once, from the session. positionOf loses its last caller and goes. The session follows the list element the List renders, which changes when its numbering turns on or off. ListReorderNames.test.tsx covers a row above that goes, a reorder, and a label that gains and loses text: each fails on main and passes here. A reorder after the numbering turns on passes on both. * Merge main 1740654 into the reorder handle names Main brings in #11199, whose controller reads a collection's rows through a reader, and #11352's committed-ref hook. #11199 edits positionOf, which this branch removes; it stays removed. One hand edit: refreshNames reads this.rows.read(list) instead of rowsOf(list), as #11199's positionOf did, so a collection's own reader numbers its rows. * refactor(List): the reorder refs use the committed-ref hook The session's list getter and the mode hint's layer handle were each copied into a ref by a one-line layout effect. They now use Core's useCommittedRef, which writes them in a commit-phase insertion effect. The session's useMemo lists the stable getter ref in its dependencies. No behavior changes. Every getter List passes reads the same list ref when called, and the hint's effect reads the handle after either write. A handle's cleanup can reach the getter through release(), and gets the same list. The hint's cleanup hides the handle its setup showed, so no cleanup reads the layer ref. * fix(List): an unchanged handle name keeps its snapshot The names refresh compared each handle's name with the session's own entry, which a handle named some other way has none of before the first read. So it stored a new {position: null, labelNamesRow: null} and the handle rendered again with the same name on every mount (architecture:react-component-runtime INV9). It now compares with handleNameOf, whose shared unread name has the same fields. A test counts the handle's renders through the verb it reads each render: once per handle on mount, and once for a row that mounts later. * fix(List): a hydrated handle keeps its server snapshot The handle's server snapshot was its own unread name, and the session answered an unread handle with another object with the same fields. So after hydration React saw a new snapshot, and each handle rendered again with the same name (architecture:react-component-runtime INV9). The handle now exports one unread name, and the session answers with it. A test hydrates server markup and counts the handle's renders through the verb it reads each render: once per handle. * fix(List): a label that names its row keeps the unread snapshot The names refresh stored whether Item's label element names the row: null before the first read, and true after it, though the handle and the session read both alike. So a handle named by its row's text label rendered again with the same name after mounting and after hydrating (architecture:react-component-runtime INV9). The snapshot now records whether the label shows no name, which stays false until a read finds the label blank. Both render-count cases add a row named by its text label. * Merge main 06b7e61 into the reorder handle names Main brings in #10912, which changes Layer/useLayer.tsx, the layer the mode hint shows. The merge needs no hand edit. * Merge main 31aacff into the reorder handle names Main brings in #11336, which changes List/ListItem.tsx, the row that renders the reorder handle. The merge needs no hand edit.
User impact
Builders reading ListItem's docs see where its slots render:
startContentsits inside the row before the label, andendContentsits inside the row after the label and description. The JSDoc said "before the item" and "after the item". The List Interactive story's chevrons now mirror in right-to-left, as the With End Controls story's chevrons already did, so the story no longer shows a right-pointing "next" chevron in a right-to-left list. No component runtime behavior changes.Three ListItem behaviors that no test checked now have tests: the ref reaches its
<li>inside and outside a List;classNameandstylemerge onto the row beside itslist-itemanditemtargets; andxstyleapplies after ListItem's own styles, so a caller's value for the same property wins.Audit result
core/ListItem(released in@astryxdesign/coreunder./List)1.16.6558725695bb, merged with main at3406f73838ef4917f58e39627d1f2c5f61619a7c4be25398cd2ListItem.spec.md(authority: current), unchanged. No observational backfill was prepared.<li>(AR1); the selected row carriesaria-current="true"; a disabled row keeps its focusable control witharia-disabled="true"and stays in the tab order; links keephref,target, andrelwithnoopener noreferrerfor_blanklist-itembeside Item'sitemtarget (FR5); open FIX: markers are extra elements (Needs Review 1)BaseProps,refto the<li>, row props forwarded to Item (FR1). NIT closed:startContent/endContentJSDoc said "before/after the item" (P34)refand FR5's merge andxstyleorder had no test (FR5's basis was "Current source")component:ListFR10); no 320 px frame was captured§11 is not run for an existing core component.
Why the score moved: the new unit cases close the §6 FIX and the JSDoc closes the §3 NIT. The §2 FIX stays open.
Pre-fix score: scored from base source before any change. Night Watch records only the landed post-fix result in the score ledger, so the pre-fix score lives here.
Findings fixed
refreaches the<li>, thatclassNameandstylemerge beside the row's targets, or thatxstyleapplies after ListItem's own stylescomponent:ListItemFR1, FR5, ORD2reffrom the merged refs fails the ref case; movingxstylebefore ListItem's own styles fails the order casertlStyles.mirroron the Icon), as the With End Controls story doesxstyle={rtlStyles.mirror}on the three chevrons. Browser check: the end chevron is mirrored in right-to-left and not in left-to-right; it failed before and passes afterstartContentandendContentJSDoc said "before the item" and "after the item"ListItem.tsx(Item renders both inside the row);ListItem.doc.mjs("after the label area")The §6 test gap is scored FIX rather than V3's BLOCK because the behavior works and has no reachable victim; only the proof was missing.
Needs Review
spanelements and a number is onespanwith a counter pseudo-element.architecture:component-style-authoringINV7 puts decoration with no role on a pseudo-element.ListItem.spec.mdrecords this under Current-state impact. Moving the markers changes the row's structure and its shared number columns, so this pull request leaves it.targettype (API, not scored).ListItemProps.targetisstring, but ListItem passes it to Item as'_blank' | '_self'through a type cast. Which type is right is a public API choice.swipenot built (owned elsewhere).spec:AST-057FR1 has ListItem passswipethrough to Item, but Item has noswipeyet (DEP-0017), soListItemPropshas none either.ListItem.spec.mdrecords this as its second Current-state gap. It is not scored against ListItem.rgb(212, 212, 212)light,rgb(71, 71, 71)dark on the selected row); selection paint iscomponent:Item's shipped selection style, so it is not scored here.Evidence
ListItemAudit.a11y.chromium.spec.tsdrives the List stories that render ListItem rows (Interactive, Disabled Items, Ordered List withlistStyleset to disc, circle, and decimal, and Links), in light and dark, and the interactive states in right-to-left too. Every frame has a receipt bound to the Storybook build and checkout: story id, theme, mode, direction, viewport, DPR 2, settled fonts, and no page errors. Each line below is a check that fails the receipt when it does not hold:<li>with thelist-itemanditemtargets and an invisible button; one selected row witharia-current="true"; the start icon at the row's inline start; the end chevron mirrored only in right-to-left; rest paints nothing; hover paints a translucent overlay (observed alpha 0.05); a press paints a stronger translucent overlay (observed alpha 0.1) without changing the row height; Tab reaches the first row, which matches:focus-visiblewith a solid ring of at least 2 px;aria-disabled="true", the control is not native disabled, the row paints nothing under the pointer, the pointer shows no interactive cursor, and Tab reaches the row;counter(astryx-list));href="/docs"; the_blankrow addsnoopener noreferrer.5587256from a checkout with only the spec added: 7 of 8 receipts pass, and the right-to-left interactive receipt fails with "end chevron mirrored false in rtl". After, at4f36b9c: all 8 pass; the 14 left-to-right frames are byte-identical and the 4 right-to-left frames differ only in the mirrored chevrons. Review then moved the marker cases to two-line rows and added dark runs; at the exact headf4917f5all 13 receipts pass (24 frames). Those cases have no before run; this pull request does not change ListItem's rendering.List.test.tsxcases; the List folder passes (204 cases).Closed evidence inventory
ListItem,ListItemPropsList/index.tsListItem.doc.mjsarchitecture:public-component-api<li>rendered through Item, row props forwardedListItem.tsxrefto the<li>ListItem.tsxListItem.tsxList.doc.mjsListItem.tsxListItem.tsxListMarkersbrowser specList.doc.mjslistStylelist-itemtarget,className,style,xstyleorderListItem.tsxonClick,href,target,relListItem.tsxisDisabled,isSelectedListItem.tsxitemKeyListItem.tsxspec:AST-103DEC-4startContent,endContent,alignListItem.tsxswipeActions,swipeBehaviorListItem.tsxspec:AST-057swipespec:AST-057FR1, DEP-0017FR10 eligibility report
{ "schema": "astryx.audit-eligibility/v1", "component": "ListItem", "package": "core", "mode": "night-watch", "rubricVersion": "1.16.6", "repository": {"base": "558725695bb", "head": "f4917f58e39627d1f2c5f61619a7c4be25398cd2"}, "contract": {"id": "component:ListItem", "authority": "current", "changed": false}, "inventory": {"closed": true, "rows": 13}, "remediations": [ {"id": "V3", "kind": "behavior-test", "evidence": "3 unit cases; ref and order mutation checks"}, {"id": "I10-fixture", "kind": "fixture", "evidence": "story chevrons; right-to-left browser check red before, green after; not scored"}, {"id": "P34", "kind": "doc-drift", "evidence": "startContent and endContent JSDoc"} ], "unresolved": { "objective": ["markers are extra elements (component-style-authoring INV7)"], "manual": ["ListItemProps.target type versus Item's", "send icon mirroring in a story"], "ownedElsewhere": ["swipe pass-through (AST-057 FR1, not built)"] }, "approvals": {"specOwner": "n/a (no record change)"}, "verdict": {"autoMergeEligible": false, "reasons": ["AST-029 FR11 activation has not shipped", "open items"]} }