Skip to content

perf(Table): build the row-index column once per plugin - #10654

Merged
humbertovirtudes merged 1 commit into
mainfrom
table-virt/1-row-index-fixes
Nov 8, 2026
Merged

humbertovirtudes merged 1 commit into
mainfrom
table-virt/1-row-index-fixes

Conversation

@humbertovirtudes

@humbertovirtudes humbertovirtudes commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Stack

Row virtualization is split into eight stacked PRs, each under the 2,000-line limit. Each PR's base is the one above it, so review and merge from the top of this list down.

  1. perf(Table): build the row-index column once per plugin #10654 perf(Table): build the row-index column once per plugin (this PR)
  2. refactor(core): share per-instance warning dedupe and temporary focus targets #10655 refactor(core): share per-instance warning dedupe and temporary focus targets
  3. feat(core): add the shared list-windowing module and Table's capability hook #10656 feat(core): add the shared list-windowing module and Table's capability hook
  4. feat(Table): add the window controller and Table's shared-geometry runtime #10657 feat(Table): add the window controller and Table's shared-geometry runtime
  5. feat(Table): window fixed-height flat tables through useTableRowsVirtualization #8280 feat(Table): window fixed-height flat tables through useTableRowsVirtualization
  6. feat(Table): window tables that use selection and row index #10658 feat(Table): window tables that use selection and row index
  7. perf(Text): take a new text's first truncation measurement from the shared observer #10668 perf(Text): take a new text's first truncation measurement from the shared observer
  8. test(Table): add Chromium accessibility and 1k/10k/100k release evidence for row windowing #10659 test(Table): add Chromium accessibility and 1k/10k/100k release evidence for row windowing

Two record amendments the stack relies on: #10665 (Table adopts the shared list-windowing module first) and #10666 (a windowed row-number column fits its last position).

Maintainer impact

A table that uses useTableRowIndex re-renders every row whenever its parent re-renders, even when no row changed. The plugin built a new index column on every Table render, so Table's resolved columns never stayed equal and every memoized row re-rendered.

Intended invariant

A plugin column keeps its identity while the plugin's inputs stay the same, so a parent re-render leaves unchanged rows alone.

Change

useTableRowIndex builds its column once, with the plugin, instead of inside transformColumns. Its width, label, renderer and numbering are unchanged.

Evidence

  • A new test counts body-cell transforms: before the change, a parent re-render re-ran every cell's transform; after it, none.
  • All existing row-index tests pass unchanged.

Scope

  • No intended public API, product behavior, visual direction, or policy change.
  • Product changes discovered during the work were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

  • Format (Prettier), strict lint (--max-warnings=0) on every changed file, and pnpm typecheck in packages/core pass on this exact head.
  • vitest run --project ui packages/core: 20,605 tests pass. Four locale time-format tests (DateTimeInput, TimeInput, timeFormat) fail on the local machine's ICU data and pass in CI; they do not touch Table.
  • node scripts/pre-review.mjs --base <the branch below>: 74 authored lines.
  • The new re-render test fails without this change and passes with it.

This PR was generated with AI assistance (Navi).

useTableRowIndex created a new column object on every Table render, so a
parent re-render re-rendered every row of a table that shows row numbers.
The column is now built with the plugin.

This diff was generated with AI assistance (Navi).
Tags: ai-generated
@vercel

vercel Bot commented Nov 8, 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 8, 2026 8:39am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 8, 2026
@astracat-bot

astracat-bot Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 8, 2026, 8:47 AM 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.

Approved pending CI: CI is still running on this head.

useTableRowIndex now builds its index column once per plugin, so a parent re-render no longer re-renders unchanged rows. The new test fails without the change and passes with it, and the row numbers, header, width and alignment render as before.

Non-blocking:

  • The comment added at useTableRowIndex.tsx:94-95 could follow the repository's plain-English comment style; see the inline suggestion.

[Automated review]

Comment on lines +94 to +95
// One column object per plugin, so a Table re-render keeps its resolved
// columns and leaves unchanged rows alone.

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: this comment opens with a fragment that has no verb and uses the idiom “leaves … alone”. The source-comment rule (INV29 in docs/architecture/knowledge-contracts.md) asks for short, active sentences with no idioms. A version that keeps only the reason:

// Table re-renders every row when a column object changes. Build this column once per plugin.

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 413328b

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
TableBody 3.5 kB (0) · 3.3 kB CSS (0) — ✓ · ✓ · ✗
TableFooter 3.5 kB (0) · 3.3 kB CSS (0) — ✓ · ✓ · ✗
TableHeader 3.5 kB (0) · 3.3 kB CSS (0) — ✓ · ✓ · ✗
5 more components
Component Size LoC Visual · A11y · RTL
TableRow 6.9 kB (0) · 3.9 kB CSS (0) — ✓ · ✓ · ✗
Table 116.3 kB (0) · 17.7 kB CSS (0) — ✓ · ✓ · —
TableCell 107.4 kB (0) · 17.4 kB CSS (0) — ✓ · ✓ · ✓
TableHeaderCell 107.0 kB (0) · 17.2 kB CSS (0) — ✓ · ✓ · ✓
TableSelectionToolbar 68.8 kB (0) · 13.0 kB CSS (0) — ✓ · ✓ · ✓

Package size: @astryxdesign/core 6.97 MB packed (+33 B); no new dependencies.

API changes: none in this pull request

Committed API report behind this build: cli 29 rows, core 40 rows; run pnpm api:report.

Touched components checked; add ci:run-visual, ci:run-a11y or ci:run-rtl to run the full suites.


Generated by PR Enrichment workflow | View full report

This branch was successfully deployed

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

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant