Skip to content

test(DropdownMenu): catch an eager sheet import when it is requested, not by a timer - #8353

Merged
cixzhang merged 7 commits into
meta:mainfrom
vjeux:uikit/f3-lazysheet-detect
Nov 3, 2026
Merged

cixzhang merged 7 commits into
meta:mainfrom
vjeux:uikit/f3-lazysheet-detect

Conversation

@vjeux

@vjeux vjeux commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Review only this PR's change: vjeux/astryx@a00afee...d2c013f

Why

DropdownMenuLazySheet.test.tsx fails in parallel runs when nothing is wrong:

  • "Hook timed out in 10000ms". The file proves that importing DropdownMenu never loads the touch sheet. It holds the sheet's modules, so an eager import would hang, and it counted on a 10 s hook timeout to turn that hang into a failure. Importing DropdownMenu alone takes 3–4 s, so on a loaded machine the import crossed 10 s with no sheet import at all.
  • The keyboard-open test waited up to 15 s, under a 20 s test limit, for the first row's focus after it released the sheet. That wait also covered the sheet's own cold load.

What led to it

We run the full UI suite many times in parallel while bringing touch components to native behavior, and this test kept failing on unrelated changes.

Options and tradeoffs

  • Raise the timeouts: fewer false failures, but a real eager import then takes that long to report, and a slow enough machine still fails.
  • Time the import: depends on the machine just the same.
  • Wait for the events themselves (this pull request):
    • Each held sheet module announces its request. The file races DropdownMenu's import against the first announcement while it is collected, and no timeout bounds collection. A request fails the file at once, naming the module; a slow import simply finishes.
    • The sheet's own code also loads once at collection, past the hold, so no test carries a cold module load. That load races the first request too: if one sheet module imported the other, the file fails at once, by name, instead of waiting on the hold.
    • The keyboard-open test awaits the sheet's modules after the release, inside act, then one animation frame: the dropdown focuses the first row a frame after the rows appear. The 15 s waitFor and the 20 s test override are gone.

#9447 left this file to this pull request; its version of the keyboard-open wait is the one folded in here.

Why this choice

The checks fail on the events they guard against, a sheet module being requested or the first row not taking focus, and on nothing else. Their assertions are unchanged, and no timeout is raised.

How to check it

  1. pnpm exec vitest run packages/core/src/DropdownMenu/DropdownMenuLazySheet.test.tsx: both tests pass.
  2. Make DropdownMenu import ./MenuBottomSheet eagerly (an import planted in DropdownMenu.tsx, or a vi.mock of ./DropdownMenu that imports it first): the file fails while it is collected, with "Importing DropdownMenu requested MenuBottomSheet".
  3. Delay the sheet's module 16 s past the release (a delay in its vi.mock factory): main's version fails ("Unable to find … Edit project"); this version passes.
  4. Remove the awaited frame after the load: the focus check fails.
  5. Have the sheet's own code import the other sheet module (an importActual of a module that imports ./MenuBottomSheetActionList): the file fails while it is collected, with "Loading the sheet's own code requested the held MenuBottomSheetActionList".

Evidence

Run main This pull request
Two pinned cores with two busy loops beside them, 4 workers 3/3 fail: "Hook timed out in 10000ms", both tests skipped 10/10 pass; each test takes at most 6.3 s, and collection carries the cold load with no timeout
Eager import (step 2), three runs fails only through the hook timeout 3/3 fail at once with the named error
Sheet module 16 s past the release (step 3), three runs 3/3 fail 3/3 pass
No frame after the load (step 4), three runs n/a 3/3 fail on focus
One sheet module imports the other (step 5) n/a fails in 10 s with the named error; without the race it waits until an outside timeout
  • Test file only; no product source changes.

Testing

Local gates at d2c013f, merged with main d0b6e0f:

  • Prettier and strict ESLint on the file;
  • the core typecheck;
  • the file alone (2/2), the runs above, and steps 2–5;
  • pnpm test:ui: 18,329/18,329.

… not by a timer

The lazy-sheet test checked that importing DropdownMenu never loads the
touch sheet by holding the sheet's modules: an eager import would wait on
them forever, and the 10 s hook timeout turned that into a failure. But the
import itself takes 3–4 s alone, and under parallel full runs (a larger
module graph on some stacks) it passed 10 s and the file failed with "Hook
timed out" though nothing imported the sheet.

The import now races the first request for a sheet module: a request fails
the hook at once, naming the module, and a slow import just finishes. The
hook timeout is only a backstop (120 s). With the import slowed by 12 s the
old test times out and the new one passes; with an eager sheet import added
to DropdownMenu, the new test fails in 3 s, naming MenuBottomSheet.
@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 3, 2026 12:30am UTC

Request Review

@astracat-bot

astracat-bot Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 3, 2026, 12:42 AM UTC

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

This test-only change looks ready to approve: the eager-sheet guard still fails when DropdownMenu pulls in a sheet module eagerly, and it no longer depends on how long the import takes. Both claims in the description hold up: with the import slowed by 12 s the previous hook times out at 10 s while the new one passes, and an eager import './MenuBottomSheet' now fails in about 3 s with a message naming the module. Nothing further is needed from you.

[Automated review]

@github-actions

github-actions Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · d2c013f

Storybook · Sandbox · built from this PR's head

Modified components

Component Size LoC Visual · A11y · RTL
charts/Chart 115.7 kB (not measured) · 458 B CSS (not measured) — — · — · —
charts/ChartTooltip 92.6 kB (not measured) · 386 B CSS (not measured) 352 (not measured) — · — · —
AlertDialog · Storybook 56.9 kB (not measured) · 12.4 kB CSS (not measured) 182 (not measured) — · — · —
203 more components
Component Size LoC Visual · A11y · RTL
AppShell · Storybook 57.9 kB (not measured) · 11.6 kB CSS (not measured) 608 (not measured) — · — · —
AspectRatio 3.7 kB (not measured) · 3.5 kB CSS (not measured) — — · — · —
Avatar 37.5 kB (not measured) · 6.3 kB CSS (not measured) — — · — · —
AvatarGroup 39.8 kB (not measured) · 6.4 kB CSS (not measured) — — · — · —
AvatarGroupOverflow 39.9 kB (not measured) · 6.4 kB CSS (not measured) — — · — · —
AvatarStatusDot 7.1 kB (not measured) · 3.4 kB CSS (not measured) — — · — · —
Badge · Storybook 3.9 kB (not measured) · 3.8 kB CSS (not measured) 217 (not measured) — · — · —
Banner · Storybook 47.8 kB (not measured) · 9.9 kB CSS (not measured) 487 (not measured) — · — · —
BaseTypeahead 54.3 kB (not measured) · 9.9 kB CSS (not measured) — — · — · —
Blockquote 3.5 kB (not measured) · 3.4 kB CSS (not measured) — — · — · —
BottomSheet 34.0 kB (not measured) · 7.9 kB CSS (not measured) — — · — · —
BottomSheetSwitcher 14.8 kB (not measured) · 3.3 kB CSS (not measured) — — · — · —
BreadcrumbItem 66.4 kB (not measured) · 11.0 kB CSS (not measured) — — · — · —
Breadcrumbs 22.4 kB (not measured) · 3.3 kB CSS (not measured) — — · — · —
Button · Storybook 43.3 kB (not measured) · 9.2 kB CSS (not measured) 584 (not measured) — · — · —
ButtonGroup · Storybook 8.4 kB (not measured) · 3.3 kB CSS (not measured) 128 (not measured) — · — · —
Calendar · Storybook 54.9 kB (not measured) · 10.0 kB CSS (not measured) 1,641 (not measured) — · — · —
Card 6.4 kB (not measured) · 6.3 kB CSS (not measured) — — · — · —
Carousel · Storybook 50.2 kB (not measured) · 10.2 kB CSS (not measured) 486 (not measured) — · — · —
Center · Storybook 4.2 kB (not measured) · 4.6 kB CSS (not measured) 118 (not measured) — · — · —
ChatComposer 60.5 kB (not measured) · 10.8 kB CSS (not measured) — — · — · —
ChatComposerDrawer 23.9 kB (not measured) · 4.5 kB CSS (not measured) — — · — · —
ChatComposerInput 55.6 kB (not measured) · 10.1 kB CSS (not measured) — — · — · —
ChatComposerTokenElement 55.6 kB (not measured) · 10.1 kB CSS (not measured) — — · — · —
ChatDictationButton 46.5 kB (not measured) · 9.5 kB CSS (not measured) — — · — · —
ChatLayout 48.8 kB (not measured) · 9.9 kB CSS (not measured) — — · — · —
ChatLayoutScrollButton 46.4 kB (not measured) · 9.6 kB CSS (not measured) — — · — · —
ChatMessage 23.1 kB (not measured) · 3.5 kB CSS (not measured) — — · — · —
ChatMessageBubble 7.0 kB (not measured) · 3.6 kB CSS (not measured) — — · — · —
ChatMessageList 28.9 kB (not measured) · 7.8 kB CSS (not measured) — — · — · —
ChatMessageMetadata 25.8 kB (not measured) · 3.9 kB CSS (not measured) — — · — · —
ChatSendButton 45.8 kB (not measured) · 9.2 kB CSS (not measured) — — · — · —
ChatSystemMessage 6.7 kB (not measured) · 3.7 kB CSS (not measured) — — · — · —
ChatTokenizedText 6.9 kB (not measured) · 3.9 kB CSS (not measured) — — · — · —
ChatToolCalls 31.9 kB (not measured) · 8.9 kB CSS (not measured) — — · — · —
CheckboxIndicator 4.1 kB (not measured) · 3.8 kB CSS (not measured) — — · — · —
CheckboxInput · Storybook 49.9 kB (not measured) · 9.3 kB CSS (not measured) 355 (not measured) — · — · —
CheckboxList 46.0 kB (not measured) · 8.1 kB CSS (not measured) — — · — · —
CheckboxListItem 54.0 kB (not measured) · 10.5 kB CSS (not measured) — — · — · —
CheckIndicator 9.0 kB (not measured) · 3.6 kB CSS (not measured) — — · — · —
Citation · Storybook 25.9 kB (not measured) · 4.1 kB CSS (not measured) 229 (not measured) — · — · —
ClickableCard · Storybook 12.8 kB (not measured) · 6.9 kB CSS (not measured) 229 (not measured) — · — · —
Code · Storybook 3.5 kB (not measured) · 3.4 kB CSS (not measured) 81 (not measured) — · — · —
CodeBlock · Storybook 60.5 kB (not measured) · 10.7 kB CSS (not measured) 2,179 (not measured) — · — · —
Collapsible 11.7 kB (not measured) · 4.2 kB CSS (not measured) — — · — · —
CollapsibleGroup 6.4 kB (not measured) · 3.2 kB CSS (not measured) — — · — · —
CommandPalette 50.9 kB (not measured) · 11.8 kB CSS (not measured) — — · — · —
CommandPaletteEmpty 6.1 kB (not measured) · 3.3 kB CSS (not measured) — — · — · —
CommandPaletteFooter 23.3 kB (not measured) · 3.5 kB CSS (not measured) — — · — · —
CommandPaletteGroup 3.5 kB (not measured) · 3.3 kB CSS (not measured) — — · — · —
CommandPaletteInput 32.3 kB (not measured) · 8.1 kB CSS (not measured) — — · — · —
CommandPaletteItem 8.4 kB (not measured) · 3.5 kB CSS (not measured) — — · — · —
CommandPaletteList 22.4 kB (not measured) · 3.3 kB CSS (not measured) — — · — · —
ComplexSelector · Storybook 55.8 kB (not measured) · 10.6 kB CSS (not measured) 646 (not measured) — · — · —
ContextMenu · Storybook 77.7 kB (not measured) · 14.6 kB CSS (not measured) 678 (not measured) — · — · —
ContextMenuItem 16.6 kB (not measured) · 5.2 kB CSS (not measured) — — · — · —
DateInput · Storybook 99.9 kB (not measured) · 14.8 kB CSS (not measured) 3,532 (not measured) — · — · —
DateRangeInput · Storybook 69.4 kB (not measured) · 11.2 kB CSS (not measured) 621 (not measured) — · — · —
DateTimeInput · Storybook 110.1 kB (not measured) · 15.2 kB CSS (not measured) 3,609 (not measured) — · — · —
Dialog 16.2 kB (not measured) · 7.1 kB CSS (not measured) — — · — · —
DialogHeader 48.8 kB (not measured) · 9.8 kB CSS (not measured) — — · — · —
Divider · Storybook 6.5 kB (not measured) · 3.6 kB CSS (not measured) 153 (not measured) — · — · —
Drawer 31.6 kB (not measured) · 8.0 kB CSS (not measured) — — · — · —
DrawerHeader 48.9 kB (not measured) · 11.2 kB CSS (not measured) — — · — · —
DropdownMenu 72.7 kB (not measured) · 14.7 kB CSS (not measured) — — · — · —
DropdownMenuCheckboxItem 16.1 kB (not measured) · 5.6 kB CSS (not measured) — — · — · —
DropdownMenuDivider 6.6 kB (not measured) · 3.6 kB CSS (not measured) — — · — · —
DropdownMenuGroup 6.1 kB (not measured) · 3.3 kB CSS (not measured) — — · — · —
DropdownMenuItem 15.4 kB (not measured) · 5.2 kB CSS (not measured) — — · — · —
DropdownMenuRadioGroup 6.0 kB (not measured) · 3.2 kB CSS (not measured) — — · — · —
DropdownMenuRadioItem 16.2 kB (not measured) · 5.6 kB CSS (not measured) — — · — · —
DropdownMenuSubMenu 58.1 kB (not measured) · 9.5 kB CSS (not measured) — — · — · —
EmptyState · Storybook 7.7 kB (not measured) · 3.5 kB CSS (not measured) 143 (not measured) — · — · —
Field 44.2 kB (not measured) · 8.0 kB CSS (not measured) — — · — · —
FieldLabel 39.8 kB (not measured) · 6.5 kB CSS (not measured) — — · — · —
FieldStatus · Storybook 10.4 kB (not measured) · 4.2 kB CSS (not measured) 158 (not measured) — · — · —
FileInput · Storybook 54.1 kB (not measured) · 10.3 kB CSS (not measured) 724 (not measured) — · — · —
FormLayout 6.3 kB (not measured) · 3.4 kB CSS (not measured) — — · — · —
Grid 4.3 kB (not measured) · 3.7 kB CSS (not measured) — — · — · —
GridSpan 3.4 kB (not measured) · 3.2 kB CSS (not measured) — — · — · —
Heading 9.1 kB (not measured) · 6.8 kB CSS (not measured) — — · — · —
HoverCard · Storybook 17.2 kB (not measured) · 4.9 kB CSS (not measured) 683 (not measured) — · — · —
HStack 7.3 kB (not measured) · 4.9 kB CSS (not measured) — — · — · —
Icon · Storybook 8.8 kB (not measured) · 3.6 kB CSS (not measured) 621 (not measured) — · — · —
IconButton · Storybook 43.3 kB (not measured) · 9.2 kB CSS (not measured) 17 (not measured) — · — · —
InputGroup 44.8 kB (not measured) · 8.0 kB CSS (not measured) — — · — · —
InputGroupText 6.3 kB (not measured) · 3.7 kB CSS (not measured) — — · — · —
Item · Storybook 11.4 kB (not measured) · 4.7 kB CSS (not measured) 1,372 (not measured) — · — · —
Kbd · Storybook 6.7 kB (not measured) · 3.5 kB CSS (not measured) 140 (not measured) — · — · —
LayerProvider 63.3 kB (not measured) · 10.1 kB CSS (not measured) — — · — · —
Layout 8.1 kB (not measured) · 5.5 kB CSS (not measured) — — · — · —
LayoutContent 7.4 kB (not measured) · 4.9 kB CSS (not measured) — — · — · —
LayoutFooter 7.3 kB (not measured) · 4.8 kB CSS (not measured) — — · — · —
LayoutHeader 7.4 kB (not measured) · 4.8 kB CSS (not measured) — — · — · —
LayoutPanel 7.6 kB (not measured) · 4.8 kB CSS (not measured) — — · — · —
Lightbox · Storybook 51.2 kB (not measured) · 9.8 kB CSS (not measured) 754 (not measured) — · — · —
Link 43.5 kB (not measured) · 7.6 kB CSS (not measured) — — · — · —
LinkProvider 3.5 kB (not measured) · 20 B CSS (not measured) — — · — · —
List 6.7 kB (not measured) · 3.4 kB CSS (not measured) — — · — · —
ListItem 53.5 kB (not measured) · 10.5 kB CSS (not measured) — — · — · —
Markdown · Storybook 144.5 kB (not measured) · 17.4 kB CSS (not measured) 8,690 (not measured) — · — · —
MetadataList 23.1 kB (not measured) · 3.6 kB CSS (not measured) — — · — · —
MetadataListItem 6.5 kB (not measured) · 3.4 kB CSS (not measured) — — · — · —
MobileNav 51.0 kB (not measured) · 10.1 kB CSS (not measured) — — · — · —
MobileNavToggle 46.2 kB (not measured) · 9.4 kB CSS (not measured) — — · — · —
MoreMenu · Storybook 72.9 kB (not measured) · 14.7 kB CSS (not measured) 87 (not measured) — · — · —
MultiSelector · Storybook 76.2 kB (not measured) · 14.6 kB CSS (not measured) 2,631 (not measured) — · — · —
NavHeadingMenu 8.9 kB (not measured) · 3.2 kB CSS (not measured) — — · — · —
NavIcon 3.4 kB (not measured) · 3.3 kB CSS (not measured) — — · — · —
NumberInput · Storybook 55.7 kB (not measured) · 10.7 kB CSS (not measured) 1,144 (not measured) — · — · —
Outline · Storybook 28.6 kB (not measured) · 4.0 kB CSS (not measured) 1,216 (not measured) — · — · —
OverflowList · Storybook 8.5 kB (not measured) · 3.5 kB CSS (not measured) 229 (not measured) — · — · —
Overlay · Storybook 19.5 kB (not measured) · 3.8 kB CSS (not measured) 451 (not measured) — · — · —
Pagination · Storybook 87.7 kB (not measured) · 15.3 kB CSS (not measured) 645 (not measured) — · — · —
Popover · Storybook 49.8 kB (not measured) · 12.1 kB CSS (not measured) 977 (not measured) — · — · —
PowerSearch · Storybook 155.1 kB (not measured) · 18.6 kB CSS (not measured) 3,948 (not measured) — · — · —
ProgressBar · Storybook 7.7 kB (not measured) · 6.6 kB CSS (not measured) 387 (not measured) — · — · —
RadioIndicator 3.8 kB (not measured) · 3.7 kB CSS (not measured) — — · — · —
RadioList 45.6 kB (not measured) · 8.0 kB CSS (not measured) — — · — · —
RadioListItem 52.1 kB (not measured) · 9.7 kB CSS (not measured) — — · — · —
ResizeHandle 25.1 kB (not measured) · 3.9 kB CSS (not measured) — — · — · —
ScrollableArea 10.4 kB (not measured) · 4.3 kB CSS (not measured) — — · — · —
Section 7.5 kB (not measured) · 6.2 kB CSS (not measured) — — · — · —
SegmentedControl 38.8 kB (not measured) · 6.3 kB CSS (not measured) — — · — · —
SegmentedControlItem 8.6 kB (not measured) · 3.9 kB CSS (not measured) — — · — · —
SelectableCard · Storybook 12.8 kB (not measured) · 7.1 kB CSS (not measured) 305 (not measured) — · — · —
Selector 79.1 kB (not measured) · 15.0 kB CSS (not measured) — — · — · —
SelectorOption 14.5 kB (not measured) · 5.1 kB CSS (not measured) — — · — · —
SideNav 58.0 kB (not measured) · 10.6 kB CSS (not measured) — — · — · —
SideNavCollapseButton 46.6 kB (not measured) · 9.5 kB CSS (not measured) — — · — · —
SideNavHeading 54.7 kB (not measured) · 10.1 kB CSS (not measured) — — · — · —
SideNavItem 54.4 kB (not measured) · 10.1 kB CSS (not measured) — — · — · —
SideNavSection 6.5 kB (not measured) · 3.6 kB CSS (not measured) — — · — · —
Skeleton · Storybook 3.8 kB (not measured) · 3.6 kB CSS (not measured) 130 (not measured) — · — · —
Slider · Storybook 48.5 kB (not measured) · 8.5 kB CSS (not measured) 979 (not measured) — · — · —
Spinner · Storybook 26.3 kB (not measured) · 7.5 kB CSS (not measured) 296 (not measured) — · — · —
Stack 7.1 kB (not measured) · 4.9 kB CSS (not measured) — — · — · —
StackItem 6.0 kB (not measured) · 3.3 kB CSS (not measured) — — · — · —
StatusDot 19.0 kB (not measured) · 6.2 kB CSS (not measured) — — · — · —
Step 32.4 kB (not measured) · 5.3 kB CSS (not measured) — — · — · —
Stepper 47.4 kB (not measured) · 9.6 kB CSS (not measured) — — · — · —
Switch · Storybook 48.4 kB (not measured) · 9.3 kB CSS (not measured) 569 (not measured) — · — · —
Tab 9.7 kB (not measured) · 4.1 kB CSS (not measured) — — · — · —
Table 84.0 kB (not measured) · 15.1 kB CSS (not measured) — — · — · —
TableBody 3.3 kB (not measured) · 3.2 kB CSS (not measured) — — · — · —
TableCell 78.8 kB (not measured) · 14.8 kB CSS (not measured) — — · — · —
TableFooter 3.3 kB (not measured) · 3.2 kB CSS (not measured) — — · — · —
TableHeader 3.3 kB (not measured) · 3.2 kB CSS (not measured) — — · — · —
TableHeaderCell 78.6 kB (not measured) · 14.8 kB CSS (not measured) — — · — · —
TableRow 6.2 kB (not measured) · 3.5 kB CSS (not measured) — — · — · —
TableSelectionToolbar 52.4 kB (not measured) · 11.2 kB CSS (not measured) — — · — · —
TabList 40.2 kB (not measured) · 7.2 kB CSS (not measured) — — · — · —
TabMenu 51.6 kB (not measured) · 10.0 kB CSS (not measured) — — · — · —
Text · Storybook 8.6 kB (not measured) · 6.8 kB CSS (not measured) 530 (not measured) — · — · —
TextArea · Storybook 49.4 kB (not measured) · 9.4 kB CSS (not measured) 462 (not measured) — · — · —
TextInput · Storybook 53.5 kB (not measured) · 10.5 kB CSS (not measured) 381 (not measured) — · — · —
Thumbnail · Storybook 50.7 kB (not measured) · 11.0 kB CSS (not measured) 355 (not measured) — · — · —
TimeInput · Storybook 86.8 kB (not measured) · 13.8 kB CSS (not measured) 1,245 (not measured) — · — · —
Timer · Storybook 9.2 kB (not measured) · 6.8 kB CSS (not measured) 186 (not measured) — · — · —
Timestamp · Storybook 27.5 kB (not measured) · 9.5 kB CSS (not measured) 674 (not measured) — · — · —
Toast · Storybook 59.8 kB (not measured) · 9.7 kB CSS (not measured) 1,382 (not measured) — · — · —
ToggleButton 44.1 kB (not measured) · 9.3 kB CSS (not measured) — — · — · —
ToggleButtonGroup 6.3 kB (not measured) · 3.2 kB CSS (not measured) — — · — · —
Token · Storybook 29.6 kB (not measured) · 4.5 kB CSS (not measured) 459 (not measured) — · — · —
Tokenizer · Storybook 64.8 kB (not measured) · 11.7 kB CSS (not measured) 871 (not measured) — · — · —
Toolbar · Storybook 39.8 kB (not measured) · 7.7 kB CSS (not measured) 269 (not measured) — · — · —
Tooltip · Storybook 16.8 kB (not measured) · 4.9 kB CSS (not measured) 577 (not measured) — · — · —
TopNav 51.9 kB (not measured) · 10.4 kB CSS (not measured) — — · — · —
TopNavHeading 54.2 kB (not measured) · 9.9 kB CSS (not measured) — — · — · —
TopNavItem 9.0 kB (not measured) · 3.8 kB CSS (not measured) — — · — · —
TopNavMegaMenu 54.2 kB (not measured) · 10.8 kB CSS (not measured) — — · — · —
TopNavMegaMenuFeaturedCard 6.7 kB (not measured) · 3.4 kB CSS (not measured) — — · — · —
TopNavMegaMenuItem 9.1 kB (not measured) · 4.1 kB CSS (not measured) — — · — · —
TopNavMenu 53.6 kB (not measured) · 10.1 kB CSS (not measured) — — · — · —
TreeList · Storybook 32.5 kB (not measured) · 4.7 kB CSS (not measured) 872 (not measured) — · — · —
Typeahead 61.5 kB (not measured) · 11.3 kB CSS (not measured) — — · — · —
TypeaheadItem 6.2 kB (not measured) · 3.4 kB CSS (not measured) — — · — · —
VStack 7.3 kB (not measured) · 4.9 kB CSS (not measured) — — · — · —
lab/ChatEmojiPicker 64.8 kB (not measured) · 773 B CSS (not measured) — — · — · —
lab/ChatReactionBar 65.3 kB (not measured) · 1.1 kB CSS (not measured) — — · — · —
lab/ChatTypingIndicator 23.5 kB (not measured) · 612 B CSS (not measured) — — · — · —
lab/ChatUnreadDivider 3.5 kB (not measured) · 348 B CSS (not measured) — — · — · —
lab/CircularProgress · Storybook 7.1 kB (not measured) · 1.0 kB CSS (not measured) 328 (not measured) — · — · —
lab/CodeEditor · Storybook 14.6 kB (not measured) · 665 B CSS (not measured) 461 (not measured) — · — · —
lab/CommentComposer 93.4 kB (not measured) · 1.9 kB CSS (not measured) — — · — · —
lab/CommentPin · Storybook 47.4 kB (not measured) · 1.2 kB CSS (not measured) 386 (not measured) — · — · —
lab/Comments 219.7 kB (not measured) · 2.5 kB CSS (not measured) — — · — · —
lab/CommentThread 215.0 kB (not measured) · 2.4 kB CSS (not measured) — — · — · —
lab/DiffViewer · Storybook 45.6 kB (not measured) · 2.1 kB CSS (not measured) 2,203 (not measured) — · — · —
lab/EmojiPicker · Storybook 62.9 kB (not measured) · 722 B CSS (not measured) 3,581 (not measured) — · — · —
lab/InfoTip · Storybook 21.7 kB (not measured) · 458 B CSS (not measured) 68 (not measured) — · — · —
lab/ListInput · Storybook 75.2 kB (not measured) · 1.6 kB CSS (not measured) 1,760 (not measured) — · — · —
lab/LogStream · Storybook 7.9 kB (not measured) · 1.6 kB CSS (not measured) 468 (not measured) — · — · —
lab/MobilePowerSearch · Storybook 159.7 kB (not measured) · 1.4 kB CSS (not measured) 2,492 (not measured) — · — · —
lab/MobileTokenizer · Storybook 91.2 kB (not measured) · 775 B CSS (not measured) 596 (not measured) — · — · —
lab/Schedule · Storybook 65.6 kB (not measured) · 3.9 kB CSS (not measured) 4,750 (not measured) — · — · —
lab/Tour 3.7 kB (not measured) · 20 B CSS (not measured) — — · — · —
lab/TourStep 55.2 kB (not measured) · 590 B CSS (not measured) — — · — · —
lab/TransferList 66.6 kB (not measured) · 1.7 kB CSS (not measured) — — · — · —
lab/TransferListSelector 72.3 kB (not measured) · 1.9 kB CSS (not measured) — — · — · —
richtext/RichTextEditor · Storybook 270.7 kB (not measured) · 2.6 kB CSS (not measured) 662 (not measured) — · — · —
richtext/RichTextEditorToolbar 215.0 kB (not measured) · 454 B CSS (not measured) 870 (not measured) — · — · —
richtext/RichTextView 251.2 kB (not measured) · 2.3 kB CSS (not measured) — — · — · —

Wide change (110 components): add ci:run-visual, ci:run-a11y or ci:run-rtl to run them.

⚠️ Approximate analysis - the diff could not be resolved to a merge base, so a two-dot fallback was used. The component list may include base-only changes or miss a component whose change also landed on base.


Generated by PR Enrichment workflow | View full report

vjeux added 2 commits October 25, 2026 17:20
… machine's cold load never lands in a test's wait

The keyboard-open test released the held sheet and then waited 15 s for the
first action to take focus. That wait also covered the cold load of the
sheet's module graph, which the mock's importOriginal runs only after the
release, and on a loaded machine that took longer than 15 s.

beforeAll now loads the sheet modules' own code once, untimed, right after
the eager-import check. vi.importActual skips the mocks, so nothing is
recorded as requested and the hold still decides when the sheet arrives; the
mocks' importOriginal then returns the loaded modules.

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

This test-only change looks ready to approve: the eager-sheet check now fails as soon as a sheet module is requested instead of racing a timer, and the sheet's code loads once before the tests, so the keyboard-open test's wait no longer includes a cold module load. Both tests still fail when the behavior they guard breaks, including an eager import of either sheet module, which now fails by name. The red test-ui (2/4) shard failed on unhandled teardown errors from DropdownMenu.ssr.test.tsx, which this change does not touch, so it only needs a rerun.

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

This test-only change looks ready to approve: an eager import of either sheet module now fails the file at once and by name, a slow DropdownMenu import or sheet load no longer fails it, and both tests still fail when the behavior they guard breaks. One optional hardening, noted inline: the up-front vi.importActual load runs outside the request race, so a future static import between the two sheet modules would fail the file only after the 120 s backstop, with a generic hook timeout.

[Automated review]

Comment on lines +79 to +80
await vi.importActual('./MenuBottomSheet');
await vi.importActual('./MenuBottomSheetActionList');

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.

Optional hardening: vi.importActual skips the mock only for the module it loads, so if MenuBottomSheet ever imported ./MenuBottomSheetActionList statically, this load would wait on the held gate and the file would fail after the 120 s backstop with a generic Hook timed out in 120000ms (the file as it is on main passes that case). Racing these loads against sheetLoad.firstRequest too, or noting the constraint in the comment above, would make that failure immediate or explained.

@vjeux
vjeux marked this pull request as draft October 29, 2026 22:35
cixzhang pushed a commit that referenced this pull request Oct 30, 2026
…er an unhandled rejection (#8478)

## User impact

A bottom-sheet DropdownMenu preloads its action list at rest. When that load fails (a dropped or flaky connection), the page gets an unhandled promise rejection in the console. The rejected load also stays cached, so every later open of the menu fails to show its rows until a reload. In this repository's CI, the same unhandled rejection fails the UI test shard that runs `DropdownMenu.ssr.test.tsx` while every test passes, as on #8353, #8229 and #8211.

## Problem and solution fit

- Why does it occur? `preloadMenuBottomSheetActionList` starts the load with `void loadActionList()`: nothing handles a rejection, and `actionListLoad ??=` keeps the rejected promise.
- Why does it harm the task? An unhandled rejection is reported as an error, and a cached rejection turns one network blip into a menu whose rows never appear.
- Why does that matter? The preload only exists to make the first open instant; it must never break the open. In tests, the SSR file can finish while its preload is still importing; the environment tears down mid-import and the rejection fails the run.

The fix handles the preload's failure and drops the failed load, so the next preload or open asks the loader again. The SSR test waits for the sheet modules before it ends.

## Expected behavior and authority

The sheet loads on demand (#7709) and preloads at rest so the first open shows its actions at once (#8392). A preload is an optimization: its failure surfaces no error and blocks no retry.

## Smallest restoration

- `loadActionList` clears its cached load when the import rejects.
- `preloadMenuBottomSheetActionList` handles the rejection.
- `DropdownMenu.ssr.test.tsx` awaits the two sheet modules after unmounting.

No API, rendering or timing change.

## Evidence

- Reproduction before the change: on main e9b3f3e, `DropdownMenu.ssr.test.tsx` run alone fails 5 of 6 runs with three `EnvironmentTeardownError`s each, and the new unit test records the unhandled rejection.
- Result after the change: the SSR file passes 8 of 8 runs alone, and the unit test passes.
- Representative unchanged path: all 10 DropdownMenu test files (312 tests) pass.
- Regression test or other mutation-sensitive proof: `lazyMenuBottomSheet.test.ts` fails the list's import once, then checks there is no unhandled rejection and that the next call imports it again. Keeping the rejected load cached fails it ("expected 1 to be 2").

## Scope

- [x] One defect is restored.
- [x] Separable contradictory or unsettled tagalongs were removed or split.
- [x] No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
- [x] Public text and artifacts contain no internal Meta context.

## Testing

- At 3962530: the changeset and comments promise only what holds everywhere (no unhandled rejection, no kept failure); the unit and SSR tests: 2 passed; changeset coverage: passes.
- At 8877d94 (adds the Changeset): `node scripts/release/changeset-coverage.mjs pr --base e9b3f3e` fails at 4d8e178 and passes here (`[fix]`, `@astryxdesign/core`); `pnpm check:changesets`: valid.
- `pnpm exec vitest run --project ui packages/core/src/DropdownMenu/lazyMenuBottomSheet.test.ts`: fails on main, passes here.
- `pnpm exec vitest run --project ui packages/core/src/DropdownMenu/DropdownMenu.ssr.test.tsx`, alone, 8 times: 8 of 8 (main: 1 of 6).
- `pnpm exec vitest run packages/core/src/DropdownMenu`: 10 files, 312 tests.
- `tsc -p packages/core/tsconfig.json --noEmit`, eslint and prettier on the changed files: clean.
cixzhang pushed a commit that referenced this pull request Oct 31, 2026
…and sheet module before its one-second wait (#8896)

## Why

The Tokenizer case of `useAnnounceRenderedText.adopters.test.tsx` fails at random on a busy machine, on pull requests that don't touch Tokenizer: "Unable to find a label with the text of: Search Tags".

## What led to it

Tokenizer loads its touch sheet on demand (`loadTokenizerBottomSheet` in `Tokenizer.tsx`). The case opens the sheet and waits one second, the default `findByLabelText` wait, for the sheet's search field, so that second covers the sheet module's first load as well as the open. The load alone takes about a second on an idle machine. With vitest's default worker count on a 166-core box (165 workers), the case failed in all three full core runs I made; with 16 workers it passed in both, and it passes alone.

## Options and tradeoffs

- Raise the wait: hides the cause, and a slower machine still fails.
- Load the sheet eagerly in Tokenizer: changes product code, and the on-demand load is deliberate (`component:Tokenizer` PR6).
- Load the module in the test before the open, so the wait covers only what the test checks (this pull request).

## Why this choice

The case checks that the sheet hands its own content to the shared announcement module, not how its code loads. It now awaits `import('../Tokenizer/TokenizerBottomSheet')` before it renders. That load counts against the test's 30-second budget, never against the one-second wait. The other lazily loaded sheets and layers have the same fix open in #8642 (Selector, MultiSelector), #8352 (Item's swipe layer) and #8353 (DropdownMenu's sheet).

## How to check it

1. Make the sheet module's load cost CPU, as on a starved machine: in a copy of the test, mock `../Tokenizer/TokenizerBottomSheet` with a factory that busy-waits 1.2 s before returning the real module.
2. Run that copy. On main the Tokenizer case fails with the error above; with this change all 8 cases pass.
3. Run the real test without the mock: all 8 pass.

## Evidence

- With the 1.2 s busy-wait: 3 of 3 runs fail on main, 3 of 3 pass here.
- The hooks and Tokenizer test folders pass (46 files, 747 tests), along with core's typecheck and `pnpm check:repo`.
- A `setTimeout` delay in the mock did not reproduce it: the sheet rendered before the delay ended. A busy-wait starves the event loop the way load does.

Local gates at 4e6b38d: Prettier and ESLint pass on the changed file; the root build passes; the core UI suite passes, and the adopters file passes alone in 5 runs of 5; the node project passes except two process-timing cases in `packages/cli/foundation/release/cache.test.mjs`, which pass when that file runs alone (34 of 34), on this head and on main.
vjeux added 2 commits November 2, 2026 15:01
Comment-only: the repository's source-comments rule asks for sentences of 25 words at most.
…d wait for the sheet's load and one frame

The eager-import check ran in a beforeAll under a 120 s backstop. It now runs while the file is collected, which no timeout bounds. The keyboard-open test waited up to 15 s, under a 20 s limit, for the first row's focus. It now awaits the sheet's modules after the release, then the frame in which the dropdown focuses the first row.

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

Requesting changes on one point. The rest of the test change holds up: an eager sheet import now fails at collection, by name, and breaking the popover path or the keyboard-open focus still fails the file.

  • The two vi.importActual loads at lines 72–73 run outside the request race and nothing bounds collection, so if MenuBottomSheet ever imports ./MenuBottomSheetActionList (a case the current file passes), the file hangs with no output instead of failing; racing them against sheetLoad.firstRequest, as the DropdownMenu import already is, makes it fail at once by name (suggestion inline).

[Automated review]

Comment on lines +72 to +73
await vi.importActual('./MenuBottomSheet');
await vi.importActual('./MenuBottomSheetActionList');

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.

Blocking: vi.importActual skips the mock only for the module it loads, so if MenuBottomSheet ever imported ./MenuBottomSheetActionList statically, this load would wait on the held gate. Nothing bounds collection, so the file would hang with no output, where the current file passes that case. Racing these loads against sheetLoad.firstRequest, as the DropdownMenu import above is, fails it at once by name:

const actual = await Promise.race([
  Promise.all([
    vi.importActual('./MenuBottomSheet'),
    vi.importActual('./MenuBottomSheetActionList'),
  ]).then(() => ({})),
  sheetLoad.firstRequest.then(name => ({eager: name})),
]);
if ('eager' in actual) {
  throw new Error(
    `Loading the sheet's own code requested the held ${actual.eager}: one sheet module imports the other.`,
  );
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in d2c013f: the two vi.importActual loads now race sheetLoad.firstRequest, as the DropdownMenu import does. A test-local module that imports ./MenuBottomSheetActionList, loaded the same way, hung until an outside timeout before; now it fails in 10 s with "Loading the sheet's own code requested the held MenuBottomSheetActionList".

…n a held request

If one sheet module imported the other, the importActual load at collection would wait on the hold forever, and nothing bounds collection. The load now races the first sheet-module request, as DropdownMenu's import does.

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

Looks ready to approve: an eager sheet import now fails at collection with the module's name, a static import between the two sheet modules now fails by name instead of hanging, and breaking the keyboard-open focus still fails the second test. One optional wording fix, noted inline: the sheet-code race's error blames a sheet-to-sheet import even when DropdownMenu.tsx itself starts loading the sheet at import, so naming both causes would send the next person to the right file.

[Automated review]

]);
if ('eager' in sheetCode) {
throw new Error(
`Loading the sheet's own code requested the held ${sheetCode.eager}: one sheet module imports the other.`,

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.

Non-blocking: firstRequest is one-shot, so a request that lands after the DropdownMenu race settles is caught here too. With void import('./MenuBottomSheet'); at the end of DropdownMenu.tsx, the file fails with this message although neither sheet module imports the other. Naming both causes points the next person at the right file:

`Loading the sheet's own code requested the held ${sheetCode.eager}: a sheet module imports the other, or DropdownMenu started loading the sheet when it was imported.`,

@cixzhang cixzhang added the ci:run A maintainer lets this outside contributor's pull request run CI (AST-030 FR17) label Nov 3, 2026
@cixzhang
cixzhang marked this pull request as ready for review November 3, 2026 01:14
@cixzhang
cixzhang merged commit 0f25a0f into meta:main Nov 3, 2026
110 checks passed
@vjeux
vjeux deleted the uikit/f3-lazysheet-detect branch November 3, 2026 04:18

This branch was successfully deployed

1 active deployment
Preview — d2c013f3 Deployed Nov 3, 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants