Roll back native Help Viewer integration; fix duplicate View menu
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.
This commit is contained in:
@@ -1526,9 +1526,6 @@ Whenever the user asks you to translate something, translate it to Norwegian Bok
|
|||||||
<dt><kbd>⌘,</kbd></dt>
|
<dt><kbd>⌘,</kbd></dt>
|
||||||
<dd>Open Settings</dd>
|
<dd>Open Settings</dd>
|
||||||
|
|
||||||
<dt><kbd>⌃⌘H</kbd></dt>
|
|
||||||
<dd>Show in-app Help</dd>
|
|
||||||
|
|
||||||
<dt><kbd>⌘?</kbd></dt>
|
<dt><kbd>⌘?</kbd></dt>
|
||||||
<dd>Open this Help (macOS Help)</dd>
|
<dd>Open this Help (macOS Help)</dd>
|
||||||
|
|
||||||
|
|||||||
@@ -213,7 +213,6 @@ private let keyboardShortcuts: [(key: String, description: String)] = [
|
|||||||
("\u{2318}L", "Conversations"),
|
("\u{2318}L", "Conversations"),
|
||||||
("\u{21E7}\u{2318}S", "Statistics"),
|
("\u{21E7}\u{2318}S", "Statistics"),
|
||||||
("\u{2318},", "Settings"),
|
("\u{2318},", "Settings"),
|
||||||
("\u{2303}\u{2318}H", "Help"),
|
|
||||||
]
|
]
|
||||||
|
|
||||||
// MARK: - HelpView
|
// MARK: - HelpView
|
||||||
|
|||||||
+12
-6
@@ -116,8 +116,11 @@ struct oAIApp: App {
|
|||||||
.disabled(chatViewModel.messages.filter { $0.role != .system }.isEmpty)
|
.disabled(chatViewModel.messages.filter { $0.role != .system }.isEmpty)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── View menu ─────────────────────────────────────────────────
|
// ── Chat menu ─────────────────────────────────────────────────
|
||||||
CommandMenu("View") {
|
// 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 }
|
Button("Select Model") { chatViewModel.showModelSelector = true }
|
||||||
.keyboardShortcut("m", modifiers: .command)
|
.keyboardShortcut("m", modifiers: .command)
|
||||||
|
|
||||||
@@ -132,9 +135,6 @@ struct oAIApp: App {
|
|||||||
Button("Command History") { chatViewModel.showHistory = true }
|
Button("Command History") { chatViewModel.showHistory = true }
|
||||||
.keyboardShortcut("h", modifiers: [.command, .shift])
|
.keyboardShortcut("h", modifiers: [.command, .shift])
|
||||||
|
|
||||||
Button("In-App Help") { chatViewModel.showHelp = true }
|
|
||||||
.keyboardShortcut("h", modifiers: [.command, .control])
|
|
||||||
|
|
||||||
Button("Credits") { chatViewModel.showCredits = true }
|
Button("Credits") { chatViewModel.showCredits = true }
|
||||||
|
|
||||||
Divider()
|
Divider()
|
||||||
@@ -161,7 +161,13 @@ struct oAIApp: App {
|
|||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
private func openHelp() {
|
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
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user