mac: ⌘F focuses the sidebar search (#293)
A hidden shortcut button on the takeover surface — it expands the collapsed avatar rail first, so ⌘F always lands the caret in Search.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
1 file changed,
+12
−0
ios/LChatMac/NativeChatView.swift+12 −0
diff --git a/ios/LChatMac/NativeChatView.swift b/ios/LChatMac/NativeChatView.swift| index 74522db..cf3b9d3 100644 |
| --- a/ios/LChatMac/NativeChatView.swift |
| +++ b/ios/LChatMac/NativeChatView.swift |
| @@ -27,6 +27,7 @@ struct NativeChatView: View { |
| } |
| @State private var search = "" |
| + @FocusState private var searchFocused: Bool |
| @State private var showNewChat = false |
| @State private var showInvite = false |
| // The list is user-resizable (drag the divider); below the threshold it |
| @@ -55,6 +56,16 @@ struct NativeChatView: View { |
| feedColumn |
| } |
| .background(theme.panel.resolved(scheme)) |
| + // ⌘F focuses the sidebar search (expanding the rail if collapsed). |
| + .background( |
| + Button("") { |
| + if collapsed { listWidth = 300 } |
| + DispatchQueue.main.async { searchFocused = true } |
| + } |
| + .keyboardShortcut("f", modifiers: .command) |
| + .opacity(0) |
| + .accessibilityHidden(true) |
| + ) |
| .task { |
| await store.refresh() |
| if selectedID == nil { |
| @@ -529,6 +540,7 @@ struct NativeChatView: View { |
| TextField("Search", text: $search) |
| .textFieldStyle(.plain) |
| .font(.system(size: 13)) |
| + .focused($searchFocused) |
| // Keyboard-driven typeahead: arrows move the highlight |
| // through the results panel, Return opens, Esc clears. |
| .onKeyPress(.downArrow) { |