Skip to content

feat(Item): a grid-row shape — cells under role="row", the row's own control, swipe actions - #7270

Closed
vjeux wants to merge 3 commits into
meta:mainfrom
vjeux:item-grid-row
Closed

vjeux wants to merge 3 commits into
meta:mainfrom
vjeux:item-grid-row

Conversation

@vjeux

@vjeux vjeux commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

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 Item rows: with any role the row renders no control, its parts sit bare where a grid wants cells, and swipe is refused.

Problem and solution fit

  • Item.tsx: under role="row" the parts render as gridcells — marker, start, label with description, end, each swipe panel (ItemSwipeLayer takes a panelRole) — and the label cell keeps the row's own control, reached by controlProps. isSelected is the row's aria-selected. row admits swipe; the panel is a cell, inert at rest. Every other role is unchanged.
  • Docs; a Grid Rows story (the grid clips inline; the roving stop survives a removal).

Current specification

spec:AST-057 DEC-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 the row exception. Owner decision needed: the cell shape as a rule; row in that list.

Public delta and caller burden

  • role="row" renders cells and keeps the control; no new prop. controlProps carries the roving tabIndex.
  • The anchor is a plain link in its cell, never a gridcell, never carrying aria-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 for onClick; a static row; selection on the row; a one-cell row; other roles untouched; swipe served under role="row", the panel a cell; refused on option. 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

pnpm -F @astryxdesign/core typecheck && pnpm -F @astryxdesign/core typecheck:docs
pnpm exec vitest run packages/core --maxWorkers=5   # 12685 passed
pnpm storybook:build && pnpm exec playwright test packages/core/src/Item/__tests__/ItemGridRow.a11y.chromium.spec.ts --project=chromium
pnpm check:changesets && pnpm check:knowledge && pnpm check:sync

@vercel

vercel Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Oct 20, 2026 7:41pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 9, 2026
@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Oct 9, 2026
@astracat-bot

astracat-bot Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 4, 2026, 2:16 PM UTC

@github-actions

github-actions Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR

🧪 Sandbox Preview

View Sandbox for this PR

Modified Components

Item (@astryxdesign/core) · View in Storybook
Metric Before After Delta
Bundle Size (ESM) N/A N/A N/A
Lines of Code N/A 1407 -
Complexity N/A Very High (147) -

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.9KB 1.2KB

Accessibility Audit

Status: No accessibility violations detected.

Visual Regression

40 of 486 shot(s) changed.

A change here is a question, not a failure: check whether the after is the
picture you intended. Record that review on the PR. Baseline maintenance is an
explicit dispatch of CI; this report never rewrites the baseline or adds a release gate.

component story theme mode pixels
Selector Indicator Space Bottom Sheet Narrow End RTL neutral light 754,077
Selector Indicator Space Bottom Sheet Wide Start neutral light 740,188
Chat Full AI Chat probe light 230,823
Chat Full AI Chat probe dark 229,805
RichTextEditor Markdown parity: side by side probe dark 94,866
RichTextEditor Markdown parity: side by side probe light 89,762
Collapsible Dividers probe dark 66,445
Collapsible Dividers probe light 66,445
Chat Default neutral dark 36,304
Chat Default neutral light 35,767
Chat Empty State probe light 23,531
Chat Empty State probe dark 22,622
ChatAutoScroll Scroll Behavior Comparison neutral dark 15,378
ChatAutoScroll Scroll Behavior Comparison neutral light 14,107
Chat With Attachments probe light 13,406
Chat With Attachments probe dark 11,232
ProgressBar With Target Mark probe dark 7,895
ProgressBar With Target Mark probe light 7,895
Markdown Default neutral dark 7,573
Markdown Default neutral light 7,566

and 20 more.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]

Comment thread packages/core/src/Item/Item.tsx Outdated
Comment on lines +724 to +727
const rendersControl =
!isDelegate &&
(role == null || isGridRow) &&
(href != null || onClick != null);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.md still says any role on a plain root renders no control, and that omitting controlProps changes nothing, although a disabled onClick row's button now also gets aria-disabled and tabindex="-1".
  • The controlProps docs, JSDoc, Changeset and development warning repeat the same role inaccuracy.
  • 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]

Comment thread packages/core/src/Item/Item.spec.md Outdated

| 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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/core/src/Item/Item.tsx Outdated
type="button"
onClick={onClick}
disabled={isDisabled}
aria-disabled={isDisabled ? true : controlProps?.['aria-disabled']}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/core/src/Item/Item.tsx Outdated
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 ' +

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) =>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@vjeux

vjeux commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

metadata-only rewrite: commit author identity; tree unchanged

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 list ItemGridRow.a11y.chromium.spec.ts in 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]

Comment on lines +681 to +688
startContent={
<CheckboxInput
label={`Select ${row.label}`}
isLabelHidden
value={row.selected}
onChange={() => toggle(row.id)}
/>
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/core/src/Item/Item.spec.md Outdated
| 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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.
@vjeux

vjeux commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

(b) in head 1b4a6f0: the Grid Rows story is one tab stop — the focused row's select cell and link carry tabIndex 0 and every other row's cells -1 (CheckboxInput forwards tabIndex, onKeyDown and the data-select-id mark); Up and Down move between rows, Left and Right between a row's select cell and its link, Space selects. The Chromium spec asserts it: Tab lands on the select cell, Right reaches the link, Down/Up rove, Left returns, exactly two tabindex="0" cells in the grid, the swipe panels inert, a second Tab leaves the grid.

(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 component:Item and ItemGridRow.a11y.chromium.spec.ts to verified_by.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 tabIndex 0), and ItemGridRow.a11y.chromium.spec.ts pins that count; rove one cell rather than one row and assert a single tabindex="0".
  • Once the tier is decided, make the grid-row Changeset name the role="row" behavior it replaces (no control or second tab stop, onClick on the root, href ignored).

[Automated review]

Comment thread apps/storybook/stories/Item.stories.tsx Outdated
Comment on lines +713 to +720
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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread .changeset/item-grid-row.md Outdated
'@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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

@vjeux

vjeux commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Both in head c68d81c. (1) The Grid Rows story tracks the focused cell (row and column): exactly one control carries tabIndex 0 — the last focused select cell or link — and every other cell -1, so Tab enters the grid once and the next Tab leaves it. ItemGridRow.a11y.chromium.spec.ts now asserts one tabindex="0" among the grid's anchors, inputs and buttons before, during and after roving (Tab → select cell, Right → link, Down/Up between rows, Left back), the panels inert, and Tab from the select cell leaving the grid. (2) The changeset names the old role="row" behavior — no control, the label in a plain span, onClick on the root, href ignored, no tab stop — and what a caller that relied on it finds now; the tier stays patch with the record's compatibility class, for the maintainer to confirm with the shape.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 onFocus on the checkbox and on the link through controlProps): 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') => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/core/src/Item/Item.spec.md Outdated
| 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 |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

vjeux added 2 commits October 20, 2026 12:35
…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.
@vjeux

vjeux commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

All three in head ebd9ba6. (1) Each cell control reports its focus (onFocus on the checkbox, and on the link through controlProps), so a pointer focus moves the roving stop: the spec clicks the fourth row's select cell, finds it the one tabindex="0", Tabs out and Shift+Tabs back to it, not to the first row. (2) The grid carries aria-multiselectable="true"; the spec reads it beside the two selected rows. (3) FR9's basis now reads "current behavior, except the role="row" clause, which is new with the grid-row shape". Chromium 6/6 twice; Item + List 179; check:knowledge aligned. The maintainer calls stay as you list them.

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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]

@cixzhang

cixzhang commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Posted by Cindy's agent on her behalf.

Requested change before approval.

  • Don't add the grid-row shape, role or defaults to Item. Item is a primitive.
  • Grid semantics, if any, belong to List, and only when List rows carry gestures or row actions. That needs a List spec first. A List amendment is being drafted covering the keyboard model, what assistive technology announces, and how row actions stay reachable by keyboard and mouse. No build until it's approved.
  • With a mouse or trackpad, List has no swipe actions, so it stays a plain list.

The PRs stacked on this one and the swipe-row PRs wait on that List spec.

@vjeux

vjeux commented Oct 25, 2026

Copy link
Copy Markdown
Contributor Author

Taking the direction: the grid-row shape — cells under role="row", the row's own control in the label cell, swipe on a grid row — leaves Item. This pull request goes to draft now and closes once the List amendment exists; the branch stays as it is meanwhile, since another stack still carries it in its base.

What this head holds that the List amendment may want as evidence: ItemGridRow.a11y.chromium.spec.ts (real Chromium; axe clean at rest and resting open; every exposed row child a gridcell; one Tab stop with roving focus between rows and between a row's cells; a pointer focus moving the stop; aria-multiselectable; inert swipe panels; Tab leaving the grid) and the Grid Rows story it runs against. One measurement stands whatever the home: an <a> may carry neither role="gridcell" nor aria-selected (axe aria-allowed-role; aria-allowed-attr, critical), so the cell wraps the link and selection sits on the row.

#7269 (controlProps) stays open on its own; whether Item still needs it is the List amendment's to say.

@vjeux
vjeux marked this pull request as draft October 25, 2026 03:42
vjeux added a commit to vjeux/astryx that referenced this pull request Oct 25, 2026
@vjeux vjeux closed this Nov 4, 2026
@cixzhang cixzhang reopened this Nov 4, 2026
@vjeux

vjeux commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

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: ItemGridRow.a11y.chromium.spec.ts and the Grid Rows story at ebd9ba6 (one Tab stop with roving focus, aria-multiselectable, cells, inert swipe panels; an <a> may carry neither role="gridcell" nor aria-selected). #7269 (controlProps) continues on its own.

@vjeux vjeux closed this Nov 4, 2026

This branch was successfully deployed

1 active deployment
Preview — ebd9ba68 Deployed Oct 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review needs:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants