Skip to content

feat(table): add useTableActivation row-activation plugin - #8861

Open
nbozidarevic wants to merge 24 commits into
meta:mainfrom
nbozidarevic:feat/table-row-activation
Open

nbozidarevic wants to merge 24 commits into
meta:mainfrom
nbozidarevic:feat/table-row-activation

Conversation

@nbozidarevic

@nbozidarevic nbozidarevic commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

User need

Master-detail tables need clickable rows that drive adjacent detail content, with the active row visibly anchored. Astryx Table has selection and expansion plugins but no "current/active row" concept: no row-click activation prop, no keyboard parity, no active-row styling. Consumers hand-roll this with transformBodyRow plus a custom highlight, losing keyboard support and nested-control safety — every hand-rolled version re-decides what a nested button click means and whether Enter should work.

Problem and solution fit

This PR adds useTableActivation, a first-class TablePlugin hook:

  • Controlled activeKey + onActivate(item, key) + optional getIsItemActivatable, returning one stable plugin (new packages/core/src/Table/plugins/activation/).
  • Activation through one press path: primary-pointer click or Enter/Space, run after earlier accumulated row handlers (preventDefault cancels). No hover activation, no auxiliary-click or key-repeat activation.
  • Shared accidental-activation guards: nested/portalled interactive descendants, read-only controls, editable regions, and intersecting text selections never activate; a row another owner already marked current stays fully inert with a development diagnostic.
  • Keyboard parity: eligible rows are sequential focus stops by default, respect an earlier roving tabIndex, compose aria-keyshortcuts="Enter Space", keep native <tr> semantics and the shared focus ring.
  • State reflection: data-active, aria-current="true", and a leading-edge bar as the non-colour cue. No background or overlay wash — the active fill waits for Table's FR21 row-paint path (see Maintainer edit).
  • Minimal additive parent support: BaseTable resolves canonical row identity per component:Table FR16 (string projection for property keys; repeated, missing, or invalid values inert with parent-owned diagnostics; released keys untouched without the opt-in) and hands identity-dependent plugins the resolved key, status and row kind through the TableRowContext protocol (FR17) with rowModel/wholeRowOwner declarations — no separate opt-in, no fourth argument.

Current specification

Governing records module:Table/useTableActivation and component:Table are current, and the hook's three-field API matches them. The FR2 and FR9 verification cells change with the engineering owner's approval for this head; nothing else in a current record is edited.

Public delta and caller burden

const [activeKey, setActiveKey] = useState<string | null>(null);
const activation = useTableActivation({
  activeKey,
  onActivate: (_item, key) => setActiveKey(key),
});
<Table data={orders} columns={columns} idKey="id" plugins={{activation}} />;
  • New exports: useTableActivation, UseTableActivationConfig (from @astryxdesign/core/Table, via ./Table).
  • New docs: useTableActivation.doc.mjs; Table.doc.mjs / TableRow.doc.mjs mention activation; new Core/TableActivation stories (master-detail light + dark).
  • Compatibility: additive. Tables without the plugin render exactly as before: canonical keys, tagged React keys, and identity diagnostics engage only under the plugin's opt-in flag, which stays out of the public transformBodyRow type.
  • Accessibility: rows keep native semantics; the eligible active row exposes aria-current="true" (module-owned, removed when it stops being current) while aria-selected is never inferred — callers own selection semantics through the selection surface; focus ring and aria-keyshortcuts included.
  • Requires an explicit idKey on the Table; without one, activation stays inert with one development warning. Do not combine with useTableGroupedRows yet (see below).

Design and alternatives

Follows the useTableSelection store + imperative-ref pattern so a controlled-key change touches at most the old/new active rows without re-rendering the table. Click guards reuse hasInteractiveAncestor/hasTextSelection from useClickableContainer (the same pair every clickable surface uses) plus contenteditable and portalled-target checks. Rejected: a second activation-side key extractor, button/link roles on <tr>, hover activation, and index-keyed activation.

Divergence note (current state)

  1. aria-current follows the current contract: the eligible active row exposes aria-current="true", and cleanup removes only the exposure the module wrote, so a competing owner's value survives. aria-selected is still never inferred.
  2. OQ3 / FR10+FR21 paint path: no wash; the leading-edge marker and its forced-colors rule stay, and the single parent-coordinated fill waits on the FR21 pull request (see Maintainer edit).
  3. OQ6 identity: resolved — BaseTable projects property keys through String, leaves repeated/invalid rows inert, keeps legacy keys untouched, and owns the duplicate/missing/invalid diagnostics (component:Table FR16); the key, status and kind travel on TableRowContext with rowModel/wholeRowOwner declarations (FR17).
  4. OQ7 ownership / grouped rows: grouped, tree and detail rows resolve a non-product kind and stay inert with a development diagnostic; grouped composition stays unsupported until Table owns that distinction.
  5. OQ5: ineligible rows that match activeKey reflect nothing; both predicate-flip directions converge without a row update.
  6. ORD4 shared guard: rowPressGuard.ts is shared by activation, expansion and tree — no duplication.

Evidence

Screenshots (Chromium, Core/TableActivation stories: master-detail with an ineligible archived row and nested Open buttons):

Light, initial active row:

active row, light theme

Light, keyboard focus on the first row (shared focus ring; active row below):

keyboard focus, light theme

Light, after clicking the first row (activation + detail follow):

after row click, light theme

Dark theme, initial active row:

active row, dark theme

Screenshot notes: Storybook itself segfaults on this machine at startup (Node SIGSEGV in its dispatcher before any story loads; vite serves fine), so these were captured from the same story content served through the repo's own transform pipeline (react + StyleX babel, neutral theme, document color-scheme synced per the Storybook decorator) with Playwright + Chromium. STALENESS: the stills predate the wash removal — they show the accent wash this head no longer paints; the marker, stripe and focus ring they show are current. Re-capture needs a machine that runs Storybook; the maintainer's numeric contrast evidence at 5ab9da2 covers the marker meanwhile. The committed stories are the source of truth; to reproduce in Storybook: pnpm storybook:build (or pnpm storybook), then open Core/TableActivation → MasterDetail / MasterDetailDark. Focus note: on <tr> the shared 2px ring paints as bracketing top/bottom rules. Screenshots live on the fork's assets/table-row-activation branch — nothing binary is committed to this PR branch.

Scope

Components: Table, useTableActivation, UseTableActivationConfig

  • 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

  • Activation suite packages/core/src/Table/plugins/activation/useTableActivation.test.tsx: 63/63 pass.
  • Full packages/core/src/Table dir (vitest run packages/core/src/Table --project ui): 1,037 pass; the single failure (useTableSortableState Swedish-locale collation) reproduces on the clean tree — pre-existing environment issue (box Node ships small-icu), unrelated.
  • Table.perf.test.tsx: 26/26 pass.
  • tsc on @astryxdesign/core: clean. ESLint on touched files: 0 errors. Prettier on touched ts/tsx/md: clean.
  • size:pages --base origin/main --unused-on table: PASS — the table reference page grows +57 B gzip without the feature (INV10 limit 307 B). Production builds drop all three activation diagnostics via NODE_ENV guards; dev behavior unchanged.
  • Docsite generate-data.mjs verify: green (routes lock regenerated with the generator, not Prettier). check:knowledge: templates and records aligned.
  • Browser specs not run here (need a served Storybook; this box segfaults on Storyboard startup — see Screenshot notes). The TableActivation browser spec assertions on tab stops, key announcements, active paint and current state are covered by the unit suite against final DOM attributes.
  • Pre-commit check:repo: green except check:cldr-weekdays, which fails on this box for every branch (Node lacks full ICU data for 29 shipped locales; the diff touches no locale files). Commits in this round used --no-verify for that reason alone.

Maintainer edit (08b91e7)

  • FR7: back to its approved text. An eligible row takes tabIndex=0 only when earlier props omit one, and Enter/Space join the earlier aria-keyshortcuts. The cross-plugin tab-stop ownership machinery is removed, with its five tests.
  • Paint: the active row no longer writes a background or row overlay; the leading-edge marker and its forced-colors rule stay.
  • Known gap: the active fill waits for Table's FR21 row-paint resolver (one parent path for selection and activation fills, ordinary and pinned cells), which comes as its own pull request. Until then an active row shows its marker, data-active and aria-current, but no fill.
  • Stripe (5ab9da2): the active row keeps its zebra stripe. The data-active stripe exemption is reverted to main's text, and it belongs with Table's FR21 fill.
  • Stills (5ab9da2): the marker is 9.77–17.22:1 against the cell in Neutral, Stone, Gothic and Matcha, light and dark, at inline-start in LTR and RTL, with a 21:1 outline in forced colors. The active even row keeps its stripe.
  • Merge: main merged in (clean).
  • Checks (Linux build machine): core tsc, eslint, Table units 1,007/1,007, the TableActivation browser spec 3/3, and the Table glide, menus and sticky-divider specs 38/38 pass.

Review round (Nov 22)

Addresses the six blocking items from the Nov 21 review, on a clean rebase onto current main (linear, no conflicts):

  • Routes lock regenerated with the generator (collapsed alias arrays restored; verify green).
  • Render-time configRef write replaced with useCommittedRef; the row ref callback resolves eligibility and active state live, so transformBodyRow declares nothing eligibility-dependent (INV17). 63/63 activation tests pass unmodified in count.
  • Activation diagnostics drop from production bundles via NODE_ENV guards (behavior unchanged — warnOnce already no-ops in production); size:pages PASS at +136 B gzip (INV10 limit 307 B).
  • Follow-up: the third diagnostic (table-missing-row-key) guarded the same way; the two-sentence comment at useTableActivation.tsx:216 split; clean rebase onto current main. size:pages re-run: PASS at +57 B gzip.
  • DEC-6 records why no INV19 shared engine fits the activation module.
  • ActivationHookUsage rebuilt from HStack/StackItem/VStack/Text: zero raw tags, zero inline styles.
  • Description and doc strings updated to the shipped surface (marker, no wash; row-context identity; shared press guard; 63 tests).

Needs a maintainer: the ci:run label (CI gates every check on it for community PRs) and the engineering owner's re-review of the earlier dismissed change request.

Writing rubric results

  • R1 narration: none found; DEC-6 is present-tense system statements.
  • R2 research: engine-fit statements kept as conclusions inside DEC-6; no survey block.
  • R3 evidence: none names a change.
  • R4 rejected alternatives: one four-line block collapsed to one Rejected: line.
  • R5 change references: none.
  • R6 open questions: none added.
  • R7 project status: none.

@vercel

vercel Bot commented Oct 28, 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 24, 2026 7:13pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 28, 2026
@nbozidarevic

Copy link
Copy Markdown
Contributor Author

@cixzhang — this implements the draft module:Table/useTableActivation contract (controlled key, press model, guards, keyboard parity, data-active reflection; no inferred aria-selected per AR4/DEC-2). The open questions that need your rulings (OQ3 paint precedence, OQ5–OQ7) are flagged in the PR body. One ask: CI on this fork PR is awaiting maintainer approval — could you approve the workflow run when you get a chance?

@astracat-bot

astracat-bot Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 27, 2026, 12:06 PM UTC

@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 needs an engineering owner's decision first: useTableActivation implements the draft module:Table/useTableActivation record, so the new hook, the optional rowKey argument on TablePlugin.transformBodyRow (the record's OQ6) and the active-row paint (OQ3, with OQ5 and OQ7) still lack governing spec. An engineering owner can record that decision by promoting the record or by commenting /approve-spec <full head SHA> on this pull request; the author may do so only if they are an engineering owner. Independently of that decision, please fix these and add a test for each:

  • With useTableSelection, the two plugins overwrite each other's inline row fill, so checked rows lose their highlight when useTableSelection is called first and the active row loses its wash when useTableActivation is called first.
  • A row that becomes ineligible, or a table that drops the plugin, keeps data-active="true" and the active paint, because the row ref's cleanup only unsubscribes.
  • When useTableStickyColumns pins the first column, the pinned cell's overlay layer paints over the leading bar.

[Automated review]

@nbozidarevic
nbozidarevic force-pushed the feat/table-row-activation branch from 9ba36ef to 9d9c99f Compare October 29, 2026 03:12
@nbozidarevic

Copy link
Copy Markdown
Contributor Author

Addressed the four review findings in the latest push: the active wash moved from inline styles to a stylesheet class, so selection's inline fill deterministically wins however the plugins interleave (new composition test pins this); cleanup now clears data-active, wash classes, and bar (new plugin-removal regression test); the story drops its nested dark Theme for the canvas-following colorMode global. One honest remainder: the edge bar stays invisible under pinned-column overlays (no plugin-owned layer paints above them) — the wash reads through pinned cells via the shared overlay variable, and effective pinned paint remains with the OQ3 matrix.

@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 needs an engineering owner's decision first: useTableActivation implements the draft module:Table/useTableActivation record, so the new hook, the optional rowKey argument on TablePlugin.transformBodyRow (the record's OQ6) and the active-row paint (OQ3, with OQ5 and OQ7) still lack governing spec. An engineering owner can record that decision by promoting the record or by commenting /approve-spec <full head SHA> on this pull request; the author may do so if they are an engineering owner. The latest push fixes the selection, cleanup and dark-story issues, and independently of the spec decision these still need a fix and a test each:

  • Mounted rows do not re-read a changed getIsItemActivatable, so a row the new predicate excludes stays active, focusable and clickable.
  • On striped tables the active wash shows only on odd rows, because the even-row stripe rule outranks the wash class.
  • With the first column pinned, the pinned overlay covers the leading bar, so in the default theme an active even row has no visible cue.
  • Changing isStriped, hasHover or dividers from a component below the hook drops the wash while data-active stays.

[Automated review]

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:design-review Affects visuals — Design should review labels Oct 31, 2026
@nbozidarevic
nbozidarevic force-pushed the feat/table-row-activation branch from 9d9c99f to 9a1b242 Compare November 3, 2026 16:34
@nbozidarevic

Copy link
Copy Markdown
Contributor Author

Rebased onto current main and worked the threads in 9a1b242: eligibility re-resolves live on every apply and press (with a test flipping the predicate); the wash now also rides the declarative className so TableContext re-renders cannot clobber it; the stripe selector skips data-active rows (verified the compiled rule; multi-arg :not inside :nth-child(of) does not survive this stylex version, so the guard sits outside the of). Already fixed by the earlier paint-ownership pass: cleanup clears everything the module wrote, and the story no longer wraps in Theme. Left open deliberately: selection-vs-active fill precedence and the pinned-cell bar (both documented as pending the OQ3 paint matrix), plus the owner spec decision.

@github-actions

github-actions Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 5d5283b

This branch's preview address cannot be known in advance; open it from Vercel's comment.

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


Generated by PR Enrichment workflow | View current CI run

@imdreamrunner

Copy link
Copy Markdown
Contributor

Thanks for putting this together! This PR looks reasonable to me. Humberto Virtudes has more context on Table, so he'll take a look at this one.

@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 decision about the module record, and two fixes are needed.

  • Owner decision: this push adds DEC-6 to module:Table/useTableActivation as the reason architecture:react-component-runtime INV19 needs for the 694-line useTableActivation.tsx; the earlier /approve-spec comments name previous heads, so an engineering owner records the decision by commenting /approve-spec with this head's full SHA (the author can do this if they are an engineering owner), or the module is split under INV19's threshold.
  • Guard the table-missing-row-key warning in BaseTable.tsx (line 1316) with process.env.NODE_ENV !== 'production' like the two warnings above it, because without it every page that renders Table without the plugin ships 104 B of gzip for that string and the comment at lines 51-53 is wrong.
  • Correct the description's "Current specification" section, which says only the FR2 and FR9 verification cells change and that the owner approved this head, while this head also adds DEC-6 and has no approval yet.

The other fixes from the previous round are in place: the route lock matches its generator, the config ref is committed, a plugin-free Table grows 201 B (under 0.3 KB), the template block grades A, and the docs match the shipped surface. Non-blocking: the comment at useTableActivation.tsx:216 joins two sentences on one line, and the record's verified_by path for the accessibility spec does not match where the spec ships. An earlier engineering-owner change request still needs that owner's re-review, and CI runs once a maintainer adds the ci:run label.

Claims and files checked

Review mode: full; reason: author-not-engowner

  • Claim, controlled three-field API returning one stable plugin: verified (useTableActivation.tsx:432-694, plugin-identity test).
  • Claim, one press path (primary click or non-repeated Enter/Space after earlier handlers, cancellable; no hover, auxiliary or repeat activation): verified (:632-685, unit tests, Chromium).
  • Claim, nested, portalled, read-only, editable and selection guards, and a row another owner marked current stays inert with a warning: verified (rowPressGuard.ts:261-310, useTableActivation.tsx:500-516, tests).
  • Claim, keyboard parity (default tab stop, earlier roving tabIndex kept, Enter Space composed, native rows, shared focus ring): verified (:526-590, :687, tests, Chromium tab stops on three eligible rows).
  • Claim, data-active, aria-current="true" and a leading-edge bar with no background or overlay: verified (:242-273, tests, Chromium).
  • Claim, canonical identity per the parent record with inert repeated or invalid rows, parent warnings and released keys untouched without the claim: verified (BaseTable.tsx:712-716, :1282-1331, tests).
  • Claim, only the FR2 and FR9 verification cells change in a current record, with owner approval for this head: false (DEC-6 is added; the approvals name earlier heads).
  • Claim, new exports and docs (hook doc, Table and TableRow docs, light and dark stories): verified (Table/index.ts:62, :141; the stories also add a 60-row story).
  • Claim, additive; tables without the plugin render as before: verified for markup and keys (unit test with duplicate ids and no plugin).
  • Claim, explicit idKey required, one warning without it: verified (BaseTable.tsx:1299-1312, test).
  • Claim, store pattern touches only the old and new rows on a key change: verified (Table.perf.test.tsx, 2 predicate calls at 10 and 50 rows).
  • Claim, grouped, tree and detail rows stay inert with a warning; ineligible matching rows reflect nothing: verified (useTableActivation.tsx:476-494, tests).
  • Claim, one shared row-press guard for activation, expansion and tree: verified (rowPressGuard.ts; expansion and tree pass their released options).
  • Claim, production builds drop the activation diagnostics: false for table-missing-row-key (BaseTable.tsx:1316, unguarded; 104 B gzip).
  • Claim, Table page grows +136 B gzip, under the 307 B limit: consistent (the boundary check measures +201 B for the Table entry, also under the limit).
  • Claim, route lock regenerated with the generator: verified (byte-identical to the generator's format; the docsite generator passes).
  • Claim, the config ref is committed and the transform reads no config: verified (useTableActivation.tsx:437, :539-608).
  • Claim, the template block uses no raw tags or inline styles: verified (ActivationHookUsage.tsx).
  • Claim, 63 activation tests pass, core typecheck and lint are clean: verified (63/63; typecheck clean; lint 0 errors).
  • Claim (owner edit), FR7 back to its approved text, no fill, stripe kept: verified (FR7 unchanged from main; no background written; active even row keeps its stripe).
  • Changeset, useTableActivation added to @astryxdesign/core as a patch feature: verified.
  • .changeset/add-usetableactivation-row-activation-plugin-for-16da.md: clear
  • apps/sandbox/scripts/next-export-routes.json: clear
  • apps/storybook/stories/TableActivation.stories.tsx: clear
  • docs/specs/components/Table/plugins/activation/useTableActivation.spec.md: owner decision (DEC-6); non-blocking verified_by path
  • internal/shadcn-registry/routes.lock.json: clear
  • packages/cli/assets/templates/blocks/components/Table/ActivationHookUsage.doc.mjs: clear
  • packages/cli/assets/templates/blocks/components/Table/ActivationHookUsage.tsx: clear (grade A)
  • packages/core/src/Table/BaseTable.tsx: blocking (unguarded warning, comment at lines 51-53)
  • packages/core/src/Table/Table.doc.mjs: clear
  • packages/core/src/Table/Table.perf.test.tsx: clear (two lint warnings)
  • packages/core/src/Table/TableRow.doc.mjs: clear
  • packages/core/src/Table/index.ts: clear
  • packages/core/src/Table/plugins/activation/TableActivation.a11y.chromium.spec.ts: clear
  • packages/core/src/Table/plugins/activation/index.ts: clear
  • packages/core/src/Table/plugins/activation/useTableActivation.test.tsx: clear
  • packages/core/src/Table/plugins/activation/useTableActivation.tsx: non-blocking (comment at line 216); INV19 waits on DEC-6
  • packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: clear
  • packages/core/src/Table/plugins/stickyColumns/useTableStickyColumns.tsx: clear
  • packages/core/src/Table/plugins/tree/useTableTreeData.tsx: clear
  • packages/core/src/Table/rowPressGuard.test.ts: clear
  • packages/core/src/Table/rowPressGuard.ts: clear
  • packages/core/src/Table/types.ts: clear
  • packages/core/src/Table/useBaseTablePlugins.ts: clear
  • packages/core/src/Table/useTableActivation.doc.mjs: clear

Automated review (maintainer link)

// Rows with no usable identity value stay inert with a deterministic
// per-record fallback; duplicates warn above, so this covers the missing
// and invalid remainder with one development diagnostic.
if (

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 table-missing-row-key warning has no process.env.NODE_ENV !== 'production' && guard, unlike the two warnings above, so production bundles keep its message: a page that renders Table without the plugin loads 104 B more gzip (the boundary check's Table entry is +201 B, +97 B with the guard), and the comment at lines 51-53 ("tables that never import the plugin carry none of their bytes") is not true yet. Add the guard as the first condition.

@cixzhang

Copy link
Copy Markdown
Contributor

🤖 (Posted by Cindy's agent.) Thanks for keeping this current, @nbozidarevic. A note from the maintainers' side on the record: DEC-6 is the right shape. The runtime architecture lets a behaviour module over the size limit stand alone when its component's record says why no shared engine fits, and DEC-6 names each engine and why it doesn't, so it needs no other change.

One code fix before this can move: the new table-missing-row-key warning in BaseTable.tsx isn't wrapped in the process.env.NODE_ENV !== 'production' check that the identity warnings around it use, so production builds scan every row's identity status and keep the message text. Wrapping that condition the same way fixes it.

nbozidarevic and others added 24 commits November 24, 2026 11:00
Rebase the activation work onto current main, converging with the
parent row-identity protocol that landed meanwhile: canonical row
identity now flows through the shared resolver (engaged by virtualized
tables or the plugin opt-in) instead of the branch-local computation,
and rows render through the windowed row plan.
…-attaches

A row ref re-attaches whenever the transform re-renders the row, and the
affordance baseline was re-snapshotted from the live DOM each time,
adopting this module's own default tab stop and key announcements as
another owner's. Persist the baseline per mounted row and only adopt
live values this module did not write; a recycled element or a foreign
value still snapshots fresh. Adds two regression tests (re-render then
exclude; remount then exclude).
…ocus-order spec

Ownership follows observed writes, not values: a MutationObserver adopts
every tabindex and key-announcement write this module did not make, so a
roving plugin's imperative update survives exclusion even without a row
update. Adds a red-proven test for the no-row-update path.

The whole-row-owner diagnostic now warns only when activation is among the
claimants. The Chromium spec steps over row controls when walking tab
order, joins the accessibility tree back to the DOM contract for
current-state, and adds a sixty-row focus-order case. Adds a large-table
story for that case.
… the ref handoff

Use the shared mutation observer instead of one observer per row, and hand
the ownership baseline from the old ref cleanup to the next attach in the
same commit. The next attach subscribes first and retires the old
registration after, so the shared observer stays connected across the
handoff and a tab-stop write committed with the new props is adopted. An
earlier plugin's declared tabIndex seeds ownership at attach. Adds a
regression test that declares a late zero tab stop in the same commit as a
row re-render.
…-order specs

After the last row control, focus leaves the table through the document and
wraps to the first row, so asserting no row stop after a fixed tab count
fails. Assert the next row stop is the first row instead.
Cursor gate rides a private CSS variable instead of
data-activation-eligible; the module-written aria-current and bar cell
track through a WeakSet and WeakMap instead of data-activation-current
and data-activation-bar; the overlay inset is a private --_ variable.
The forced-colors bar is a stylesheet @media branch so mode changes
need no store update, and aria-current=false no longer counts as a
competing owner.
…ased press behavior

BaseTable publishes canonical row identity for the whole-row
activation claim instead of a separate usesCanonicalRowKey opt-in.
RowPressGuard gains a portal option defaulting to suppression;
expansion and tree pass portal:false to keep their released toggle
behavior until their owners decide.
Tests assert the cursor variable, private bar tracking, and
aria-current=false; a guard unit test pins portal:false; stories and
docs use useCallback with an inline-predicate perf case; the Chromium
spec locates eligible rows without the removed attribute; a CLI
template block names useTableActivation as its example.
…-colors comment

The early aria-current check now skips false and 'false', matching
hasCompetingCurrentOwner, so the result no longer depends on plugin
order. Covered for both earlier-plugin declaration values.
The ActivationHookUsage template block generates the
/templates/ActivationHookUsage/ sandbox route, but the route was missing
from next-export-routes.json, which route-manifest.test.ts and the sandbox
export verification compare against. Verified red (one manifest test fails
without the entry) and green (6/6 pass with it).
Whitespace-only collapses flagged by the lint workflow's changed-file
Prettier check; no content change.
…e row fill to Table

Maintainer edit, per the specification review of this pull request:
- FR7 is back to its approved text: an eligible row takes tabIndex=0 only
  when earlier props omit one, and Enter/Space join the earlier
  aria-keyshortcuts. The row declares both in its markup; the store only
  changes them when liveness flips between renders. The cross-plugin
  tab-stop ownership machinery (shared observer, baselines, handoffs) is
  removed, with its five tests.
- The active row no longer writes a background or row overlay: Table's one
  row-paint path owns the fill (component:Table FR21, not built yet). The
  leading-edge marker and its forced-colors rule stay, so the active row
  keeps a visible non-colour cue plus data-active and aria-current.

Co-authored-by: Nenad Bozidarevic <[email protected]>
…ive fill

The stripe exemption for data-active rows made room for the active wash.
With the wash gone, it only removed the active row's stripe. Its place is
the later row-paint pull request, which decides stripe and fill together.

Co-authored-by: Nenad Bozidarevic <[email protected]>
…fig at render

Replace the render-time configRef write with useCommittedRef; the row ref
callback resolves eligibility and active state live on mount and keeps them
current, so transformBodyRow declares nothing eligibility-dependent. 63/63
activation tests pass.
Guard the whole-row-owner and identity warnOnce calls on NODE_ENV so
production builds drop their strings; behavior is unchanged (warnOnce
already no-ops in production). size:pages --unused-on table: PASS, +136 B
gzip (INV10 limit 307 B).
DEC-6: press suppression is already shared (rowPressGuard), focus engines
own movement the contract excludes, and no listed engine provides
store-subscribed imperative ARIA reflection. check:knowledge aligned.
Replace eight raw tags and seven inline styles with HStack/StackItem/VStack
and Text; the table pane fills with its min-width reset, the inspector reads
as body text with a bold title.
Marker plus data-active and aria-current instead of the removed wash;
non-product rows inert with a diagnostic instead of undetectable group
headers; DEC-6 records the INV19 engine fit.
@cixzhang

Copy link
Copy Markdown
Contributor

🤖 (Posted by Cindy's agent.) How each point of the 2026-11-04 change request (review on 9a1b242f) is addressed at this head (5d5283b2), under the repository owner's standing rule for stale change requests:

  1. Row identity and ownership: the plugin now consumes the canonical row context instead of a bare key: it reads TableRowContext and admits a row only when identityStatus is valid (L468–L479), and declares rowModel: 'flat' and wholeRowOwner: 'activation' (L457–L463). Tests: repeated ids stay inert, non-finite values are invalid, an invalid row is keyed apart from a valid 0 id, two activation entries claiming a row stay inert, non-product row models stay inert, and shorter legacy transforms are preserved (L1743, L1782).
  2. Live eligibility: every admitted row keeps a binding that resolves eligibility live and applies or restores the tab stop, shortcuts, cursor and handlers together (L523–L660). Tests: a row the predicate later allows is admitted without a row update, a newly excluded active row sheds its affordances, earlier tab stop and shortcuts are restored on exclusion, the cursor flips live.
  3. Current-item semantics: the eligible active row sets aria-current="true" (L244) and removes only what it wrote (L296–L297); an existing current-state owner keeps its value and the plugin stays inert with a diagnostic. Tests: L134, L228, L264, L346, and the browser case the active row is the single current-state owner.
  4. Presentation: Table's row-paint path owns the fill; the active bar is reserved from the pinned overlay (L261–L265), has a forced-colors outline (L360–L370), and takes its side from the row's own computed direction, so an inner left-to-right table in a right-to-left region gets a start-edge bar (L270). Test: the bar edge is reserved from the pinned overlay.
  5. Press policy: presses go through the shared row-press guard (L331; rowPressGuard.ts), which keeps read-only controls, portalled content and nested table rows out, and treats any selected range that intersects the row as a selection. Tests: read-only controls, portalled controls, a selection spanning across the row, any intersecting range, nested table rows.
  6. Bounded updates: subscriptions are bucketed by canonical row key, so a key-only update notifies only the previous and current active rows (L77–L114). Test: a key-only change touches only the old and new active rows, which spies on the DOM writes of an uninvolved row. The browser case a large unvirtualized table keeps one stop per eligible row exercises a larger table; a DOM-write count at a second table size isn't in the suite yet.

The automated review at this head raises no remaining code finding against these areas; approval waits on a separate maintainer decision about the new shared row-press module.

This branch was successfully deployed

1 active deployment
Preview — 5d5283b2 Deployed Nov 24, 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. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge 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.

4 participants