Skip to content

docs(Table): the long-table row-expansion story passes stable callbacks - #13181

Merged
cixzhang merged 2 commits into
mainfrom
l0/table-expansion-story-stable-callbacks
Nov 21, 2026
Merged

cixzhang merged 2 commits into
mainfrom
l0/table-expansion-story-stable-callbacks

Conversation

@cixzhang

@cixzhang cixzhang commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Maintainer impact

  • Who: anyone who measures Table row expansion on the Storybook story "Gliding Rows Long Table" (2,000 rows, not windowed), for example on a phone.
  • Problem: the story passed inline onToggle, getRowKey and renderExpanded to useTableRowExpansion. Those are memo inputs of the plugin, so every render of the story made a new plugin, and every row of the table rendered again. A profile of the story then counted the story's own renders as Table's work.

Intended invariant

  • A story that measures a component passes stable inputs, so a profile shows only the component's work.
  • Table's behavior does not change: an expansion still renders every row, because the plugin holds the expanded set (a separate, open question for Table's plugin design).

Change

  • apps/storybook/stories/TableRowExpansion.stories.tsx (GlidingRowsLongTable only): onToggle is a useCallback, and getRowKey and renderExpanded are module-level helpers. Nothing else changes.
  • Story-only: no package code, no changeset, no release note.

Evidence

  • Failure before the change: a render-count probe (jsdom, a 50-row Table with the expansion plugin and a counting renderCell). With inline callbacks, as the story wrote them, a parent render that does not touch the table renders 50/50 rows.
  • Success after the change: with stable callbacks, the same parent render renders 0/50 rows.
  • Product/runtime behavior verified unchanged: no file under packages/ changes; the story renders the same table and panels.

Scope

Components: Table (story only)

  • 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

  • Preflight (node scripts/preflight.mjs at 59e1c17 on main 35bda7f, Linux build machine): review:pre, build, typecheck, lint, vitest ui, knowledge and changesets pass; vitest node passes except offline-media's two real-browser cases, which need the machine's proxy unset (24/24 without it). Storybook builds; the TableRowGlide browser spec passes 14/14.

GlidingRowsLongTable passed inline onToggle, getRowKey and renderExpanded,
which are memo inputs of the expansion plugin. Every render of the story
made a new plugin, so every row of the 2,000-row table rendered again, and
a measurement of the story counted the story's own renders as Table's work.
The story now passes a useCallback toggle and module-level helpers.
@vercel

vercel Bot commented Nov 21, 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 21, 2026 10:34am UTC

Request Review

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

astracat-bot Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 21, 2026, 2:42 PM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 59e1c17

@github-actions

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · c910d39

Storybook · Sandbox · built from this PR's head

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approved pending CI: CI has not run on this head yet (its last run stopped because CI was full), so it needs a re-run before merge.

Stable callbacks in GlidingRowsLongTable do what the description says: a story render that keeps the expanded set now re-renders 0 of 2,000 rows (2,000 before), and an expansion still renders all 2,000, so a profile of one toggle is unchanged. Non-blocking: the "Who" line reads broader than that gain, so consider naming the renders that improve (a Storybook toolbar, decorator or parent re-render).

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none.
  • Claim (title): the long-table row-expansion story passes stable callbacks: verified from the diff.
  • Claim: the story passed inline toggle, row-key and panel callbacks, which the plugin memoizes on: verified in the plugin's memo lists.
  • Claim: every story render made a new plugin and every row rendered again: verified, 2,000 of 2,000 rows on a parent render at the base.
  • Claim: a profile then counted the story's own renders as Table's work: verified for story renders that keep the expanded set; a profile of one expansion is unchanged (non-blocking).
  • Claim: the affected people are those who measure row expansion on this story: broader than the gain, which is limited to renders that keep the expanded set (non-blocking).
  • Claim: a story that measures a component passes stable inputs, so a profile shows only the component's work: verified for this story, 0 of 2,000 rows on the same render at the head.
  • Claim: Table's behavior does not change and an expansion still renders every row: verified, no package file changes and an expansion renders 2,000 rows at both.
  • Claim: only GlidingRowsLongTable changes, with a useCallback toggle and module-level helpers: verified from the diff.
  • Claim: story-only, with no package code, changeset or release note: verified from the diff.
  • Claim: a 50-row render-count probe goes from 50 of 50 rows to 0 of 50: consistent with the same measurement on the real story (2,000 of 2,000 to 0 of 2,000); the 50-row fixture is not in the pull request.
  • Claim: the story renders the same table and panels: verified, same data, columns, rows and toggles.
  • Claim: no public API, product behavior, visual or policy change, and no internal context in public text: verified.
  • Claim: product changes found during the work were removed or split: consistent, the pull request changes no product file.
  • Claim: preflight's build, typecheck, lint, knowledge and changeset checks pass: verified by re-running the build, the Storybook typecheck, ESLint on the story and the knowledge and changeset checks; the Lint workflow also passed on this head.
  • Claim: preflight's UI tests and pre-review report pass: the row-expansion and Table performance UI tests pass (84 of 84); the full UI suite and the pre-review report were not re-run.
  • Claim: node tests pass apart from two real-browser media cases that need the proxy unset: not re-run; the node project does not include stories.
  • Claim: Storybook builds: verified, and the long-table story is in its index.
  • Claim: the row-glide browser spec passes 14 of 14: not re-run; the spec holds 14 tests.
  • File: apps/storybook/stories/TableRowExpansion.stories.tsx: clear.

Automated review (maintainer link)

@cixzhang cixzhang added the lane:0 Astryx fix-loop lane 0 owns this label Nov 21, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 21, 2026 08:44
@cixzhang
cixzhang marked this pull request as draft November 21, 2026 10:19
@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec c910d39

@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, and the merge guard waits for its required checks to pass.

Stable callbacks in GlidingRowsLongTable do what the description says: a story render that keeps the expanded set now re-renders 0 of 2,000 rows (2,000 before), and an expansion still renders all 2,000, so a profile of one toggle is unchanged. Non-blocking: the "Who" line reads broader than that gain, so consider naming the renders that improve (a Storybook toolbar, decorator or parent re-render).

Claims and files checked

Review mode: same-head; reason: none

  • changed rules (0): none.
  • Claim (title): the long-table row-expansion story passes stable callbacks: verified from the diff.
  • Claim: the story passed inline toggle, row-key and panel callbacks, which the plugin memoizes on: verified in the plugin's memo lists.
  • Claim: every story render made a new plugin and every row rendered again: verified, 2,000 of 2,000 rows on a parent render at the base.
  • Claim: a profile then counted the story's own renders as Table's work: verified for story renders that keep the expanded set; a profile of one expansion is unchanged (non-blocking).
  • Claim: the affected people are those who measure row expansion on this story: broader than the gain, which is limited to renders that keep the expanded set (non-blocking).
  • Claim: a story that measures a component passes stable inputs, so a profile shows only the component's work: verified for this story, 0 of 2,000 rows on the same render at the head.
  • Claim: Table's behavior does not change and an expansion still renders every row: verified, no package file changes and an expansion renders 2,000 rows at both.
  • Claim: only GlidingRowsLongTable changes, with a useCallback toggle and module-level helpers: verified from the diff.
  • Claim: story-only, with no package code, changeset or release note: verified from the diff.
  • Claim: a 50-row render-count probe goes from 50 of 50 rows to 0 of 50: consistent with the same measurement on the real story (2,000 of 2,000 to 0 of 2,000); the 50-row fixture is not in the pull request.
  • Claim: the story renders the same table and panels: verified, same data, columns, rows and toggles.
  • Claim: no public API, product behavior, visual or policy change, and no internal context in public text: verified.
  • Claim: product changes found during the work were removed or split: consistent, the pull request changes no product file.
  • Claim: preflight's build, typecheck, lint, knowledge and changeset checks pass: verified by re-running them on this patch; CI's lint, typecheck and build jobs also pass on this head.
  • Claim: preflight's UI tests and pre-review report pass: the row-expansion and Table performance UI tests pass (84 of 84), and CI's UI test shards pass on this head; the pre-review report was not re-run.
  • Claim: node tests pass apart from two real-browser media cases that need the proxy unset: not re-run here; CI's node shards were still running at review time.
  • Claim: Storybook builds: verified, the long-table story is in its index, and CI's Storybook build passes on this head.
  • Claim: the row-glide browser spec passes 14 of 14: not re-run here; the spec holds 14 tests, and CI's interaction shards were still running at review time.
  • File: apps/storybook/stories/TableRowExpansion.stories.tsx: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 21, 2026 14:26
@cixzhang
cixzhang merged commit b2305f0 into main Nov 21, 2026
147 checks passed
@github-actions
github-actions Bot deleted the l0/table-expansion-story-stable-callbacks branch November 22, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — c910d394 Deployed Nov 21, 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. lane:0 Astryx fix-loop lane 0 owns this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant