From f1296ba13d4de4394e0f2d6afdf3feb0ab620c57 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Tue, 20 Oct 2026 23:10:48 -0700 Subject: [PATCH] Focus the Project tab's keyboard on Cmd-P --- mac/Sources/Byre/Dialogs.swift | 1 + mac/Sources/Byre/Project.swift | 3 +++ mac/Sources/Byre/Switcher.swift | 2 ++ 3 files changed, 6 insertions(+) diff --git a/mac/Sources/Byre/Dialogs.swift b/mac/Sources/Byre/Dialogs.swift index 77453eb..66116a8 100644 --- a/mac/Sources/Byre/Dialogs.swift +++ b/mac/Sources/Byre/Dialogs.swift @@ -53,6 +53,7 @@ final class Overlays { var switcher: SwitcherModel? var leftTab = LeftTab.lead var leadFocus = 0 + var projectFocus = 0 @ObservationIgnored var pickerFrame: CGRect = .zero @ObservationIgnored var menuHover = false var paneFrame: CGRect = .zero diff --git a/mac/Sources/Byre/Project.swift b/mac/Sources/Byre/Project.swift index 1b93e30..2aa908e 100644 --- a/mac/Sources/Byre/Project.swift +++ b/mac/Sources/Byre/Project.swift @@ -57,6 +57,9 @@ struct ProjectView: View { } refresh() } + .onChange(of: overlays.projectFocus) { + keys = true + } .onDisappear { off?() off = nil diff --git a/mac/Sources/Byre/Switcher.swift b/mac/Sources/Byre/Switcher.swift index 4f50944..e229943 100644 --- a/mac/Sources/Byre/Switcher.swift +++ b/mac/Sources/Byre/Switcher.swift @@ -18,6 +18,8 @@ func runGo(_ key: String, _ store: Store, _ overlays: Overlays) { createTask(project.id, .init(), store, overlays) } case "p": + overlays.window?.makeFirstResponder(nil) + overlays.projectFocus += 1 store.focusTab(.project) case "l": overlays.switcher?.close()