From 5b876d7085cee8e5cb8727c03461d15d28fc0e3c Mon Sep 17 00:00:00 2001 From: psmattas Date: Fri, 21 Aug 2026 00:50:39 +0100 Subject: [PATCH] chore: remove Keyboard Shortcuts menu item and window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No real app-specific shortcuts existed - the panel only listed Return/⌘,/⌘W/⌘Q (standard macOS conventions everyone already knows, and it didn't even include the app's actual shortcuts like ⌘K for Command Palette). Removed the menu item from AccountFooter's bottom menu, the Window scene that hosted it, and KeyboardShortcutsView itself plus WindowConfigurator.swift (disablesFullScreen() had no other caller once this was gone). --- Outpost/Features/Account/AccountFooter.swift | 5 --- .../Account/KeyboardShortcutsView.swift | 39 ------------------- Outpost/OutpostApp.swift | 8 ---- Outpost/Support/WindowConfigurator.swift | 38 ------------------ 4 files changed, 90 deletions(-) delete mode 100644 Outpost/Features/Account/KeyboardShortcutsView.swift delete mode 100644 Outpost/Support/WindowConfigurator.swift diff --git a/Outpost/Features/Account/AccountFooter.swift b/Outpost/Features/Account/AccountFooter.swift index 79722ee..e4c2033 100644 --- a/Outpost/Features/Account/AccountFooter.swift +++ b/Outpost/Features/Account/AccountFooter.swift @@ -10,7 +10,6 @@ struct AccountFooter: View { @Environment(SessionStore.self) private var session @Environment(AppNavigation.self) private var navigation @Environment(\.openURL) private var openURL - @Environment(\.openWindow) private var openWindow @AppStorage("outpost.appearance") private var appearance: AppAppearance = .system @AppStorage(CachingOutlineAPIClient.offlineModeDefaultsKey) private var isOfflineModeEnabled = false @State private var isMenuPresented = false @@ -63,10 +62,6 @@ struct AccountFooter: View { private var menuContent: some View { VStack(alignment: .leading, spacing: 2) { - menuItem("Keyboard Shortcuts…") { openWindow(id: "keyboard-shortcuts") } - - Divider() - menuItem("Documentation") { openURL(repositoryURL) } if let apiDocumentationURL { menuItem("API Documentation") { openURL(apiDocumentationURL) } diff --git a/Outpost/Features/Account/KeyboardShortcutsView.swift b/Outpost/Features/Account/KeyboardShortcutsView.swift deleted file mode 100644 index 2e98c6c..0000000 --- a/Outpost/Features/Account/KeyboardShortcutsView.swift +++ /dev/null @@ -1,39 +0,0 @@ -#if os(macOS) -import SwiftUI - -struct KeyboardShortcutsView: View { - private struct Shortcut: Identifiable { - let id = UUID() - let action: String - let keys: String - } - - private let shortcuts: [Shortcut] = [ - Shortcut(action: "Sign In", keys: "⏎"), - Shortcut(action: "Preferences", keys: "⌘ ,"), - Shortcut(action: "Close Window", keys: "⌘ W"), - Shortcut(action: "Quit Outpost", keys: "⌘ Q") - ] - - var body: some View { - VStack(alignment: .leading, spacing: 16) { - Text("Keyboard Shortcuts") - .font(.title3.bold()) - - VStack(spacing: 10) { - ForEach(shortcuts) { shortcut in - HStack { - Text(shortcut.action) - Spacer() - Text(shortcut.keys) - .foregroundStyle(.secondary) - .monospaced() - } - } - } - } - .padding(24) - .frame(width: 280) - } -} -#endif diff --git a/Outpost/OutpostApp.swift b/Outpost/OutpostApp.swift index 3ad9c4a..c784767 100644 --- a/Outpost/OutpostApp.swift +++ b/Outpost/OutpostApp.swift @@ -75,14 +75,6 @@ struct OutpostApp: App { } } #endif - - #if os(macOS) - Window("Keyboard Shortcuts", id: "keyboard-shortcuts") { - KeyboardShortcutsView() - .disablesFullScreen() - } - .windowResizability(.contentSize) - #endif } #if os(macOS) diff --git a/Outpost/Support/WindowConfigurator.swift b/Outpost/Support/WindowConfigurator.swift deleted file mode 100644 index 412325a..0000000 --- a/Outpost/Support/WindowConfigurator.swift +++ /dev/null @@ -1,38 +0,0 @@ -#if os(macOS) -import SwiftUI -import AppKit - -/// Grabs the hosting `NSWindow` once it's attached to a screen, for the -/// handful of things SwiftUI's `Window` scene doesn't expose a modifier for. -private struct WindowConfigurator: NSViewRepresentable { - let configure: (NSWindow) -> Void - - func makeNSView(context: Context) -> NSView { - let view = NSView() - DispatchQueue.main.async { - if let window = view.window { - configure(window) - } - } - return view - } - - func updateNSView(_ nsView: NSView, context: Context) {} -} - -extension View { - /// `Window` scenes default to a full standard titlebar, fullscreen - /// (green) button included — not appropriate for fixed-size reference - /// panels like About or Keyboard Shortcuts, which have no reason to - /// support fullscreen at all. - func disablesFullScreen() -> some View { - background( - WindowConfigurator { window in - window.collectionBehavior.remove(.fullScreenPrimary) - window.collectionBehavior.insert(.fullScreenNone) - window.standardWindowButton(.zoomButton)?.isHidden = true - } - ) - } -} -#endif