Skip to content

Replace the search indicator with a real editable field - #85

Open
alvst wants to merge 1 commit into
momenbasel:mainfrom
alvst:alvie/pr-native-search
Open

Replace the search indicator with a real editable field#85
alvst wants to merge 1 commit into
momenbasel:mainfrom
alvst:alvie/pr-native-search

Conversation

@alvst

@alvst alvst commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

The search UI was a synthetic pill assembled from captured keystrokes: append-only, with no cursor, no click-to-edit, no selection, and no IME. This replaces it with a real NSTextField edited through the normal AppKit responder chain.

What changed

  • NativeBarSearchField is a real text field: cursor, click-to-edit, text selection, ⌘A/⌘X/⌘C/⌘V, and IME/dead-key input all work.
  • The field stays mounted even in its compact zero-width state, so the bar's key monitor can focus it synchronously and the very first typed character isn't lost.
  • BarInputMode tracks whether the field or the clip strip owns focus, so the key monitor and the field agree on who handles a given key instead of probing the responder chain from every call site.

Screenshots

Before:
00-baseline screenshots bar.png

After:
04-native-search screenshots after.png

Notes for review

  • The first-responder guard that keeps bar shortcuts alive while typing is intact — verified that ⌘-shortcuts still reach the bar with the field focused.
  • Related: alvie/pr-27-space-preview-with-search exists because this branch and alvie/pr-quicklook interact — a focused field would otherwise swallow Space-to-preview. That's fixed in its own PR, not here; nothing in this branch regresses on its own.
  • Out of scope: no search scoping, history, or regex.

This feature should be bundled into v2.

Part of #80.

The previous search UI was a synthetic pill built from captured
keystrokes — appended-only, no cursor, no click-to-edit, no text
selection or IME support. NativeBarSearchField is a real NSTextField
edited through the normal AppKit responder chain (kept mounted even in
its compact zero-width state, so the bar's key monitor can focus it
synchronously and hand off the very first keystroke without losing it).

BarInputMode tracks whether focus belongs to the field or the clip
strip, so the monitor and the field agree on who owns a given key
without probing the first-responder chain from every call site.
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