Skip to content

perf(Table): load the cell context menu only when a cell has actions - #8403

Closed
rhagigi wants to merge 36 commits into
meta:mainfrom
rhagigi:perf/table-context-menu-lazy
Closed

rhagigi wants to merge 36 commits into
meta:mainfrom
rhagigi:perf/table-context-menu-lazy

Conversation

@rhagigi

@rhagigi rhagigi commented Oct 25, 2026 •

Copy link
Copy Markdown

Primary intent

Load the table-cell context menu only for cells with contextMenuActions. Static imports currently pull the menu and its dependencies into every Table, TableCell and TableHeaderCell, including tables that never show a menu. Separating that code reduces the cells' eager JavaScript. This is a performance change, which none of the narrower templates covers.

User or maintainer impact

Cells without actions render as before and do not import the menu. With actions, the cell renders its content and trigger immediately; the menu loads beside them after hydration, without replacing the content or losing its state and focus.

A right-click, Shift+F10 or long press before the load is held until the menu attaches. Only the latest cell's invocation is held, and a later press or key cancels it. Long presses keep the loaded menu's deadline, movement tolerance and lift behavior. A failed import leaves the table mounted, ends any pending early press, drops its invocation and restores native context-menu handling. A new mount or a later invocation can ask the loader again; this does not guarantee that a native browser import will refetch a failed module or recover a removed chunk.

There is no public API change. Action getters still resolve when the menu opens, and ordinary ContextMenu behavior is unchanged.

Problem and solution fit

  • Move resolveContextActions and hasContextActions into a dependency-free module so cells, Table and its plugins can read actions without importing the menu. Existing resolver exports remain available.
  • Render a shared ContextMenuTrigger around caller content and lazy-load only its menu sibling. ContextMenuForTrigger uses the same menu implementation with the cell's trigger and anchor; it is not exported from the package.
  • Use createModuleLoader instead of duplicating its one-pending-load, success-cache and rejection-reset logic. The lazy failure fallback and cell cleanup remain unchanged.
  • Keep the lazy menu out of server and hydrating markup. Start shared input-modality tracking with the trigger, before an early invocation can arrive.
  • Inside the lazily loaded menu graph, import Core modules directly, not through folder barrels, so an app bundled into one esbuild file still renders. Keep the cells' one held invocation under a shared realm key, so every copy of Core on a page uses the same hold.
  • Fix the code-split check in scripts/core-single-bundle.test.mjs to read the app's own entry. It took the first entry esbuild listed, which can be one of Core's lazy modules; the new lazy menu changed that order.
  • Hold an early invocation as a point in the trigger's own box, and replay it through an internal openAtTriggerPoint with the trigger as the focus fallback. A scroll during the load then keeps the menu on the content. ContextMenu and the cell share the contextMenuPoint and longPressPoint helpers in ContextMenuTrigger.
  • Give each of ContextMenu's seven item aliases (ContextMenuItem, ContextMenuDivider, ContextMenuGroup, ContextMenuCheckboxItem, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSubMenu) a one-line module that the ContextMenu index re-exports. With the menu split, an alias imported alone from the package entry otherwise reached ContextMenu. Names and types are unchanged; the generated API report matches main's.

Authority

  • component:TableCell PR1: menu code loads only when actions are given. Its verification row names the tests and states how the contract holds across the menu load: an early invocation is held and replayed once, and a failed load keeps the table and returns the native menu. An engineering owner approved this row as a consistency change.
  • component:TableCell FR4 and component:TableHeaderCell FR3: preserve the full-cell trigger, density padding and action-getter behavior.
  • component:ContextMenu FR1/FR10: preserve its invocation wiring and one open-state owner. FR10 still records the headless-menu implementation gap. Its gap note now also names the table cell's internal ContextMenuForTrigger path and the cell's held invocation.
  • architecture:component-style-authoring INV6/INV7: report import sizes and keep the trigger wrapper and cursor anchor, with no additional caller-content DOM.
  • spec:AST-013 FR9 and architecture:interaction-modality INV1: match server/hydrating markup and let programmatic menu focus follow the input that opened it.

Change and evidence

Component size

The following measurements compare main at 3582c71f (this branch's merge base) with this branch at 23f819a1, using pnpm -F @astryxdesign/core build and node .github/scripts/analyze-pr.js --main-record. The analyzer estimates a component's eager import-closure JavaScript and its CSS in the package stylesheet, not the JavaScript a particular page downloads. Bytes, gzip:

Component JS base JS head JS change CSS base CSS head CSS change
TableCell 113,136 18,118 −95,018 18,306 18,306 0
TableHeaderCell 112,670 17,740 −94,930 18,075 18,075 0
Table 128,931 59,154 −69,777 18,725 18,725 0
ContextMenu 111,878 112,150 +272 17,821 17,821 0
ContextMenuItem 33,288 30,747 −2,541 6,462 6,403 −59
Markdown 193,211 176,888 −16,323 21,120 21,120 0
TableRow, TableBody unchanged 0 unchanged 0

The cell's own share includes about 4.7 KB that main added recently: its input-modality module now also loads the keyboard-height tracker, and the cell starts modality tracking up front.

Markdown renders Table, so its import estimate no longer includes the table menu.

The analyzer measures only ContextMenuItem among the aliases. The same esbuild setup, importing each alias alone from the package entry, gives these eager gzip sizes (base → head): ContextMenuItem 36,245 → 33,784, ContextMenuDivider 7,074 → 7,175, ContextMenuGroup 10,891 → 10,891, ContextMenuCheckboxItem 37,823 → 38,128, ContextMenuRadioGroup 11,414 → 11,623, ContextMenuRadioItem 37,888 → 38,213, ContextMenuSubMenu 88,839 → 86,796. Without the per-alias modules each reached about 125 KB. These are esbuild measurements of one import; they do not cover other bundlers, real pages or paint.

Behavior checks

Body- and header-cell tests check the same content nodes, edited input, button state, one mount and retained focus after the menu loads, plus keyboard opening, ArrowDown and Escape focus return. Other cases cover no-action imports, an already-loaded menu, early touch and tap, competing cells, and cancellation by a later press or key.

The server-render test runs three fresh module graphs through renderToString and hydrateRoot, with no recoverable hydration errors. The early-mouse test checks that the first menu row receives a focus call with focusVisible: false. Rejection tests preserve the cell node and page content, allow a later native context-menu event, and retry through a new root or an invocation on the existing cell. A touch begun before rejection cannot open the retried menu on its own.

Further jsdom tests cover a held right-click that keeps its point in the cell across a scroll during the load, the trigger passed as the focus fallback, and a cell that unmounts before the load: it drops its own hold, and another cell's hold survives. The unmount test fails without the cleanup.

TableCellMenuLoad.a11y.chromium.spec.ts runs in Chromium. It builds a small fixture from source with Vite and astryxStylex, as Storybook does, so it needs no Core build. The server build renders a table with React, the browser hydrates it, and the spec's local server holds the menu chunk until the test releases it. For a right-click, Shift+F10 and a touch long press that arrive first, it checks that the browser's own menu stays shut (each contextmenu arrives with its default prevented), that the menu opens once when the chunk arrives, at the pointer or finger, with focus on its first row, and that Escape hands focus back. After the right-click the first row has no keyboard focus ring. Hydration reports no recoverable error, and the page logs no error. With the replay removed, all three cases fail.

Fail-before controls catch content remounting, lost early invocations, hydration aborts, wrong focus options, import rejection escaping render, and a pending long-press timer surviving failure. The jsdom tests use a mocked loader; the Chromium spec uses a source build and a held chunk, but it does not prove recovery after a failed native chunk load, WebKit behavior or focus-ring pixels. The focus-fallback test checks that the trigger's focus is called; the trigger is not a focusable element by itself.

Writing rubric results

TableCell.spec.md adds the five test files to verified_by, and its PR1 verification row cites them in place of the gap it recorded, including how the contract holds across the menu load. ContextMenu.spec.md adds two sentences to FR10's implementation gap and its current-state note: table cells open the same menu through the internal ContextMenuForTrigger mode, and the cell holds an early invocation.

R1 narration: none; the TableCell row states what the tests check, and the FR10 sentences state how cells open the menu now, in the present tense.
R2 research: none added to the record.
R3 evidence: the TableCell row names test files, not a pull request or commit; the FR10 sentences cite no evidence.
R4 rejected alternatives: none added.
R5 change references: none added.
R6 open questions: none added.

Scope

  • This PR has one primary intent.
  • Independently removable deltas were removed or split.
  • Public text and artifacts contain no internal Meta context.

Testing

On Node 24.22.1, Vitest 4.1.11 and Playwright 1.61.1 (Chromium headless shell 149), at 23f819a1:

  • pnpm exec vitest run on packages/core/src/Table, ContextMenu, DropdownMenu, Layer, List and Item, the useLongPress, longPressDetector, interactionModality and server-safe-components tests, and scripts/core-single-bundle.test.mjs and scripts/shared-identity.test.mjs: 108 files, 2,261 tests passed. The touch, modality, SSR and load-failure files passed five consecutive runs, 15 tests each.
  • pnpm exec playwright test --config playwright.config.ts --project=chromium TableCellMenuLoad, with no packages/core/dist present: 3 tests passed in three consecutive runs.
  • pnpm -F @astryxdesign/core typecheck, strict eslint on changed files, pnpm check:knowledge and pnpm check:repo: passed. Repository pre-commit hooks passed, except on the one commit that restores apps/sandbox/perf/scenes.perf.spec.ts to main's exact bytes: the hooks' eslint --fix would reformat that file again, so that commit skips them.
  • pnpm review:pre: the branch merges into main cleanly. It reports one finding: 2,568 authored lines, over the 2,000-line limit. The lines over the limit are the Chromium spec and the tests a reviewer asked for.
  • Core build and the size comparison above ran at 23f819a1. The later commit changes only ContextMenu.spec.md; pnpm check:knowledge and pnpm review:pre passed on it, apart from the size finding. The API report generated for main and for this branch at ca79cf1b is identical; the later commit adds no public export (its new helper is internal to ContextMenuTrigger).
  • Not run: Storybook, WebKit and the full accessibility suites. Fork CI workflows are waiting for maintainer approval, so this is not CI-green evidence.
  • Changeset: .changeset/table-cell-lazy-context-menu.md ([perf], patch).

TableCell and TableHeaderCell imported `wrapInTableContextMenu` statically, so
every table cell pulled in ContextMenu, DropdownMenu's menu hooks and the touch
sheet, even in tables that never pass `contextMenuActions`. Plugins and the
Table entry also imported `resolveContextActions` from the same module.

- `tableContextActions.ts` holds the dependency-free helpers
  (`resolveContextActions`, `hasContextActions`). Plugins and the Table entry
  import from it; `tableContextMenu` re-exports `resolveContextActions` for
  existing imports.
- `TableCellContextMenu` renders a cell's content as-is when it has no
  actions, and otherwise loads `TableContextMenu` with `React.lazy`, the
  pattern ContextMenu already uses for its touch sheet. While the menu loads,
  the content sits in a wrapper with the trigger's styles, so the cell's layout
  doesn't shift.
- Tests: `TableCellContextMenu.test.tsx` checks the menu module is not
  imported for cells without actions and is for a cell with actions. Suites
  that right-click cells warm the lazy menu once in `beforeAll`
  (`warmTableContextMenu`, like `warmMenuBottomSheet`).

Bundle (esbuild, minified, package source, React and StyleX external): the
static closure of `TableCell`, `TableRow` and `TableBody` goes from 74,769 B
to 7,207 B gzip; the menu becomes its own lazy chunk.
@vercel

vercel Bot commented Oct 25, 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 10, 2026 4:17pm UTC

Request Review

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

astracat-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
❓ Needs maintainer input (for maintainers only) Nov 17, 2026, 5:26 PM UTC

@github-actions github-actions Bot added community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:design-review Affects visuals — Design should review labels Oct 25, 2026
@rhagigi
rhagigi marked this pull request as ready for review October 25, 2026 14:05

@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.

Moving the context menu out of the cell modules' static imports is a clear win for tables without actions, but this needs changes before it can land. The Suspense boundary in TableCellContextMenu wraps the cell's own children, so when the menu chunk loads every cell with actions remounts its content: keyboard focus on a sort control drops to the page and any state inside the cell resets, which keeping the children outside the suspending subtree (and a test for focus and state) would fix. Please also report base and head gzip sizes for the TableCell and TableHeaderCell imports plus the CSS delta, as the component size rule asks, and use the [perf] changeset category instead of [fix].

[Automated review]

@humbertovirtudes humbertovirtudes 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.

Requesting changes on exact head 70f7f1af921f77730990fe2518d2e7c7483faf06 for the Table-related delta and its direct dependencies. This is not a rejection of unrelated work in the PR.

  1. [MAJOR] packages/core/src/Table/TableCellContextMenu.tsx:64

The Suspense fallback owns one copy of caller children and the resolved lazy component owns another. Resolving the menu replaces the fallback subtree rather than preserving cell-content identity. This resets state and mount effects and can drop focus from a sortable header or editable body cell.

Failure case: On a cold route, render a cell with actions containing a stateful editor or a focused sort control. Enter text or focus the control while the chunk is pending; resolving the chunk mounts a new content subtree. This also affects a getter that will return an empty action list: getters still take the lazy path.

Requested fix: Keep the cell content and its trigger host outside the suspending subtree, and lazy-load only the menu behavior/surface through a stable seam. Add deferred-import tests that assert the same content node, retained input state, one mount, and retained focus for both body and header cells. Check keyboard context invocation, menu navigation and Escape focus return after resolution.

Validation boundary: these findings are grounded in the exact implementation and relevant tests. Isolated source/geometry probes are not fresh mounted React, browser, clipboard, screen-reader or native-device certification. Retain the applicable focused tests and head-bound evidence when updating the PR.

# Conflicts:
#	packages/core/src/Table/plugins/sortable/useTableSortable.tsx
The lazy menu used to wrap the cell's children inside its Suspense boundary,
so when the menu arrived React replaced the fallback copy with a new one:
focus inside the cell dropped to the page and the cell's state reset.

The cell now renders the right-click trigger and its cursor anchor itself,
and the menu loads beside them through ContextMenuForTrigger, an internal
mode of ContextMenu that opens from a trigger its caller renders. The
content's DOM node, focus and state survive the load; until the menu
attaches, right-click shows the browser's menu.

The test focuses a stateful button inside a cell before the menu loads and
checks the node, focus, state and mount count after; it fails on the
previous version. The changeset moves to [perf] and says that a test
opening a menu right after render has to wait for the menu.
…menu load

A shared scenario renders a cell with actions while its menu is still
loading, edits an input and clicks a stateful button, focuses one of them,
and lets the menu load. It then checks the same nodes, the input's value,
the count, focus and a single mount, and that the menu opens from the
keyboard (Shift+F10), moves with ArrowDown and returns focus on Escape.

The body-cell suite focuses the editor; a new header-cell suite, in its own
file so the menu starts unloaded, focuses the button. Both fail on the
version where the content sat inside the Suspense boundary.
# Conflicts:
#	packages/core/src/Table/plugins/sortable/useTableSortable.test.tsx
#	packages/core/src/Table/plugins/sortable/useTableSortable.tsx
… file header

The two Effects in ContextMenu's external-trigger mode now say which
system each one syncs, as the pre-review check asks, and the
TableCellContextMenu header fits the header length rule.
@rhagigi

rhagigi commented Nov 5, 2026

Copy link
Copy Markdown
Author

The latest push (4b73ec1) should address the requested changes.

  1. No remount. The cell renders the right-click trigger and cursor anchor itself, and the menu loads beside them, outside the Suspense boundary. New tests for a body cell and a header cell edit, click and focus the content while the menu loads. After the load they check the same nodes, value, state, focus and a single mount, then open the menu from the keyboard, move with ArrowDown and return focus with Escape. Both tests fail on the previous version.
  2. Sizes. From the repo's analyze-pr.js, main 9e7567c against 4b73ec1, gzip import size: TableCell 91,359 → 9,267 B, TableHeaderCell 90,945 → 8,884 B, Table 99,714 → 33,165 B, ContextMenu +148 B. CSS is unchanged. The full table is in the description.
  3. Changeset. It is now [perf], and it says that a test which opens a cell's menu right after render has to wait for the menu to load.

The CI, Lint and CLI Smoke Test runs for this fork show "action required"; a maintainer needs to click "Approve and run workflows" for them to run.

@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.

Moving the menu out of the cell modules' static imports cuts the TableCell import from about 89 KB to about 9 KB gzip, and cell content now survives the menu load, but approval waits on an engineering-owner decision and three changes:

  • Spec decision: until the lazily loaded menu arrives, right-click and Shift+F10 on a cell with contextMenuActions reach the browser's own menu and a long-press opens nothing, and no current TableCell or TableHeaderCell clause covers that window, so an engineering owner needs to record whether it is accepted (for example under TableCell PR1 and TableHeaderCell FR3, approved by commenting /approve-spec <full head SHA>, which the author may do if they are an engineering owner) or whether a cell must hold the invocation until its menu loads.
  • Desktop behavior change needs an owner decision: during that window a mouse right-click on a cell with actions opens the browser's menu instead of the cell's (TableCellContextMenu.tsx:105), so either gate the fall-through to touch input by holding a mouse right-click until the menu loads, or cite the owner decision that accepts it.
  • TableCellContextMenu.tsx keeps a hand-synced copy of ContextMenu's trigger wrapper and cursor anchor that already renders the anchor differently (no left/top inset), so please move that trigger into one small module that ContextMenu owns and render it from both places.
  • wrapInTableContextMenu and its LazyTableContextMenu in tableContextMenu.tsx no longer have a caller and duplicate the getter rule in TableContextMenuForTrigger, so please delete them and update the file header.

The branch also conflicts with main in the imports of useTableRowExpansion.test.tsx, so please merge main. The engineering owner who requested changes on the earlier version still needs to re-review, though the fix they asked for is in place. CI has not run on this head yet: a maintainer adds the ci:run label so it runs.

[Automated review]

@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.

No blocking issues in the code at this head. Cells without contextMenuActions no longer load the context menu, cell content survives the load, a loaded menu matches main, and a failed load keeps the table and retries; the TableCell.spec.md row has an engineering owner's spec approval for this head.

What remains is outside the code:

  • humbertovirtudes's changes-requested review of an earlier head (the failed menu load) is still in force; this head keeps the table, drops the held invocation, retries the load and adds rejecting-import tests, so it needs their re-review or dismissal.
  • CI has not run on this head yet; a maintainer adds the ci:run label so it runs.

[Automated review]

@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec e6ff52f

@humbertovirtudes humbertovirtudes 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.

Recheck at e6ff52f: REVISE. The CI, Lint and smoke workflows on this head are waiting for maintainer approval, so nothing has run yet.

Resolved

  • The earlier second-trigger blocker. The headless createContextMenu path isn't on main (ContextMenu FR10 records the gap), and the spec owner approved the spec at this head. Please mention the internal ContextMenuForTrigger path and the cell-owned held invocation in the FR10 implementation-gap note, so #8693 knows to absorb them.
  • A failed chunk load now renders MenuUnavailable, drops the hold and retries, with four tests.

Blocking

  • The delayed-replay interaction still has only jsdom evidence (AST-013 FR10; FR9/FR13 for hydration). Please add a Chromium interaction spec with a gated chunk covering an early right-click, Shift+F10 and a touch long press: native menu suppressed, a single replay, focus on the first row with no keyboard ring after a mouse open, focus returning on Escape, and server render → hydration → invocation.

Minor

  • No test covers the held-invocation unmount cleanup (TableCellContextMenu.tsx:219). Unmount a holding cell, let the load finish, and assert nothing opens and another cell's hold survives. The test should fail if that line is removed.
  • The replayed event has a null currentTarget, so the focus-restore fallback is lost, and its pre-load clientX/Y misplace the anchor if the page scrolls during the load (TableCellContextMenu.tsx:199-200 → ContextMenu.tsx:713). Pass triggerRef.current as the focus element and store a trigger-local point when holding.
  • ContextMenuItem's eager import grows by about 83 KB gzip. It's disclosed but not decided; record the decision or split the folder index.

Nits

  • Drop the unrelated brace reformat in apps/sandbox/perf/scenes.perf.spec.ts:70-72.
  • Remove the resolveContextActions re-export from tableContextMenu.tsx; nothing imports it now, and importing it would load the menu.

@astracat-bot

astracat-bot Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

In reply to @humbertovirtudes

I'll run a full review to re-check this with your note.

@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.

Changes requested: tables without context actions now skip the menu code, and an early right-click, Shift+F10 or long press opens the same menu once it loads; what remains is a real-browser test of the server-rendered path.

  • Miss: the cell keeps its menu out of the hydrating render and holds an early invocation until the menu renders (TableCellContextMenu.tsx:208-211, :320-328), but only a jsdom renderToString/hydrateRoot test covers it, while spec:AST-013's FR9/FR13 verification asks for a real-browser server render, hydration and post-hydration fixture, so please add a Chromium *.interaction.browser.spec.ts that holds the menu chunk back, server-renders and hydrates a table, right-clicks a cell, and also pins the early right-click, Shift+F10 and long press.

Engineering owner humbertovirtudes asked for the same spec in their review of this head, and their changes-requested review stays in force until they re-review or dismiss it. Smaller and non-blocking: a scroll during the load opens the replayed menu off the cell, because the held clientX/Y predate the scroll (TableCellContextMenu.tsx:200); storing a trigger-local point when holding fixes it. CI has not run on this head yet; a maintainer adds the ci:run label so it runs.

[Automated review]

…he cell as focus target

- A right-click or long press held before the menu loads now stores its
  point in the trigger's own box, so a scroll during the load keeps the
  menu on the content. The menu opens it through openAtTriggerPoint, with
  the trigger as its focus fallback; the held event had no current target.
  ContextMenu and the cell share contextMenuPoint for the keyboard and
  touch cases.
- Tests: the held point across a scroll, the focus fallback, a cell that
  unmounts drops its own hold, and another cell's hold survives.
- tableContextMenu no longer re-exports resolveContextActions; nothing
  imports it there, and importing it would load the menu.
…ell menu loads

The spec server-renders a table with React, hydrates it in Chromium, and
holds the lazy menu chunk until the test releases it. For a right-click,
Shift+F10 and a touch long press that arrive first, it checks that the
browser's menu stays shut, the menu opens once when the chunk arrives,
focus lands on the first row (no ring after a mouse open), the menu opens
at the pointer or finger, Escape hands focus back, and hydration reports
no recoverable error. It fails when the
held invocation is not replayed.
An earlier lint sweep on this branch reformatted one loop's braces in this
file, which this pull request does not otherwise touch. This commit puts the
file back exactly as main has it. It skips the commit hooks, because their
eslint --fix (curly) would add the braces again.
The ContextMenu index re-exported its seven DropdownMenu aliases
(ContextMenuItem, Divider, Group, CheckboxItem, RadioGroup, RadioItem,
SubMenu) next to ContextMenu. With the table menu loaded on demand, an
esbuild app that imported one alias from the package entry also loaded
ContextMenu up front. Each alias now lives in a one-line module that the
index re-exports, so its import reaches only the item it names. Public
names and types are unchanged: the generated API report is identical to
main's.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec ca79cf1

@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.

Changes requested: tables without contextMenuActions now skip the menu code, and an early right-click, Shift+F10 or long press opens the same menu once it loads, but two fixes remain.

  • TableCellMenuLoad.a11y.chromium.spec.ts resolves @astryxdesign/core to packages/core/dist/index.js (line 109) and serves dist/astryx.css (line 160), but the CI jobs that run browser accessibility specs only install dependencies and download Storybook, so without a Core build the spec fails with Could not resolve ".../packages/core/dist/index.js" here and on every later pull request that touches Table/, ContextMenu/ or the long-press hook; please build the fixture from source, as TableVirtualization.release.a11y.chromium.spec.ts on main does through TableVirtualization.release.vite.mjs, with an SSR build for the server render.
  • The held long press at TableCellContextMenu.tsx:231-239 repeats the viewport-to-trigger conversion of openFromLongPress in ContextMenu.tsx (lines 731-744), so please add that case beside contextMenuPoint in ContextMenuTrigger.tsx and call it from both places.

Also worth a look: TableCellContextMenu.loadFailure.test.tsx:84 waits a fixed 20 ms for the mocked import and failed once under a loaded full run. The rest checks out: cell content survives the load, the three early invocations replay once in Chromium when Core is built, a failed load keeps the table, and the public API is unchanged. Engineering owner humbertovirtudes's changes-requested review of an earlier head stays in force until they re-review or dismiss it. CI has not run on this head yet; a maintainer adds the ci:run label so it runs.

[Automated review]

…rce, and share the long-press point

- TableCellMenuLoad.a11y.chromium.spec.ts no longer needs a Core build. A
  Vite fixture (client and server builds, compiled with astryxStylex as
  Storybook does) renders the table on the server and hydrates it, and the
  spec holds the lazy menu chunk it finds in the client manifest.
- longPressPoint sits beside contextMenuPoint in ContextMenuTrigger. The
  cell's held long press and ContextMenu's openFromLongPress both use it, so
  openFromLongPress now opens through openAtTriggerPoint.
- The load-failure tests wait until the mocked import has run, instead of
  one fixed 20 ms wait that a loaded machine could outrun.
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 23f819a

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval waits on one owner action; no code changes are needed at this head.

  • Engineering owner humbertovirtudes's changes-requested review of an earlier head is still in force. This head does what it and their later comment asked (the failed menu load keeps the table and retries, the Chromium early-invocation spec, the unmount-cleanup test, the trigger-local point and the per-alias ContextMenu modules), so it is theirs to re-review or dismiss.

The spec change to component:TableCell's PR1 verification row has an engineering owner's approval for this head, and no public API changes. Optionally, component:ContextMenu FR10's gap note could name the internal ContextMenuForTrigger path, as humbertovirtudes asked. CI has not run on this head yet; a maintainer adds the ci:run label so it runs.

[Automated review]

The FR10 implementation gap now says that table cells open the same menu
through the internal ContextMenuForTrigger mode around a trigger they render,
and that the cell holds an invocation that arrives before the menu loads.
Both belong to the same gap as ContextMenu's own invocation handling. No
code change.
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 10, 2026
@cixzhang

Copy link
Copy Markdown
Contributor

/approve-spec 41d9640

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 10, 2026

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approval waits on one owner action; no code changes are needed at this head.

  • Engineering owner humbertovirtudes's changes-requested review of an earlier head still stands for this review, because it was dismissed by another maintainer rather than re-reviewed by humbertovirtudes, so a re-review of this head from humbertovirtudes, whose requests are all in place here, is what clears it.

The spec changes to component:TableCell's PR1 verification row and component:ContextMenu's FR10 gap note have an engineering owner's approval for this head, and no public API changes. Optionally, the PR1 row could also list the Chromium early-invocation spec beside the jsdom tests. CI has not run on this head yet; its workflows wait for a maintainer's approval.

[Automated review]

@cixzhang
cixzhang dismissed humbertovirtudes’s stale review November 10, 2026 16:33

Dismissed by Cindy's agent under her standing rule for addressed reviews. Each point is fixed at 41d9640: a failed menu chunk load now renders nothing for that cell, drops the held invocation and retries, with rejecting-import tests (your recheck on Nov 10 marks this resolved); the changeset size and the TableCell verification rows were updated; and the follow-ups from your later recheck are in (the Chromium early-invocation interaction spec, the held-invocation unmount-cleanup test, the trigger-local point and focus element, per-alias ContextMenu modules, and the ContextMenu FR10 gap note). The automated review at this head reports no open findings. Thank you for the thorough reviews, @humbertovirtudes.

@cixzhang

Copy link
Copy Markdown
Contributor

(Posted by Cindy's agent.)

Thank you, @rhagigi, for this work. It now continues in #11569, which ports this PR onto current main with you as co-author. That PR keeps your design (cells without actions never load the menu; a cell with actions renders its trigger at once and loads the menu beside its content, so the content keeps its node, focus and state). It changes one thing: before the menu code arrives, the cell no longer runs its own long-press recognizer. It holds the touch events and hands them to the loaded menu's long press, which the repository's import-boundary rules now require. It also removes the Table row from the import-boundary allowlist. Measured on a consumer import of Table, the first load goes from about 358 KB to about 138 KB minified (124 KB to 48 KB gzip). Superseded by #11569.

@rhagigi

rhagigi commented Nov 17, 2026

Copy link
Copy Markdown
Author

Closing as Superseded by #11569

This branch was successfully deployed

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

Labels

ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) CLA Signed This label is managed by the Meta Open Source bot. community Authored by a community contributor (not on the eng/design team) needs:code-review High-risk change (new package/component/API) — needs human code review before merge needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants