Skip to content

fix(welcome): act on the whole query when Return leaves the search field - #4432

Merged
datlechin merged 3 commits into
mainfrom
fix/welcome-search-return
Nov 23, 2026
Merged

datlechin merged 3 commits into
mainfrom
fix/welcome-search-return

Conversation

@datlechin

@datlechin datlechin commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Return in the Welcome search field could select a row the query was about to hide. The view model rebuilds the list 150 ms after the last keystroke, and Return inside that window picked the first row of the list built for fewer typed characters; the late rebuild then dropped that row and the selection with it.
  • 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.
  • This is what turned main red since perf(welcome): own the toolbar and search in AppKit #4415: testTheToolbarFiltersByTagAndSearchesTheList types charlie, whose first letter already hides alpha-staging but keeps delta-local until the debounce fires, so Return selected delta-local and the rebuild cleared it (runs 45102132412 and 45115904188; the failure trees show the list focused and charlie-prod alone, unselected). The PR's own runs passed on timing.

Test plan

  • WelcomeToolbarTests.returnActsOnTheWholeQuery: types g then ga inside 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 test on 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.
  • Codex review against main: no findings (the first pass caught that localhost matched the original test query; the tests use g/ga and b now).

@datlechin
datlechin enabled auto-merge (squash) November 23, 2026 07:30
@datlechin
datlechin merged commit 05a3ec0 into main Nov 23, 2026
12 checks passed
@datlechin
datlechin deleted the fix/welcome-search-return branch November 27, 2026 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant