Repository navigation
feat(Table): add controlled row activation - #8281
humbertovirtudes wants to merge 2 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
eec2985 to
8af7ffe
Compare
ee5df46 to
f37e24e
Compare
8af7ffe to
fd764ea
Compare
f37e24e to
867a1cd
Compare
fd764ea to
8ba446d
Compare
867a1cd to
53409ee
Compare
8ba446d to
d783e47
Compare
53409ee to
6a12764
Compare
d783e47 to
84fdd06
Compare
6a12764 to
4726cb2
Compare
84fdd06 to
05d66f4
Compare
4726cb2 to
1af260f
Compare
There was a problem hiding this comment.
This review is on hold for a spec decision: module:Table/useTableActivation is still a draft on main, so the new useTableActivation hook, its default aria-current="true" and its active-row paint have no governing spec yet. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), or by landing the activation and parent Table records as current on main; either way, these two fixes are needed:
- Re-rendering a row removes its
tabindexandaria-keyshortcuts, becauseuseTableActivation.tsx:251assumes React re-applied them after the old binding's cleanup removed them, so in the PR's own story keyboard activation works once and then focus drops to the page. - Core
typecheckfails atTableIntegrationRegression.test.tsx:43anduseTableActivation.test.tsx:745, andeslintfails on theanyatTableMenuWindowFocus.test.tsx:38.
[Automated review]
| node = element; | ||
| // Initial DOM props are already derived from the current config. Track their | ||
| // ownership before synchronizing so an ineligible transition restores them. | ||
| hasAffordances = isEligible; |
There was a problem hiding this comment.
This assumes React has just applied tabindex and aria-keyshortcuts, but the previous binding's cleanup (removeAffordances, lines 185-196) removed both, and React does not re-set unchanged props. After any row re-render, which in the ControlledActivation story with its inline columns means the first activation, rows leave the tab order and a focused row drops focus to the page. Letting reflect() re-apply missing affordances whenever the row is eligible (line 211: if (isEligible)) keeps them, and the existing 37 tests still pass with that change.
| [], | ||
| ); | ||
| return ( | ||
| <Table data={data} columns={cols} idKey="id" plugins={{activation}} /> |
There was a problem hiding this comment.
The core typecheck (tsc --project tsconfig.json --noEmit) fails here: useTableActivation({...}) infers TablePlugin<Record<string, unknown>>, which is not assignable to TablePlugin<{id: string; name: string}>. Passing the item type, useTableActivation<{id: string; name: string}>(...), fixes it.
| if (typeof cleanup === 'function') {cleanup();} | ||
| }); | ||
| const spy = vi.spyOn(fixture, 'setAttribute'); | ||
| rerender({activeKey: null}); |
There was a problem hiding this comment.
The core typecheck fails here: initialProps: {activeKey: 'one'} types activeKey as string, so null is rejected. initialProps: {activeKey: 'one' as string | null} fixes it.
| const menu = useMemo( | ||
| () => ({ | ||
| rowModel: 'flat' as const, | ||
| transformBodyCell(props: any) { |
There was a problem hiding this comment.
eslint reports @typescript-eslint/no-explicit-any as an error here; typing the argument as BodyCellRenderProps satisfies it.
1af260f to
0ad3b25
Compare
There was a problem hiding this comment.
This review is on hold for a spec decision: module:Table/useTableActivation is still a draft on main, so the new useTableActivation hook, its default aria-current="true" and its active-row paint have no governing spec yet. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request (the author may do so as an engineering owner), or by landing the activation and parent Table records as current on main. Independently, a click on a nested control's label (for example an Astryx CheckboxInput with a visible label) or on a <summary> inside a row operates that control and also activates the row; stopping isRowActivationGesture at a label with an associated control and at summary, with tests for both, would match the documented native-control boundary.
[Automated review]
| for ( | ||
| let ancestor: Element | null = element; | ||
| ancestor && ancestor !== row; | ||
| ancestor = ancestor.parentElement | ||
| ) { | ||
| const editable = ancestor.getAttribute('contenteditable')?.toLowerCase(); | ||
| if ( | ||
| ancestor.matches(INTERACTIVE_SELECTORS) || | ||
| editable === '' || | ||
| editable === 'true' || | ||
| editable === 'plaintext-only' | ||
| ) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
A <label> or <summary> target passes this walk: neither is in INTERACTIVE_SELECTORS nor editable. In Chromium, a click on an Astryx CheckboxInput's visible label inside an activatable row checks the box and also makes that row current, and a click on a <summary> opens it and makes its row current. Stopping here at a label with an associated control (ancestor instanceof view.HTMLLabelElement && ancestor.control != null) and at summary would keep the documented native-control boundary; a regression test with a labelled CheckboxInput and a <details> row would cover it.
0ad3b25 to
507361a
Compare
There was a problem hiding this comment.
This pull request is on hold for an engineering owner's spec decision: the useTableActivation contract it implements is still a draft on main, so an owner needs to approve or amend it (including the default aria-current="true", the active-row paint, the new wholeRowOwner/canActivate API and whether the hook may ship without a template example) by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner. Two changes are needed whichever way that goes:
- Enter and Space on a focused row do nothing while any text selection crosses that row (for example after Ctrl+A), because the keyboard path reuses the click-only selection guard; check the selection in the click path only and add a keyboard test.
- At 2,979 authored lines the change is above the 2,000-line threshold; landing the shared selection-guard repair and the parent protocol and paint seam separately would bring the hook under review in a smaller piece.
[Automated review]
| const requestKeyDown: NonNullable<RowProps['onKeyDown']> = event => { | ||
| if ((event.key !== 'Enter' && event.key !== ' ') || !canRequest(event)) { | ||
| return; | ||
| } | ||
| if (event.key === ' ') { | ||
| event.preventDefault(); | ||
| } | ||
| if (!event.repeat) { | ||
| store.getConfig().onActivate(item, key); | ||
| } | ||
| }; |
There was a problem hiding this comment.
This keyboard path reaches isRowActivationGesture, which ends with !hasTextSelection(row), so after a select-all (or with text still selected in this row) Enter and Space on the focused row do nothing, and Space is not prevented. A keyboard press does not end a text selection; the shared clickable paths apply that rule to clicks only. Checking the selection in requestClick only, plus a keyboard test with a standing selection, would fix it.
375323f to
51df9c2
Compare
There was a problem hiding this comment.
This pull request is on hold for an engineering owner's spec decision: the useTableActivation contract it implements is still a draft on main, so an engineering owner needs to approve or amend it, including the default aria-current="true", the active-row wash and inline-start cue on every Table's first cell, the new wholeRowOwner/canActivate API, and whether the hook may ship without a template example. An engineering owner records that decision by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner. Whichever way it goes, the change is 3,036 authored lines, above the 2,000-line threshold: landing the shared text-selection repair and the Table protocol and paint seam separately would bring the hook under review in a smaller piece.
[Automated review]
| htmlProps.tabIndex = original.tabIndex ?? 0; | ||
| htmlProps['aria-keyshortcuts'] = shortcuts; | ||
| if (store.getConfig().activeKey === key) { | ||
| htmlProps['data-active'] = true; |
There was a problem hiding this comment.
Non-blocking: React renders this as data-active="true", while setRowActivation then writes data-active="active" (tableRowState.ts:52), so server HTML and the attached row disagree. Writing one value in both places keeps any data-active selector stable.
88c922e to
5f26c90
Compare
51df9c2 to
314f3b7
Compare
There was a problem hiding this comment.
This adds a well-tested, opt-in useTableActivation hook, and the activation contract it implements is now current, but two things need resolving before it can be approved.
Blocking:
- The change is 3,046 authored lines with no exception, so please land the shared
useClickableContainerselection repair and the Table protocol and paint seam as their own pull requests first, and trim the hook part (including its 1,332-line test file) under 2,000 lines.
Owner decision needed: no current spec record decides two new public API rows, TableRenderContext.canActivate and the --table-row-active-cue-width custom property, and the hook has no template example naming it (exampleFor/alsoExampleFor). An engineering owner needs to accept those rows or have them made internal, and say whether the example can ship as a tracked docs gap; they can record it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
Non-blocking: data-active renders as "true" but the paint writer sets "active" after mount (useTableActivation.tsx:361, tableRowState.ts:52); please write one value.
[Automated review]
| htmlProps.tabIndex = original.tabIndex ?? 0; | ||
| htmlProps['aria-keyshortcuts'] = shortcuts; | ||
| if (store.getConfig().activeKey === key) { | ||
| htmlProps['data-active'] = true; |
There was a problem hiding this comment.
Non-blocking: React renders this as data-active="true", but the paint writer sets data-active="active" once the row attaches (tableRowState.ts:52). Server HTML and the mounted row then disagree, and a selector on either value matches only one of them. Please write one value in both places.
5f26c90 to
e288a0c
Compare
314f3b7 to
e74e4b0
Compare
There was a problem hiding this comment.
This adds a well-tested, opt-in useTableActivation hook, and the activation contract it implements is now current, but two things need resolving before it can be approved.
Blocking:
- The change is 3,046 authored lines with no exception, so please land the shared
useClickableContainerselection repair and the Table protocol and paint seam as their own pull requests first, and trim the hook part (including its 1,332-line test file) under 2,000 lines.
Owner decision needed: no current spec record decides two new public API rows, TableRenderContext.canActivate and the --table-row-active-cue-width custom property, and the hook has no template example naming it (exampleFor/alsoExampleFor). An engineering owner needs to accept those rows or have them made internal, and say whether the example can ship as a tracked docs gap; they can record it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
Non-blocking: data-active renders as "true" but the paint writer sets "active" after mount (useTableActivation.tsx:361, tableRowState.ts:52); please write one value.
[Automated review]
| htmlProps.tabIndex = original.tabIndex ?? 0; | ||
| htmlProps['aria-keyshortcuts'] = shortcuts; | ||
| if (store.getConfig().activeKey === key) { | ||
| htmlProps['data-active'] = true; |
There was a problem hiding this comment.
Non-blocking: React renders this as data-active="true", but the paint writer sets data-active="active" once the row attaches (tableRowState.ts:52). Server HTML and the mounted row then disagree, and a selector on either value matches only one of them. Please write one value in both places.
There was a problem hiding this comment.
Thanks for the thorough, well-tested useTableActivation hook; the activation contract it implements is current, but two things need resolving before it can be approved.
Blocking:
- The change is 3,046 authored lines with no size exception, so please land the shared
useClickableContainertext-selection repair and the Table protocol and paint seam as their own pull requests first, and trim the hook part (including its 1,332-line test file) under 2,000 lines.
Owner decision needed: no current spec record decides two new public API rows, TableRenderContext.canActivate and the --table-row-active-cue-width custom property, and the hook has no template example naming it (exampleFor/alsoExampleFor). An engineering owner needs to accept those rows or have them made internal (a private --_ name would keep the cue width off the public surface), and say whether the example can ship as a tracked docs gap; they can record it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
Non-blocking: data-active renders as "true" but the paint writer sets "active" after mount (useTableActivation.tsx:361, tableRowState.ts:52), and strict lint still reports 8 warnings in TableIntegrationRegression.test.tsx and tableRowState.ts.
[Automated review]
| htmlProps.tabIndex = original.tabIndex ?? 0; | ||
| htmlProps['aria-keyshortcuts'] = shortcuts; | ||
| if (store.getConfig().activeKey === key) { | ||
| htmlProps['data-active'] = true; |
There was a problem hiding this comment.
Non-blocking: React renders this as data-active="true", but the paint writer sets data-active="active" once the row attaches (tableRowState.ts:52), so server HTML and the mounted row disagree and a selector on either value matches only part of the row's life. Writing one value in both places fixes it.
There was a problem hiding this comment.
Thanks for the well-tested useTableActivation hook; the activation contract it implements is current, but two things need resolving before it can be approved.
Blocking:
- The change is 3,046 authored lines with no size exception, so please land the shared
useClickableContainertext-selection repair and the Table protocol and paint seam as their own pull requests first, and bring the hook part (including its 1,332-line test file) under 2,000 lines.
Owner decision needed: no current spec record decides two new public API rows, TableRenderContext.canActivate and the --table-row-active-cue-width custom property, and no template example names the hook in exampleFor/alsoExampleFor. An engineering owner needs to accept those rows or have them made internal, and say whether the example can ship as a tracked docs gap; they can record it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
Non-blocking: data-active renders as "true" but becomes "active" once the row mounts (useTableActivation.tsx:361, tableRowState.ts:52), and strict lint still reports 8 warnings in TableIntegrationRegression.test.tsx and tableRowState.ts.
[Automated review]
| htmlProps.tabIndex = original.tabIndex ?? 0; | ||
| htmlProps['aria-keyshortcuts'] = shortcuts; | ||
| if (store.getConfig().activeKey === key) { | ||
| htmlProps['data-active'] = true; |
There was a problem hiding this comment.
Non-blocking: React renders this as data-active="true", but the paint writer sets data-active="active" once the row attaches (tableRowState.ts:52), so server HTML and the mounted row disagree and a selector on either value matches only before or only after attach. Writing one value in both places fixes it.
| export interface TableRenderContext { | ||
| readonly mode: 'data' | 'children'; | ||
| readonly rowModel: 'flat' | 'tree' | 'grouped' | 'detail' | 'custom'; | ||
| readonly canActivate: boolean; |
There was a problem hiding this comment.
No current spec record lists this member: the Table record says TableRenderContext supplies mode, the admitted row model, logical/header counts and the viewport. An engineering owner needs to accept it as public context, or it needs to be kept off the exported type.
There was a problem hiding this comment.
Thanks for the well-tested useTableActivation hook; the activation contract it implements is current, but two things need resolving before it can be approved.
Blocking:
- The change is 3,053 authored lines with no size exception, so please land the shared
useClickableContainertext-selection repair and the Table protocol and paint seam as their own pull requests first, and bring the hook part (including its 1,332-line test file) under 2,000 lines.
Owner decision needed: no current spec record decides two new public API rows, TableRenderContext.canActivate and the --table-row-active-cue-width custom property, and no template example names the hook in exampleFor/alsoExampleFor. An engineering owner needs to accept those rows or have them made internal, and say whether the example can ship as a tracked docs gap; they can record it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
Non-blocking: data-active renders as "true" but becomes "active" once the row mounts (useTableActivation.tsx:361, tableRowState.ts:52), and strict lint still reports 8 warnings in TableIntegrationRegression.test.tsx and tableRowState.ts.
[Automated review]
| htmlProps.tabIndex = original.tabIndex ?? 0; | ||
| htmlProps['aria-keyshortcuts'] = shortcuts; | ||
| if (store.getConfig().activeKey === key) { | ||
| htmlProps['data-active'] = true; |
There was a problem hiding this comment.
Non-blocking: React renders this as data-active="true", but the paint writer sets data-active="active" once the row mounts (tableRowState.ts:52), so server HTML and the mounted row disagree. Writing one value in both places keeps a selector on either value stable.
| export interface TableRenderContext { | ||
| readonly mode: 'data' | 'children'; | ||
| readonly rowModel: 'flat' | 'tree' | 'grouped' | 'detail' | 'custom'; | ||
| readonly canActivate: boolean; |
There was a problem hiding this comment.
No current spec record lists this member: the Table record says TableRenderContext supplies mode, the admitted row model, logical/header counts and the viewport. An engineering owner needs to accept it as public API or have it made internal.
There was a problem hiding this comment.
Thanks for the well-tested useTableActivation hook; the activation contract it implements is current, but two things need resolving before it can be approved.
Blocking:
- The change is 3,050 authored lines with no size exception, so please land the shared
useClickableContainertext-selection repair and the Table protocol and paint seam as their own pull requests first, and bring the hook part (including its 1,332-line test file) under 2,000 lines.
Owner decision needed: no current spec record decides two new public API rows, TableRenderContext.canActivate and the --table-row-active-cue-width custom property, and no template example names the hook in exampleFor/alsoExampleFor. An engineering owner needs to accept those rows or have them made internal, and say whether the example can ship as a tracked docs gap; they can record it by commenting /approve-spec <full head SHA> on this pull request, and the author may do so as an engineering owner.
Non-blocking: data-active renders as "true" but becomes "active" once the row mounts (useTableActivation.tsx:358, tableRowState.ts:52), and strict lint still reports 8 warnings in TableIntegrationRegression.test.tsx and tableRowState.ts.
[Automated review]
| htmlProps.tabIndex = original.tabIndex ?? 0; | ||
| htmlProps['aria-keyshortcuts'] = shortcuts; | ||
| if (store.getConfig().activeKey === key) { | ||
| htmlProps['data-active'] = true; |
There was a problem hiding this comment.
Non-blocking: React renders data-active="true" here, but the paint writer sets data-active="active" once the row mounts (tableRowState.ts:52), so server HTML and the mounted row disagree. Please write one value in both places.
| export interface TableRenderContext { | ||
| readonly mode: 'data' | 'children'; | ||
| readonly rowModel: 'flat' | 'tree' | 'grouped' | 'detail' | 'custom'; | ||
| readonly canActivate: boolean; |
There was a problem hiding this comment.
No current spec record decides this new required public member of TableRenderContext (the Table record lists only mode, row model, counts and viewport). An engineering owner needs to accept it, or it can become internal.
…otocol This diff was generated with AI assistance (Navi). Tags: ai-generated Independent review fixes preserve legacy appends, fallback wrapping, caller-owned attributes and fine-grained row updates. Clarify and implement parent-owned unknown row totals for admitted incremental loading; past approval does not cover the new protocol claim. Repair fallback observation admission, strict-lint ownership and forced-colours/diagnostic boundaries. AI-assisted changes. Repair legacy row-render and interface compatibility, generated registry routes and story types. Split activation and loading runtime support into their owning PRs. AI-assisted changes. Preserve selection and pinned-column append cost with private count-consumer registration; stage protocol and consumer docs only in their introducing PR. AI-assisted changes. Preserve active cues above pinned overlays and reset inherited cue width at every row boundary. AI-assisted changes. Keep custom row totals fresh, explain window admission fallbacks, trim unused loading protocol and registration formatting churn. AI-assisted changes. Track actual immutable row-count reads without imposing count invalidation on legacy plugins; refresh canonical identity on mutable data-length changes. AI-assisted changes. Preserve offscreen row focus when the browser document loses focus; keep wide Table loading reachable on horizontal scroll. AI-assisted changes. Clarify runtime Table windowing admission while preserving the exported props interface. No approval or runtime behavior change. AI-assisted changes. Preserve native loading extent anchors, intrinsic Table sizing and per-instance diagnostics. AI-assisted changes. Declare first-party flat Table modifiers in the canonical admission contract. This diff was generated with AI assistance (Navi). Tags: ai-generated Keep forced-colour current-row marker separate from focus and restore owner-only empty-plugin warnings. This diff was generated with AI assistance (Navi). Tags: ai-generated Use the row-specific useTableRowsVirtualization public hook and config type. Include its runnable CLI example and generated public API/registry contracts. Runtime behavior is unchanged.
This diff was generated with AI assistance (Navi). Tags: ai-generated Independent review fixes preserve legacy appends, fallback wrapping, caller-owned attributes and fine-grained row updates. Clarify and implement parent-owned unknown row totals for admitted incremental loading; past approval does not cover the new protocol claim. Preserve keyboard attributes across activation ref handoffs; cover rerender, StrictMode and caller-affordance restoration. Fix test-inclusive TypeScript and lint errors. AI-assisted changes. Keep associated control labels and disclosure summaries inside their native interaction boundary; real-Table regression coverage. AI-assisted changes. Repair fallback observation admission, strict-lint ownership and forced-colours/diagnostic boundaries. AI-assisted changes. Repair legacy row-render and interface compatibility, generated registry routes and story types. Split activation and loading runtime support into their owning PRs. AI-assisted changes. Preserve selection and pinned-column append cost with private count-consumer registration; stage protocol and consumer docs only in their introducing PR. AI-assisted changes. Preserve active cues above pinned overlays and reset inherited cue width at every row boundary. AI-assisted changes. Keep custom row totals fresh, explain window admission fallbacks, trim unused loading protocol and registration formatting churn. AI-assisted changes. Track actual immutable row-count reads without imposing count invalidation on legacy plugins; refresh canonical identity on mutable data-length changes. AI-assisted changes. Preserve offscreen row focus when the browser document loses focus; keep wide Table loading reachable on horizontal scroll. AI-assisted changes. Clarify runtime Table windowing admission while preserving the exported props interface. No approval or runtime behavior change. AI-assisted changes. Preserve native loading extent anchors, intrinsic Table sizing and per-instance diagnostics. AI-assisted changes. Declare first-party flat Table modifiers in the canonical admission contract. This diff was generated with AI assistance (Navi). Tags: ai-generated Keep forced-colour current-row marker separate from focus and restore owner-only empty-plugin warnings. This diff was generated with AI assistance (Navi). Tags: ai-generated Use the row-specific useTableRowsVirtualization public hook and config type. Include its runnable CLI example and generated public API/registry contracts. Runtime behavior is unchanged.
There was a problem hiding this comment.
Thanks for the thorough useTableActivation work; the activation contract it implements is current, but approval needs a size split and an owner decision.
Blocking:
- The change is 3,050 authored lines with no size exception, so please land the shared
useClickableContainertext-selection repair and the Table protocol and paint seam as their own pull requests first, and bring the hook part (including its 1,332-line test file) under 2,000 lines.
Owner decision needed: no current spec record decides TableRenderContext.canActivate, the public --table-row-active-cue-width custom property, whether the hook may ship without a template example naming it in exampleFor/alsoExampleFor, or the wider text-selection rule that the shared hasTextSelection change now applies to expansion and tree row clicks. An engineering owner can record that decision (accept these, ask for the two API rows to become internal, and rule on the example) by commenting /approve-spec <full head SHA> on this pull request; the author may do so as an engineering owner.
Non-blocking: data-active renders as "true" but becomes "active" after mount and server HTML shows aria-current without the bar; the hook doc says selected text blocks activation although Enter and Space still activate; strict lint reports 8 warnings.
[Automated review]
| htmlProps.tabIndex = original.tabIndex ?? 0; | ||
| htmlProps['aria-keyshortcuts'] = shortcuts; | ||
| if (store.getConfig().activeKey === key) { | ||
| htmlProps['data-active'] = true; |
There was a problem hiding this comment.
Non-blocking: React renders data-active="true" here, but setRowActivation rewrites it to "active" once the row mounts (tableRowState.ts:52). Server HTML also carries aria-current="true" with no fill or bar until hydration, because the 3px width and the fill are written only from the ref and TableRow resets the width to 0px. Rendering one data-active value, and the cue width and fill, from these row props as well keeps server and client output aligned (module FR3).
| subComponentOf: 'Table', | ||
| displayName: 'useTableActivation', | ||
| description: | ||
| "Returns a TablePlugin for one controlled current product row in a flat data table. Primary click, Enter and Space request activation. The caller controls activeKey and the adjacent detail or preview content. Supply an explicit stable unique Table idKey. Activation does not select rows, navigate or move focus; row rerenders preserve the existing keyboard focus and shortcuts. Native controls, editable content, portalled content and intersecting text selections do not activate the row. A compatible custom body-row or body-cell plugin must declare rowModel: 'flat'; an undeclared or non-flat model disables activation with a development diagnostic.", |
There was a problem hiding this comment.
Non-blocking: "intersecting text selections do not activate the row" reads as if a selection blocks every activation. Module FR6 and the hook's tests let Enter and Space activate while text is selected; only clicks yield. Suggest "intersecting text selections do not activate the row on click".
| export interface TableRenderContext { | ||
| readonly mode: 'data' | 'children'; | ||
| readonly rowModel: 'flat' | 'tree' | 'grouped' | 'detail' | 'custom'; | ||
| readonly canActivate: boolean; |
There was a problem hiding this comment.
No current spec record lists this member: the Table record says TableRenderContext supplies mode, the admitted row model, logical/header counts and the viewport. An engineering owner needs to accept it as public API, or it can become internal.
User need
A master-detail Table needs one controlled current product row, independent of checkbox selection, navigation and focus. This PR adds
useTableActivationthrough the existing Table plugin pipeline.Current contract and dependency
The governing
module:Table/useTableActivationandcomponent:Tablerecords are current on main, approved through merged #7972. This is implementation of that contract, not a request to promote a draft spec. The runtime depends on the shared parent protocol in #8280; #8282 is its loading dependent. The historical #8279 approval-record branch is not a runtime prerequisite.Implementation
TableRowContext; no second key extractor or incompatible bare-key callback slot.aria-current="true", one shared selection/activation paint path and an independent inline-start cue. Existing current-state/focus attributes remain owned by their callers.Refresh and verification
Rebased the same canonical stack onto main
cd1e42cec8ef1f621b8b74bb980d43cfbb8f2da7. The activation patch is unchanged. The upstream header-resize accessible-name fix, focus return on removed surfaces and shared Effect notes are preserved. Generated API reports are refreshed separately at their owning stages.The refreshed full Table/helper suite passes 899 tests across 51 files. Both intermediate stages pass their focused contracts and core builds, and API reports are generated at their own stages. The final core source/declaration build passes. Test-inclusive core TypeScript retains one
TokenizerBottomSheet.test.tsxexperimental-prop error that reproduces identically on pinned main; this is disclosed, not a new green typecheck claim. Rebase integration strict lint, formatting, knowledge and pre-review checks pass. A bounded real-source browser check exercises the canonical activation story with click, native Tab/Enter/Space, retained focus and forced-colour logical cue in LTR/RTL, with no page exceptions; it is not full Storybook, hosted deployment, AT, motion or numerical release-budget certification.Earlier counts and captures remain historical rather than being reassigned to this head.
Remaining approval and release holds
The primary contracts are current, but the review's narrower questions remain open: deciding records for
TableRenderContext.canActivateand--table-row-active-cue-width, the runnable hook example, and authored-size disposition. Parent row-status composition and numerical virtualization/accessibility release evidence also remain separate holds. Existing nonblocking data-active-value and activation lint-warning notes are not silently cleared.The parallel #8861 targets the same public capability but follows a different earlier-contract parent argument and state model; this refresh does not merge, adopt or modify it. One canonical implementation should land, not both.
FAQ: Is this ready to merge?
No. This publishes the refreshed implementation for review while preserving the existing draft status and dependency bases. No specification approval, reviewer approval, lifecycle transition or runtime merge is performed.
This PR was generated with AI assistance (Navi).
Tags: ai-generated