test(tui): wait for diff base search focus - #46083
Merged
Merged
Conversation
This was referenced Aug 29, 2026
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.
Why
The diff-base selection test can type before the branch-search input receives
focus. DialogSelect schedules focus asynchronously; a rendered chooser is not
an input-readiness signal. When rendering wins that race, the input discards the
typed query and the later request assertion times out.
This failed in Windows CI on #46075 in the committed comparison, then in the
working comparison on an unchanged rerun. The same failure also blocked #46077.
The fixture was reproduced locally with fast rendering, independently of those
Session changes.
What Changes
Wait for the search editor to receive focus before typing. An already-focused
editor proceeds immediately; otherwise the test observes the renderer's existing
focus event. The test still exercises the real component and retains its search,
comparison, review-count, and reopening assertions.
Reproduction
Using a temporary
maxFps: Number.POSITIVE_INFINITYfixture setting:frame state and stack location as Windows CI.
remained empty after the original debounce wait.
under that identical fast-render setting.
The fast-render override and diagnostic logs are not part of the final change.
Scope
Test synchronization only. No application focus changes, assertion weakening,
test retries, or timeout increases. Independent of both Session refactors.
Verification
Normal-speed focused stress: 300 passed, 0 failed, all three variants run
100 times, 4,400 assertions (195.02 seconds).
Normal-speed repeated diff-viewer suite: 273 passed, 0 failed, 2,376
assertions. Full TUI: 989 passed, 4 skipped, 0 failed, two snapshots and 4,371
assertions across 122 files. TUI typecheck and all 33 pre-push typecheck tasks
passed at
d7bbe7a01d.Three simplify reviews of the complete six-line diff found no actionable
changes. Prettier and diff checks passed. The final patch contains no diagnostic
logging or fast-render override.