test(e2e): re-press ⌘K until the palette answers - #1282
Merged
Conversation
The palette shortcut is a window keydown listener the shell attaches in an effect, and effects run after the paint that puts 'Your teams' on screen. A spec that presses the instant that marker shows can land its single keystroke before the listener exists — a keypress has no auto-retry, so the palette never opens and the spec hangs to its 30s timeout. That's exactly how teams-nav 'recent missions' died twice in a row on main (run 31329194483): the failure snapshot shows only CommandDialog's always-mounted sr-only header, no dialog. openPalette() presses inside an expect.toPass loop, re-pressing only while the input stays hidden so the shortcut's toggle can't close a palette that did open. All three palette-open sites in teams-nav.spec.ts now go through it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the
mainCI failure in run 31329194483:teams-nav.spec.ts› the palette's recent missions open the mission's chat on that team board timed out 30s waiting for the palette's search input, on both attempts.Why it failed
The ⌘K shortcut is a
windowkeydown listener the shell attaches in an effect (useKeyboardShortcuts()inworkspace-shell.tsx), and effects run after the paint that puts the spec's ready-marker ("Your teams") on screen. The spec pressed ⌘K the instant that marker showed, so on a slow CI runner the single keystroke landed before the listener existed. A keypress, unlike a locator action, has no auto-retry — the press was dropped, the palette never opened, and the spec hung to its timeout.The failure snapshot proves it: only
CommandDialog's always-mounted sr-only header ("Command palette" / "Jump anywhere in Houston" — rendered outsideDialogContent, so present even when closed) is in the tree. The dialog itself never opened.Fix
New
e2e/support/palette.ts→openPalette(page): presses ⌘K inside anexpect(...).toPass()loop, re-pressing only while the input stays hidden so the shortcut's toggle can't close a palette that did open, and returns the search input. All three palette-open sites inteams-nav.spec.tsnow go through it (the other two had the same latent race).App behavior is untouched — for a human the listener is attached long before any keypress; this is purely a test-timing hardening, same family as c89321b.
Verification
pnpm test:e2e e2e/teams-nav.spec.ts— 4/4 pass locallypnpm --filter houston-web typecheck:e2eclean, Biome clean