From 86027001c7e61449d8dae66b2d4c596084d70898 Mon Sep 17 00:00:00 2001 From: Rune Olsen Date: Mon, 20 Jul 2026 08:17:33 +0200 Subject: [PATCH] Roll back native Help Viewer integration; fix duplicate View menu MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Per Rune: the NSHelpManager-based Cmd+? fix from the last few commits technically worked (registration was correct) but opened Apple's broken generic Tips landing page instead of oAI's own content on the macOS 27 beta this is built against — worse than the original browser-tab behavior. Revisit at macOS 27 RC1 (see CLAUDE.md). - openHelp() reverts to NSWorkspace.open() on index.html directly. - Removed the "In-App Help" Ctrl+Cmd+H menu item entirely — HelpView's panel (search already fully working) is reachable only via /help from the input field now, by design. - Renamed the custom CommandMenu("View") to CommandMenu("Chat") — it was colliding with the "View" menu macOS auto-adds for NavigationSplitView (Enter Full Screen, etc.), producing two identically-titled top-level menus in the menu bar. --- .../Contents/Resources/en.lproj/index.html | 3 --- oAI/Views/Screens/HelpView.swift | 1 - oAI/oAIApp.swift | 18 ++++++++++++------ 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/oAI/Resources/oAI.help/Contents/Resources/en.lproj/index.html b/oAI/Resources/oAI.help/Contents/Resources/en.lproj/index.html index c02e094..341ce65 100644 --- a/oAI/Resources/oAI.help/Contents/Resources/en.lproj/index.html +++ b/oAI/Resources/oAI.help/Contents/Resources/en.lproj/index.html @@ -1526,9 +1526,6 @@ Whenever the user asks you to translate something, translate it to Norwegian Bok
⌘,
Open Settings
-
⌃⌘H
-
Show in-app Help
-
⌘?
Open this Help (macOS Help)
diff --git a/oAI/Views/Screens/HelpView.swift b/oAI/Views/Screens/HelpView.swift index 2471e16..9063dd9 100644 --- a/oAI/Views/Screens/HelpView.swift +++ b/oAI/Views/Screens/HelpView.swift @@ -213,7 +213,6 @@ private let keyboardShortcuts: [(key: String, description: String)] = [ ("\u{2318}L", "Conversations"), ("\u{21E7}\u{2318}S", "Statistics"), ("\u{2318},", "Settings"), - ("\u{2303}\u{2318}H", "Help"), ] // MARK: - HelpView diff --git a/oAI/oAIApp.swift b/oAI/oAIApp.swift index 280ae0a..064b093 100644 --- a/oAI/oAIApp.swift +++ b/oAI/oAIApp.swift @@ -116,8 +116,11 @@ struct oAIApp: App { .disabled(chatViewModel.messages.filter { $0.role != .system }.isEmpty) } - // ── View menu ───────────────────────────────────────────────── - CommandMenu("View") { + // ── Chat menu ───────────────────────────────────────────────── + // Named "Chat" (not "View") to avoid colliding with the "View" menu + // macOS auto-adds for NavigationSplitView (Enter Full Screen, etc.) — + // two menus both titled "View" would otherwise appear in the menu bar. + CommandMenu("Chat") { Button("Select Model") { chatViewModel.showModelSelector = true } .keyboardShortcut("m", modifiers: .command) @@ -132,9 +135,6 @@ struct oAIApp: App { Button("Command History") { chatViewModel.showHistory = true } .keyboardShortcut("h", modifiers: [.command, .shift]) - Button("In-App Help") { chatViewModel.showHelp = true } - .keyboardShortcut("h", modifiers: [.command, .control]) - Button("Credits") { chatViewModel.showCredits = true } Divider() @@ -161,7 +161,13 @@ struct oAIApp: App { #if os(macOS) private func openHelp() { - NSHelpManager.shared.openHelpAnchor("", inBook: Bundle.main.object(forInfoDictionaryKey: "CFBundleHelpBookName") as? String) + // Opens the Help Book's index.html directly in the default browser rather than + // through NSHelpManager/Help Viewer — see CLAUDE.md's macOS 27 beta note for why + // (Apple's Tips.app replacement for Help Viewer can't resolve anchors on this beta). + // Revisit once macOS 27 reaches RC. + if let helpBookURL = Bundle.main.url(forResource: "oAI.help", withExtension: nil) { + NSWorkspace.shared.open(helpBookURL.appendingPathComponent("Contents/Resources/en.lproj/index.html")) + } } #endif }