Repository navigation
Conversation
Port of #8403 onto current main. Cells without `contextMenuActions` no longer import ContextMenu. A cell with actions renders a shared trigger around its content and loads only the menu beside it, so the content keeps its node, focus and state across the load. Co-authored-by: Royi Hagigi <[email protected]>
A cell before its menu loads now holds the touch events of a press and hands them to the menu's own long press when it attaches, instead of running a long-press recognizer itself. The pre-load listeners recognize no gesture. The menu times the press from the touch's own start. Also lists the cell trigger and the gesture counter as base modules in the import-boundary check, removes the Table menu crossing from its allowlist, and names when a cell with actions starts the menu load.
…the external-trigger mode exist; keep CI-measured sizes
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 1d8278c |
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
…ord links these files
|
/approve-spec c54e3f0 |
There was a problem hiding this comment.
Request changes. Loading the cell menu lazily works, and the size win checks out: import {Table} drops from 357,792 to 137,952 minified bytes, and its eager chunks hold no menu module. Two parts of the early-invocation and failure paths do not yet follow architecture:component-import-boundaries:
- A held touch loses its earlier moves (INV4):
holdTouchEvent(TableCellContextMenu.tsx:164-167) keeps only the last move, so a press that strays past the 10 px tolerance and comes back before the menu loads opens the menu on replay, while the same press on a loaded cell opens nothing; hold every move and add that sequence to the touch tests. - A failed load is silent in development (INV6): the catch at
TableCellContextMenu.tsx:89-91(and the preload and retry catches) swallows the error, but INV6 says development builds warn once; callwarnOncefromutils/devWarningthere and assert it once in the load-failure test.
Also, when heavy CI runs, refresh the boundaries record's "Table carries 123.5 KB eager" line from the check's printout.
Claims and files checked
Claims (changeset and description):
- Cells load the menu only when they have actions: verified (
TableCellContextMenureturns the content untouched without actions; no-load test). - A table without menus no longer ships ContextMenu, DropdownMenu's menu code and the touch sheet, about 358 KB to 138 KB minified: verified (357,792 to 137,952 bytes; no menu module in the eager chunks). The gzip figures depend on how chunks are compressed and were not reproduced exactly.
- A cell with actions renders its content at once, starts loading on its first client render, and keeps the content's node, focus and state: verified (hydration gate; content-survives tests for body and header cells).
- An early right-click, Shift+F10 or long press is held and opens the menu once it loads unless another press or key comes first, with the browser menu kept shut: verified for right-click and Shift+F10; a held touch can also open the menu after a press that strayed past the tolerance (finding above).
- A failed load keeps the table, returns the browser menu, and a later mount, right-click or touch retries: verified (load-failure tests); no development warning (finding above).
- Tests that expect the menu synchronously after render must wait for it: verified (warm-up helper added to Core's suites).
resolveContextActionskeeps its export and no longer pulls the menu in: verified (Table/index.tsre-exports it fromtableContextActions.ts).- No public API change, no new props, exports or data attributes: verified (generated API surface has no row).
- Action getters still resolve when the menu opens: verified (getter path, row-expansion and sortable tests).
- A loaded menu behaves as before: verified (ContextMenu, DropdownMenu and Table menu suites pass).
- The measured Table and ContextMenu minified sizes: verified exactly; the Markdown and root-entry rows were not re-measured.
- The cell's listeners recognize no gesture before the menu loads: verified (no long-press detector before load).
- A held touch is handed to the loaded detector as its raw events, in order, timed from the touch's start: partly false; consecutive moves collapse to the last one, though timing from the start holds.
- Modules in the lazy graph import Core modules directly: verified (single-bundle test passes).
- Each ContextMenu item alias has its own module: verified.
- The boundary check lists the trigger and gesture-counter modules as base code and drops the Table row: verified (script, its test and the record).
- The menu stays out of server markup and the hydrating render: verified (SSR test over three server renders).
- The two new cell Effects name what they sync: verified.
Files (48):
Table/TableCellContextMenu.tsx: the two findings above.ContextMenu/ContextMenu.tsx,ContextMenuTrigger.tsx,index.tsand the seven alias modules: clear.Table/TableCell.tsx,TableHeaderCell.tsx,tableContextActions.ts,tableContextMenu.tsx,index.ts, and the row-expansion and sortable plugin sources: clear.- The four
DropdownMenuimport edits: clear. - The changeset: clear apart from the touch case above.
- The three records: clear apart from the eager-size line.
- The three boundary and bundle scripts and the shared-identity baseline: clear.
- The 18 test, fixture and helper files: clear.
|
/revoke-spec |
Keeps the lazy cell menu. From main: the header's unpositioned menu trigger, with points measured from the anchor's containing block, a held right-click included; the predicate's one name, hasContextActions; the touch sheet's lazy action list; the sub-menu's visibleText. The boundaries record takes main's tables without the cell-menu row, adds the cell wrapper's gesture-counter crossing, and the check's current costs.
…ns once in development A press that strayed past the move tolerance and came back before the menu loaded opened the menu on replay, because only the last move was held. Every move is held now, so the replay cancels it as a loaded cell does. A failed load of the menu code warns once in development builds, from whichever path saw it first.
|
/approve-spec b190355 |
|
/approve-spec 2f13741 |
There was a problem hiding this comment.
Approved pending CI: the pull request is a draft, so CI has not run on this head; its required checks start once it is marked ready for review.
The newest commit only merges main cleanly, and the record edits are approved for this head.
Non-blocking, no commit needed for this approval:
- The import-boundaries record gives Table's eager size as 50.5 KB, but the boundary check prints 54.3 KB on this head, and the refreshed Button, Link and windowing costs differ from its printout too; copy them from CI's printout at the next edit of that record.
- The description does not mention the two browser-spec edits (Button cut label, Table cut heading); one line under Testing saying why their chunk pattern narrows would tell reviewers why they change.
- The description's test tally (72 files, 1,388 tests) and the 50.5 KB figure come from earlier heads; 81 files and 1,495 tests pass on this head.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim: A table whose cells have no actions renders as before and loads no menu code: verified (
TableCellContextMenu.tsx:214; the no-load test; the boundary check shows no Table crossing into ContextMenu). - Claim: A page with Table, Text and Button loads about 23 to 25 KB less first-load gzip in Vite, Rolldown and webpack (about 21 %): consistent with the esbuild reference-page run on this head (table page −26,486 B gzip, 21.0 %); the per-bundler matrix names an earlier head and was not re-run.
- Claim: A cell with actions renders its content and trigger at once and starts its menu load at its first client render after hydration: verified (
TableCellContextMenu.tsx:279,:380; the server-render test). - Claim: The content keeps its node, focus and state when the menu attaches, and the trigger box does not move: verified (body and header scenario tests; the Chromium box-and-axe case).
- Claim: An early right-click, Shift+F10 or long press is held and opens the menu once unless another press or key comes first, and the browser menu stays shut: verified (
TableCellContextMenu.tsx:262,:311-337; 14 touch tests; the header Shift+F10 test; three Chromium early-invocation cases). - Claim: A failed load keeps the table, drops the held invocation, returns the browser menu and asks the loader again later: verified (
TableCellContextMenu.tsx:67,:89,:102,:318; four load-failure tests, one asserting a single development warning). - Claim: No public API change, and no new prop, export or data attribute: verified (the API generator lists 0 rows for Core, the build package and the seven themes; the package exports reach none of the new modules).
- Claim: Action getters still resolve when the menu opens, and a loaded menu behaves as on main: verified (
tableContextMenu.tsx:89; ContextMenu and DropdownMenu suites pass). - Claim: The action helpers move to a dependency-free module with the public export unchanged: verified (
tableContextActions.ts:28,:41;Table/index.ts:63). - Claim: The trigger wrapper is shared by ContextMenu and the cell, the cell loads only the menu through the internal mode and the shared loader, and neither module is exported: verified (
ContextMenu.tsx:409;TableCellContextMenu.tsx:54). - Claim: Before the menu attaches the cell recognizes no gesture; a right-click is held as a point and a touch as its raw events, timed from the touch's start: verified (
TableCellContextMenu.tsx:165,:183; the detector-count and deadline touch tests). - Claim: Modules in the lazy graph import directly, and the seven item aliases get one-line modules so a single-file app still renders: verified (the single-bundle tests pass).
- Claim: The boundary check lists the two new base modules and drops the stale Table row: verified (
check-component-import-boundaries.mjs; its 35 tests; the check passes). - Claim: The governing records and claims listed under Authority: verified against the records, which are unchanged on today's main.
- Claim: The two Effects added name the system they sync: verified for the cell's two; ContextMenu adds two more layout Effects, which also name theirs (non-blocking).
- Claim: The per-bundler byte table, the menu page's added 0.35 KB and the static-graph figures: measured at earlier heads as stated; this head's esbuild run gives menu +340 B and table −26,486 B gzip, matching in size and direction.
- Claim: The boundary check prints Table's eager gzip as 50.5 KB, and the record carries that figure: stale; this head prints 54.3 KB here (non-blocking).
- Claim: The red-first long-press-detector test, the new touch cases and the tests carried from the earlier port: verified (they pass; the red-first run against the port was not repeated).
- Claim: The Chromium cases for box stability, early right-click, Shift+F10 and long press, the Shift+F10 case needing a Linux run: verified (four pass in Chromium on Linux on this head).
- Claim: The measurement on top of the iOS long-press pull request: not re-run.
- Claim: The records changed and the writing-rubric results: verified against the four record edits.
- Claim: The test tally of 72 files and 1,388 tests: stale; 81 files and 1,495 tests pass on this head (non-blocking).
- Claim: Typecheck, ESLint, Prettier, the knowledge check and the changeset check pass: Core typecheck and the knowledge check verified on this head; ESLint, Prettier and the changeset check not re-run.
- Claim: Overlap with other pull requests and the land path: two of the three listed pull requests are already on main and merged into this head; the rest is stated, not checked.
- Claim: Release note: a patch; menus load only for cells with actions; about 23 to 25 KB less first-load JavaScript; content keeps its node; early invocations are held; a failure returns the browser menu and retries; tests that expect a synchronous menu must wait;
resolveContextActionskeeps its export: verified as above, per-bundler figures not re-run. - File:
.changeset/table-cell-lazy-context-menu.md: clear - File:
docs/architecture/component-import-boundaries.md: non-blocking note (the Table eager figure and the refreshed costs differ from the check's printout at this head) - File:
docs/specs/components/ContextMenu/ContextMenu.spec.md: clear - File:
docs/specs/components/Table/TableCell.spec.md: clear - File:
docs/specs/components/Table/TableHeaderCell.spec.md: clear - File:
packages/core/src/Button/__tests__/ButtonCutLabel.interaction.browser.spec.ts: clear (pattern still matches the cutText chunk; not re-run on this head) - File:
packages/core/src/ContextMenu/ContextMenu.test.tsx: clear - File:
packages/core/src/ContextMenu/ContextMenu.tsx: clear (two layout Effects name their system; non-blocking description note) - File:
packages/core/src/ContextMenu/ContextMenuCheckboxItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuDivider.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuSubMenu.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuTrigger.tsx: clear - File:
packages/core/src/ContextMenu/index.ts: clear - File:
packages/core/src/DropdownMenu/DropdownMenuDivider.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuItem.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuSubMenu.tsx: clear - File:
packages/core/src/DropdownMenu/renderDropdownItems.tsx: clear - File:
packages/core/src/Table/TableCell.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.loadFailure.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.modality.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.ssr.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.touch.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.tsx: clear - File:
packages/core/src/Table/TableHeaderCell.tsx: clear (main's cut-heading change merges cleanly beside the wrapper swap) - File:
packages/core/src/Table/TableHeaderCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableMenuWindowFocus.test.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.a11y.chromium.spec.ts: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.client.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.fixture.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.html: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.server.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.vite.mjs: clear - File:
packages/core/src/Table/__tests__/TableCutHeadingAfterPaint.interaction.browser.spec.ts: clear (pattern still matches the cutText chunk; not re-run on this head) - File:
packages/core/src/Table/__tests__/menuLoadScenario.tsx: clear - File:
packages/core/src/Table/__tests__/warmTableContextMenu.tsx: clear - File:
packages/core/src/Table/index.ts: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.tsx: clear - File:
packages/core/src/Table/tableContextActions.ts: clear - File:
packages/core/src/Table/tableContextMenu.test.tsx: clear - File:
packages/core/src/Table/tableContextMenu.tsx: clear - File:
scripts/check-component-import-boundaries.mjs: clear - File:
scripts/check-component-import-boundaries.test.mjs: clear - File:
scripts/shared-identity.baseline.json: clear
There was a problem hiding this comment.
Changes requested. The lazy cell menu holds up at this head, and CI's boundary check confirms the saving: Table's eager gzip falls from 122.1 KB to 54.3 KB. One figure fix is needed before approval.
- Found by CI:
docs/architecture/component-import-boundaries.mdsays Table carries 50.5 KB eager and that its costs are CI's printout, but CI's boundary check at this head prints 54.3 KB for Table, 18.3 KB for the Button tooltip crossing (record: 19.7 KB) and 22.4 KB for Link (record: 21.7 KB), so copy CI's figures into the record (windowing 3.6 KB too), update the two 50.5 KB lines in the description, and record a new/approve-specfor the new head.
Non-blocking: one line under Testing could say why the Button cut-label and Table cut-heading browser specs now match only the cutText-<hash>.js chunk, and the test tally there comes from an earlier head (81 files and 1,495 tests pass at this head).
Claims and files checked
Review mode: same-head; reason: none
- changed rules (0): none
- Claim: A table whose cells have no actions renders as before and loads no menu code: verified (
TableCellContextMenu.tsx:214; the no-load test; CI's boundary check shows no Table crossing into ContextMenu and Table's eager gzip falling from 122.1 KB to 54.3 KB). - Claim: A page with Table, Text and Button loads about 23 to 25 KB less first-load gzip in Vite, Rolldown and webpack (about 21 %): consistent with the esbuild reference-page run on this head (table page −26,486 B gzip, 21.0 %); the per-bundler matrix names an earlier head and was not re-run.
- Claim: A cell with actions renders its content and trigger at once and starts its menu load at its first client render after hydration: verified (
TableCellContextMenu.tsx:279,:380; the server-render test). - Claim: The content keeps its node, focus and state when the menu attaches, and the trigger box does not move: verified (body and header scenario tests; the Chromium box-and-axe case).
- Claim: An early right-click, Shift+F10 or long press is held and opens the menu once unless another press or key comes first, and the browser menu stays shut: verified (
TableCellContextMenu.tsx:262,:311-337; 14 touch tests; the header Shift+F10 test; three Chromium early-invocation cases). - Claim: A failed load keeps the table, drops the held invocation, returns the browser menu and asks the loader again later: verified (
TableCellContextMenu.tsx:67,:89,:102,:318; four load-failure tests, one asserting a single development warning). - Claim: No public API change, and no new prop, export or data attribute: verified (the API generator lists 0 rows for Core, the build package and the seven themes; the package exports reach none of the new modules).
- Claim: Action getters still resolve when the menu opens, and a loaded menu behaves as on main: verified (
tableContextMenu.tsx:89; ContextMenu and DropdownMenu suites pass). - Claim: The action helpers move to a dependency-free module with the public export unchanged: verified (
tableContextActions.ts:28,:41;Table/index.ts:63). - Claim: The trigger wrapper is shared by ContextMenu and the cell, the cell loads only the menu through the internal mode and the shared loader, and neither module is exported: verified (
ContextMenu.tsx:409;TableCellContextMenu.tsx:54). - Claim: Before the menu attaches the cell recognizes no gesture; a right-click is held as a point and a touch as its raw events, timed from the touch's start: verified (
TableCellContextMenu.tsx:165,:183; the detector-count and deadline touch tests). - Claim: Modules in the lazy graph import directly, and the seven item aliases get one-line modules so a single-file app still renders: verified (the single-bundle tests pass).
- Claim: The boundary check lists the two new base modules and drops the stale Table row: verified (
check-component-import-boundaries.mjs; its 35 tests; CI's boundary check passes at this head). - Claim: The governing records and claims listed under Authority: verified against the records, which are unchanged on today's main.
- Claim: The two Effects added name the system they sync: verified for the cell's two; ContextMenu adds two more layout Effects, which also name theirs (non-blocking).
- Claim: The per-bundler byte table, the menu page's added 0.35 KB and the static-graph figures: measured at earlier heads as stated; this head's esbuild run gives menu +340 B and table −26,486 B gzip, matching in size and direction.
- Claim: The boundary check prints Table's eager gzip as 50.5 KB, and the record carries that figure: false; CI's boundary check at this head prints 54.3 KB (blocking finding above).
- Claim: The red-first long-press-detector test, the new touch cases and the tests carried from the earlier port: verified (they pass; the red-first run against the port was not repeated).
- Claim: The Chromium cases for box stability, early right-click, Shift+F10 and long press, the Shift+F10 case needing a Linux run: verified (four pass in Chromium on Linux on this head).
- Claim: The measurement on top of the iOS long-press pull request: not re-run.
- Claim: The records changed and the writing-rubric results: verified against the four record edits, except that the import-boundaries costs were refreshed from the check's printout: false; CI prints Button 18.3 KB and Link 22.4 KB against the record's 19.7 KB and 21.7 KB (blocking finding above).
- Claim: The test tally of 72 files and 1,388 tests: stale; 81 files and 1,495 tests pass on this head (non-blocking).
- Claim: Typecheck, ESLint, Prettier, the knowledge check and the changeset check pass: Core typecheck and the knowledge check verified on this head; ESLint, Prettier and the changeset check not re-run.
- Claim: Overlap with other pull requests and the land path: two of the three listed pull requests are already on main and merged into this head; the rest is stated, not checked.
- Claim: Release note: a patch; menus load only for cells with actions; about 23 to 25 KB less first-load JavaScript; content keeps its node; early invocations are held; a failure returns the browser menu and retries; tests that expect a synchronous menu must wait;
resolveContextActionskeeps its export: verified as above, per-bundler figures not re-run. - File:
.changeset/table-cell-lazy-context-menu.md: clear - File:
docs/architecture/component-import-boundaries.md: blocking finding (the Table eager figure and the refreshed Button and Link costs differ from CI's printout at this head) - File:
docs/specs/components/ContextMenu/ContextMenu.spec.md: clear - File:
docs/specs/components/Table/TableCell.spec.md: clear - File:
docs/specs/components/Table/TableHeaderCell.spec.md: clear - File:
packages/core/src/Button/__tests__/ButtonCutLabel.interaction.browser.spec.ts: clear (pattern still matches the cutText chunk; not re-run on this head) - File:
packages/core/src/ContextMenu/ContextMenu.test.tsx: clear - File:
packages/core/src/ContextMenu/ContextMenu.tsx: clear (two layout Effects name their system; non-blocking description note) - File:
packages/core/src/ContextMenu/ContextMenuCheckboxItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuDivider.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuSubMenu.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuTrigger.tsx: clear - File:
packages/core/src/ContextMenu/index.ts: clear - File:
packages/core/src/DropdownMenu/DropdownMenuDivider.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuItem.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuSubMenu.tsx: clear - File:
packages/core/src/DropdownMenu/renderDropdownItems.tsx: clear - File:
packages/core/src/Table/TableCell.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.loadFailure.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.modality.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.ssr.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.touch.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.tsx: clear - File:
packages/core/src/Table/TableHeaderCell.tsx: clear (main's cut-heading change merges cleanly beside the wrapper swap) - File:
packages/core/src/Table/TableHeaderCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableMenuWindowFocus.test.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.a11y.chromium.spec.ts: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.client.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.fixture.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.html: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.server.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.vite.mjs: clear - File:
packages/core/src/Table/__tests__/TableCutHeadingAfterPaint.interaction.browser.spec.ts: clear (pattern still matches the cutText chunk; not re-run on this head) - File:
packages/core/src/Table/__tests__/menuLoadScenario.tsx: clear - File:
packages/core/src/Table/__tests__/warmTableContextMenu.tsx: clear - File:
packages/core/src/Table/index.ts: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.tsx: clear - File:
packages/core/src/Table/tableContextActions.ts: clear - File:
packages/core/src/Table/tableContextMenu.test.tsx: clear - File:
packages/core/src/Table/tableContextMenu.tsx: clear - File:
scripts/check-component-import-boundaries.mjs: clear - File:
scripts/check-component-import-boundaries.test.mjs: clear - File:
scripts/shared-identity.baseline.json: clear
… are CI's printout at this head
|
/approve-spec f882043 |
There was a problem hiding this comment.
Changes requested. The lazy cell menu holds up at this head: the jsdom suites, the four Chromium cases and CI's boundary check pass, and the record table now matches CI. One figure fix remains before approval:
- Found by CI: the description still says twice that the boundary check prints Table's eager gzip as 50.5 KB and that the record carries it, but CI prints 54.3 KB at this head, and the record's INV7 gap bullet (
docs/architecture/component-import-boundaries.md:295) now says 3.5 KB where CI and the allowlist row say 3.6 KB, so update both description lines, restore 3.6 KB there, and have an engineering owner (the author qualifies) comment/approve-specwith the new head's full SHA.
Non-blocking: TableCell PR1 could say when the load starts on a client-rendered first page, where the cell's first render is the page's first render, and the Testing tally is from an earlier head (81 files and 1,495 tests pass here).
Claims and files checked
Review mode: full; reason: spec-record
- Claim: A table whose cells have no actions renders as before and loads no menu code: verified (the cell returns its content untouched without actions; the no-load test; CI's boundary check shows no Table crossing into the menu and Table's eager gzip falling from 122.1 KB to 54.3 KB).
- Claim: A page with Table, Text and Button loads about 23 to 25 KB less first-load gzip in Vite, Rolldown and webpack (about 21 %): consistent with the boundary check at this head; the per-bundler matrix was measured at an earlier head and was not re-run.
- Claim: A cell with actions renders its content and trigger at once and starts its menu load on its first client render after hydration: verified (
TableCellContextMenu.tsx:279,:380; the server-render test). - Claim: The content keeps its node, focus and state when the menu attaches, and the trigger box does not move: verified (body and header load scenarios; the Chromium box-and-axe case passes here).
- Claim: An early right-click, Shift+F10 or long press is held and opens the menu once unless another press or key comes first, and the browser menu stays shut: verified (14 touch tests, the header Shift+F10 test, three Chromium early-invocation cases).
- Claim: A failed load keeps the table, drops the held invocation, returns the browser menu and asks the loader again later: verified (four load-failure tests, one asserting a single development warning).
- Claim: No public API change, and no new prop, export or data attribute: verified (the API generator lists 0 rows for Core, the build package and the seven themes).
- Claim: Action getters still resolve when the menu opens, and a loaded menu behaves as on main: verified (
tableContextMenu.tsxgetter path; ContextMenu and DropdownMenu suites pass; Storybook frames of a sortable header menu and the default ContextMenu are pixel-identical base to head). - Claim: The action helpers move to a dependency-free module with the public export unchanged: verified (
tableContextActions.ts;Table/index.ts:63). - Claim: The trigger wrapper is shared by ContextMenu and the cell, the cell loads only the menu through the internal mode and the shared loader, and neither module is exported: verified (
ContextMenu.tsx,TableCellContextMenu.tsx:54; no exports entry reaches them). - Claim: Before the menu attaches the cell recognizes no gesture; a right-click is held as a point and a touch as its raw events, timed from the touch's start: verified (the detector-count and deadline touch tests).
- Claim: Modules in the lazy graph import directly, and the seven item aliases get one-line modules: verified (the single-bundle tests pass).
- Claim: The boundary check lists the two new base modules and drops the stale Table row: verified (its 35 tests and the check pass here and in CI).
- Claim: The governing records and claims listed under Authority: verified against the records, which are unchanged on today's main.
- Claim: The two Effects added name the system they sync: verified for the cell's two; ContextMenu's two added layout Effects also name theirs.
- Claim: The per-bundler table, the menu page's added 0.35 KB and the static-graph figures: measured at an earlier head as stated; not re-run.
- Claim: The boundary check prints Table's eager gzip as 50.5 KB and the record carries that figure: false; CI prints 54.3 KB at this head and the record says 54.3 KB (blocking finding).
- Claim: The red-first long-press-detector test, the new touch cases and the tests carried from the earlier port: verified (they pass; the red-first run against the port was not repeated).
- Claim: The Chromium cases for box stability, early right-click, Shift+F10 and long press: verified (four pass in Chromium on Linux here).
- Claim: The measurement on top of the iOS long-press pull request: not re-run.
- Claim: Records changed and the writing-rubric results: verified, except that the import-boundaries costs were refreshed from the check's printout: false for the INV7 gap bullet, which says 3.5 KB against CI's 3.6 KB (blocking finding).
- Claim: The test tally of 72 files and 1,388 tests: stale; 81 files and 1,495 tests pass here (non-blocking).
- Claim: Typecheck, ESLint, Prettier, the knowledge check and the changeset check pass: typecheck and lint (formatting, ESLint, changeset coverage, boundary check) pass in CI at this head; the knowledge check was not re-run.
- Claim: Overlap with other pull requests and the land path: stated, not checked.
- Claim: Release note (patch): menus load only for cells with actions; about 23 to 25 KB less first-load JavaScript; content keeps its node; early invocations are held; a failure returns the browser menu and retries; tests that expect a synchronous menu must wait;
resolveContextActionskeeps its export: verified as above, per-bundler figures not re-run. - File:
.changeset/table-cell-lazy-context-menu.md: clear - File:
docs/architecture/component-import-boundaries.md: blocking finding (the INV7 gap bullet says 3.5 KB; CI and the allowlist row say 3.6 KB) - File:
docs/specs/components/ContextMenu/ContextMenu.spec.md: clear - File:
docs/specs/components/Table/TableCell.spec.md: clear - File:
docs/specs/components/Table/TableHeaderCell.spec.md: clear - File:
packages/core/src/Button/__tests__/ButtonCutLabel.interaction.browser.spec.ts: clear - File:
packages/core/src/ContextMenu/ContextMenu.test.tsx: clear - File:
packages/core/src/ContextMenu/ContextMenu.tsx: clear (two layout Effects sync the caller-rendered trigger) - File:
packages/core/src/ContextMenu/ContextMenuCheckboxItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuDivider.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuSubMenu.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuTrigger.tsx: clear - File:
packages/core/src/ContextMenu/index.ts: clear - File:
packages/core/src/DropdownMenu/DropdownMenuDivider.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuItem.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuSubMenu.tsx: clear - File:
packages/core/src/DropdownMenu/renderDropdownItems.tsx: clear - File:
packages/core/src/Table/TableCell.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.loadFailure.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.modality.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.ssr.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.touch.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.tsx: clear (non-blocking: the load moment on a client-rendered first page) - File:
packages/core/src/Table/TableHeaderCell.tsx: clear - File:
packages/core/src/Table/TableHeaderCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableMenuWindowFocus.test.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.a11y.chromium.spec.ts: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.client.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.fixture.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.html: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.server.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.vite.mjs: clear - File:
packages/core/src/Table/__tests__/TableCutHeadingAfterPaint.interaction.browser.spec.ts: clear - File:
packages/core/src/Table/__tests__/menuLoadScenario.tsx: clear - File:
packages/core/src/Table/__tests__/warmTableContextMenu.tsx: clear - File:
packages/core/src/Table/index.ts: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.tsx: clear - File:
packages/core/src/Table/tableContextActions.ts: clear - File:
packages/core/src/Table/tableContextMenu.test.tsx: clear - File:
packages/core/src/Table/tableContextMenu.tsx: clear - File:
scripts/check-component-import-boundaries.mjs: clear - File:
scripts/check-component-import-boundaries.test.mjs: clear - File:
scripts/shared-identity.baseline.json: clear
…6 KB windowing cost too
|
/approve-spec bda89a8 |
There was a problem hiding this comment.
Approved pending CI. CI has not run on this head yet: every check was skipped on the draft, and the merge guard needs the required checks green before merge.
The two figure fixes land: the description now gives Table's eager size as 54.3 KB, and the windowing gap bullet says 3.6 KB, matching the allowlist row and the boundary check. The jsdom suites (81 files, 1,495 tests), the four Chromium early-invocation cases, typecheck and the boundary check pass here, and the loaded menus render pixel-identical to main.
Non-blocking:
- TableCell and TableHeaderCell PR1 could say when the load starts on a page with no server markup, where the cell's first client render is the page's first render.
- The Authority section could name TableHeaderCell PR1 beside its FR3.
Claims and files checked
Review mode: full; reason: spec-record
- Claim: A table whose cells have no actions renders as before and loads no menu code: verified (the cell returns its content untouched without actions; the no-load test; the boundary check shows no Table crossing into the menu and Table's eager gzip at 54.3 KB, down from 122.1 KB).
- Claim: A page with Table, Text and Button loads 22.8 to 25.2 KB less first-load gzip in Vite, Rolldown and webpack (about 21 %): consistent with the boundary check at this head; the per-bundler matrix was measured at an earlier head and not re-run.
- Claim: A cell with actions renders its content and trigger at once and starts its menu load on its first client render after hydration: verified (
TableCellContextMenu.tsx:279,:380; the server-render test). - Claim: The content keeps its node, focus and state when the menu attaches, and the trigger box does not move: verified (body and header load scenarios; the Chromium box-and-axe case).
- Claim: An early right-click, Shift+F10 or long press is held and opens the menu once unless another press or key comes first, and the browser menu stays shut: verified (14 touch tests, the header Shift+F10 test, three Chromium early-invocation cases).
- Claim: A failed load keeps the table, drops the held invocation, returns the browser menu, and a later mount or invocation asks the loader again: verified (four load-failure tests, one asserting a single development warning).
- Claim: No public API change, and no new prop, export or data attribute: verified (the API surface generator lists 0 rows for Core, the build package and the seven themes).
- Claim: Action getters still resolve when the menu opens, and a loaded menu behaves as on main: verified (getter path in
tableContextMenu.tsx; ContextMenu and DropdownMenu suites; Storybook frames of a sortable header menu, an expandable-row cell menu and the default ContextMenu are pixel-identical base to head). - Claim: The action helpers move to a dependency-free module with the public export unchanged: verified (
tableContextActions.ts;Table/index.ts:63). - Claim: The trigger wrapper is shared by ContextMenu and the cell, the cell loads only the menu through the internal mode and the shared loader, and neither module is exported: verified (
ContextMenu.tsx,TableCellContextMenu.tsx:54; no exports entry reaches them). - Claim: Before the menu attaches the cell recognizes no gesture; a right-click is held as a point and a touch as its raw events, timed from the touch's start: verified (the detector-count and deadline touch tests).
- Claim: Modules in the lazy graph import directly, and the seven item aliases get one-line modules: verified (the single-bundle tests pass).
- Claim: The boundary check lists the two new base modules and drops the stale Table row: verified (its 35 tests and the check pass).
- Claim: The governing records and claims listed under Authority: verified against the records, which are unchanged on today's main; the header cell's load-moment clause is not listed there (non-blocking).
- Claim: The two added cell Effects name the system they sync: verified; ContextMenu's two added layout Effects also name theirs.
- Claim: The per-bundler table, the menu page's added 0.35 KB and the static-graph figures: measured at an earlier head as stated; not re-run.
- Claim: The boundary check prints Table's eager gzip as 54.3 KB and the record carries it: verified (a local run at this head prints 54.3 KB, as CI did at the previous head with identical code; CI's checks were skipped on this draft head).
- Claim: The red-first long-press-detector test, the new touch cases and the tests carried from the earlier port: verified (they pass; the red-first run against the port was not repeated).
- Claim: The Chromium cases for box stability, early right-click, Shift+F10 and long press: verified (four pass in Chromium on Linux).
- Claim: The measurement on top of the iOS long-press pull request: not re-run.
- Claim: Records changed and the writing-rubric results, including costs refreshed from the check's printout: verified for every cost the change edits; the untouched truncation-tooltip row still says 1.7 KB where the check prints 2.0 KB at base and head (inherited).
- Claim: The test tally of 81 files and 1,495 tests, and the 14 touch tests: verified (same tally here).
- Claim: Typecheck, ESLint, Prettier, the knowledge check and the changeset check pass: typecheck, ESLint (0 errors), Prettier and the knowledge check pass here; the changeset check was not re-run.
- Claim: The two browser specs match only the cut-text chunk itself: verified by reading the narrowed patterns.
- Claim: Overlap with other pull requests and the land path: stated, not checked.
- Claim: Release note (patch): menus load only for cells with actions; about 23 to 25 KB less first-load gzip; content keeps its node; early invocations are held; a failure returns the browser menu and retries; tests that expect a synchronous menu must wait;
resolveContextActionskeeps its export: verified as above, per-bundler figures not re-run. - File:
.changeset/table-cell-lazy-context-menu.md: clear - File:
docs/architecture/component-import-boundaries.md: clear (the 3.6 KB bullet now matches; the untouched truncation-tooltip row is inherited) - File:
docs/specs/components/ContextMenu/ContextMenu.spec.md: clear - File:
docs/specs/components/Table/TableCell.spec.md: clear (non-blocking: the load moment on a client-rendered first page) - File:
docs/specs/components/Table/TableHeaderCell.spec.md: clear (non-blocking: the same load-moment wording) - File:
packages/core/src/Button/__tests__/ButtonCutLabel.interaction.browser.spec.ts: clear - File:
packages/core/src/ContextMenu/ContextMenu.test.tsx: clear - File:
packages/core/src/ContextMenu/ContextMenu.tsx: clear (two layout Effects sync the caller-rendered trigger) - File:
packages/core/src/ContextMenu/ContextMenuCheckboxItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuDivider.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuSubMenu.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuTrigger.tsx: clear - File:
packages/core/src/ContextMenu/index.ts: clear - File:
packages/core/src/DropdownMenu/DropdownMenuDivider.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuItem.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuSubMenu.tsx: clear - File:
packages/core/src/DropdownMenu/renderDropdownItems.tsx: clear - File:
packages/core/src/Table/TableCell.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.loadFailure.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.modality.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.ssr.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.touch.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.tsx: clear - File:
packages/core/src/Table/TableHeaderCell.tsx: clear - File:
packages/core/src/Table/TableHeaderCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableMenuWindowFocus.test.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.a11y.chromium.spec.ts: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.client.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.fixture.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.html: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.server.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.vite.mjs: clear - File:
packages/core/src/Table/__tests__/TableCutHeadingAfterPaint.interaction.browser.spec.ts: clear - File:
packages/core/src/Table/__tests__/menuLoadScenario.tsx: clear - File:
packages/core/src/Table/__tests__/warmTableContextMenu.tsx: clear - File:
packages/core/src/Table/index.ts: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.tsx: clear - File:
packages/core/src/Table/tableContextActions.ts: clear - File:
packages/core/src/Table/tableContextMenu.test.tsx: clear - File:
packages/core/src/Table/tableContextMenu.tsx: clear - File:
scripts/check-component-import-boundaries.mjs: clear - File:
scripts/check-component-import-boundaries.test.mjs: clear - File:
scripts/shared-identity.baseline.json: clear
| menu loads only when actions are given. A cell with actions starts the | ||
| menu load at its first client render after the hydrating render, before |
There was a problem hiding this comment.
Non-blocking: on a page with no server markup, useIsHydrating is false from the first render (TableCellContextMenu.tsx:279, :380), so the menu starts loading during the page's first render, while architecture:component-import-boundaries INV2 lets a record name a moment "after the page's first render". One clause naming the client-rendered case would settle it, here and in component:TableHeaderCell PR1.
|
/approve-spec 4210440 |
There was a problem hiding this comment.
Approved pending CI. CI is running on this head now that the pull request is out of draft, and the merge guard needs the required checks green before merge.
So far at this head the import-boundary check holds and prints Table's eager size at 54.3 KB (down from 122.2 KB), and lint, typecheck, the builds, the node test shards, visual regression and most accessibility jobs pass; the UI, interaction and remaining accessibility shards are still running. No change is needed from the author.
Non-blocking:
- TableCell and TableHeaderCell PR1 could say when the load starts on a page with no server markup, where the cell's first client render is the page's first render.
- The Authority section could name TableHeaderCell PR1 beside its FR3.
Claims and files checked
Review mode: same-head; reason: none
- changed rules (0): none, the recipe is unchanged since the last review
- Claim: A table whose cells have no actions renders as before and loads no menu code: verified (
TableCellContextMenu.tsx:214-215returns the content untouched; the no-load test; CI's boundary check at this head shows no Table crossing into the menu and Table's eager gzip at 54.3 KB, down from 122.2 KB). - Claim: A page with Table, Text and Button loads 22.8 to 25.2 KB less first-load gzip in Vite, Rolldown and webpack (about 21 %): consistent with the boundary check at this head; the per-bundler matrix was measured at an earlier head and not re-run.
- Claim: A cell with actions renders its content and trigger at once and starts its menu load on its first client render after hydration: verified (
TableCellContextMenu.tsx:279,:380; the server-render test). - Claim: The content keeps its node, focus and state when the menu attaches, and the trigger box does not move: verified (body and header load scenarios; the Chromium box-and-axe case).
- Claim: An early right-click, Shift+F10 or long press is held and opens the menu once unless another press or key comes first, and the browser menu stays shut: verified (14 touch tests, the header Shift+F10 test, three Chromium early-invocation cases on Linux).
- Claim: A failed load keeps the table, drops the held invocation, returns the browser menu, and a later mount or invocation asks the loader again: verified (four load-failure tests, one asserting a single development warning).
- Claim: No public API change, and no new prop, export or data attribute: verified (the API surface generator lists 0 rows for Core, the build package and the seven themes; the ContextMenu index re-exports only its existing names).
- Claim: Action getters still resolve when the menu opens, and a loaded menu behaves as on the base: verified (getter path in
tableContextMenu.tsx; ContextMenu and DropdownMenu suites; the sortable header menu, an expandable-row cell menu and the default ContextMenu capture pixel-identical base to head). - Claim: The action helpers move to a dependency-free module with the public export unchanged: verified (
tableContextActions.ts;Table/index.ts:63). - Claim: The trigger wrapper is shared by ContextMenu and the cell, the cell loads only the menu through the internal mode and the shared loader, and neither module is exported: verified (
ContextMenu.tsx:409,TableCellContextMenu.tsx:54; no exports entry reaches them). - Claim: Before the menu attaches the cell recognizes no gesture; a right-click is held as a point and a touch as its raw events, timed from the touch's start: verified (the detector-count and deadline touch tests).
- Claim: Modules in the lazy graph import directly, and the seven item aliases get one-line modules: verified (the single-bundle tests pass).
- Claim: The boundary check lists the two new base modules and drops the stale Table row: verified (the script, its test, and CI's check holding at this head).
- Claim: The governing records and claims listed under Authority: verified against the records, which are unchanged on today's main; the header cell's load-moment clause is not listed there (non-blocking).
- Claim: The two added cell Effects name the system they sync: verified; ContextMenu's two added layout Effects also name theirs.
- Claim: The per-bundler table, the menu page's added 0.35 KB and the static-graph figures: measured at an earlier head as stated; not re-run.
- Claim: CI's printout at this head puts Table's eager gzip at 54.3 KB and the record carries it: verified (CI's lint job at this head prints 54.3 KB; it prints the base as 122.2 KB where the description says 122.1 KB for main, a base-side rounding difference).
- Claim: The red-first long-press-detector test, the new touch cases and the tests carried from the earlier port: verified that they exist and pass; the red-first run against the port was not repeated.
- Claim: The Chromium cases for box stability, early right-click, Shift+F10 and long press: verified (four pass in Chromium on Linux, the Shift+F10 case included).
- Claim: The measurement on top of the iOS long-press pull request: not re-run.
- Claim: Records changed and the writing-rubric results, including costs refreshed from the check's printout: verified for every cost the change edits; the untouched truncation-tooltip row still says 1.7 KB where the check prints 2.0 KB (inherited).
- Claim: The test tally of 81 files and 1,495 tests, and the 14 touch tests: verified that all pass and that the touch file holds 14 tests; this head runs 1,497 tests, two more from merges of main.
- Claim: Typecheck, ESLint, Prettier, the knowledge check and the changeset check pass: verified (CI's typecheck and lint jobs pass at this head, the knowledge and changeset checks included).
- Claim: The two browser specs match only the cut-text chunk itself: verified by reading the narrowed patterns.
- Claim: Overlap with other pull requests and the land path: stated, not checked.
- Claim: Release note (patch): menus load only for cells with actions; about 23 to 25 KB less first-load gzip; content keeps its node; early invocations are held; a failure returns the browser menu and retries; tests that expect a synchronous menu must wait;
resolveContextActionskeeps its export: verified as above, per-bundler figures not re-run. - File:
.changeset/table-cell-lazy-context-menu.md: clear - File:
docs/architecture/component-import-boundaries.md: clear (every edited cost matches CI's check; the untouched truncation-tooltip row is inherited) - File:
docs/specs/components/ContextMenu/ContextMenu.spec.md: clear - File:
docs/specs/components/Table/TableCell.spec.md: clear (non-blocking: the load moment on a client-rendered first page) - File:
docs/specs/components/Table/TableHeaderCell.spec.md: clear (non-blocking: the same load-moment wording) - File:
packages/core/src/Button/__tests__/ButtonCutLabel.interaction.browser.spec.ts: clear - File:
packages/core/src/ContextMenu/ContextMenu.test.tsx: clear - File:
packages/core/src/ContextMenu/ContextMenu.tsx: clear (two layout Effects sync the caller-rendered trigger) - File:
packages/core/src/ContextMenu/ContextMenuCheckboxItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuDivider.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioGroup.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuRadioItem.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuSubMenu.ts: clear - File:
packages/core/src/ContextMenu/ContextMenuTrigger.tsx: clear - File:
packages/core/src/ContextMenu/index.ts: clear - File:
packages/core/src/DropdownMenu/DropdownMenuDivider.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuItem.tsx: clear - File:
packages/core/src/DropdownMenu/DropdownMenuSubMenu.tsx: clear - File:
packages/core/src/DropdownMenu/renderDropdownItems.tsx: clear - File:
packages/core/src/Table/TableCell.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.loadFailure.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.modality.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.ssr.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.touch.test.tsx: clear - File:
packages/core/src/Table/TableCellContextMenu.tsx: clear - File:
packages/core/src/Table/TableHeaderCell.tsx: clear - File:
packages/core/src/Table/TableHeaderCellContextMenu.test.tsx: clear - File:
packages/core/src/Table/TableMenuWindowFocus.test.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.a11y.chromium.spec.ts: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.client.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.fixture.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.html: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.server.tsx: clear - File:
packages/core/src/Table/__tests__/TableCellMenuLoad.vite.mjs: clear - File:
packages/core/src/Table/__tests__/TableCutHeadingAfterPaint.interaction.browser.spec.ts: clear - File:
packages/core/src/Table/__tests__/menuLoadScenario.tsx: clear - File:
packages/core/src/Table/__tests__/warmTableContextMenu.tsx: clear - File:
packages/core/src/Table/index.ts: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.test.tsx: clear - File:
packages/core/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx: clear - File:
packages/core/src/Table/plugins/sortable/useTableSortable.tsx: clear - File:
packages/core/src/Table/tableContextActions.ts: clear - File:
packages/core/src/Table/tableContextMenu.test.tsx: clear - File:
packages/core/src/Table/tableContextMenu.tsx: clear - File:
scripts/check-component-import-boundaries.mjs: clear - File:
scripts/check-component-import-boundaries.test.mjs: clear - File:
scripts/shared-identity.baseline.json: clear
…lick, so it opens the menu without also sorting the column
|
/approve-spec 5a99cb1 |
There was a problem hiding this comment.
Changes requested. The lazy menu load, the held early invocations and the four record edits, which an engineering owner approved for this head, check out; one change in the newest commit blocks approval.
- Blocking: the new lift check in
TableCellContextMenu.tsx(isHeldLongPressand thepreventDefaultit drives inonTouchEnd) recognizes a long press in the cell's base import before the menu loads, whicharchitecture:component-import-boundariesINV2 ("they recognize no gesture") and INV8 rule out and this pull request does not amend, so either amend those clauses with an engineering owner and take the rule and the click suppression from the shared long-press detector and click guard, or leave the lift to the loaded menu, and in both cases correct the file header and the description's "the cell's listeners recognize no gesture".
Non-blocking: the clause that cancels a gesture's touchend is spec:AST-094 FR21, not FR35; and the TableCell and TableHeaderCell PR1 load moment could say what happens on a page with no server markup, where the cell's first client render is the page's first render.
Claims and files checked
Review mode: full; reason: spec-record
- Tables whose cells have no actions load no menu code: verified (
TableCellContextMenu.tsx:248-250, the no-load test; the boundary check shows Table's eager size at 54.4 KB against 122.2 KB on the base). - A Table, Text and Button page loads 22.8 to 25.2 KB less first-load JavaScript in three bundlers: measured at an earlier head and not re-run; consistent with the boundary check.
- A cell with actions renders its trigger at once and starts its menu load on its first client render after hydration: verified (
:313,:421-429; the server-render test). - Content keeps its node, focus and state, and the trigger box does not move: verified in the body and header load scenarios; the Chromium box case was not run at this head.
- An early right-click, Shift+F10 or long press is held and opens the menu once unless another press or key comes first: verified (16 touch tests, the header Shift+F10 test, the modality test).
- A failed load keeps the table, drops the hold, returns the browser menu, warns once and retries: verified (four load-failure tests).
- No public API change and no new prop, export or data attribute: verified (the API surface generator lists no changed row).
- The action helpers move to a dependency-free module with the public export unchanged: verified (
tableContextActions.ts,Table/index.ts:63). - The trigger module is shared, the cell loads only the menu through the internal mode and the shared loader, and neither is exported: verified.
- Before the menu attaches, the cell's listeners recognize no gesture: false at this head (
isHeldLongPress,TableCellContextMenu.tsx:192-215). - A held touch reaches the loaded detector as raw events, timed from the touch's start: verified (the deadline test).
- The lazy graph imports modules directly and the item aliases have their own modules: verified (the single-bundle test).
- The boundary check lists the two new base modules and drops the stale Table row: verified.
- The governing records under Authority: verified, except that the lift check conflicts with INV2 and INV8; the TableHeaderCell PR1 load moment is not listed.
- The two cell Effects name the system they sync: verified.
- The measurement on top of the iOS long-press pull request: not re-run.
- A long press lifted before the menu loads makes no click, while a tap or a moved press keeps its click: verified (the new test fails on the previous head and passes here); the cited clause should be FR21.
- 81 test files and 1,499 tests pass: verified.
- The touch file holds 16 tests and the load-failure test asserts one warning: verified.
- The lift test is red on the previous head and the tap test passes on both: verified.
- The boundary-check and single-bundle node tests pass: verified.
- The boundary check holds, Table carries 54.4 KB eager and the lift check adds 0.1 KB: verified; the base tree prints 122.2 KB where the description says 122.1 KB.
- The two browser specs match only the cutText chunk: verified by reading the patterns.
- The new allowlist row costs 0.0 KB: verified.
- The local Playwright runs: not re-run.
- Typecheck, lint, formatting, knowledge and changeset checks pass: Core typecheck, ESLint on the changed cell files and the knowledge check pass here; formatting and the changeset check were not run.
- Overlap with other pull requests and the land path: stated, not checked.
- The release note: verified as above; the per-bundler figures were not re-run.
- File
packages/core/src/Table/TableCellContextMenu.tsx: blocking finding (pre-load long-press check, stale header). - Files
docs/specs/components/Table/TableCell.spec.md,docs/specs/components/Table/TableHeaderCell.spec.md: clear (non-blocking: the load moment on a page with no server markup). - Files
.changeset/table-cell-lazy-context-menu.md,docs/architecture/component-import-boundaries.md,docs/specs/components/ContextMenu/ContextMenu.spec.md: clear. - Files
packages/core/src/ContextMenu/ContextMenu.tsx,ContextMenuTrigger.tsx,index.ts,ContextMenuCheckboxItem.ts,ContextMenuDivider.ts,ContextMenuGroup.ts,ContextMenuItem.ts,ContextMenuRadioGroup.ts,ContextMenuRadioItem.ts,ContextMenuSubMenu.ts,ContextMenu.test.tsx: clear. - Files
packages/core/src/DropdownMenu/DropdownMenuDivider.tsx,DropdownMenuItem.tsx,DropdownMenuSubMenu.tsx,renderDropdownItems.tsx: clear. - Files
packages/core/src/Table/TableCell.tsx,TableHeaderCell.tsx,tableContextMenu.tsx,tableContextActions.ts,index.ts,plugins/rowExpansion/useTableRowExpansion.tsx,plugins/sortable/useTableSortable.tsx: clear. - Files
packages/core/src/Table/TableCellContextMenu.loadFailure.test.tsx,.modality.test.tsx,.ssr.test.tsx,.test.tsx,.touch.test.tsx,TableHeaderCellContextMenu.test.tsx,TableMenuWindowFocus.test.tsx,tableContextMenu.test.tsx,plugins/rowExpansion/useTableRowExpansion.test.tsx,plugins/sortable/useTableSortable.test.tsx: clear. - Files
packages/core/src/Table/__tests__/TableCellMenuLoad.a11y.chromium.spec.ts,TableCellMenuLoad.client.tsx,TableCellMenuLoad.fixture.tsx,TableCellMenuLoad.html,TableCellMenuLoad.server.tsx,TableCellMenuLoad.vite.mjs,TableCutHeadingAfterPaint.interaction.browser.spec.ts,menuLoadScenario.tsx,warmTableContextMenu.tsx, andpackages/core/src/Button/__tests__/ButtonCutLabel.interaction.browser.spec.ts: clear. - Files
scripts/check-component-import-boundaries.mjs,scripts/check-component-import-boundaries.test.mjs,scripts/shared-identity.baseline.json: clear.
| // A loaded menu opens under a held finger, so the lift's click | ||
| // never reaches the content. Before the menu loads, cancel the | ||
| // lift of a long press: the browser then makes no click, and the | ||
| // content (a sort button) does not act on the menu's gesture. | ||
| if (isHeldLongPress(heldTouchRef.current, event)) { | ||
| event.preventDefault(); | ||
| } |
There was a problem hiding this comment.
Blocking: this lift check recognizes a long press (one finger, LONG_PRESS_DURATION_MS since the touch start, within LONG_PRESS_ALLOWABLE_MOVEMENT_PX) in the pre-load listener, which architecture:component-import-boundaries INV2 ("they recognize no gesture") and INV8 (telling a tap from a scroll belongs to the loaded surface) rule out, and this pull request leaves them unamended. It also copies the rule createLongPressDetector applies and cancels the touchend with a bare preventDefault instead of the shared click guard (armClickGuard). Either amend INV2/INV8 with an engineering owner and take the rule and the click suppression from those shared owners, or leave the lift to the loaded menu; the file header at lines 14-15 and the description's "the cell's listeners recognize no gesture" need the same correction.
… lift makes no click before its surface loads (INV2, INV8)
Primary intent
A page that renders a Table whose cells have no context-menu actions no longer downloads the context menu. Today every Table, TableCell and TableHeaderCell import pulls in ContextMenu, DropdownMenu's menu code and the touch sheet, even when no column defines actions. This is a performance change with no product behavior change, which none of the narrower templates covers.
This PR supersedes #8403 by @rhagigi, ported onto current
main, and keeps @rhagigi as co-author. On top of that port it changes how a touch made before the menu code arrives is handled (see below), and it updates the import-boundary check and its record now that the Table crossing is gone.User or maintainer impact
data-*attributes. Action getters still resolve when the menu opens. A loaded menu behaves exactly as onmain.Problem and solution fit
resolveContextActionsand a newhasContextActionsmove to a dependency-freetableContextActions.ts, so cells and plugins read actions without importing the menu. The public export is unchanged.ContextMenuTrigger(the trigger wrapper and its 1px cursor anchor, no menu code) is shared by ContextMenu and the cell. The cell renders it around its content and lazy-loads only the menu beside it through the internalContextMenuForTriggermode and the sharedcreateModuleLoader. Neither module is exported publicly.architecture:component-import-boundariesDEC-6, below): a right-click or Shift+F10 is held as a point in the trigger, and a touch is held as its raw touch events, which the loaded menu's own long-press detector reads in order when it attaches. The press is timed from the touch's own start. (perf(Table): load the cell context menu only when a cell has actions #8403 ran a second long-press recognizer in the cell before load; that is the change from the port.)ContextMenu/ContextMenuTriggerandLayer/gestureCounteras base code in surface folders, and the staleTable/tableContextMenu → ContextMenuallowlist row is removed.Authority
architecture:component-import-boundariesINV1–INV6: the menu is a surface revealed by interaction and loads through the shared module loader; the trigger contract is complete before load; an early intent is replayed once; the load moves no box; a failed load leaves the page working. INV2's "named moment after the first render" is named incomponent:TableCellPR1.component:TableCellPR1 ("a context menu loads only when actions are given"), FR4;component:TableHeaderCellFR3.component:ContextMenuFR1, FR10 (implementation gap note now names the cell's internal path).architecture:react-component-runtimeINV2/INV3 (interaction work in callbacks; the two Effects added name the system they sync: the shared hold's lifetime and a failed load).spec:AST-013FR9: the lazy menu is kept out of server markup and the hydrating render.Change and evidence
First-load bytes
Real bundlers, from the repository's first-load matrix (base
55674f90c2a, the merge base withmain→ headb1903553fb1; Core built asbuild:esm; React, React DOM and StyleX external; gzip in KB of 1,024 B; chunks are first-load requests):The menu page uses ContextMenu, so it pays for the trigger contract that now lives in its own module (
ContextMenuTrigger), about 0.35 KB. Under Rolldown, the table page's first load splits into 7 requests instead of 5.Static graph (
pnpm size:pageswith its module-count and depth report, esbuild; structural evidence, not the headline): table page −25,449 B gzip, static modules 635 → 616, module depth 12 → 12, chunks 13 → 13 (chunk depth 2); menu page +351 B gzip, static modules 266 → 272, module depth 8 → 8, chunks 11 → 11; docs and form +0. The import-boundary check passes, and the boundary check's printout at this head puts Table's eager gzip at 54.4 KB (main 122.1 KB); the record carries that figure.Behavior checks
TableCellMenuLoad.a11y.chromium.spec.ts, a server-rendered, hydrated fixture whose server holds the menu chunk): a new case shows the cell's, trigger's and button's boxes are identical before and after the menu loads, axe reports no violation before or after, and the loaded menu opens on the first right-click. Existing cases cover a right-click, Shift+F10 and a long press made before the chunk arrives.Not covered: WebKit, recovery after a failed native chunk load in a real browser, and focus-ring pixels.
#8125 on top of this change (table page)
pnpm size:pages, this head (main 5b44d9a0 merged) against this head plus #8125's source (9cfc2fa), first-load gzip:So on top of this change, #8125 adds 57 B to the table page, under INV10's 307 B. Without this change, main's table page reached the whole ContextMenu. The measurement leaves out #8125's edits to
ContextMenu.tsxitself: those don't merge cleanly onto this head, and the table page reaches that module only on demand here, so they don't change its first load. #8125's shared gesture and Layer changes are included.Writing rubric results
Records changed:
architecture:component-import-boundaries(base-code list gainsContextMenu/ContextMenuTriggerandLayer/gestureCounter; the Table allowlist row and its current-state bullet are removed; one new allowlist row,Table/TableCellContextMenu→Layer/gestureCounter, at 0.0 KB; costs refreshed from the check's printout),component:TableCell(PR1 names when the load starts and how an early invocation is replayed;verified_byand the PR1 verification row list the tests),component:ContextMenu(Owns lines forContextMenuTriggerandContextMenuForTrigger; FR10's gap note names the cell's internal path),component:TableHeaderCell(PR1 "Resources": the cell's only state stays FR2's cut-heading tooltip, and a header cell with actions starts the menu load at the same moment ascomponent:TableCellPR1, with an early invocation held and replayed once; its verification row names the early Shift+F10 case and two gaps).Scope
Components: Table, TableCell, TableHeaderCell, ContextMenu, DropdownMenu (direct imports only)
A long press lifted before the menu loads
Before the menu chunk arrives, a cell only holds a touch. A finger that lifts after the long-press time but before the chunk lands (a cold load) used to keep its click: on a header the column sorted at the lift, and then the held long press opened the menu. On a loaded cell the menu opens under the finger mid-hold, so the click never reaches the cell's content. Now a held lift that is already a long press (one finger, down for the long-press time, never past the movement tolerance) cancels its
touchend, so the browser makes no click, as the menu press model already does (spec:AST-094FR21). A tap, or a press that moved, keeps its click before and after the load, so a short tap on a heading still sorts.Owner decision needed (proposal in this PR). That lift check is gesture judgement in the cell's base import, which
architecture:component-import-boundariesINV2 and INV8 rule out. This PR proposes DEC-6 (Decider: pending owner approval), a narrow amendment: before its surface loads, a trigger that holds a touch cancels the lift of a press that is already a long press by the shared long-press numbers. It starts no timer, opens nothing, and the loaded menu still recognizes the press; +0.1 KB eager. The alternative is to load the Table context menu after first paint instead, which keeps INV2/INV8 as written, but every page with such a table pays for the menu. The pull request does not merge before the owner picks.Testing
vitest run packages/core/src/Table packages/core/src/ContextMenu packages/core/src/DropdownMenuafter mergingmain: 81 files, 1,499 tests pass.TableCellContextMenu.touch.test.tsx: "cancels the lift of a press held past the deadline before the menu loads, so the lift adds no click" is red on the previous head; "keeps the click of a tap before and after the menu loads, and of a moved press" passes on both.vitest run packages/core/src/Table/TableCellContextMenu*: touch tests (now 16: a press that strays past the move tolerance and comes back before the menu loads opens nothing, red on the previous head), load failure (now asserts one development warning, red on the previous head), modality, SSR and header-cell tests pass.vitest run --project node scripts/check-component-import-boundaries.test.mjs scripts/core-single-bundle.test.mjs: pass.pnpm check:component-import-boundaries: boundaries hold; Table eager 54.4 KB gzip (main 122.1 KB). The long-press lift check below adds 0.1 KB.cutText-<hash>.jschunk: the lazy menu splits outcutTextOnKeyboardFocus-<hash>.js, which the old pattern also matched. One new allowlist row,Table/TableCellContextMenu→Layer/gestureCounter(INV8, 0.0 KB: Text's own row already brings the module).playwright test TableCellMenuLoad.a11y.chromium.spec.ts(Chromium, run locally one case at a time with--single-process, which the local sandbox requires): the new box-and-axe case, the early right-click case and the early long-press case pass. The Shift+F10 case could not run locally: Chromium on macOS sends nocontextmenuevent for Shift+F10, so it needs the Linux CI run.pnpm -F @astryxdesign/core typecheck, ESLint and Prettier on changed files,pnpm check:knowledge,pnpm check:changesets: pass.Overlap checked: #11859 (menu press fix; shares DropdownMenuItem and DropdownMenuSubMenu, merges first), #8125 (iOS long-press ContextMenu, which this unblocks; merges first), #8080 (DropdownMenu device work; merges first)
Owner: @cixzhang; the Astryx fix loop shepherds it to merge. Land path: CodeBunny approval of the exact head, Specs stamp, CI, then the merge queue after #11859, #8080 and #8125.
Co-authored-by: Royi Hagigi (@rhagigi), from #8403.