Repository navigation
docs(Table): the long-table row-expansion story passes stable callbacks - #13181
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 59e1c17 |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
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
GlidingRowsLongTablechanges, with auseCallbacktoggle 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.
|
/approve-spec c910d39 |
There was a problem hiding this comment.
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
GlidingRowsLongTablechanges, with auseCallbacktoggle 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.
Maintainer impact
onToggle,getRowKeyandrenderExpandedtouseTableRowExpansion. 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
Change
apps/storybook/stories/TableRowExpansion.stories.tsx(GlidingRowsLongTableonly):onToggleis auseCallback, andgetRowKeyandrenderExpandedare module-level helpers. Nothing else changes.Evidence
renderCell). With inline callbacks, as the story wrote them, a parent render that does not touch the table renders 50/50 rows.packages/changes; the story renders the same table and panels.Scope
Components: Table (story only)
Testing
node scripts/preflight.mjsat 59e1c17 onmain35bda7f, 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.