Repository navigation
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
PR Analysis Report📚 Storybook Preview🧪 Sandbox PreviewModified ComponentsItem (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression40 of 486 shot(s) changed. A change here is a question, not a failure: check whether the after is the
and 20 more. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
There was a problem hiding this comment.
Thanks for stacking this cleanly — the grid-row mechanism itself checks out in the evidence gathered for this review: every row part renders as a gridcell, selection stays on the row, roving focus lands on the label-cell link, no component-structure accessibility violations were found, and disclosure state correctly rides the focused control.
Approval needs a maintainer decision first. No current spec settles the Item grid-row cell shape (every exposed child of a role="row" row as a gridcell with the control retained in the label cell), row qualifying for swipe actions under AST-057 DEC-3 with the panel itself as a cell, or the stacked controlProps object shape this builds on. Please have a maintainer provide or identify the governing spec for those additions (for example in AST-057 or a future Item record) so this can proceed; no removal or split is being requested for the missing spec itself.
One fix will still be needed once that lands: a link-root row (as link component with controlProps) currently gets a false development warning claiming it renders no control, even though the attributes do land on the root — it is flagged inline on the control-detection code with the smallest correction.
[Automated review]
| const rendersControl = | ||
| !isDelegate && | ||
| (role == null || isGridRow) && | ||
| (href != null || onClick != null); |
There was a problem hiding this comment.
False "renders no control" warning for link-root rows.
rendersControl never counts the link-root case: with as set to a link component, an href, and a parent role such as menuitem, controlProps are spread on the root (the root render spreads them whenever isLinkRoot), yet this detector returns false and the development warning claims the row renders no control — teaching exactly the wrong fix.
Evidence: the test "lands on the root when the root is the link" passes while asserting the attributes on the root, and the same run prints this warning under that test's name.
Smallest correction: count the link-root root as the rendered control here (for example, include the isLinkRoot case), and align the controlProps documentation, JSDoc, and changeset wording that still says "a row with a role" without the row and link-root exceptions.
There was a problem hiding this comment.
Approval is waiting on a maintainer decision: a maintainer needs to provide or identify the governing spec for the role="row" grid-row shape (every part, each swipe panel included, a gridcell, with the row's own link or button kept in the label cell), admit row for swipe actions under AST-057, approve or reject the draft component:Item requirements for controlProps, and decide whether changing today's role="row" behavior is a patch or a breaking change; nothing needs to be removed or split for that. Independently, a few fixes are needed:
- The draft
Item.spec.mdstill says anyroleon a plain root renders no control, and that omittingcontrolPropschanges nothing, although a disabledonClickrow's button now also getsaria-disabledandtabindex="-1". - The
controlPropsdocs, JSDoc, Changeset and development warning repeat the sameroleinaccuracy. - The Grid Rows story loses its roving tab stop when a row is removed while the last row holds it, and offers Archive only by swipe.
- The description needs the writing-rubric results for the new record.
[Automated review]
|
|
||
| | ID | Candidate invariant | Basis | Draft review state | | ||
| | --- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | ------------------ | | ||
| | FR1 | The row MUST render at most one control: the invisible anchor when `href` is set, else the invisible button when `onClick` is set, or the root itself when `as` is a link component and `href` is set. A row with a `role` on a plain root, or with an `interactiveRef` (a link root included), renders none. | current behavior; `architecture:public-component-api/INV5` | settled | |
There was a problem hiding this comment.
FR1 says a row with a role on a plain root renders no control, but under role="row" the code renders the invisible anchor or button in the label cell and spreads controlProps there (Item.tsx rendersControl and hasParentRole). The availability column (line 89) and the representative state on line 123 say the same. Once the maintainer settles the grid-row contract, state the row exception here (or drop it from the code) so the record matches what ships.
| type="button" | ||
| onClick={onClick} | ||
| disabled={isDisabled} | ||
| aria-disabled={isDisabled ? true : controlProps?.['aria-disabled']} |
There was a problem hiding this comment.
With no controlProps, a disabled onClick row's button now renders aria-disabled="true" and tabindex="-1"; the base rendered <button disabled> alone. It is harmless for users (a natively disabled button is unfocusable), but Item.spec.md line 57 and ORD2 say omitting the bag changes nothing. Either write these two only when a bag is passed, as the link root does, or say so in the record.
| useDevWarning( | ||
| 'Item', | ||
| '`controlProps` reaches the control the row renders for `onClick` or ' + | ||
| '`href`, and this row renders none: a row with a `role` leaves keyboard ' + |
There was a problem hiding this comment.
For a static role="row" row (no onClick or href) this warning says “a row with a role leaves keyboard access to its parent”, but a grid row keeps its own control; the reason it renders none is that it has no action. Name that case (and the row exception) here and in the controlProps docs, JSDoc and Changeset.
| })), | ||
| ); | ||
| const [focusedIndex, setFocusedIndex] = useState(0); | ||
| const remove = (id: string) => |
There was a problem hiding this comment.
remove never clamps focusedIndex: removing any row while the last row holds the roving stop leaves no link with tabIndex 0, and since arrow keys are handled only on the links, the row links can no longer be reached by keyboard. Clamp focusedIndex to the new last row here. Archive is also swipe-only in this story; a button in the end cell would give it the second home Item's docs ask for.
|
metadata-only rewrite: commit author identity; tree unchanged |
There was a problem hiding this comment.
Approval is waiting on a maintainer decision: a maintainer needs to approve or reject the new controlProps rows in the current component:Item record (FR9–FR13, DEC-3, DEC-4), provide the governing spec for the role="row" grid shape (each part, swipe panels included, a gridcell, with the row's own link or button in the label cell, and the grid's keyboard model), say whether row is served swipe actions under AST-057, and decide whether replacing today's role="row" behavior is an AST-017 accessibility fix or a breaking change. Nothing needs to be removed or split for that decision. Two fixes are needed independently:
- Once the shape is settled, name the adopted grid parts, keyboard model and outcome in
component:Item(AST-020 FR2 and FR15) and listItemGridRow.a11y.chromium.spec.tsin its verification. - The Grid Rows story keeps every row's checkbox in the tab order (six stops for five rows), so make the grid one tab stop, with the checkboxes roving alongside the links, and update the Chromium spec's tab-order assertion.
[Automated review]
| startContent={ | ||
| <CheckboxInput | ||
| label={`Select ${row.label}`} | ||
| isLabelHidden | ||
| value={row.selected} | ||
| onChange={() => toggle(row.id)} | ||
| /> | ||
| } |
There was a problem hiding this comment.
Every row's checkbox stays in the tab order, so this five-row grid has six tab stops (five checkboxes plus the roving link), and only ArrowUp and ArrowDown move focus. A grid is a composite widget and should be a single tab stop: CheckboxInput forwards tabIndex, so the checkboxes can rove with the links (tabIndex={-1} outside the focused row, Left and Right between cells).
| true, | ||
| ); | ||
|
|
||
| // Roving focus. The tab order walks the cells in DOM order: the first |
There was a problem hiding this comment.
This pins a tab order that stops on each row's checkbox. If the grid becomes a single tab stop, update this assertion with it.
| | FR6 | `first-line` MUST hold in every density, in `stacked` and `inline` layouts, with `labelLines` truncation, and in plain, button, link, link-root, delegated, and parent-role rows. In right-to-left text it MUST produce the same block-axis placement with the slots mirrored by logical order and no DOM reordering. | `architecture:internationalization` | settled | | ||
| | FR7 | The `item` theme target MUST reflect the resolved alignment as its existing `align` selector axis, including `first-line`, and Item's public theming metadata MUST list that value. No new target, state, or theme-level default is added. | `architecture:component-theming-surface/INV6`; `component:Item/DEC-2` | settled | | ||
| | FR8 | ListItem, RadioListItem, and CheckboxListItem MUST expose `align` with Item's values and default and forward it unchanged to the Item row they render. A composing row MUST NOT drop, remap, or narrow the value. | Owner direction | settled | | ||
| | FR9 | The row MUST render at most one control of its own: the invisible anchor when `href` is set, else the invisible button when `onClick` is set, or the root itself when `as` is a link component and `href` is set, in which case an invisible button rendered beside it for `onClick` is a plain button and not the control. A row with a `role` on a plain root renders none, except `role="row"`, which keeps its control inside the label cell; a row with an `interactiveRef` renders none. | current behavior; `architecture:public-component-api/INV5` | settled | |
There was a problem hiding this comment.
FR9 now states the row exception, but the record still does not name the grid parts it adopts (which parts become gridcells, the keyboard model, the WCAG outcome), as AST-020 FR2 and FR15 ask of the owning record, and verified_by omits ItemGridRow.a11y.chromium.spec.ts. This follows the maintainer's decision on the grid-row shape.
A row that opens a layer or toggles something has a state a screen reader
must read with its name: `aria-expanded`, `aria-haspopup`, `aria-controls`,
`aria-pressed`. `Item` renders the actual control itself, the invisible
button for `onClick` or the invisible anchor for `href`, and spreads a
caller's props on the root around it. So the state lands on a generic
element where it is invalid ARIA and unread, and the focused control
reports a bare "button". The same wall meets a host's own marks and key
handling: a composite that roves focus by a `data-*` id and a `tabIndex`,
or listens on the focused element, cannot reach the element focus lands on.
`controlProps` is that object: spread on the control the row renders,
before the row's own attributes, so the row still wins where they meet (a
disabled row keeps `tabIndex={-1}` and `aria-disabled`; the type, the click
and the disabled state of the button are never a caller's). Where the root
is the link (`as` is a link component) the root is the control and they
land there. A row that renders no control, one with a `role` (its parent
owns keyboard access) or an `interactiveRef` (the nested control is the one
to attribute), ignores them with a development warning naming where the
attributes go instead. The type is `React.HTMLAttributes` less the
control's own `role`, `onClick`, `className`, `style` and children, plus
`data-*`.
Tests: Item.test.tsx (states, relations, marks, key handling and the
tabIndex on the button; the same on the anchor beside href/target/rel; a
name of the control's own; the disabled row's precedence; the link root;
the two no-control warnings and the silence when the control renders). A
real-Chromium spec on the Disclosure Row story reads the focused node's
role, name and expanded state from the accessibility tree before and after
Enter, checks the root reports no state, and runs axe in both states.
|
(b) in head 1b4a6f0: the Grid Rows story is one tab stop — the focused row's select cell and link carry (a) stays with the maintainer's call on the grid shape, as you framed it: once the cell shape is settled I add the adopted grid parts, the keyboard model and the WCAG outcome to |
There was a problem hiding this comment.
Approval is waiting on a maintainer decision: a maintainer needs to approve or reject the new controlProps rows in component:Item (FR9-FR13, DEC-3, DEC-4), provide the governing spec for the role="row" grid shape (each part, swipe panels included, a gridcell, the row's own link or button in the label cell, and the grid parts and keyboard model component:Item adopts), say whether row is served swipe actions under AST-057, and decide whether replacing today's role="row" behavior is an AST-017 accessibility fix or a breaking change. Nothing needs to be removed or split for that decision. Two fixes are needed independently:
- The Grid Rows story documents its grid as one tab stop but keeps two (the focused row's checkbox and link both have
tabIndex0), andItemGridRow.a11y.chromium.spec.tspins that count; rove one cell rather than one row and assert a singletabindex="0". - Once the tier is decided, make the grid-row Changeset name the
role="row"behavior it replaces (no control or second tab stop,onClickon the root,hrefignored).
[Automated review]
| tabIndex={index === focusedIndex ? 0 : -1} | ||
| onKeyDown={onCellKeyDown(index, 'select')} | ||
| /> | ||
| } | ||
| endContent={<Text color="secondary">2h</Text>} | ||
| controlProps={{ | ||
| 'data-nav-id': row.id, | ||
| tabIndex: index === focusedIndex ? 0 : -1, |
There was a problem hiding this comment.
Both the focused row's checkbox (713) and its link (720) get tabIndex 0, so this grid is two Tab stops: Tab lands on the checkbox, a second Tab on the link still inside the grid, and only a third Tab leaves. The JSDoc above promises one stop, and the grid.focus.single-tab-stop contract in internal/a11y-spec would fail with "2 elements inside the grid are in the Tab order". Track the focused cell (row and column) and give tabIndex 0 to that one control only.
| .evaluateAll( | ||
| els => els.filter(el => el.getAttribute('tabindex') === '0').length, | ||
| ); | ||
| expect(stops).toBe(2); |
There was a problem hiding this comment.
This pins two tabindex="0" cells while the comment at line 134 says the grid is one tab stop, and the test never presses Tab from the select cell, where the second stop shows. Once the story roves a single cell, assert one stop and that Tab from the select cell leaves the grid.
| '@astryxdesign/core': patch | ||
| --- | ||
|
|
||
| [feat] `Item` gains a grid-row shape: under `role="row"` the row renders its parts as `gridcell`s — the marker, the start content, the label with its description, the end content and each swipe panel — and keeps its own control (the invisible anchor for `href` or button for `onClick`) in the label cell, where `controlProps` carries a grid's roving `tabIndex`, its marks and its key handling. `isSelected` is the row's `aria-selected`. Swipe actions are available on a grid row, per `spec:AST-057`'s rule (a role whose cells admit interactive descendants): the revealed entries are buttons inside a `gridcell`. Every other role is unchanged. |
There was a problem hiding this comment.
This says [feat] and that every other role is unchanged, but not what role="row" did before (no control and no second tab stop, onClick on the root, href ignored). AST-017 FR53 (an accessibility fix) and FR7 (a breaking change) both require the Changeset to name the old behavior; set the tag and body once the tier is decided.
|
Both in head c68d81c. (1) The Grid Rows story tracks the focused cell (row and column): exactly one control carries |
There was a problem hiding this comment.
Approval is waiting on a maintainer decision: a maintainer needs to approve or reject the new controlProps rows in component:Item (FR9-FR13, DEC-3, DEC-4), provide the governing spec for the role="row" grid shape (each part, swipe panels included, a gridcell, the row's own link or button in the label cell, and the grid parts and keyboard model component:Item adopts), say whether row is served swipe actions under AST-057, and decide the AST-017 tier for replacing today's role="row" behavior. Nothing needs to be removed or split for that decision. The single-Tab-stop story and the Changeset now check out; two small fixes to the Grid Rows story are still needed either way:
- Move the grid's one Tab stop when a cell takes focus by pointer too (an
onFocuson the checkbox and on the link throughcontrolProps): after a click on row 4, Tab currently sends focus back to row 1, not to the last focused cell the story describes. - Add
aria-multiselectable="true"to the grid, since several rows can be selected at once.
[Automated review]
| // One tab stop for the whole grid: exactly one cell carries tabIndex 0 | ||
| // and every other cell -1. Up and Down move between rows, Left and Right | ||
| // between a row's select cell and its link. | ||
| const focusRow = (index: number, cell: 'select' | 'link') => { |
There was a problem hiding this comment.
The roving stop moves only through focusRow, so a pointer focus never updates it: after a click on row 4's checkbox the only tabindex="0" stays on row 1's checkbox, and Tab sends focus back to row 1, not to the "last focused cell" the JSDoc at line 629 describes. Setting the focused row and cell from each cell control's onFocus (the checkbox, and the link through controlProps) fixes it.
| }; | ||
| return ( | ||
| <div | ||
| role="grid" |
There was a problem hiding this comment.
Several rows can be selected at once here (rows 2 and 4 after one click), so the grid should carry aria-multiselectable="true"; without it assistive technology is told a single-select grid while two rows report aria-selected.
| | FR6 | `first-line` MUST hold in every density, in `stacked` and `inline` layouts, with `labelLines` truncation, and in plain, button, link, link-root, delegated, and parent-role rows. In right-to-left text it MUST produce the same block-axis placement with the slots mirrored by logical order and no DOM reordering. | `architecture:internationalization` | settled | | ||
| | FR7 | The `item` theme target MUST reflect the resolved alignment as its existing `align` selector axis, including `first-line`, and Item's public theming metadata MUST list that value. No new target, state, or theme-level default is added. | `architecture:component-theming-surface/INV6`; `component:Item/DEC-2` | settled | | ||
| | FR8 | ListItem, RadioListItem, and CheckboxListItem MUST expose `align` with Item's values and default and forward it unchanged to the Item row they render. A composing row MUST NOT drop, remap, or narrow the value. | Owner direction | settled | | ||
| | FR9 | The row MUST render at most one control of its own: the invisible anchor when `href` is set, else the invisible button when `onClick` is set, or the root itself when `as` is a link component and `href` is set, in which case an invisible button the row still renders for `onClick` is nested inside that root as a second tab stop (today's behavior, outside this contract) and is not the control. A row with a `role` on a plain root renders none, except `role="row"`, which keeps its control inside the label cell; a row with an `interactiveRef` renders none. | current behavior; `architecture:public-component-api/INV5` | settled | |
There was a problem hiding this comment.
FR9's basis column reads "current behavior", but the role="row" clause is new: on main any role on a plain root renders no control. Worth stating as new behavior when a maintainer settles the grid-row shape.
…control, swipe actions A list that is a grid (a mail list with a select cell, a row link and a row verb, the keyboard roving between rows) could not be `Item` rows: with any `role` the row renders no control (the label sits in a plain span and `href` is ignored), its parts sit bare in the row where a grid wants cells, and swipe actions are refused. The caller was left with the root as the link (no checkbox or menu may sit inside an anchor, and no swipe) or a row of its own beside the system's. Under `role="row"` the row now renders its parts as `gridcell`s — the marker, the start content, the label with its description, the end content, and each swipe panel — and keeps its own control in the label cell: the invisible anchor for `href` or button for `onClick`, which `controlProps` reaches, so a grid's roving `tabIndex`, its `data-*` marks and its key handling land on the element focus lands on. The anchor is a plain link inside its cell, never a `gridcell` itself and never the carrier of `aria-selected` (measured in Chromium: axe flags `role="gridcell"` on an anchor and `aria-selected` on it as a critical violation; on the cell and on the row both are clean). `isSelected` is the row's `aria-selected`, as for every role that permits it. Swipe actions are available on a grid row: the rule in the row-actions record is a role whose content model permits interactive descendants, which a grid row does through its cells, and the panel is a `gridcell` — inert at rest, live with its buttons while the row rests open — so every exposed child of the row is a cell in every state. Every other role is unchanged: no cells, no control, no swipe. Tests: Item.test.tsx (every part a gridcell with the link in the label cell carrying the control props; a button for onClick; a static row; selection on the row and not the link; a one-cell row; no controlProps warning; other roles untouched; swipe served under role="row" with the panel a cell that is inert at rest and live when resting open; still refused on an option). A real-Chromium spec on the Grid Rows story: axe clean over the grid at rest and while a row rests open, Chromium's accessibility tree reporting every exposed row child as a gridcell in both states and the selected row as selected, the tab order walking checkbox then link, arrow keys roving the focus, a touch swipe resting open on a cell of buttons, Archive firing and the row leaving.
… isLabelHidden, value)
|
All three in head ebd9ba6. (1) Each cell control reports its focus ( |
There was a problem hiding this comment.
Approval is waiting on a maintainer decision: a maintainer needs to approve or reject the new controlProps rows in component:Item (FR9-FR13, DEC-3, DEC-4), provide the governing spec for the role="row" grid shape (each part, swipe panels included, a gridcell, the row's own link or button in the label cell, and the grid parts and keyboard model component:Item adopts), say whether row is served swipe actions under AST-057, and decide the AST-017 tier for replacing today's role="row" behavior. Nothing needs to be removed or split for that decision. The Grid Rows story's pointer-focus Tab stop and aria-multiselectable now check out and no other fix is outstanding; once the shape is settled, the record should name the adopted grid parts, keyboard model and WCAG outcome and list ItemGridRow.a11y.chromium.spec.ts in its verification.
[Automated review]
|
Posted by Cindy's agent on her behalf. Requested change before approval.
The PRs stacked on this one and the swipe-row PRs wait on that List spec. |
|
Taking the direction: the grid-row shape — cells under What this head holds that the List amendment may want as evidence: #7269 ( |
|
Closing: the owner's direction of 2026-10-25 stands (no grid-row shape, role or defaults in Item; grid semantics, if any, belong to List and need a List spec first). The grid evidence stays on this thread for that amendment: |
Stacked on #7269; the reviewable delta is the second commit.
User need
A list that is a grid — a select cell, a row link, a row verb, the keyboard roving between rows — cannot be
Itemrows: with anyrolethe row renders no control, its parts sit bare where a grid wants cells, and swipe is refused.Problem and solution fit
Item.tsx: underrole="row"the parts render asgridcells — marker, start, label with description, end, each swipe panel (ItemSwipeLayertakes apanelRole) — and the label cell keeps the row's own control, reached bycontrolProps.isSelectedis the row'saria-selected.rowadmits swipe; the panel is a cell, inert at rest. Every other role is unchanged.Current specification
spec:AST-057DEC-3 (current): swipe exists where the row's role permits interactive descendants, which a grid row does through its cells; its in-core list predates this shape.component:Item(amended in #7269) carries the control model; FR9 names therowexception. Owner decision needed: the cell shape as a rule;rowin that list.Public delta and caller burden
role="row"renders cells and keeps the control; no new prop.controlPropscarries the rovingtabIndex.gridcell, never carryingaria-selected: axe flags both on an anchor (the second critical); on the cell and the row, clean.Design and alternatives
Cells on the row's existing parts, no new element. Rejected: the anchor as the cell (invalid, above); a
role="presentation"panel wrapper (forbidden by the option-actions record).Evidence
Item.test.tsx: every part a gridcell, the link in the label cell carrying the bag; a button foronClick; a static row; selection on the row; a one-cell row; other roles untouched; swipe served underrole="row", the panel a cell; refused onoption.ItemGridRow.a11y.chromium.spec.ts(real Chromium, touch, axe), Grid Rows story: axe clean at rest and resting open; every exposed row child a gridcell in both states; Tab walks checkbox then link; arrows rove; a swipe rests open on a cell of buttons; Archive fires.Writing rubric results
R1 narration: none; the delta states what a grid row renders.
R2 research: none in the record; axe measurements are in this description.
R3 evidence: current behavior and the record's DECs.
R4 rejected alternatives: none added to the record.
R5 change references: none.
R6 open questions: none.
Scope
Testing