Home

dev / tinycast

publicthedavidweng/tinycast· sync paused
Overview Code History Branches Pull requestsIssuesInsights
main
HomeOverview Code PRsIssues

Freeze search field while ⌘K menu is open; fix clipboard ⌘↵

2 months ago

b8cd0eb
Authored
abue-ammar7/24/2026, 12:48:38 PM
When a footer popover menu (⌘K Actions / app menu) is open, the search
field kept accepting input and showed a blinking caret, and clearing the
query while the menu was up corrupted the compact-bar state. Now the
field reads as inert while a menu owns the keyboard — matching Raycast —
without ever resigning first responder, so its text/placeholder never
reflows:

- PalettePanel.sendEvent swallows text-editing keystrokes while
  menuOpen, letting shortcut chords (⌘K, ⌘⌫) and menu-nav keys reach
  SwiftUI's onKeyPress.
- The caret is hidden by tuning SwiftUI's own live field editor
  (insertionPointColor) via PaletteViewModel.onMenuOpenChanged — not by
  changing focus (which caused the field-editor↔cell reflow) and not by
  replacing the field editor (SwiftUI force-casts it to a private type
  and aborts).

Also fix clipboard ⌘↵ pasting instead of copying while the menu is open:
the Return handler activated the highlighted menu row for any Return,
ignoring modifiers. Now only plain ↵ activates the row; a modified ↵
always runs the mode-specific action, so ⌘↵ copies to clipboard whether
or not the menu is open.

Parentcc68ca5

3 files changed
  • Tinycast/Core/AppCore.swift+5−0
  • Tinycast/Core/PalettePanel.swift+28−2
  • Tinycast/Features/RootPaletteView.swift+6−4