Repository navigation
perf(core): load the Selector bottom-sheet frame on demand (#12018) - #12075
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Changes requested. The deferral works: pages with one Selector or MultiSelector lose about 4.7 KB gzip of first-load JavaScript, and the reference pages are unchanged. Five fixes are needed first:
SelectorBottomSheet.tsxis now the root of a lazily loaded module graph but still imports the../Headingand../Sectionbarrels (andSection.tsximports../utils), soscripts/core-single-bundle.test.mjs"imports no barrel from inside a lazily imported module graph" fails; import../Heading/Heading,../Section/Sectionand../utils/mergePropsdirectly.- In the same file, "keeps the bottom sheet out of the startup chunks of a code-split app" now fails only because it walks from the first output that has an
entryPoint, which the new lazy entry turns into the lazyPowerSearchBottomSheetchunk; start the walk from the app's own entry, where the List app's startup chunks hold no BottomSheet. - The new comments at
Selector.tsx:1169andMultiSelector.tsx:1110cite a knowledge record, which makesno-comment-provenance.baseline.mjs --checkfail (and the cited rule covers minimal DOM, not loading), so drop the citation and keep the reason. - The lazy host and its preload Effect are copied into both
Selector.tsxandMultiSelector.tsxfor one shared sheet, so makeSelectorBottomSheet.tsxitself the lazy host (same export and props) and move the frame into a module that only it imports. - The changeset says the sheet "mounts only when opened", but the host renders the closed sheet at rest whenever the bottom-sheet presentation is active (
Selector.tsx:2262-2274), so say instead that it loads and mounts the closed sheet after the first client render.
Non-blocking: because the host already renders the lazy element at rest, the preload Effect starts the same import a second time and can go.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: desktop and pointer pages no longer carry the sheet frame in their first load. Verified: the frame, Section and Heading leave the first load, and the import-boundaries check passes.
- Claim: a Selector page loads about 3.8 KB less gzip (108.4 KB to 104.6 KB). Verified by the import-boundaries check; the reference-page measure shows 4.7 KB less.
- Claim: compact touch and explicit bottom-sheet selectors preload the sheet chunk and open as before. Verified: the chunk loads after the first client render, and the bottom-sheet and accessibility tests pass.
- Claim: the sheet mounts only when opened. False: the host renders the closed sheet at rest (
Selector.tsx:2262-2274,MultiSelector.tsx:2536-2548). - Claim: the change follows the Tokenizer and PowerSearch pattern under the cited style-authoring rule. The pattern is followed, but the citation is false: that rule covers minimal DOM, and the loading rule is the import-boundaries record.
- Claim:
SelectorBottomSheetexports its props and importsBottomSheetdirectly. Verified (SelectorBottomSheet.tsx:14,:29). - Claim: tests warm the sheet module and the bottom-sheet tests pass. Verified: five Selector and MultiSelector test files pass.
- Claim: the core typecheck passes. Verified.
- Claim: knowledge templates and records are aligned. Verified.
- Claim: the pre-review script reports 0 findings. Not reproduced (it needs a git remote).
- File
.changeset/selector-multiselector-defer-selectorbottomsheet-i4zp.md: finding (false "mounts only when opened"). - File
packages/core/src/Selector/SelectorBottomSheet.tsx: finding (barrel imports inside the lazy graph). - File
packages/core/src/Selector/Selector.tsx: findings (duplicated host, record citation, redundant Effect, false comment). - File
packages/core/src/MultiSelector/MultiSelector.tsx: findings (the same as Selector). - File
packages/core/src/Selector/Selector.test.tsx: clear. - File
packages/core/src/MultiSelector/MultiSelector.test.tsx: clear.
There was a problem hiding this comment.
Changes requested. The deferral works: a page with one Selector or MultiSelector loads about 4.8 KB less gzip JavaScript on first load, the reference pages are unchanged, and the points from the last review are fixed. Three fixes are needed:
- Miss:
Selector.sheetActiveDescendant.test.tsxnow fails, because it holds../BottomSheet/BottomSheetwhile the first open waits on./SelectorBottomSheetFrame, so point itsvi.mockand itsvi.importActualwarm-up at./SelectorBottomSheetFrame(the test passes with that change). - The pull request description still describes the previous revision (a host and preload Effect in
Selector.tsxandMultiSelector.tsx, a directBottomSheetimport inSelectorBottomSheet.tsx, and a minimal-DOM rule as authority), so rewrite it for this head: the frame inSelectorBottomSheetFrame.tsx, the host inSelectorBottomSheet.tsx, theSection.tsximport, the bundle-test entry fix, and the component import-boundaries rules as authority. - The changeset says
SelectorBottomSheetis no longer carried and is deferred, but it is the host that both components still import, so say instead that the bottom-sheet frame (Section,Headingand the sheet markup) leaves the first load and loads withBottomSheetafter the first client render.
Non-blocking: rerun node internal/eslint-plugin-astryx/no-internal-barrel-import.baseline.mjs to drop the now-stale rows for SelectorBottomSheet.tsx and Section.tsx, and consider a Selector.ssr.test.tsx like DropdownMenu.ssr.test.tsx, since this change also fixes the bottom-sheet Selector's aborted server render.
Claims and files checked
Review mode: full; reason: author-not-engowner
- Description: pointer pages no longer carry the sheet frame,
SectionandHeadingin their first load. Verified: Selector's eager entry goes from 108.4 KB to 104.4 KB, and a Selector page loses 4,978 B gzip. - Description: about 3.8 KB less (108.4 KB to 104.6 KB). Understated and stale: this head measures 104.4 KB.
- Description: compact touch and explicit bottom-sheet selectors load the sheet chunk on mount and open as before. Verified: the chunk loads after hydration, and the bottom-sheet tests in
Selector.test.tsxandMultiSelector.test.tsxpass. - Description:
Selector.tsxandMultiSelector.tsxgain a lazy host and a preload Effect. False: neither file changes. - Description:
SelectorBottomSheetexports its props. Verified (SelectorBottomSheet.tsx:16). - Description:
SelectorBottomSheetimportsBottomSheetdirectly, with no lazy. False:SelectorBottomSheet.tsx:18is the lazy, and the direct import isSelectorBottomSheetFrame.tsx:14. - Description: the change follows the Tokenizer and PowerSearch pattern under the minimal-DOM styling rule. False citation: it follows the Popover and DropdownMenu sheet hosts under the import-boundaries rules.
- Description: a preload Effect follows the Effects rule. False: no Effect is added.
- Description: tests warm the sheet module. Verified (
Selector.test.tsx:79-80,MultiSelector.test.tsx:86-87). - Description: the bottom-sheet tests pass. Verified for the two files named, but
Selector.sheetActiveDescendant.test.tsxfails. - Description: the core typecheck passes. Verified.
- Description: knowledge templates and records are aligned. Verified.
- Description: the pre-review script reports 0 findings. Not reproduced (it needs a git remote).
- Changeset: a pointer selector no longer statically carries
SelectorBottomSheet. False (Selector.tsx:110,MultiSelector.tsx:112). - Changeset: it no longer carries the sheet frame. Verified.
- Changeset: both components defer
SelectorBottomSheetbehind a lazy host. False: it is the host. - Changeset: the closed sheet loads and mounts after the first client render while the bottom-sheet presentation is active. Verified (
SelectorBottomSheet.tsx:25-27,Selector.tsx:2222-2234). - Changeset: about 3.8 KB less gzip on first paint. Verified as an understatement (4.0 KB on the entry check, 4,978 B on a Selector page).
- Changeset: bottom-sheet and compact adaptive selectors load the chunk after mount and open as before. Verified by the bottom-sheet tests.
- File
.changeset/selector-multiselector-defer-selectorbottomsheet-i4zp.md: finding (wrong module named as deferred). - File
packages/core/src/MultiSelector/MultiSelector.test.tsx: clear. - File
packages/core/src/Section/Section.tsx: clear (stale lint baseline row, non-blocking). - File
packages/core/src/Selector/Selector.test.tsx: clear. - File
packages/core/src/Selector/SelectorBottomSheet.tsx: finding (breaksSelector.sheetActiveDescendant.test.tsx). - File
packages/core/src/Selector/SelectorBottomSheetFrame.tsx: clear. - File
scripts/core-single-bundle.test.mjs: clear.
…d update baseline (meta#12018)
There was a problem hiding this comment.
Changes requested. The code is ready: a page with one Selector or MultiSelector loads about 4.9 KB less gzip JavaScript on first load, the reference pages are unchanged, and the test and changeset points from the last review are fixed. Two text fixes remain:
- The pull request description still describes the previous revision (a host and preload Effect in
Selector.tsxandMultiSelector.tsx, a directBottomSheetimport inSelectorBottomSheet.tsx, 3.8 KB, and the minimal-DOM rule as authority), so rewrite it for this head: the frame inSelectorBottomSheetFrame.tsx, the host inSelectorBottomSheet.tsx, theSection.tsximport, the bundle-test entry fix, the regenerated lint baseline, the component import-boundaries rules as authority, and Selector's eager entry going from 108.4 KB to 104.4 KB. - Miss: the title says
SelectorBottomSheetis deferred, but it is the lazy host that both components still import, so retitle the pull request around the frame, for exampleperf(core): load the Selector bottom-sheet frame on demand (#12018).
Non-blocking: Selector.sheetActiveDescendant.test.tsx:38 adds a consistent-type-imports lint warning (see the inline note), and a Selector.ssr.test.tsx like DropdownMenu.ssr.test.tsx would pin the hydration fix this change also brings.
Claims and files checked
Review mode: full; reason: author-not-engowner
- Description: pointer selectors no longer carry the sheet frame,
SectionandHeadingin their first load. Verified: both leave Selector's and MultiSelector's eager graph. - Description: the base's entry chunk carried
BottomSheet. False:BottomSheetwas already lazy on the base. - Description: about 3.8 KB less (108.4 KB to 104.6 KB). False at this head: 108.4 KB to 104.4 KB, 4.0 KB.
- Description: compact touch and explicit bottom-sheet selectors load the sheet chunk on mount and open as before. Verified (
SelectorBottomSheet.tsx:24-34,Selector.tsx:2222; the bottom-sheet tests pass). - Description:
Selector.tsxandMultiSelector.tsxgain a lazy host and a preload Effect. False: neither file changes, and no Effect is added. - Description: the change follows the Tokenizer and PowerSearch sheet-host pattern under the minimal-DOM styling rule. The pattern is verified; the citation is false, since the component import-boundaries rules govern loading.
- Description:
SelectorBottomSheetexports its props type. Verified (SelectorBottomSheet.tsx:16). - Description:
SelectorBottomSheetimportsBottomSheetdirectly, with itslazyremoved. False:SelectorBottomSheet.tsx:18is thelazy, and the direct import isSelectorBottomSheetFrame.tsx:14. - Description: the tests warm the sheet modules. Verified (
Selector.test.tsx:79-80,MultiSelector.test.tsx:86-87). - Description: the changeset documents 3.8 KB. False: it says about 4.0 KB.
- Description: the bottom-sheet tests pass. Verified: all 625 Selector and MultiSelector tests pass.
- Description: the Core typecheck passes. Verified.
- Description: knowledge templates and records are aligned. Verified.
- Description: the pre-review script reports no findings. Not reproduced: it needs a git checkout.
- Title:
SelectorBottomSheetis deferred behind a lazy host. False: it is the host. - Changeset: a pointer selector no longer statically carries the bottom-sheet frame (
Section,Headingand the sheet markup). Verified. - Changeset: the frame loads with
BottomSheetafter the first client render while the bottom-sheet presentation is active. Verified (SelectorBottomSheet.tsx:24-34,Selector.tsx:2222-2233,MultiSelector.tsx:2495-2506). - Changeset: about 4.0 KB less gzip on first paint. Verified (4.0 KB on the entry check; 4,978 B on a Selector page).
- Changeset: bottom-sheet and compact adaptive selectors load the chunk after mount and open as before. Verified by the bottom-sheet tests.
- Changeset: a patch bump for Core. Verified (the changeset check passes).
- File
.changeset/selector-multiselector-defer-selectorbottomsheet-i4zp.md: clear. - File
internal/eslint-plugin-astryx/no-internal-barrel-import.baseline.json: clear (its generator's check passes). - File
packages/core/src/MultiSelector/MultiSelector.test.tsx: clear. - File
packages/core/src/Section/Section.tsx: clear. - File
packages/core/src/Selector/Selector.sheetActiveDescendant.test.tsx: non-blocking lint warning (line 38). - File
packages/core/src/Selector/Selector.test.tsx: clear. - File
packages/core/src/Selector/SelectorBottomSheet.tsx: clear. - File
packages/core/src/Selector/SelectorBottomSheetFrame.tsx: clear. - File
scripts/core-single-bundle.test.mjs: clear.
There was a problem hiding this comment.
Changes requested: the code is ready, and two sentences in the description need a fix.
- The description says
BottomSheetwas eagerly bundled on the base ("no longer eagerly bundle …BottomSheetdependencies" and "previously statically bundledHeading,Section, andBottomSheet"), but the baseSelectorBottomSheet.tsxalready loaded it throughlazy(), so dropBottomSheetfrom both sentences: the 4.0 KB saving is the frame alone (Section,Headingand the sheet markup).
The sheet test, changeset, title and lint points from the last review are fixed, and the new SSR test fails on the base and passes here. CI has not run on this head yet; a maintainer adds the ci:run label so it runs.
Claims and files checked
Review mode: full; reason: author-not-engowner
- Description: addresses item 3 of the linked issue (the Selector sheet frame in every Selector's first load). Verified: the frame leaves the Selector and MultiSelector eager graphs.
- Description: less eager JavaScript before first paint for pointer presentations. Verified: 4,085 B gzip less for the Selector entry and 4,119 B for MultiSelector.
- Description: pointer consumers no longer eagerly bundle the frame,
Section,HeadingandBottomSheet. False forBottomSheet, which the base already loaded lazily (SelectorBottomSheet.tsx:18-22on the base); verified for the frame,SectionandHeading. - Description: a page using Selector loads 4.0 KB less (108.4 KB to 104.4 KB). Verified (110,955 B to 106,870 B on the import-boundaries entry).
- Description: compact touch and explicit bottom-sheet selectors load the sheet chunk after mount and open as before. Verified (
SelectorBottomSheet.tsx:24-34,Selector.tsx:2222-2233; the bottom-sheet tests pass). - Description:
SelectorBottomSheetpreviously bundledHeading,SectionandBottomSheetstatically. False forBottomSheet(same evidence). - Description: the host follows the Popover and DropdownMenu sheet hosts, with a hydration guard and no change to
Selector.tsxorMultiSelector.tsx. Verified (Popover/lazyPopoverBottomSheet.ts:46-57,DropdownMenu/lazyMenuBottomSheet.ts:85-96; neither component file changes). - Description: the frame and
Sectionimport directly, so the lazy graph has no barrel. Verified (SelectorBottomSheetFrame.tsx:14-16,Section.tsx:39; the single-bundle barrel test passes). - Description: the component import-boundaries rules are the authority. Verified.
- Description: the bundle test's code-split walk starts from the app entry. Verified (
scripts/core-single-bundle.test.mjs:163). - Description: the sheet test holds and warms the frame module. Verified (
Selector.sheetActiveDescendant.test.tsx:35-48). - Description: the Selector and MultiSelector tests warm the frame. Verified (
Selector.test.tsx:79-80,MultiSelector.test.tsx:86-87). - Description: the lint baseline drops the stale rows for
SelectorBottomSheet.tsxandSection.tsx. Verified; it also drops five other stale rows that its own check requires. - Description: the changeset documents a 4.0 KB eager gzip reduction. Verified.
- Description: the import-boundaries check shows 108.4 KB to 104.4 KB. Verified.
- Description: the single-bundle test passes 3 of 3. Verified.
- Description: the sheet, Selector and MultiSelector bottom-sheet tests pass. Verified (658 tests pass).
- Description: knowledge templates and records are aligned. Verified.
- Description: public text carries no internal context. Verified.
- Changeset: a pointer Selector or MultiSelector no longer statically carries the frame (
Section,Headingand the sheet markup). Verified. - Changeset: the frame loads with
BottomSheetafter the first client render while the bottom-sheet presentation is active. Verified (SelectorBottomSheet.tsx:25-31). - Changeset: about 4.0 KB less gzip on first paint. Verified.
- Changeset: bottom-sheet and compact adaptive selectors load the chunk after mount and open as before. Verified by the bottom-sheet tests.
- Changeset: a patch bump for Core. Verified (the changeset check passes).
- Title: the Selector bottom-sheet frame loads on demand. Verified: it loads only when a bottom-sheet presentation renders.
- File
.changeset/selector-multiselector-defer-selectorbottomsheet-i4zp.md: clear. - File
internal/eslint-plugin-astryx/no-internal-barrel-import.baseline.json: clear (its check fails on the base and passes here). - File
packages/core/src/MultiSelector/MultiSelector.test.tsx: clear. - File
packages/core/src/Section/Section.tsx: clear. - File
packages/core/src/Selector/Selector.sheetActiveDescendant.test.tsx: clear. - File
packages/core/src/Selector/Selector.ssr.test.tsx: clear (fails on the base, passes here). - File
packages/core/src/Selector/Selector.test.tsx: clear. - File
packages/core/src/Selector/SelectorBottomSheet.tsx: clear. - File
packages/core/src/Selector/SelectorBottomSheetFrame.tsx: clear. - File
scripts/core-single-bundle.test.mjs: clear.
…here or focus moving away
|
/approve-spec 2b515a0 |
There was a problem hiding this comment.
Changes requested: the on-intent sheet load and the earlier fixes hold, but the newest commit ends a held sheet open with its own outside-press listener.
useSelectorPresentation.ts(lines 258-280) adds its own documentpointerdownlistener, stop ref and unmount Effect to end a held sheet open, beside the shareduseOutsidePresswatch the same hook already uses (line 147), so please start a second watch fromuseOutsidePresswithpath => path.includes(trigger)and the trigger's shadow root, and delete the hand-written copy, which already misjudges a second tap on a trigger inside a closed shadow root.- The description says the head's
Selectorboundary entry reads 115.8 to 115.9 KB, but the boundary check on this head reads 116.1 KB (−3.8 KB), so please update that figure.
Ending a held open when the person presses elsewhere or moves focus away fits the import-boundaries record's later-intent rule; only its listener needs to move. The non-blocking notes (held-open arrow keys, no test for a drop by a focus move alone, three tests that warm only BottomSheet, and comment wording) are in the review.
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Changeset: the bottom-sheet frame no longer loads with the page: verified (
SelectorBottomSheet.tsx:27-58, boundary check). - Changeset and description: a page with a
Selectorloads about 4 KB less gzip on first paint: verified (boundary check on this head: −3.8 KB). - Changeset: a sheet-presented selector loads the frame on a pointer down, focus or open request: verified (
Selector.tsx:2316-2321,:2343;MultiSelector.tsx:2609-2615,:2743;useSelectorPresentation.ts:293). - Changeset: a tap before the frame arrives opens the sheet once it does, with focus in the list: verified (
Selector.sheetLoad.test.tsx). - Popover presentations no longer carry the sheet frame,
SectionorHeadingin their first load: verified (type-only frame import plusimport(); boundary check). - The trigger also loads on a mouse or pen entering it, and
show()loads for the sheet: verified (Selector.tsx:2344,useSelectorPresentation.ts:359-372). - A failed load warns once, is not kept, and drops a held open: verified (
SelectorBottomSheet.tsx:30-36,moduleLoader.ts:50-62,useSelectorPresentation.ts:293-297,Selector.sheetLoadFailure.test.tsx). - The host never suspends, and an early open stays requested until the frame renders it unless the person moves on: verified (
SelectorBottomSheet.tsx:53-58). - The frame imports
BottomSheet,HeadingandSectiondirectly, andSectionimportsmergePropsdirectly: verified (SelectorBottomSheetFrame.tsx:14-16,Section.tsx:39). - During a held open a second press, Enter or Space keeps it while Escape and Tab drop it, and the public hooks keep their signatures: verified (
Selector/hooks.ts:476-480,:551-554,:638-641,:655-666;MultiSelector/hooks.ts:97-101,:183-186,:314-317,:337-347). - A held open ends on a press outside the trigger or a focus move, and its listeners go when the list shows, on close or on unmount: verified (
useSelectorPresentation.ts:243-290,:316,:381-383). - The two new held-open tests fail without the change: verified by reading, not run.
- The loader's new members are additive and no existing caller changes: verified (
moduleLoader.ts; MobileNav, DropdownMenu, Toast and Text are untouched). - The trigger reports expanded and names the listbox only while the sheet's listbox is in the document; a load elsewhere leaves a closed trigger unchanged; the popover is unchanged; the chevron and its theme state follow: verified (
useSelectorPresentation.ts:400-401;Selector.tsx:2249-2250,:2431,:2505,:2513;MultiSelector.tsx:2629-2630,:2826-2832,:2904,:2912). - Each new or updated test does what the description says: verified by reading.
- The lint baseline drops stale rows: verified (lint passes on this head; it also drops other stale rows).
- After merging main the head's boundary entry reads 115.8 to 115.9 KB: false on this head (116.1 KB).
- Each of the four reference pages grows under 0.3 KB gzip: verified for this head (the newest commit touches no module those pages reach).
- The bundle and unit test runs pass: not rechecked here (those jobs run after review).
- Maintainer device runs at an earlier revision: informational; no record this change touches requires them.
Files:
.changeset/selector-multiselector-defer-selectorbottomsheet-i4zp.md: clearinternal/eslint-plugin-astryx/no-internal-barrel-import.baseline.json: clearpackages/core/src/MultiSelector/MultiSelector.sheetLoad.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clearpackages/core/src/MultiSelector/hooks.ts: clear (comment wording note)packages/core/src/Section/Section.tsx: clearpackages/core/src/Selector/Selector.sheetActiveDescendant.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldInputs.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldOtherSelector.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldPressOutside.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoad.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoadFailure.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoadHover.test.tsx: clearpackages/core/src/Selector/Selector.ssr.test.tsx: clearpackages/core/src/Selector/Selector.test.tsx: clearpackages/core/src/Selector/Selector.tsx: clearpackages/core/src/Selector/SelectorBottomSheet.tsx: clearpackages/core/src/Selector/SelectorBottomSheetFrame.tsx: clearpackages/core/src/Selector/__tests__/SelectorSheetHeldOpen.a11y.chromium.spec.ts: clearpackages/core/src/Selector/hooks.ts: clear (held-open arrow keys and comment wording, non-blocking)packages/core/src/Selector/useSelectorPresentation.ts: finding (a second outside-press watch beside the shared one)packages/core/src/utils/moduleLoader.test.ts: clearpackages/core/src/utils/moduleLoader.ts: clear (doc wording note)
|
/approve-spec d838fa3 |
There was a problem hiding this comment.
Changes requested: the held sheet open ends through the shared outside-press watch, as asked earlier, but that watch's default makes a held open swallow a modal host's backdrop tap.
useSelectorPresentation.ts(line 260) hands the held-open drop to the shared watch as its outside callback, so the watch records it as a layer's outside close, and a backdrop tap on a Dialog, Drawer or BottomSheet holding the selector, made before the sheet code arrives, leaves that host open; please let the watch skip that count for a close that dismisses no layer, and add a test that the backdrop tap still closes the host.- The description says the head's
Selectorboundary entry reads 116.0 KB, but the boundary check on this head reads 116.1 KB (−3.8 KB), so please update or drop that figure.
The non-blocking notes (a second tap on the chevron re-takes the hold, the held-open arrow keys, test gaps, and comment wording) are in the review.
Claims and files checked
Review mode: same-head; reason: none
Claims:
- Changeset: the bottom-sheet frame no longer loads with the page: verified (
SelectorBottomSheet.tsx:27-37, boundary check). - Changeset and description: a page with a
Selectorloads about 4 KB less gzip on first paint: verified (boundary check on this head: −3.8 KB). - Changeset and description: a sheet-presented selector loads the frame on a pointer down, focus or open request, and on a mouse or pen entering the trigger: verified (
Selector.tsx:2316-2321,:2343-2346;MultiSelector.tsx:2609-2615,:2743-2746;useSelectorPresentation.ts:288,:354-367). - Changeset: a tap before the frame arrives opens the sheet once it does, with focus in the list: verified (
Selector.sheetLoad.test.tsx), unless the person presses elsewhere or moves focus first. - Popover presentations no longer carry the sheet frame,
SectionorHeadingin their first load: verified (type-only frame import plusimport(); boundary check). - The bottom sheet was bundled eagerly because the components imported it statically and it imported
HeadingandSectionstatically: verified (baseSelectorBottomSheet.tsx). - A failed load warns once, is not kept, and drops a held open: verified (
SelectorBottomSheet.tsx:30-36,moduleLoader.ts,useSelectorPresentation.ts:288-292,Selector.sheetLoadFailure.test.tsx). - The host never suspends and renders nothing until the frame arrives, and an early open stays requested until the frame renders it: verified (
SelectorBottomSheet.tsx:50-58). - The frame imports
BottomSheet,HeadingandSectiondirectly, andSectionimportsmergePropsdirectly: verified (SelectorBottomSheetFrame.tsx:14-16,Section.tsx:39). - During a held open a second press, Enter or Space keeps it while Escape and Tab drop it, and the public hooks keep their signatures: verified for a press on the trigger (
Selector/hooks.ts:476-480,:551-554,:638-641,:655-666;MultiSelector/hooks.ts:97-101,:183-186,:314-317); a press on the chevron drops and re-takes the hold (non-blocking). - A held open ends on a press outside the trigger or a focus move, through a second shared watch and a trigger focus check that stop when the list shows, on close, and (the watch) on unmount: verified (
useSelectorPresentation.ts:234-275,:311,:376-378;Layer/outsidePress.ts:300); the drop is also counted as a layer's outside close (blocking finding). - The two held-open tests fail without the change: verified by reading, not run.
- The loader's new members are additive and no existing caller changes: verified (
moduleLoader.ts; MobileNav, DropdownMenu, Toast and Text are untouched). - The controller owns the listbox attachment and returns one expanded and one named rule for both components: verified (
useSelectorPresentation.ts:369-396). - The trigger reports expanded and names the listbox only while the sheet's listbox is in the document; a load elsewhere leaves a closed trigger unchanged; the popover is unchanged; a held MultiSelector names no active option; the chevron and its theme state follow: verified (
Selector.tsx:2249-2250,:2430-2431,:2505,:2513;MultiSelector.tsx:2629-2630,:2826-2832,:2904,:2912). - Each new or updated test does what the description says: verified by reading.
- The lint baseline drops the stale rows for the sheet host and
Section: verified (it also drops six other rows already stale on the base). - After merging main the head's boundary entry reads 116.0 KB: false on this head (116.1 KB).
- Each of the four reference pages grows under 0.3 KB gzip: verified as reported (description table), and consistent with the boundary check's +0.1 KB per entry at this head.
- The bundle and unit test runs pass: not rechecked (those jobs run after review).
- The knowledge check passes: verified (the Lint run passes on this head).
- Maintainer device runs at an earlier revision: informational; no record this change touches requires them.
Files:
.changeset/selector-multiselector-defer-selectorbottomsheet-i4zp.md: clearinternal/eslint-plugin-astryx/no-internal-barrel-import.baseline.json: clearpackages/core/src/MultiSelector/MultiSelector.sheetLoad.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clearpackages/core/src/MultiSelector/hooks.ts: clear (comment wording note)packages/core/src/Section/Section.tsx: clearpackages/core/src/Selector/Selector.sheetActiveDescendant.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldInputs.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldOtherSelector.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldPressOutside.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoad.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoadFailure.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoadHover.test.tsx: clearpackages/core/src/Selector/Selector.ssr.test.tsx: clearpackages/core/src/Selector/Selector.test.tsx: clearpackages/core/src/Selector/Selector.tsx: clearpackages/core/src/Selector/SelectorBottomSheet.tsx: clearpackages/core/src/Selector/SelectorBottomSheetFrame.tsx: clearpackages/core/src/Selector/__tests__/SelectorSheetHeldOpen.a11y.chromium.spec.ts: clearpackages/core/src/Selector/hooks.ts: clear (held-open arrow keys and comment wording, non-blocking)packages/core/src/Selector/useSelectorPresentation.ts: finding (the held-open drop is counted as a layer's outside close)packages/core/src/utils/moduleLoader.test.ts: clearpackages/core/src/utils/moduleLoader.ts: clear (doc wording note)
… so a modal host's backdrop press still closes the host
|
/approve-spec 29d015b |
There was a problem hiding this comment.
Approved pending CI: the held sheet open now ends without counting as a layer's outside close, so a backdrop tap on a Dialog, Drawer or BottomSheet holding the selector closes it in one tap, and the stale boundary figure is gone from the description. The unit, browser, build and docsite jobs are still running on this head, and the merge waits for them to pass.
Nothing blocking remains. The non-blocking notes (a tap on the chevron during a held open drops and re-takes it, the navigation keys tracked in #13751, two missing single-intent tests, three accessibility tests that warm only BottomSheet, and comment wording) are in the review.
Claims and files checked
Review mode: full; reason: author-not-engowner
Claims:
- Changeset: the bottom-sheet frame (
BottomSheet,Section,Heading, sheet markup) no longer loads with the page: verified (SelectorBottomSheet.tsx:22-37, boundary check). - Changeset and description: a page using
Selectorloads about 4 KB less gzip on first paint: verified (boundary check on this head: 120.0 KB to 116.2 KB, −3.8 KB; the description's 118.5 to 114.5 KB pair is from an earlier base, as its evidence section says). - Changeset and description: a sheet-presented selector loads the frame when a pointer lands on the trigger, the trigger takes focus, or the list is asked to open, and also when a mouse or pen enters it: verified (
Selector.tsx:2319-2321,:2343-2346;MultiSelector.tsx:2612-2614,:2632-2648,:2692-2694,:2743-2746;useSelectorPresentation.ts:290,:356-369). - Changeset and description: a tap before the frame arrives opens the sheet once it does, with focus in the list: verified (
Selector.sheetLoad.test.tsx), unless the person presses elsewhere or moves focus first. - Popover pages no longer carry the frame,
SectionorHeadingin their first load: verified (type-only frame import plusimport(); boundary check). - The sheet was bundled eagerly because both components imported it statically and it imported
HeadingandSectionstatically: verified (the baseSelectorBottomSheet.tsx). - A failed load warns once, is not kept, and drops a held open: verified (
SelectorBottomSheet.tsx:27-37,moduleLoader.ts,useSelectorPresentation.ts:290-294,Selector.sheetLoadFailure.test.tsx). - The host never suspends, renders nothing until the frame arrives, and an early open stays requested until the frame renders it: verified (
SelectorBottomSheet.tsx:50-58). - The frame imports
BottomSheet,HeadingandSectiondirectly, andSectionimportsmergePropsdirectly: verified (SelectorBottomSheetFrame.tsx:14-16,Section.tsx:39). - During a held open a second press, Enter or Space keeps it while Escape and Tab drop it, and the public hooks keep their signatures: verified for a press on the trigger (
Selector/hooks.ts:476-481,:551-554,:638-641;MultiSelector/hooks.ts:97-102,:183-186,:314-317); a press on the chevron drops and re-takes the hold (non-blocking). - A held open ends on a press outside the trigger or a focus move, through a second shared watch that counts no layer dismissal and a trigger focus check; both stop when the list shows or on close, and the watch also on unmount: verified (
useSelectorPresentation.ts:234-277,:313,:378-380;Layer/outsidePress.ts:299-315). - The outside-press watch gains a dismissal option that defaults to counting, so every existing caller is unchanged: verified (
Layer/outsidePress.ts:63-70,:113,:128-130,:201-203). - A backdrop press on a Dialog holding the Selector during the hold still closes the Dialog, and the watch's own test covers the option: verified by reading (
Selector.sheetHeldBackdrop.test.tsx,outsidePress.test.ts), not run. - The press-elsewhere and other-selector tests fail without the change: verified by reading, not run.
- The loader's new members are additive and no existing caller changes: verified (
moduleLoader.ts; MobileNav, DropdownMenu, Toast and Text are untouched). - The controller owns the listbox attachment and returns one expanded and one named rule for both components: verified (
useSelectorPresentation.ts:371-398). - The trigger reports expanded and names the listbox only while the sheet's listbox is in the document; a load elsewhere leaves a closed trigger unchanged; the popover is unchanged; a held MultiSelector names no active option; the chevron and its theme state follow: verified (
Selector.tsx:2430-2431,:2505,:2513;MultiSelector.tsx:2709-2710,:2826-2832,:2904,:2912). - Each new or updated test does what the description says: verified by reading.
- The lint baseline drops the stale rows for the sheet host and
Section: verified (it also drops six other rows already stale on the base). - Each of the four reference pages grows under 0.3 KB gzip: verified as reported, and consistent with the boundary check's +0.1 KB per entry on this head.
- The bundle and unit test runs pass: not rechecked (those jobs are still running on this head).
- The knowledge check passes: verified (the Lint run passes on this head).
- Maintainer device runs at an earlier revision: informational; no record this change touches requires them.
Files:
.changeset/selector-multiselector-defer-selectorbottomsheet-i4zp.md: clearinternal/eslint-plugin-astryx/no-internal-barrel-import.baseline.json: clearpackages/core/src/Layer/outsidePress.test.ts: clearpackages/core/src/Layer/outsidePress.ts: clearpackages/core/src/MultiSelector/MultiSelector.sheetLoad.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clear (chevron second-tap note)packages/core/src/MultiSelector/hooks.ts: clear (comment wording note)packages/core/src/Section/Section.tsx: clearpackages/core/src/Selector/Selector.sheetActiveDescendant.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldBackdrop.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldInputs.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldOtherSelector.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldPressOutside.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoad.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoadFailure.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoadHover.test.tsx: clearpackages/core/src/Selector/Selector.ssr.test.tsx: clearpackages/core/src/Selector/Selector.test.tsx: clearpackages/core/src/Selector/Selector.tsx: clear (chevron second-tap note)packages/core/src/Selector/SelectorBottomSheet.tsx: clearpackages/core/src/Selector/SelectorBottomSheetFrame.tsx: clearpackages/core/src/Selector/__tests__/SelectorSheetHeldOpen.a11y.chromium.spec.ts: clearpackages/core/src/Selector/hooks.ts: clear (held-open navigation keys and comment wording, non-blocking)packages/core/src/Selector/useSelectorPresentation.ts: clear (comment wording notes)packages/core/src/utils/moduleLoader.test.ts: clearpackages/core/src/utils/moduleLoader.ts: clear (doc wording note)
|
/approve-spec 748d997 |
There was a problem hiding this comment.
Approved pending CI: the bottom-sheet frame now loads on the trigger's intent, a tap made before it arrives is held with the trigger reading collapsed, and the merge of main changes none of this pull request's own lines. The unit, build, browser and docsite jobs started on this head after review passed and are still running; the merge waits for them to pass.
Nothing blocking remains. The non-blocking notes (a tap on the chevron during a held open drops and re-takes it, the navigation keys tracked in #13751, two missing single-intent tests, three accessibility tests that warm only BottomSheet, and comment wording) are unchanged from the last review.
Claims and files checked
Review mode: full; reason: author-not-engowner
Claims:
- Changeset: the bottom-sheet frame (
BottomSheet,Section,Heading, sheet markup) no longer loads with the page: verified (SelectorBottomSheet.tsx:22-37, boundary check). - Changeset and description: a page using
Selectorloads about 4 KB less gzip on first paint: verified (boundary check on this head: 120.3 KB to 116.5 KB, −3.8 KB; the description's 118.5 to 114.5 KB pair is from an earlier base, as its evidence section says). - Changeset and description: a sheet-presented selector loads the frame when a pointer lands on the trigger, the trigger takes focus, or the list is asked to open, and also when a mouse or pen enters it: verified (
Selector.tsx:2326-2328,:2350-2353;MultiSelector.tsx:2619-2621,:2642-2655,:2699-2701,:2750-2753;useSelectorPresentation.ts:290,:356-369). - Changeset and description: a tap before the frame arrives opens the sheet once it does, with focus in the list: verified (
Selector.sheetLoad.test.tsx), unless the person presses elsewhere or moves focus first. - Popover pages no longer carry the frame,
SectionorHeadingin their first load: verified (type-only frame import plusimport(); boundary check). - The sheet was bundled eagerly because both components imported it statically and it imported
HeadingandSectionstatically: verified (the baseSelectorBottomSheet.tsx). - A failed load warns once, is not kept, and drops a held open: verified (
SelectorBottomSheet.tsx:27-37,moduleLoader.ts:50-83,useSelectorPresentation.ts:290-294,Selector.sheetLoadFailure.test.tsx). - The host never suspends, renders nothing until the frame arrives, and an early open stays requested until the frame renders it: verified (
SelectorBottomSheet.tsx:50-59). - The frame imports
BottomSheet,HeadingandSectiondirectly, andSectionimportsmergePropsdirectly: verified (SelectorBottomSheetFrame.tsx:14-16,Section.tsx:39). - During a held open a second press, Enter or Space keeps it while Escape and Tab drop it, and the public hooks keep their signatures: verified for a press on the trigger (
Selector/hooks.ts:476-481,:551-554,:638-641;MultiSelector/hooks.ts:97-102,:183-186,:314-317); a press on the chevron drops and re-takes the hold (non-blocking). - A held open ends on a press outside the trigger or a focus move, through a second shared watch that counts no layer dismissal and a trigger focus check; both stop when the list shows or on close, and the watch also on unmount: verified (
useSelectorPresentation.ts:234-277,:313,:378-380;Layer/outsidePress.ts:299-318). - The outside-press watch gains a dismissal option that defaults to counting, so every existing caller is unchanged: verified (
Layer/outsidePress.ts:63-70,:113,:128-130,:201-203). - A backdrop press on a Dialog holding the Selector during the hold still closes the Dialog, and the watch's own test covers the option: verified by reading (
Selector.sheetHeldBackdrop.test.tsx,outsidePress.test.ts), not run. - The press-elsewhere and other-selector tests fail without the change: verified by reading, not run.
- The loader's new members are additive and no existing caller changes: verified (
moduleLoader.ts; MobileNav, DropdownMenu, Toast and Text are untouched). - The controller owns the listbox attachment and returns one expanded and one named rule for both components: verified (
useSelectorPresentation.ts:371-398). - The trigger reports expanded and names the listbox only while the sheet's listbox is in the document; a load elsewhere leaves a closed trigger unchanged; the popover is unchanged; a held MultiSelector names no active option; the chevron and its theme state follow: verified (
Selector.tsx:2437-2438,:2512,:2520;MultiSelector.tsx:2716-2717,:2833-2839,:2911,:2919). - Each new or updated test does what the description says: verified by reading.
- The lint baseline drops the stale rows for the sheet host and
Section: verified (it also drops six other rows already stale on the base). - Each of the four reference pages grows under 0.3 KB gzip: verified as reported, and consistent with the boundary check's +0.1 KB per entry on this head.
- The bundle and unit test runs pass: not rechecked (those jobs are still running on this head).
- The knowledge check passes: verified (the Lint run passes on this head).
- Maintainer device runs at an earlier revision: informational; no record this change touches requires them.
Files:
.changeset/selector-multiselector-defer-selectorbottomsheet-i4zp.md: clearinternal/eslint-plugin-astryx/no-internal-barrel-import.baseline.json: clearpackages/core/src/Layer/outsidePress.test.ts: clearpackages/core/src/Layer/outsidePress.ts: clearpackages/core/src/MultiSelector/MultiSelector.sheetLoad.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.test.tsx: clearpackages/core/src/MultiSelector/MultiSelector.tsx: clear (chevron second-tap note)packages/core/src/MultiSelector/hooks.ts: clear (comment wording note)packages/core/src/Section/Section.tsx: clearpackages/core/src/Selector/Selector.sheetActiveDescendant.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldBackdrop.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldInputs.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldOtherSelector.test.tsx: clearpackages/core/src/Selector/Selector.sheetHeldPressOutside.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoad.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoadFailure.test.tsx: clearpackages/core/src/Selector/Selector.sheetLoadHover.test.tsx: clearpackages/core/src/Selector/Selector.ssr.test.tsx: clearpackages/core/src/Selector/Selector.test.tsx: clearpackages/core/src/Selector/Selector.tsx: clear (chevron second-tap note)packages/core/src/Selector/SelectorBottomSheet.tsx: clearpackages/core/src/Selector/SelectorBottomSheetFrame.tsx: clearpackages/core/src/Selector/__tests__/SelectorSheetHeldOpen.a11y.chromium.spec.ts: clearpackages/core/src/Selector/hooks.ts: clear (held-open navigation keys and comment wording, non-blocking)packages/core/src/Selector/useSelectorPresentation.ts: clear (comment wording notes)packages/core/src/utils/moduleLoader.test.ts: clearpackages/core/src/utils/moduleLoader.ts: clear (doc wording note)
|
🤖 (Posted by Cindy's agent.) Merged, thank you @MuhammadAusafJamal! Selector and MultiSelector now load their bottom-sheet code only when someone is about to open one (on hover, focus or the first press), so pages with a Selector download about 4 KB less up front. Along the way, the change picked up careful handling for slow and failed loads: a tap made while the sheet loads opens it exactly once, tapping elsewhere cancels it, and a failed load leaves the Selector usable and retries on the next tap. A maintainer carried the later rounds on your branch with you credited. Thank you for starting this. |
Thank you for letting me be a part of this project. ;) |
Primary intent
Defer the
SelectorandMultiSelectorbottom-sheet presentation so it loads on the trigger's intent through the shared module loader. Addresses item 3 of #12018.This is a performance improvement reducing eager JavaScript loaded before first paint on pointer/desktop presentations;
other.mdfits because this is neither a bug fix nor a new feature.User or maintainer impact
Desktop and pointer consumers (where
SelectorandMultiSelectorpresent as a popover) no longer eagerly bundle the mobile bottom-sheet frame,Section, andHeadingdependencies into their first-paint chunk.A page using
Selectorloads about 4 KB less eager JavaScript (gzip) on first paint (check-component-import-boundaries: 118.5 KB → 114.5 KB, −4.0 KB). Compact touch and explicitpresentation="bottom-sheet"load the sheet frame when a finger or pointer lands on the trigger, the trigger takes focus, or the list is asked to open. A tap made before the frame arrives opens the sheet once it does, with focus in the list.Problem and solution fit
Selector.tsxandMultiSelector.tsximportedSelectorBottomSheetstatically, which previously statically bundledHeadingandSection.architecture:component-import-boundariesINV1 reaches a surface module only throughimport()behind the shared module loader; INV2 starts the load on intent (pointer down, focus, open request) and never before it, during server render or during hydration; INV4 honours an intent made before the load once; INV5 lets the load move nothing.SelectorBottomSheet.tsxholds acreateModuleLoaderforSelectorBottomSheetFrame, andloadSelectorBottomSheet()starts it. The trigger calls it from a capturing pointer-down, from a mouse or pen entering it, and from focus (when the selector can open), anduseSelectorPresentation'sshow()calls it for the sheet. A failed load warns once, is not kept (the shared loader drops a failed load), and drops a held open, so the trigger never reports a list that never shows (INV6). The host reads the loaded frame throughuseSyncExternalStoreand renders nothing until it arrives, so it never suspends, and an open requested before then stays requested until the frame renders it.SelectorBottomSheetFrame.tsximports../Heading/Heading,../Section/Section, and../BottomSheet/BottomSheetdirectly, andSection.tsximports../utils/mergeProps, eliminating barrel traversal within the lazily imported module graph.Authority
architecture:component-import-boundaries: eager bundle boundaries and avoiding barrel imports within lazily imported module graphs.Change and evidence
packages/core/src/Selector/SelectorBottomSheetFrame.tsx:BottomSheet,Section,Heading).../Heading/Heading,../Section/Section, and../BottomSheet/BottomSheet.packages/core/src/Selector/SelectorBottomSheet.tsx:createModuleLoaderfor./SelectorBottomSheetFrame,loadSelectorBottomSheet(), andSelectorBottomSheet, which renders the loaded frame (server snapshot: none).packages/core/src/Selector/useSelectorPresentation.ts:show()starts the load for the sheet, and the controller returnspreloadSheet.packages/core/src/Selector/Selector.tsx,packages/core/src/MultiSelector/MultiSelector.tsx: the trigger's focus and a capturing pointer-down on the control box callpreloadSheetwhen the selector can open.packages/core/src/Selector/Selector.sheetLoad.test.tsx(new): nothing loads before intent or on a read-only selector's focus; pointer down starts one load; focus and the open add none; a tap before the frame arrives opens one sheet, with focus in the listbox, once it does. It fails on the lazy-at-mount host (a load before intent).packages/core/src/MultiSelector/MultiSelector.sheetLoad.test.tsx(new): a held open (focus, then ArrowDown, before the frame arrives) leaves the trigger collapsed with noaria-controlsoraria-activedescendantuntil the sheet renders its listbox; a caller'srenderTriggercontrol starts the load on a pointer down and on a mouse entering it, each checked on its own by countingloadSelectorBottomSheetcalls (therefthe selector hands over registerspreloadSheetandpreloadSheetOnPointerEnter), and the trigger names the listbox only while the sheet is open.Selector/hooks.ts,MultiSelector/hooks.ts: Selector and MultiSelector call internaluseComboboxInternalanduseMultiComboboxInternal, which take whether the open list is in the document. While an open is held, a second press, Enter or Space keeps it and closes or picks nothing; Escape and Tab still drop it. The publicuseComboboxanduseMultiComboboxkeep their signatures and wrap the internal hooks, so their callers (CommandPalette among them) are unchanged.useSelectorPresentation.ts: a held open (an open made before the sheet's frame renders its list) ends when a press lands outside the trigger or focus moves to another element. No sheet then appears later over what the person turned to, and focus stays where they put it. A press elsewhere or a focus move is a later intent, which replaces a held one (architecture:component-import-boundariesINV4;architecture:interaction-modalityINV8). The open starts a second watch from the shared outside-press helper (shadow roots included), which counts as no layer dismissal, so a modal host's backdrop press still closes the host, and a focus listener on the trigger; both stop when the list shows or on close, and the watch also stops on unmount.Layer/outsidePress.ts:watchOutsidePresstakes anisDismissaloption. It defaults to true, which keeps today's behaviour, and no existing caller passes it, so Popover, DropdownMenu, ContextMenu, the date inputs and the sheets are unchanged; all existingoutsidePress.test.tsanduseBackdropPress.test.tsxcases pass unchanged. False makes a press outside count no outside dismissal; only the Selector's held open passes it.Selector.sheetHeldBackdrop.test.tsx(new): a backdrop press on a Dialog that holds the Selector, during the hold, still closes the Dialog;outsidePress.test.tscoversisDismissal: false.Selector.sheetHeldPressOutside.test.tsx,Selector.sheetHeldOtherSelector.test.tsx(new): a press elsewhere during the hold leaves no open sheet; moving to a second selector during the hold opens only that selector's sheet. Both fail without the change.utils/moduleLoader.ts(shared by every deferred surface):createModuleLoadergains anonLoadFailureoption,subscribe()andtryLoad(). These members are additive:load()andloaded()behave as before, and no existing caller changes (MobileNav, DropdownMenu's sheet, Toast, Text's truncation tooltip and keyboard cut text). The sheet host makes onetryLoad()call and subscribes withsubscribe.moduleLoader.test.tscovers bothload()as existing callers use it and the new members.Selector.sheetHeldInputs.test.tsxandutils/moduleLoader.test.ts(new): a second press, Enter and Space during a held open pick nothing and the sheet opens once; a failedtryLoadreports and resolves false, the next asks again, and a load tells its subscribers.useSelectorPresentation.ts: the controller owns the listbox attachment (attachListbox,isListboxMounted) and returns one rule for both components:isListShown(open and in the document) andisListboxNamed.Selector.tsx,MultiSelector.tsx: in the sheet presentation the trigger reportsaria-expanded="true"and names the listbox inaria-controlstogether, only while the sheet is open and its listbox is in the document (INV3). An open made before the frame arrives is held (INV4): the trigger stays collapsed and names nothing until the sheet shows. A load that another selector starts leaves a closed trigger's ARIA unchanged. The popover presentation is unchanged. While a MultiSelector open is held, its trigger names no active option either. The chevron's rotation and its themestatefollow the same expanded state, so during a held open nothing shows the list as open.Selector.sheetActiveDescendant.test.tsx: the held open before the surface loads now expectsaria-expanded="false"and noaria-controls, where it expected"true"for a list that was not yet in the document.packages/core/src/Selector/__tests__/SelectorSheetHeldOpen.a11y.chromium.spec.ts(new): in Chromium, with the sheet frame's chunk held, a tap leaves the trigger collapsed and naming nothing, axe finds no violation, and once the chunk is released the sheet opens witharia-expanded="true"andaria-controlsnaming its listbox, axe again clean.packages/core/src/Selector/Selector.sheetLoadHover.test.tsx(new): a mouse entering the trigger starts the load, and a finger entering it does not (its pointer down does); once the frame has loaded, a closed trigger names no listbox, and only the open one does. It fails without the trigger'sonPointerEnter.packages/core/src/Selector/Selector.sheetLoadFailure.test.tsx(new, INV6): with a rejecting loader, an open closes again (aria-expanded="false", no sheet), warns once, and the next open asks for the frame again.packages/core/src/Section/Section.tsx:../utilsimport to../utils/mergeProps.packages/core/src/Selector/Selector.sheetActiveDescendant.test.tsx:../BottomSheet/BottomSheetto./SelectorBottomSheetFrame.packages/core/src/Selector/Selector.ssr.test.tsx:packages/core/src/Selector/Selector.test.tsxandpackages/core/src/MultiSelector/MultiSelector.test.tsx:SelectorBottomSheetFrame.internal/eslint-plugin-astryx/no-internal-barrel-import.baseline.json:SelectorBottomSheet.tsxandSection.tsx..changeset/selector-multiselector-defer-selectorbottomsheet-i4zp.md:Evidence:
scripts/check-component-import-boundaries.mjs: on the earlier base (ac873683), theSelectorentry drops from 118.5 KB to 114.5 KB (−4.0 KB gzip). After merging main (d63c2497), CI's boundary check prints the base and head figures for the current base.pnpm size:pages, based63c2497, minified / gzip bytes). The shared module loader reaches every page throughText; each change is under the 0.3 KB gzip limit:scripts/core-single-bundle.test.mjs(unchanged here): passes.packages/core/src/Selector/Selector.sheetLoad.test.tsxandSelector.sheetLoadFailure.test.tsx: pass.packages/core/src/Selector/Selector.sheetActiveDescendant.test.tsx: passed.packages/core/src/Selector/Selector.ssr.test.tsx: passed.packages/core/src/Selector/Selector.test.tsx&packages/core/src/MultiSelector/MultiSelector.test.tsx: all bottom-sheet tests passed.scripts/check-knowledge.mjs: Templates and records aligned.Scope
Components: Selector, MultiSelector
Testing
Maintainer reshape
The intent load through the shared module loader is a maintainer edit by @cixzhang on top of @MuhammadAusafJamal's frame split, per
architecture:component-import-boundariesINV1, INV2, INV4 and INV5. The size win and the frame module are the contributor's.Real-browser evidence
Maintainer device runs at
2ef8d58a, against main at the merge baseac873683:renderTrigger, mouse hover then click: when idle, the opener has noaria-controlsand no sheet code is loaded; the hover loads it; the click opens one sheet with focus in the listbox (3/3).Since then, the trigger's
aria-expandedandaria-controlschange together, only once the sheet's listbox is in the document, and therenderTriggeropener registers the shared intent callbacks. The custom-trigger cell is re-checked at this head.Follow-up: #13751 (navigation keys during a held open, and a comment length).