Repository navigation
test(host): stop the console's switcher and authoring-sheet tests flaking by waiting for Base UI's initial focus (MMR-597) - #518
Conversation
…tcher and authoring sheet (MMR-597) Base UI moves a popup's initialFocus on the next animation frame, so a findBy can resolve before focus lands. Under the parallel jsdom run the picker's search box was asserted focused too early, and the authoring sheet's title stole focus mid-type from the DEPENDS-ON combobox. The open helpers now wait for the initial focus before the test acts.
|
skip-changelog: test-only change; the console's runtime behavior is untouched. |
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 53 minutes. View limit details
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Authoring-sheet focus readiness packages/host/src/test/authoring-sheet.test.tsx |
sheetReady and promoteReady wait for Title focus. Tests use this readiness check instead of separate focus waits. |
Project-picker focus readiness packages/host/src/test/project-picker.test.tsx |
Switcher-opening helpers wait for the search combobox to receive focus. Phone-drawer tests use the shared openSwitcher helper. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related PRs
- dbtlr/mimir#514: Updates the UI library that provides popup and dialog
initialFocusbehavior; this PR updates tests to wait for that focus.
Merge Risk: 
Minimal · up to 7e1fa
-
This test-only change reliably waits for popup focus without altering console runtime behavior.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Comment @coderabbitai help to get the list of available commands.
bun run test:uifailed about one run in five, each time on a different keyboard or focus test in the project switcher or the authoring sheet. The console code was not at fault.Base UI moves a popup's
initialFocuson the next animation frame, so the search box or sheet could render, andfindByresolve, before focus landed. The picker test then asserted focus while the header button still held it. The authoring-sheet test clicked the DEPENDS-ON combobox and typedauth, and the delayed title focus took the keystrokes partway through. The failing run's DOM showsauthin the Title field.The open helpers now wait for that initial focus before a test acts.
switcherSearch()backsopenSwitcherandopenSwitcherFromButton, andtitleFocused()backssheetReadyandpromoteReady. The two drawer tests go throughopenSwitcher. No timeouts changed. The jump palette's helpers were already safe, and no other test types into these popups before focus lands.Before the fix, 2 of 10 full
test:uiruns failed. After it, 20 consecutive full runs passed, andbun run verifyis green. The change is test-only, so it carriesskip-changelog.Made with Claude Opus 5.5 in Claude Code.