Skip to content

feat(Item): controlProps — attributes reach the control the row renders - #7269

Draft
vjeux wants to merge 9 commits into
meta:mainfrom
vjeux:item-control-props
Draft

vjeux wants to merge 9 commits into
meta:mainfrom
vjeux:item-control-props

Conversation

@vjeux

@vjeux vjeux commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

User need

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 control itself, the invisible button or anchor the label sits in. It spreads a caller's props on the root around it, so the state lands on a generic element, invalid and unread. A composite roving focus by data-* id and tabIndex meets the same wall.

Problem and solution fit

  • Item.tsx: controlProps, spread on the control the row renders, before the row's own attributes. On a link root (as), they land on the root. A row that renders no control ignores them and warns in development.
  • Item's and ListItem's records amended; Item.doc.mjs; ListItem forwards the prop; a Disclosure Row story.

Current specification

component:Item (current) governs align; other Item behavior follows the source until a record claims it. This change amends it with the control model: FR11–FR15, AR3–AR5, DEC-3 and DEC-4. DEC-3 makes the bag an explicit object; DEC-4 lets the row's own attributes win. INV4 and INV5 admit the prop. component:ListItem (current) passes every row prop to Item; its record lists the forwarded controlProps.

Merged with main 2535488: main's spec:AST-085 (focusable disabled) replaces DEC-4's disabled tabIndex={-1} clause. A disabled control keeps aria-disabled, blocks activation, and keeps the enabled row's focus order, or the bag's tabIndex (FR1, FR2). The bag leaves out aria-disabled, which comes from isDisabled alone. AST-085 exposes aria-disabled on a disabled control (FR1) and on a busy one (FR6), never on a plain enabled one. Main's Item FR9–FR10 renumber this change's rules FR11–FR15, and the record moved to docs/specs/components/Item/.

Public delta and caller burden

  • controlProps?: ItemControlProps: React.HTMLAttributes less role, onClick, className, style, children, dangerouslySetInnerHTML, hidden, inert, aria-hidden and aria-disabled, plus data-*. Type exported.
  • Precedence (component:Item/DEC-4): aria-disabled comes from isDisabled alone, and a disabled row blocks activation; the button's type and click stay the row's.
  • Absent, nothing changes; every other prop keeps landing on the root.

Design and alternatives

An explicit object, not inference. Forwarding aria-expanded from the root would move an attribute some callers put there on purpose. data-* and onKeyDown cannot be told from the root's.

Evidence

Item.test.tsx + List.test.tsx: the bag reaches the button, the anchor beside its href/target/rel, and the row through ListItem. They cover a name of its own, the bag's aria-current, and disabled precedence on every control, Enter and Space withheld from the bag's onKeyDown included. A disabled link root given the bag stays a tab stop. aria-disabled stays out of the bag, by type and at run time. A row without the bag is unchanged, a link root with onClick carries the bag once, and the no-control cases warn. ItemControlProps.a11y.chromium.spec.ts (real Chromium, axe), Disclosure Row story: Tab lands on the control. It reports button, its name, and expanded false, then true after Enter, with focus kept. The root reports no state; axe is clean both ways. First-load gzip without controlProps (pnpm size:pages, test) stays under INV10's 307 B on every page. An Item page grows 266 B; docs 0 B, form 0 B, menu 269 B and table 297 B.

Writing rubric results

R1 narration: FR11, ORD3, AR5, DEC-3 and a states row said what the row did before; each now states what it does. Main's Omitted align row ("today's center") and DEC-1 ("today's default") keep their own wording.
R2 research: none in either record; browser evidence is in this description.
R3 evidence: Item's bases are current behavior, DEC-3, DEC-4, INV5, and AST-085 FR1, FR2 and FR6; ListItem's FR1 keeps its basis.
R4 rejected alternatives: one, Item's DEC-3, one line.
R5 change references: none in either record.
R6 open questions: none.

Scope

Components: Item, ListItem

  • One capability is added.
  • Unrelated fixes, cleanup, and policy changes were removed or split.
  • Consumer docs, focused tests, and migration evidence ship with the feature.
  • Public text and artifacts contain no internal Meta context.

Testing

At 43b8cd9, which merges main 3560b58. Item's spec and tests are resolved by hand: main's FR9 rows and click suite sit beside this branch's. It holds the merge of main 2535488 (402a0f3), ListItem's record (5e8b263) and aria-disabled out of the bag (db32235). It also holds DEC-4's wording (f9a254f), the disabled-key fix (39fae3c), the link root's tab stop (543de00) and its comment (e793890):

pnpm -F @astryxdesign/core typecheck && pnpm -F @astryxdesign/core typecheck:docs
pnpm exec vitest run packages/core --maxWorkers=8        # 24712 passed
pnpm storybook:build && pnpm exec playwright test packages/core/src/Item/__tests__/ItemControlProps.a11y.chromium.spec.ts --project=chromium   # 1 passed
pnpm check:repo && pnpm exec eslint --max-warnings=0 <changed files>
pnpm check:knowledge && pnpm check:changesets
pnpm size:pages --base 3560b58cb6 --head 43b8cd9353 --page item=Item --unused-on item,docs   # gzip: item +266 B, docs +0, form +0, menu +269, table +297; PASS

Red first, at 5e8b263 with the aria-disabled case alone: the case fails, and core typecheck reports its 3 @ts-expect-errors unused.

Red first, at f9a254f with the two disabled-key cases alone: both fail.

Red first, at 39fae3c with the two link-root cases alone: the case whose bag sets no tabIndex fails. The case with the root's tabIndex={-1} passes there, and guards that the root's own value wins.

@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 Nov 22, 2026 3:43am 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
@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 22, 2026, 3:54 AM UTC

@github-actions

github-actions Bot commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

Current run: The current CI run concluded skipped. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@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 of controlProps is waiting on a maintainer: no current spec governs exposing the control Item renders as a public attribute target, so a maintainer needs to provide or identify the governing spec that settles the shape (a controlProps object versus forwarding known ARIA state attributes from the root), the accepted attribute set, and the precedence it promises. Independently of that decision, two fixes are needed:

  • When as is a link component, aria-current and aria-disabled passed in controlProps are dropped on an enabled row, and a caller tabIndex={0} makes a disabled row a tab stop, unlike the invisible-anchor path.
  • The development warning fires for a link-root row with a role even though controlProps land on that root (the “lands on the root when the root is the link” test prints it), so the warning condition, docs and changeset should agree on that case.

[Automated review]

Comment thread packages/core/src/Item/Item.tsx Resolved
Comment thread packages/core/src/Item/Item.tsx Resolved

@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 of controlProps is waiting on a maintainer: no current spec governs exposing the control Item renders as a public attribute target, so a maintainer needs to provide or identify the governing spec (for example a component:Item record) that settles the shape, a controlProps object versus forwarding known ARIA state attributes from the root, along with the accepted attribute set and its precedence. Independently of that decision, two fixes are needed on rows whose root is a link component (as):

  • aria-current and aria-disabled passed in controlProps are dropped on an enabled row, a caller tabIndex puts a disabled row in the tab order, and root props and controlProps win on different attributes, unlike the invisible-anchor path.
  • The development warning says the attributes are ignored for a link-root row with a role even though they land on that root (the “lands on the root when the root is the link” test prints it), so the warning condition, the docs and the changeset should agree.

[Automated review]

@vjeux
vjeux force-pushed the item-control-props branch from 2cf67c9 to 52bbef5 Compare October 11, 2026 19:26
@vjeux

vjeux commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

Both fixes pushed as 52bbef5 (rebased over #7296 earlier today).

  1. Link root (as a link component): controlProps land on the root with the anchor path's precedence — a disabled row keeps aria-disabled and tabIndex={-1} whatever the caller said; an enabled row keeps the caller's aria-current, aria-disabled and tabIndex; the root's own props win over controlProps on the same attribute. Four link-root tests.
  2. The warning no longer fires for a link root with a role: that root is the control, so nothing is ignored; the condition, the prop doc, Item.doc.mjs and the changeset now say the same thing.

The governing-record question stays with the maintainers, as the description says. Carried into #7270 (a446b8f).

@vjeux

vjeux commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

Governing record: component:Item (packages/core/src/Item/Item.spec.md), added to this change as a draft record in head d622133. DEC-1 settles the shape — controlProps is an explicit object, not a forwarding rule — and the accepted set (ItemControlProps: HTML attributes less the control's own role, onClick, className, style, children, dangerouslySetInnerHTML, plus data-*). DEC-2 settles the precedence: the row's own attributes win where the bags meet (a disabled row keeps aria-disabled and tabIndex={-1}; the button's type, click and disabled state and the anchor's address are the row's), and on a link root controlProps are written after the root's props, one rule for every attribute. FR1–FR5 and AR1–AR3 carry the control model (one control per row: anchor, button, or the link root; none under a parent role on a plain root or interactiveRef). Rubric results are in the description.

The same head folds the earlier round's second fix into that rule: on a link root the caller's bag now wins over the root's props on every shared attribute, not only on the three the row writes itself (one test re-pins it).

@vjeux

vjeux commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec d622133

@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: Item has no current component record, and the draft component:Item added here, whose decisions are recorded by the PR author, cannot govern its own pull request, so a maintainer needs to accept or redirect that contract (the controlProps shape and name, its accepted attribute set, and its precedence rules, including the link-root behavior) and record it as current. Independently of that decision, three fixes are needed:

  • On a disabled onClick row, a tabIndex or aria-disabled passed in controlProps still renders on the button beside native disabled, although the docs, the changeset and draft FR3 say the row keeps tabIndex={-1} and aria-disabled; conform the button path or the text, and add a disabled-button test.
  • Link-root rows now change even without controlProps (a disabled link root gets tabindex="-1" and an enabled one renders the root's own aria-disabled), while the record and description say omitting the prop changes nothing; limit the change to rows that pass the bag, or declare and test the before and after.
  • With as set to a link component and an interactiveRef, the new warning says the bag is ignored while it still lands on the root; gate the link-root spread on the same condition as the warning.

[Automated review]

Comment thread packages/core/src/Item/Item.tsx Resolved
Comment thread packages/core/src/Item/Item.tsx Resolved
Comment thread packages/core/src/Item/Item.tsx Resolved
@vjeux
vjeux force-pushed the item-control-props branch from d622133 to e5742ac Compare October 11, 2026 20:28
@vjeux

vjeux commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

The three fixes are in head e5742ac, each with its test, and the record (component:Item FR1, FR3, FR4, the states table, the verification map), the prop doc and the changeset say the same: a disabled row keeps tabIndex={-1} and aria-disabled on every control, the button included; a link root given no controlProps renders exactly what it did before; a link root that renders no control (interactiveRef) ignores the bag and warns. Item suite 88 cases; Chromium spec unchanged and green. Carried into #7270 (9bf74b8).

The governance point is understood: the record is a draft from this change and the decision to accept or redirect it stays with the maintainers.

@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 to provide the governing spec: Item has no current component record, and the draft component:Item added here cannot govern its own pull request, so a maintainer needs to accept or redirect that contract (the controlProps shape and name, its accepted attribute set, its precedence on the button, anchor and link root, and whether ListItem carries it) and record it as current. Independently of that decision, two fixes are needed:

  • A disabled onClick row now renders aria-disabled="true" and tabindex="-1" on its button even without controlProps, although the record and the description say omitting the prop changes nothing; write those attributes only when a bag is passed, or declare the change.
  • On a link root (as) without a role but with onClick, the bag is spread on both the root and the nested button, duplicating ids and calling onKeyDown twice; spread it on the inner control only when the root is not the control.

[Automated review]

Comment thread packages/core/src/Item/Item.tsx Resolved
Comment thread packages/core/src/Item/Item.tsx Resolved
@vjeux
vjeux force-pushed the item-control-props branch from e5742ac to 818f70d Compare October 11, 2026 21:27
@vjeux

vjeux commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

Both fixes are in head 818f70d with their tests, and ListItem now carries the prop the way it carries swipeActions and swipeBehavior: declared on ListItemProps beside them, documented in ListItem.doc.mjs (en and zh-CN), forwarded unchanged, with a List test ("passes controlProps through to the row's control unchanged"). The record says so under system relationships and in the builder-impact row; the prop doc and the changeset say the same. Item + List suites 171 green; the Chromium spec unchanged and green. Carried into #7270 (57fb2bc).

The governance step stays with the maintainers.

@vjeux

vjeux commented Oct 11, 2026

Copy link
Copy Markdown
Contributor Author

metadata-only rewrite: commit author identity; tree unchanged

@vjeux

vjeux commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

/approve-spec d05b6ec

@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: this change writes new controlProps requirements into the current component:Item record (FR9–FR13, AR3–AR5, ORD2–ORD3, PR2, DEC-3 and DEC-4), and the only approval so far is the author's own, so the record's owner or another maintainer needs to accept them as the governing spec or redirect them. The points to settle are the prop's name (the input-fields family uses control* for a field's visual box), the accepted attribute set, link-root precedence (there the bag replaces a same-named root handler, and any bag lets the root's own aria-disabled through), the ListItem pass-through, and FR9's note on the nested button of a link root with onClick. The two record corrections from the last review are in, and rows without the prop render exactly as before, so nothing else is needed from the contributor for now.

[Automated review]

ListItem now passes `controlProps` to Item unchanged, so its record names
the prop in its public contract and FR1, and leaves the bag's meaning to
component:Item, beside `align`. Its pass-through verification row names the
case that proves it.
The focusable-disabled rule (spec:AST-085) pairs `aria-disabled` with an
enabled control only while it is busy. A bag that set `aria-disabled` on an
enabled row announced a disabled control that still activated.

`ItemControlProps` now leaves `aria-disabled` out, and the row writes it from
`isDisabled` on every control: the invisible anchor, the invisible button and
a link root. Item's record, its doc and the changeset say so, and one case
pins it by type and at run time.
spec:AST-085 exposes `aria-disabled` on a disabled control (FR1) and on a
busy one (FR6), never on a plain enabled one. DEC-4's reason for keeping
`aria-disabled` out of `controlProps` now says that, without reading an
"only" into FR6.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 19, 2026

@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 an engineering owner's spec decision, and three items need the contributor. This change writes new controlProps requirements into the current component:Item record (FR11–FR15, AV4–AV5, ORD2–ORD3, PR2, AR3–AR5, DEC-3 and DEC-4) and adds the prop to component:ListItem FR1, and no spec-owner approval exists for this head because the last one covered an earlier head. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. The points to settle are the name controlProps (the input-fields family uses control* for a field's visual box), the accepted attribute set, link-root precedence, the disabled rule under spec:AST-085, and the ListItem pass-through.

  • A disabled href row or link root still passes Enter and Space to controlProps.onKeyDown (Item.tsx:1031, :1119), which spec:AST-085 FR2 forbids and the disabled button row already blocks through disabledInteractionProps, so route the bag's handler the same way and add anchor and link-root tests.
  • Newly live check: the description's rubric result "R1 narration: none" is false, because FR11, ORD3, AR5 and one states row in Item.spec.md (lines 139, 176, 190 and 217) describe what the row did before instead of what it does.
  • Newly live check: architecture:component-import-boundaries INV10 asks the pull request to report the first-load gzip delta for a page that renders Item without controlProps, so please add the base-against-head number.
Claims and files checked

Review mode: full; reason: spec-record

  • Claim: the prop's attributes reach the invisible button or anchor the row renders — verified (Item.tsx:1031, :1048; tests).
  • Claim: a disclosure row's state sits on the focused control, not the root — verified (unit test; Chromium check of the Disclosure Row story).
  • Claim: the row's own attributes win, and aria-disabled comes only from isDisabled — verified (Item.tsx:1037, :1053, :1154; tests; typecheck).
  • Claim: a disabled row's control does not activate — partly false: Enter and Space still reach the bag's onKeyDown on a disabled link or link-root row.
  • Claim: a disabled row keeps the focus order the bag gives it — verified (tests on all three controls).
  • Claim: on a link root the bag lands on the root after its own props and never on a nested button — verified (Item.tsx:1119; tests).
  • Claim: a row without the prop renders what it did before — verified (13 configurations compared on base and head).
  • Claim: a row that renders no control ignores the bag with a development warning — verified (Item.tsx:779-787; tests).
  • Claim: ListItem passes the prop through unchanged and the type is exported — verified (List.test.tsx; Item/index.ts).
  • Claim: the record amendments and the excluded attribute list — verified (the list also excludes dangerouslySetInnerHTML).
  • Claim: the main-branch focusable-disabled rule replaces the earlier forced tabIndex={-1} — verified against the current record.
  • Claim: the architecture record's prop rules admit the prop — not settled; it is part of the spec decision above.
  • Claim: unit and browser tests cover the listed cases — unit tests verified (290 pass); the browser spec was not rerun here.
  • Claim: rubric R1 finds no narration — false (see above); the other rubric results are verified.
  • File .changeset/item-control-props.md — clear.
  • File apps/storybook/stories/Item.stories.tsx — clear.
  • File docs/specs/components/Item/Item.spec.md — spec decision; R1 wording.
  • File docs/specs/components/List/ListItem.spec.md — spec decision.
  • File packages/core/src/Item/Item.doc.mjs — clear.
  • File packages/core/src/Item/Item.test.tsx — clear; missing the disabled anchor and link-root key cases.
  • File packages/core/src/Item/Item.tsx — disabled key handling; three comments that narrate (non-blocking).
  • File packages/core/src/Item/__tests__/ItemControlProps.a11y.chromium.spec.ts — clear (not rerun).
  • File packages/core/src/Item/index.ts — clear.
  • File packages/core/src/List/List.test.tsx — clear.
  • File packages/core/src/List/ListItem.doc.mjs — clear.
  • File packages/core/src/List/ListItem.tsx — clear.

Automated review (maintainer link)

Comment thread packages/core/src/Item/Item.tsx Resolved
Comment thread packages/core/src/Item/Item.tsx Resolved
Comment thread docs/specs/components/Item/Item.spec.md Resolved
Comment thread packages/core/src/Item/Item.tsx Resolved
A disabled `href` row or link root still passed Enter and Space to the
bag's `onKeyDown`, while the disabled button already withholds them.
The anchor and a link root now route the bag's key handler the same
way, so a disabled control runs no caller callback on the keys that
activate it, and other keys still reach it.

Item's record, its JSDoc and its doc state a row without the bag in the
present tense, and three comments drop what restated the code.

@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 an engineering owner's spec decision, and two items need the contributor. This change writes new controlProps requirements into the current component:Item record (FR11–FR15, AV4–AV5, ORD2–ORD3, PR2, AR3–AR5, DEC-3 and DEC-4) and into component:ListItem FR1, and this head has no spec-owner approval because the last one covered an earlier head. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner; the points to settle are the name controlProps, the accepted attribute set, link-root precedence, the disabled rule under spec:AST-085, and the ListItem pass-through.

  • Miss: a disabled link-root row given controlProps without a tabIndex renders an <a> with no href and no tabindex (Item.tsx:848-855, :1121), so it leaves the tab order that spec:AST-085 FR1 says a disabled control keeps, unlike the anchor row's tabIndex ?? 0 at Item.tsx:1035; write the same default on a disabled link root given a bag and add a test whose bag sets no tabIndex.
  • Miss: architecture:component-import-boundaries INV10 asks a change that grows a shared module such as Item for the first-load gzip delta on the docs, form, menu and table pages, and the description reports only the Item and docs pages (a measurement on this head gives form +0 B, menu +231 B and table +268 B, all under the limit).

The Enter and Space fix and the record wording from the last review are in.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim: the bag reaches the invisible button or anchor the row renders — verified (Item.tsx:1032, :1050; tests).
  • Claim: a disclosure row's state sits on the focused control, not on the root — verified (unit test; Chromium check of the Disclosure Row story).
  • Claim: the row's own attributes win, and aria-disabled comes only from isDisabled — verified (Item.tsx:1038, :1055, :1155; tests; typecheck).
  • Claim: a disabled row's control does not activate, Enter and Space included — verified on the button, anchor and link root (Item.tsx:776-779, :1039, :1057, :1122; tests).
  • Claim: a disabled row keeps the focus order the bag gives it — verified for the button and anchor; false for a link root whose bag sets no tabIndex (see above).
  • Claim: on a link root the bag lands on the root after its own props and never on a nested button — verified (Item.tsx:1121; tests).
  • Claim: a row without the prop renders what it did before — verified (16 configurations compared on base and head).
  • Claim: a row that renders no control ignores the bag with a development warning — verified (Item.tsx:780-788; tests).
  • Claim: ListItem passes the prop through unchanged, and the type is exported — verified (List.test.tsx; Item/index.ts).
  • Claim: the record amendments and the excluded attribute list — verified; the description's list leaves out dangerouslySetInnerHTML, which the type, docs and record also exclude.
  • Claim: the focusable-disabled rule on the main branch replaces the earlier forced tabIndex={-1} — verified against the current record.
  • Claim: the architecture record's prop rules admit the prop — not settled; part of the spec decision above.
  • Claim: the Item page grows 250 B gzip and the docs page 0 B — verified (the same numbers here).
  • Claim: unit and browser tests cover the listed cases — unit tests verified (435 pass); the browser spec was not rerun here.
  • Claim: the rubric results (record lines describe present behavior; no research, references or open questions) — verified.
  • Claim: the new disabled-key cases fail before the fix — consistent with the earlier code, which had no guard.
  • File .changeset/item-control-props.md — clear.
  • File apps/storybook/stories/Item.stories.tsx — clear.
  • File docs/specs/components/Item/Item.spec.md — spec decision.
  • File docs/specs/components/List/ListItem.spec.md — spec decision.
  • File packages/core/src/Item/Item.doc.mjs — clear.
  • File packages/core/src/Item/Item.test.tsx — no disabled link-root case whose bag sets no tabIndex.
  • File packages/core/src/Item/Item.tsx — disabled link-root focus order.
  • File packages/core/src/Item/__tests__/ItemControlProps.a11y.chromium.spec.ts — clear (not rerun).
  • File packages/core/src/Item/index.ts — clear.
  • File packages/core/src/List/List.test.tsx — clear.
  • File packages/core/src/List/ListItem.doc.mjs — clear.
  • File packages/core/src/List/ListItem.tsx — clear.

Automated review (maintainer link)

Comment thread packages/core/src/Item/Item.tsx Resolved
A disabled link root drops its `href`, which made it a tab stop, and a
bag with no `tabIndex` gave it none. So it left the tab order the
enabled row keeps. A disabled link root that takes the bag now writes
the bag's `tabIndex`, else the root's own, else 0, as the disabled
anchor row already does. A row given no bag renders as before.

Item's record, its JSDoc, its doc and the changeset say a disabled
control keeps the enabled row's focus order, or the `tabIndex` the bag
sets.

@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 an engineering owner's spec decision; nothing else is needed from the contributor at this head.

This change writes new requirements for controlProps into the current component:Item and component:ListItem records (Item FR11–FR15, AV4–AV5, ORD2–ORD3, PR2, AR3–AR5, DEC-3 and DEC-4; ListItem FR1), and no engineering owner has approved them at this head. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner; the decision covers the controlProps name and object shape, the accepted attribute set, link-root precedence, the disabled rule under spec:AST-085, and ListItem forwarding the prop.

The disabled link-root focus fix and the reference-page size numbers asked for last round are in, and one non-blocking comment suggestion is inline.

Claims and files checked

Review mode: full; reason: spec-record

  • Claim (changeset): the bag reaches the invisible button or anchor, with states, a name, marks, a key handler and a roving tabIndex. Verified: the Item controlProps tests.
  • Claim (changeset): the row's own attributes win, and aria-disabled comes only from the disabled state. Verified: Item.tsx:1037-1038, 1054-1055, 1160 and the aria-disabled tests.
  • Claim (changeset): a disabled row's control does not activate and keeps the enabled focus order or the bag's tabIndex. Verified: Item.tsx:1035, 1056-1060, 1125-1127 and the disabled tests.
  • Claim (changeset): on a link root the bag lands on the root after its other props, never on a nested button. Verified: Item.tsx:771-773, 1121 and the link-root tests.
  • Claim (changeset): a row given no bag renders what it did before. Verified: 20 configurations match the base; one disabled anchor row has the same attributes in another order.
  • Claim (changeset): a row that renders no control ignores the bag with a development warning. Verified: Item.tsx:780-788 and the warning tests.
  • Claim (changeset, description): ListItem forwards the prop, and the type is exported. Verified: ListItem.tsx:189, Item/index.ts, the List forwarding test and the API delta.
  • Claim (description): in Chromium, Tab lands on the Disclosure Row's button, which reports expanded false, then true after Enter with focus kept, and the root reports no state. Verified by a browser probe; the axe pass was not rerun.
  • Claim (description): first-load size without the prop stays under the 0.3 KB limit on every reference page. Verified within 2 B: item +275 B, menu +249 B, table +282 B, docs and form +0.
  • Claim (description): core typecheck, the knowledge check and the changeset check pass. Verified; the whole core suite and the repository check were not rerun, and the Item and List suites pass.
  • Claim (description): the merge of main renumbers the rules to FR11–FR15 under the record's new folder. Verified.
  • Claim (description): writing rubric, with no narration left in either record. Verified: only main's own wording remains.
  • Claim (description): red-first runs at earlier commits. Not rerun.
  • .changeset/item-control-props.md: clear
  • apps/storybook/stories/Item.stories.tsx: clear
  • docs/specs/components/Item/Item.spec.md: waits on the spec decision
  • docs/specs/components/List/ListItem.spec.md: waits on the spec decision
  • packages/core/src/Item/Item.doc.mjs: clear
  • packages/core/src/Item/Item.test.tsx: clear
  • packages/core/src/Item/Item.tsx: non-blocking comment suggestion at lines 1123-1124
  • packages/core/src/Item/__tests__/ItemControlProps.a11y.chromium.spec.ts: clear (not rerun)
  • packages/core/src/Item/index.ts: clear
  • packages/core/src/List/List.test.tsx: clear
  • packages/core/src/List/ListItem.doc.mjs: clear
  • packages/core/src/List/ListItem.tsx: clear

Automated review (maintainer link)

Comment thread packages/core/src/Item/Item.tsx Resolved
The comment on a disabled link root's `tabIndex` said what the root did
before, and that only the bag or the root kept it out of the tab order.
It now says the root has no `href`, so it is not focusable by itself,
and that it keeps the enabled focus order.
This brings in main at 3560b58. Two files are resolved by hand:

- Item's spec: this branch's rows, with main's two FR9 rows on clicks
  from portals and role-based controls. Prettier aligns the tables.
- Item.test.tsx: main's suite on clicks that belong to something
  else, then this branch's controlProps suite.

@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 waits on an engineering owner's spec decision. This head writes new controlProps requirements into the current component:Item record (FR11–FR15, AV4–AV5, ORD2–ORD3, PR2, AR3–AR5, DEC-3 and DEC-4) and into component:ListItem FR1, and nothing approves them at this head. An engineering owner records the decision by commenting /approve-spec <full head SHA> on this pull request, or redirects it; the author may do so as an engineering owner. That decision settles the controlProps name and explicit-object shape, the accepted attribute set, link-root precedence (the bag replaces a same-named root prop there), the disabled rule under spec:AST-085, and ListItem forwarding.

Two fixes are still needed after that decision:

  • Miss: PR2 in Item.spec.md (lines 196–200) says the dev-warning hook carries "one ref", but useDevWarning holds a state slot plus an Effect, so the new call gives every row one never-updated state slot and one Effect, and PR2 should say so.

  • The description's Evidence paragraph reports Item +275 B, menu +248 B and table +284 B, but pnpm size:pages at this head gives +266 B, +270 B and +297 B (as the Testing block says), so that paragraph needs this head's numbers.

  • Non-blocking: the representative-states row for a link root (line 175) says "a button beside it", while FR11 says that button is nested inside the root.

Claims and files checked

Review mode: full; reason: spec-record

Claims:

  • Item gains a prop whose attributes reach the control the row renders for onClick or href: verified (Item.tsx:1040-1070).
  • Disclosure state, relations, a name of its own, data marks, onKeyDown and a roving tabIndex reach the focused control instead of the root: verified (controlProps tests; a Chromium probe of the Disclosure Row story shows aria-expanded false then true on the focused button and none on the root).
  • The row's own attributes win; aria-disabled comes from isDisabled; a disabled control does not activate and keeps its focus order or the bag's tabIndex: verified (disabled button, anchor and link-root tests).
  • On a link root the bag lands on the root after the root's props, the disabled state still wins, and the nested button gets none of it: verified (link-root tests; Item.tsx:1129-1137).
  • A row given no bag renders as before: verified (bag-less tests; code paths unchanged without the bag).
  • A row with no control ignores the bag and warns in development: verified (warning tests).
  • ListItem passes the prop through unchanged: verified (List test).
  • The type is exported, excludes ten keys and accepts data attributes: verified (Item.tsx:147-163, Item/index.ts, generated API delta).
  • On the base, caller props land on the root, so a state set on the row sits on a generic element: verified (base Item.tsx).
  • The Item and ListItem records are amended with the listed rules, and the disabled clause follows the focusable-disabled spec: verified (record diff).
  • First-load gzip without the prop stays under 307 B on every reference page: verified (largest +297 B, table page).
  • Evidence paragraph sizes (Item 275, menu 248, table 284 B): false (measured 266, 270, 297 B).
  • Testing block sizes (Item 266, docs 0, form 0, menu 269, table 297 B): verified (menu 270 B here).
  • The Chromium accessibility spec reports button, name, expanded false then true, and a clean axe run: not re-run (no static Storybook at this head).
  • Writing rubric results R1–R6: verified against the changed record lines.
  • Whole-suite count and red-first runs: not reproduced; the Item and List suites (304 tests) and the core typecheck pass.

Files:

  • .changeset/item-control-props.md: clear
  • apps/storybook/stories/Item.stories.tsx: clear
  • docs/specs/components/Item/Item.spec.md: PR2 hook description (blocking); states row wording (non-blocking); awaits spec-owner approval
  • docs/specs/components/List/ListItem.spec.md: awaits spec-owner approval
  • packages/core/src/Item/Item.doc.mjs: clear
  • packages/core/src/Item/Item.test.tsx: clear
  • packages/core/src/Item/Item.tsx: clear
  • packages/core/src/Item/tests/ItemControlProps.a11y.chromium.spec.ts: clear (not run)
  • packages/core/src/Item/index.ts: clear
  • packages/core/src/List/List.test.tsx: clear
  • packages/core/src/List/ListItem.doc.mjs: clear
  • packages/core/src/List/ListItem.tsx: clear

Automated review (maintainer link)

Comment on lines +196 to +200
- **PR2 — No runtime beyond the spread.** `controlProps` adds no state,
listener, observer or render pass; the row spreads the object it is given.
The development warning for a row that renders no control shares Item's
existing dev-warning hook, which carries one ref and one Effect per row in
every build and is the only Effect this contract touches.

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.

Miss from earlier reviews: useDevWarning is useState(createDevWarnings) plus useEffect (hooks/useDevWarning.ts:60-66). The call this change adds (Item.tsx:781) therefore gives every row one state slot it never updates and one Effect, not "one ref". Suggested wording: "…shares Item's dev-warning hook, which carries one state slot it never updates and one Effect per row in every build, and is the only Effect this contract touches."

| Omitted `align` | Identical to today's `center`. | None. |
| `onClick` or `href` row, `controlProps` given | The attributes sit on the invisible button or anchor; the root carries none of them. | Any accepted attribute. |
| Disabled row, `controlProps` given | `aria-disabled="true"` on the control and no activation, whatever the bag says; it keeps the enabled row's focus order, or the bag's `tabIndex`. | Button, anchor or link root. |
| Link root (`as`), `controlProps` given | The attributes sit on the root, after the root's props; a button beside it for `onClick` carries none; nothing warns. | Any `role` the parent gives the row. |

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.

Non-blocking: FR11 says the invisible button a link root renders for onClick is nested inside that root. "a button nested inside it for onClick carries none" would match it.

This branch was successfully deployed

1 active deployment
Preview — 43b8cd93 Deployed Nov 22, 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:spec-owner-review Current knowledge records await owner approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants