Repository navigation
fix(DropdownMenu): a sheet opened before its code loads shows its rows with it - #12619
Conversation
…s with it A bottom-sheet menu preloads its sheet and row modules at rest, but a press right after mount can open it before they arrive. The sheet's module then revealed first, and its rows rendered through lazy() a moment later, so the sheet showed empty. The lazy sheet now resolves only once the row module has loaded too (a failed row load does not hold it; the rows then fail through lazy() as before). A unit case opens the menu right after mount with the row module held and checks the sheet never shows without its rows; it fails before and passes after.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec 70f7ad9 |
PR Analysis Report🔎 Preview ·
|
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DropdownMenuCheckboxItem | 28.8 kB (0) · 7.3 kB CSS (0) | — | ✗ · ✓ · ✓ |
| DropdownMenuDivider | 5.3 kB (0) · 548 B CSS (0) | — | ✗ · ✓ · — |
| DropdownMenuGroup | 6.4 kB (0) · 3.4 kB CSS (0) | — | ✗ · ✓ · — |
14 more components
| Component | Size | LoC | Visual · A11y · RTL |
|---|---|---|---|
| DropdownMenuItem | 28.0 kB (0) · 6.9 kB CSS (0) | — | ✗ · ✓ · — |
| DropdownMenuRadioGroup | 6.6 kB (0) · 3.3 kB CSS (0) | — | ✗ · ✓ · — |
| DropdownMenuRadioItem | 28.8 kB (0) · 7.3 kB CSS (0) | — | ✗ · ✓ · — |
| DropdownMenuSubMenu | 78.9 kB (0) · 10.5 kB CSS (0) | — | ✗ · ✓ · ✓ |
| ContextMenu · Storybook | 103.3 kB (−8 B) · 18.8 kB CSS (0) | 729 (+4) | ✗ · ✓ · ✓ |
| DropdownMenu | 108.8 kB (−25 B) · 18.9 kB CSS (0) | — | ✗ · ✓ · ✓ |
| lab/Comments | 379.3 kB (+285 B) · 2.5 kB CSS (0) | — | — · — · — |
| lab/CommentThread | 372.3 kB (+35 B) · 2.4 kB CSS (0) | — | — · — · — |
| ContextMenuItem | 35.9 kB (+1 B) · 7.1 kB CSS (0) | — | — · — · — |
| MoreMenu | 109.1 kB (−30 B) · 18.9 kB CSS (0) | — | — · — · — |
| TableCell | 104.5 kB (−140 B) · 19.3 kB CSS (0) | — | — · — · — |
| Markdown | 205.3 kB (−165 B) · 22.1 kB CSS (0) | — | — · — · — |
| TableHeaderCell | 104.3 kB (−166 B) · 19.1 kB CSS (0) | — | — · — · — |
| Table | 121.6 kB (−216 B) · 19.8 kB CSS (0) | — | — · — · — |
Visual changes: 14 snapshots in 2 components
A change is a question for the reviewer, not a failure.
2 more are in the run's visual report.
Inheritance checked against the 3 newest reports of other pull requests.
Package size: @astryxdesign/core 7.68 MB packed (+556 B); no new dependencies.
Touched components checked; for the full suites, add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
Changes requested: the fix works for data-driven sheets, but its new wait also reaches ContextMenu's compound sheet.
lazyMenuBottomSheet.ts:77-81now loads and waits for the row module for every sheet, so a ContextMenu withmenuContentin the bottom-sheet presentation downloads a row chunk it never renders (about 21 KB gzip in a ContextMenu-only build) and waits for it on a cold open; please wait only where the sheet renders rows and add aContextMenu.sheetLoading.test.tsxcase asserting that a compound bottom-sheet menu loads the action list zero times.- The description's "Everyone else: unchanged" is not true for compound bottom-sheet ContextMenu users until that wait is scoped, so either fix the code or say what changes for them.
The new unit case is a good red-first check: it fails on main and passes here. CI has not run on this head yet. One optional comment-wording suggestion is inline.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claims:
- A bottom-sheet DropdownMenu, MoreMenu or ContextMenu opened before its sheet code loads shows the sheet together with its actions: verified (
lazyMenuBottomSheet.ts:77-83; ContextMenu renders its rows inside the same lazy sheet atContextMenu.tsx:897and:944; MoreMenu composes DropdownMenu atMoreMenu.tsx:23). - The release note is a patch-level fix for the core package: verified (no public API change).
- On
mainthe sheet appeared empty, then the actions filled in: verified (the new case fails onmainatMenuBottomSheetOpenBeforeLoad.test.tsx:78). - A menu opened after the at-rest preload is unchanged: verified for data-driven sheets (
lazyMenuBottomSheet.ts:109-118;DropdownMenuSheetFirstOpen.test.tsxpasses). - Everyone else is unchanged: false; a compound bottom-sheet ContextMenu now loads the row module at rest and waits for it (
lazyMenuBottomSheet.ts:80;ContextMenu.tsx:393-401; a load-count check gives 0 loads onmainand 1 here). - The sheet and row modules load lazily and preload at rest: verified for data-driven sheets (
DropdownMenu.tsx:637-639,ContextMenu.tsx:393-401,lazyMenuBottomSheet.ts:91-102). - A failed row load does not hold the sheet back, and the rows fail through
lazy()as before: verified (lazyMenuBottomSheet.ts:80,:85-89). - The new test holds the row module, checks the sheet never shows without rows, then checks the rows after release: verified (
MenuBottomSheetOpenBeforeLoad.test.tsx:34-37,:72-88). - The new case fails on
mainand passes on this branch: verified. - DropdownMenu, MoreMenu, ContextMenu and BottomSheet units pass 1131/1131: verified (35 files, 1131 tests).
- Typecheck and lint are clean: verified (core typecheck; lint on the two changed source files).
- The menu and table reference pages grow 44 B raw, gzip within noise, other pages unchanged: verified (menu +44 B / -30 B gzip, table +44 B / -389 B gzip, docs and form unchanged).
- The browser audit, interaction and cold-load runs pass: not rerun; a separate Chromium run of the DropdownMenu action-sheet story with the row module held agrees (empty sheet on
main, none on this branch until the rows arrive). - DropdownMenu's touch-sheet anatomy requirement (FR1) governs, with no record change: verified.
- A release-check run once found the sheet without rows: the author's report, not verifiable here; no finding depends on it.
- A bottom-sheet DropdownMenu, MoreMenu or ContextMenu opened before its sheet code loads shows the sheet together with its actions: verified (
- Files:
.changeset/menu-sheet-rows-at-open.md: clear.packages/core/src/DropdownMenu/MenuBottomSheetOpenBeforeLoad.test.tsx: clear.packages/core/src/DropdownMenu/lazyMenuBottomSheet.ts: blocking finding (the row wait also runs for compound ContextMenu sheets); one optional comment-wording suggestion (inline).- Consistency with
packages/core/src/ContextMenu/ContextMenu.tsx(unchanged): its data-mode-only row preload is bypassed by the new wait.
…ble frame in a real browser A browser case holds the sheet's row chunk back by a quarter second, so it arrives after the sheet's own chunk, and opens the MoreMenu bottom-sheet story twice in one page (light, then dark), reading the sheet two frames after it becomes visible, as the MoreMenu audit does. It fails on main (the sheet shows only its title) and passes with the sheet waiting for its row module.
|
/approve-spec 612c63f |
The lazy sheet waited for the row module for every sheet, so a compound bottom-sheet ContextMenu (menuContent) downloaded and waited for a row chunk it never renders. A menu that renders the action list preloads it, so the preload now marks the rows as wanted, and the sheet waits for them only then. The check runs once the sheet's own module has loaded, after the menu's mount effect has run. A ContextMenu sheet-loading case asserts that a compound sheet menu loads the action list zero times; it fails at the previous head and passes here.
|
/approve-spec f8fa31c |
There was a problem hiding this comment.
Changes requested: compound-only pages are fixed, but the new page-wide flag still lets one menu decide the wait for every sheet on the page.
lazyMenuBottomSheet.ts:77keeps one flag for the whole page and the page shares one lazy sheet, so on a page that also renders a data-driven sheet menu, amenuContentbottom-sheet ContextMenu opened before the row chunk arrives shows nothing until those rows load, though it never renders them; please decide the wait per sheet (for example a second lazy sheet used only by DropdownMenu and data-mode ContextMenu) and add a case that renders both kinds of menu on one page.- The description's "neither loads nor waits for the row module, as before" and the comment at
lazyMenuBottomSheet.ts:75-76("never loads or waits for the rows") are not true on such a page, so fix the code or reword both.
The red-first unit case and the compound load-count case work as described, and a real-browser cold run of the MoreMenu sheet story now shows all four actions at the sheet's first frame. A data-driven menu that mounts after a compound sheet has loaded the sheet module still opens empty, which is not a regression and which the per-sheet fix also closes; one optional comment-length suggestion is inline. CI has not run on this head yet.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules since the last review (0): none
- Claims:
- A bottom-sheet menu opened before its sheet code loads shows the sheet with its actions, never an empty sheet first: verified when no compound sheet loaded the sheet module first (
lazyMenuBottomSheet.ts:85-91, the new unit case, a Chromium cold run); a data-driven menu mounted after a compound sheet still opens empty (non-blocking). - On
maina menu opened at page load showed an empty sheet that filled in: verified (the new case fails onmainatMenuBottomSheetOpenBeforeLoad.test.tsx:78; the cold run onmainshows a heading-only sheet). - A menu opened after the at-rest preload already rendered its rows in the same commit: verified (
lazyMenuBottomSheet.ts:117-119). - A compound bottom-sheet ContextMenu neither loads nor waits for the row module: false on a page that also renders a data-driven sheet menu (blocking); verified for compound-only pages (
ContextMenu.sheetLoading.test.tsx:77-98). - The sheet and row modules load lazily and preload at rest, and on
mainthe sheet revealed before its rows: verified (DropdownMenu.tsx:637-639,ContextMenu.tsx:396-400,lazyMenuBottomSheet.ts:112-127). - A row-rendering menu's preload marks the rows as wanted and the sheet waits only then: verified (
lazyMenuBottomSheet.ts:65,:87). - The check runs after the sheet's own module loads, so the menu's mount effect has run: verified for a menu mounted with its sheet (browser request order); not for a menu that mounts later.
- A failed row load does not hold the sheet back and the rows fail through
lazy()as before: verified (lazyMenuBottomSheet.ts:88,:93-97; the module loader drops a failed load). - The new unit test holds the row module, checks the sheet never shows without rows, then checks the rows: verified (
MenuBottomSheetOpenBeforeLoad.test.tsx:86-103,:123-155). - The new ContextMenu case asserts zero action-list loads for a compound sheet: verified (
ContextMenu.sheetLoading.test.tsx:77-98). - The browser spec holds the row chunk 250 ms and opens the MoreMenu sheet story twice in one page, light then dark, reading two frames after it shows: verified by reading (
MenuSheetRowsAtOpen.interaction.browser.spec.ts:216-251); not run here. - The release note is a patch fix for the core package: verified (no public API change).
- DropdownMenu's touch-sheet anatomy requirement governs, with no record change: verified.
- The new case fails on
mainand passes here; the compound case fails at the previous head with one load and passes here: verified. - DropdownMenu, MoreMenu, ContextMenu and BottomSheet units pass 1132/1132: verified.
- Type check and lint are clean: verified (core type check; lint on the changed files).
- The audit, interaction and cold-load browser runs pass: not rerun; a separate Chromium cold run of the same story agrees.
- The menu and table pages grow about 51 B raw with gzip within noise, and other pages are unchanged: verified (menu +51 B / -34 B gzip, table +51 B / -391 B gzip, docs and form unchanged).
- The new browser spec fails on an earlier release build and passes here, and release checks saw the empty sheet without an unforced repro: the author's report, not verifiable here.
- A bottom-sheet menu opened before its sheet code loads shows the sheet with its actions, never an empty sheet first: verified when no compound sheet loaded the sheet module first (
- Files:
.changeset/menu-sheet-rows-at-open.md: clear.packages/core/src/ContextMenu/ContextMenu.sheetLoading.test.tsx: clear.packages/core/src/DropdownMenu/MenuBottomSheetOpenBeforeLoad.test.tsx: clear.packages/core/src/DropdownMenu/__tests__/MenuSheetRowsAtOpen.interaction.browser.spec.ts: clear.packages/core/src/DropdownMenu/lazyMenuBottomSheet.ts: blocking (page-wide wait; the compound comment at lines 75-76); non-blocking (late data-driven menu; comment length, inline).- Consistency with
DropdownMenu.tsxandContextMenu.tsx(unchanged): both call the preload as the flag expects; no test renders both kinds of sheet menu on one page.
One page-wide flag decided the wait for every sheet, since the page shares one lazy sheet: with a data-driven sheet menu on the page, a caller-content ContextMenu sheet waited for rows it never shows. There are now two lazy sheets. MenuBottomSheet, used by DropdownMenu and a data-driven ContextMenu, loads and waits for the row module. MenuBottomSheetWithoutActionList, used by a ContextMenu with menuContent, loads only the sheet. A case renders both kinds of menu on one page with the rows held: the caller-content sheet opens at once, and the DropdownMenu sheet shows only with its rows. It fails at the previous head and passes here.
|
/approve-spec e85da01 |
There was a problem hiding this comment.
Changes requested: the per-sheet wait works and the earlier blocking points are fixed, but one new test does not check what it says.
MenuBottomSheetPerSheetWait.test.tsx:86only checks that the "Edit project" row is absent before the rows load, which also holds while the DropdownMenu sheet is open with just its heading, so the case passes unchanged onmain, where that sheet does open heading-only on this page; please assert that only the ContextMenu sheet is open after the press (for exampleexpect(document.querySelectorAll('dialog[open]')).toHaveLength(1), then two after the rows load), or narrow the test header, the comment at line 81 and the description to what the case checks.
The rest checks out: the new open-before-load case fails on main and passes here, and with the row module held a caller-content ContextMenu opens at once while the data-driven sheet waits for its rows. The header wording note on lazyMenuBottomSheet.ts line 24 stays optional. CI has not run on this head yet.
Claims and files checked
Review mode: same-head; reason: none
- Changed rules since the last review (0): none
- Claims:
- A bottom-sheet menu opened before its sheet code loads shows the sheet with its actions, never an empty sheet first: verified (
lazyMenuBottomSheet.ts:79-85, the new unit case, and a Chromium cold run with the row chunk held). - Before, a menu opened right at page load showed a sheet without actions that filled in: verified (the new case fails on
mainatMenuBottomSheetOpenBeforeLoad.test.tsx:78). - A menu opened after the at-rest preload already rendered its rows in the same commit: verified (
lazyMenuBottomSheet.ts:131-133,DropdownMenuSheetFirstOpen.test.tsxpasses). - A caller-content bottom-sheet ContextMenu neither loads nor waits for the rows, on any page, including one with a data-driven sheet menu: verified (
lazyMenuBottomSheet.ts:89-91,ContextMenu.tsx:911-913, the load-count case, the one-page case's first check). - Both modules load lazily and preload at rest, and the sheet used to reveal before its rows: verified (
DropdownMenu.tsx:638,ContextMenu.tsx:394-402,lazyMenuBottomSheet.ts:126-141). - Each sheet decides the wait through its own lazy sheet: verified (
lazyMenuBottomSheet.ts:79-124). - A failed row load does not hold a sheet back, and the rows then fail through
lazy(): verified (lazyMenuBottomSheet.ts:82,:93-97). - ContextMenu picks the sheet by its content: verified (
ContextMenu.tsx:911-913,:948-953). - The open-before-load test holds the row module, checks the sheet never shows without rows, then checks the rows: verified (
MenuBottomSheetOpenBeforeLoad.test.tsx:57-89). - The new ContextMenu case checks that a caller-content sheet loads the action list zero times: verified (
ContextMenu.sheetLoading.test.tsx:77-98). - The one-page test shows the caller-content sheet opens at once and the DropdownMenu sheet shows only with its rows: first half verified (
MenuBottomSheetPerSheetWait.test.tsx:79); second half false (blocking). - The browser spec holds the row chunk 250 ms and opens the MoreMenu sheet story twice in one page, light then dark, two frames after it shows: verified (read, and Chromium runs: it fails on
mainand passes here). - The release note is a patch fix for the core package, and the changeset's description of the fix matches it: verified (no public API change; a caller-content sheet was never empty).
- DropdownMenu's touch-sheet anatomy requirement governs, with no record change: verified.
- The new case fails on
mainand passes here; the load-count and one-page cases fail on an earlier revision of this branch and pass here: verified. - DropdownMenu, MoreMenu, ContextMenu and BottomSheet units pass 1133/1133: verified (36 files).
- Type check and lint are clean: verified (Core type check; lint on the changed files).
- The audit, tooltip, menu-pattern and touch-interaction browser runs pass: not rerun; the new browser spec and a cold run of the same story agree.
- Menu page +194 B raw / +11 B gzip, table page +199 B raw, other pages unchanged: verified (menu +194 B / +12 B gzip, table +199 B, docs and form unchanged).
- The new browser spec fails on a release build's Storybook and passes here: verified against
main's own Storybook (it sees only the heading there); the release build and the release-check history are the author's report.
- A bottom-sheet menu opened before its sheet code loads shows the sheet with its actions, never an empty sheet first: verified (
- Files:
.changeset/menu-sheet-rows-at-open.md: clear.packages/core/src/ContextMenu/ContextMenu.sheetLoading.test.tsx: clear.packages/core/src/ContextMenu/ContextMenu.tsx: clear.packages/core/src/DropdownMenu/MenuBottomSheetOpenBeforeLoad.test.tsx: clear.packages/core/src/DropdownMenu/MenuBottomSheetPerSheetWait.test.tsx: blocking (the DropdownMenu half checks only a row's absence).packages/core/src/DropdownMenu/__tests__/MenuSheetRowsAtOpen.interaction.browser.spec.ts: clear.packages/core/src/DropdownMenu/lazyMenuBottomSheet.ts: non-blocking (the header still says "Neither wrapper").- Consistency with
DropdownMenu.tsx(unchanged): every DropdownMenu sheet renders rows, so it keeps the waiting sheet.
…tays closed until its rows load The case only checked that a DropdownMenu row was absent, which also holds while that sheet is open with its heading alone. It now checks that one sheet (the ContextMenu's) is open while the rows load, and two after. With main's sheet loading it fails at that check. The file header names three wrappers.
|
/approve-spec f6ab523 |
There was a problem hiding this comment.
Approved pending CI: some required checks (the test-node shards) are still running on this head.
A data-driven bottom-sheet menu opened before its row code has loaded now appears once with every action, and a caller-content ContextMenu sheet still opens without loading the rows. Nothing else is needed from the review; the required checks still have to pass before merge.
Claims and files checked
Review mode: same-head; reason: none
- Changed rules since the last review (0): none
- Claims:
- A bottom-sheet menu opened before its sheet code loads shows the sheet together with its actions, never an empty sheet first: verified (
lazyMenuBottomSheet.ts:79-85; the open-before-load case; a real-browser cold open of the MoreMenu sheet story with the row module held shows a heading-only sheet onmainand the whole sheet in its first visible frame here). - Before, a menu opened at page load showed a sheet with no actions that filled in a moment later: verified (the new case fails on
mainatMenuBottomSheetOpenBeforeLoad.test.tsx:78; the cold open onmainshows only the heading for about 3.7 s with a 4 s hold). - A menu opened after the at-rest preload already rendered its rows in the same commit: verified (
lazyMenuBottomSheet.ts:126-141renders the loaded module directly; the DropdownMenu, MoreMenu and ContextMenu suites pass). - A caller-content bottom-sheet ContextMenu neither loads nor waits for the row module, on any page, including one with a data-driven sheet menu: verified (
lazyMenuBottomSheet.ts:89-91,ContextMenu.tsx:911-913; the load-count case;MenuBottomSheetPerSheetWait.test.tsx:79). - The sheet and row modules load lazily and preload at rest, and the sheet used to reveal before its rows through a second lazy boundary: verified (
DropdownMenu.tsx:638,ContextMenu.tsx:398-402, the loader onmain). - Each sheet decides the wait through its own lazy sheet; the data sheet resolves once the row module has loaded too; the caller-content sheet loads only the sheet: verified (
lazyMenuBottomSheet.ts:74-124). - A failed row load does not hold a sheet back, and the rows then fail through
lazy()as before: verified (lazyMenuBottomSheet.ts:82,:93-97). - ContextMenu picks the sheet by its content: verified (one conditional at
ContextMenu.tsx:911-913, used at:947-953). - The open-before-load test holds the row module, checks the sheet never shows without its rows, then that the rows show once it loads: verified (
MenuBottomSheetOpenBeforeLoad.test.tsx:57-89). - The new ContextMenu case checks that a caller-content sheet loads the action list zero times: verified (
ContextMenu.sheetLoading.test.tsx:77-98). - The one-page test opens the caller-content sheet at once, keeps only that sheet open while the rows load, and opens the DropdownMenu sheet with its rows once they load: verified (
MenuBottomSheetPerSheetWait.test.tsx:79,:88,:95-97). - The browser spec holds the row chunk 250 ms and opens the MoreMenu sheet story twice in one page, light then dark, reading the sheet two frames after it shows, as the MoreMenu audit does: verified (
MenuSheetRowsAtOpen.interaction.browser.spec.ts:56-90; it runs and passes in CI on this head, and its chunk pattern matches the built Storybook's row chunk). - The release note is a patch fix for the core package covering DropdownMenu, MoreMenu and ContextMenu: verified (no public API change; with the rows held, a data-driven ContextMenu shows a heading-only sheet on
mainand no sheet until its rows arrive here). - DropdownMenu's touch-sheet anatomy requirement governs, with no record change: verified.
- The new case fails on
mainand passes here; the one-page case fails withmain's sheet loading: verified (two open dialogs atMenuBottomSheetPerSheetWait.test.tsx:88onmain). The load-count case failing on an earlier revision of this branch: the author's report (it passes onmainand here, as expected). - DropdownMenu, MoreMenu, ContextMenu and BottomSheet units pass; type check and lint are clean: verified (the menu suites pass here, CI's unit, type-check and lint jobs pass on this head, and Core's type check and lint of the changed files are clean).
- The audit, tooltip, menu-pattern and touch-interaction browser runs and the cold-load probe at several CPU rates pass: the author's report; CI's interaction and dependent-audit jobs pass on this head.
- Menu page +194 B raw / +11 B gzip, table page +199 B raw, other pages unchanged: verified within measurement (menu +194 B and table +208 B minified on this head, docs and form unchanged, every gzip change under 0.1 KB).
- The new browser spec fails against a release check's Storybook and passes with the change; two release-check audits caught the heading-only sheet: the author's report; holding the row module reproduces the heading-only sheet on
mainevery time here.
- A bottom-sheet menu opened before its sheet code loads shows the sheet together with its actions, never an empty sheet first: verified (
- Files:
.changeset/menu-sheet-rows-at-open.md: clear.packages/core/src/ContextMenu/ContextMenu.sheetLoading.test.tsx: clear.packages/core/src/ContextMenu/ContextMenu.tsx: clear.packages/core/src/DropdownMenu/MenuBottomSheetOpenBeforeLoad.test.tsx: clear.packages/core/src/DropdownMenu/MenuBottomSheetPerSheetWait.test.tsx: clear.packages/core/src/DropdownMenu/__tests__/MenuSheetRowsAtOpen.interaction.browser.spec.ts: clear.packages/core/src/DropdownMenu/lazyMenuBottomSheet.ts: clear.- Consistency with
DropdownMenu.tsx(unchanged): every DropdownMenu sheet renders rows, so it keeps the waiting sheet.
|
/approve-spec f1de6be |
There was a problem hiding this comment.
Approved pending CI: some required checks (the remaining test-node and test-ui shards) are still running on this head.
A data-driven bottom-sheet menu opened before its row code has loaded now appears once with every action, and a caller-content ContextMenu sheet still opens without loading the rows. Nothing else is needed from the review; the required checks still have to pass before merge.
Claims and files checked
Review mode: same-head; reason: none
- Changed rules since the last review (0): none
- Claims:
- A bottom-sheet menu opened before its sheet code loads shows the sheet together with its actions, never an empty sheet first: verified (
lazyMenuBottomSheet.ts:79-85; the open-before-load case; a real-browser cold open of the MoreMenu sheet story with the row module held shows a heading-only sheet onmainand the whole sheet in its first visible frame with this patch). - Before, a menu opened at page load showed a sheet with no actions that filled in a moment later: verified (the new case fails on
mainatMenuBottomSheetOpenBeforeLoad.test.tsx:78; the cold open onmainshows only the heading for about 3.7 s with a 4 s hold). - A menu opened after the at-rest preload already rendered its rows in the same commit: verified (
lazyMenuBottomSheet.ts:126-141renders the loaded module directly; the DropdownMenu, MoreMenu and ContextMenu suites pass with this patch). - A caller-content bottom-sheet ContextMenu neither loads nor waits for the row module, on any page, including one with a data-driven sheet menu: verified (
lazyMenuBottomSheet.ts:89-91,ContextMenu.tsx:911-913; the load-count case;MenuBottomSheetPerSheetWait.test.tsx:79). - The sheet and row modules load lazily and preload at rest, and the sheet used to reveal before its rows through a second lazy boundary: verified (
DropdownMenu.tsx:637-639,ContextMenu.tsx:398-402, the loader onmain). - Each sheet decides the wait through its own lazy sheet; the data sheet resolves once the row module has loaded too; the caller-content sheet loads only the sheet: verified (
lazyMenuBottomSheet.ts:74-124). - A failed row load does not hold a sheet back, and the rows then fail through
lazy()as before: verified (lazyMenuBottomSheet.ts:82,:93-97). - ContextMenu picks the sheet by its content: verified (one conditional at
ContextMenu.tsx:911-913, used at:947-953). - The open-before-load test holds the row module, checks the sheet never shows without its rows, then that the rows show once it loads: verified (
MenuBottomSheetOpenBeforeLoad.test.tsx:57-89). - The new ContextMenu case checks that a caller-content sheet loads the action list zero times: verified (
ContextMenu.sheetLoading.test.tsx:77-98). - The one-page test opens the caller-content sheet at once, keeps only that sheet open while the rows load, and opens the DropdownMenu sheet with its rows once they load: verified (
MenuBottomSheetPerSheetWait.test.tsx:79,:88,:95-97). - The browser spec holds the row chunk 250 ms and opens the MoreMenu sheet story twice in one page, light then dark, reading the sheet two frames after it shows, as the MoreMenu audit does: verified (
MenuSheetRowsAtOpen.interaction.browser.spec.ts:56-90; it passed in CI on this head, and its chunk pattern matches the built Storybook's row chunk). - The release note is a patch fix for the core package covering DropdownMenu, MoreMenu and ContextMenu: verified (no public API change; with the rows held, a data-driven ContextMenu shows a heading-only sheet on
mainand no sheet until its rows arrive with this patch). - DropdownMenu's touch-sheet anatomy requirement governs, with no record change: verified.
- The new case fails on
mainand passes here; the one-page case fails withmain's sheet loading: verified (two open dialogs atMenuBottomSheetPerSheetWait.test.tsx:88onmain). The load-count case failing on an earlier revision of this branch: the author's report (it passes onmainand here, as expected). - DropdownMenu, MoreMenu, ContextMenu and BottomSheet units pass; type check and lint are clean: verified (the menu suites and Core's type check and lint of the changed files on an earlier revision with the same patch; on this head CI's type check, lint and two of four UI unit shards pass, and the rest are still running).
- The audit, tooltip, menu-pattern and touch-interaction browser runs and the cold-load probe at several CPU rates pass: the author's report; CI's interaction, accessibility-contract and dependent-audit jobs pass on this head.
- Menu page +194 B raw / +11 B gzip, table page +199 B raw, other pages unchanged: verified within measurement (menu +194 B and table +208 B minified with this patch, docs and form unchanged, every gzip change under 0.1 KB).
- The new browser spec fails against a release check's Storybook and passes with the change; two release-check audits caught the heading-only sheet: the author's report; holding the row module reproduces the heading-only sheet on
mainevery time.
- A bottom-sheet menu opened before its sheet code loads shows the sheet together with its actions, never an empty sheet first: verified (
- Files:
.changeset/menu-sheet-rows-at-open.md: clear.packages/core/src/ContextMenu/ContextMenu.sheetLoading.test.tsx: clear.packages/core/src/ContextMenu/ContextMenu.tsx: clear.packages/core/src/DropdownMenu/MenuBottomSheetOpenBeforeLoad.test.tsx: clear.packages/core/src/DropdownMenu/MenuBottomSheetPerSheetWait.test.tsx: clear.packages/core/src/DropdownMenu/__tests__/MenuSheetRowsAtOpen.interaction.browser.spec.ts: clear.packages/core/src/DropdownMenu/lazyMenuBottomSheet.ts: clear.- Consistency with
DropdownMenu.tsx(unchanged): every DropdownMenu sheet is data-driven and renders rows, so it keeps the waiting sheet.




































Primary intent
A bottom-sheet menu opened before its sheet code has loaded shows the sheet together with its actions, never an empty sheet first.
User impact
menuContent) shows no action list, so it neither loads nor waits for the row module, as before, on any page, including one that also has a data-driven sheet menu.Cause
A bottom-sheet DropdownMenu (and MoreMenu, ContextMenu) loads its sheet module and its row module lazily, preloading both at rest. A press right after mount could open the menu before they arrived. The sheet's module then revealed first, and its rows rendered through
lazy()behindSuspense fallback={null}a moment later.Change
lazyMenuBottomSheet.ts: each sheet decides the wait on its own, through two lazy sheets.MenuBottomSheet(DropdownMenu, and ContextMenu withitems) resolves only once the row module has loaded too. The newMenuBottomSheetWithoutActionList(ContextMenu withmenuContent) loads only the sheet. A failed row load does not hold a sheet back: the rows then fail throughlazy(), as before.ContextMenu.tsx: picks the sheet by its content (one line).MenuBottomSheetOpenBeforeLoad.test.tsx: opens the menu right after mount with the row module held. It checks the sheet never shows without its rows, then that the rows show once the module loads.ContextMenu.sheetLoading.test.tsx: a new case opens a caller-content bottom-sheet ContextMenu and checks that the action list loads zero times.MenuBottomSheetPerSheetWait.test.tsx: renders a DropdownMenu and a caller-content ContextMenu on one page with the row module held. The ContextMenu sheet opens at once, and only that sheet is open while the rows load; the DropdownMenu sheet opens, with its rows, once they load.__tests__/MenuSheetRowsAtOpen.interaction.browser.spec.ts: in a real browser, holds the row chunk back by 250 ms and opens the MoreMenu bottom-sheet story twice on one page (light, then dark), reading the sheet two frames after it becomes visible, as the MoreMenu audit does.[fix]patch.Authority
component:DropdownMenuFR1: the touch presentation renders a sheet frame containing the touch action list and its rows. No record change.Evidence
size:pages, against main): the menu page is +194 B raw / +11 B gzip and the table page +199 B raw, for the second lazy sheet; other pages are unchanged.Writing rubric results
Owner and land path