Repository navigation
fix(welcome): act on the whole query when Return leaves the search field - #4432
Merged
Merged
Conversation
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.
Summary
WelcomeViewModel.submitSearch()runs a pending search rebuild at once, then asks the list for focus and the first row. The toolbar's Return handler calls it.WelcomeOutlineCoordinator.focusList(selectFirstRow:)brings the outline view up to the model's revision before picking a row, since SwiftUI hands the new revision over on its next update pass.testTheToolbarFiltersByTagAndSearchesTheListtypescharlie, whose first letter already hidesalpha-stagingbut keepsdelta-localuntil the debounce fires, so Return selecteddelta-localand the rebuild cleared it (runs 45102132412 and 45115904188; the failure trees show the list focused andcharlie-prodalone, unselected). The PR's own runs passed on timing.Test plan
WelcomeToolbarTests.returnActsOnTheWholeQuery: typesgthengainside the debounce and presses Return; the list it focuses holds only Gamma. Fails before this change (Beta and Gamma).WelcomeOutlineFocusTests.focusPicksFromTheCurrentOutline: a real outline view in a window, a query SwiftUI has not handed over yet; Return selects Beta, the only match, and the list holds the keyboard. Fails before this change (Alpha, the stale first row).verify.sh teston the Welcome suites: 78 passed. The two new tests run against the code without this change: both fail.verify.sh uitest WelcomeConnectionListUITests: 3 passed, none on a retry.localhostmatched the original test query; the tests useg/gaandbnow).