Skip to content

fix(overview): activate the search result with Enter again - #152

Merged
PapyElGringo merged 1 commit into
mainfrom
fix/overview-enter-after-search
Oct 15, 2026
Merged

PapyElGringo merged 1 commit into
mainfrom
fix/overview-enter-after-search

Conversation

@PapyElGringo

Copy link
Copy Markdown
Contributor

Summary

Regression from #139: after a search, pressing Enter in the overview search field no longer activated the first result.

Root cause. MaterialApp installs Flutter's DefaultTextEditingShortcuts inside itself; they map Enter to DoNothingAndStopPropagationTextIntent, and while an EditableText is focused its action consumes the key (with consumesKey: false, it stops propagation). VeshellShortcutManager wraps MaterialApp (see main.dart), so the global navigation.activate binding — and the framework's own Enter binding — live above those text-editing shortcuts and never get the key while the search field is focused.

#139 replaced the search pane's local CallbackShortcuts (which sat below the text-editing shortcuts and won) with the global binding, so Enter has been swallowed ever since: nothing was activated.

Fix. Bind Enter/NumpadEnter to ActivateIntent in the search pane again, close enough to win over DefaultTextEditingShortcuts. The ActivateIntent handler is unchanged and still registered only by the search pane and result lists.

  • Space is deliberately left unbound, so the search field keeps typing spaces.
  • A focused client surface is a sibling of the search pane, so it still receives Enter (its SurfaceFocus shadows it).

Testing

New test/application_search_enter_test.dart mirrors the real tree (VeshellShortcutManager above MaterialApp), types a query, and asserts the first result is launched. It fails without the fix.

  • flutter test — 485 passed
  • flutter analyze — 0 errors
  • dart format --set-exit-if-changed — clean

Docs updated: overview.md, navigation.md.

Note: this is independent of #151 (which gives a launched window the keyboard); it applies directly on main.

`MaterialApp` installs `DefaultTextEditingShortcuts`, which maps `Enter` to a
do-nothing intent handled by the focused `EditableText`. `VeshellShortcutManager`
wraps `MaterialApp` (see `main.dart`), so its global `navigation.activate`
binding — and the framework's own `Enter` binding — sit above those text-editing
shortcuts and never see the key while the search field is focused. Since #139
replaced the search pane's local `CallbackShortcuts` with the global binding,
`Enter` after a search has therefore been swallowed: nothing was activated.

Bind `Enter`/`NumpadEnter` to `ActivateIntent` in the search pane again, close
enough to win over `DefaultTextEditingShortcuts`. `Space` stays unbound so the
field keeps typing spaces; a focused client surface is a sibling of the pane and
still receives `Enter` (its `SurfaceFocus` shadows it).

The regression test mirrors the real tree (`VeshellShortcutManager` above
`MaterialApp`); it fails without this binding.
@PapyElGringo
PapyElGringo force-pushed the fix/overview-enter-after-search branch from ee9bfc7 to e957844 Compare October 15, 2026 10:32
@PapyElGringo
PapyElGringo merged commit d3c6b6d into main Oct 15, 2026
2 checks passed
@PapyElGringo
PapyElGringo deleted the fix/overview-enter-after-search branch October 15, 2026 10:36
@PapyElGringo PapyElGringo mentioned this pull request Oct 16, 2026
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