Replaces heuristic auto-save (goodbye-phrase detection, idle timeout, min-message count, on-model-switch) with a standard macOS unsaved-changes gate (Save/Don't Save/Cancel) on New Chat, Clear Chat, Load Conversation, and Quit. The Save dialog gained a folder picker with inline "New Folder…" creation. Separately, the in-progress conversation is periodically mirrored to disk (DraftRecoveryService, configurable interval in Settings, default 10s) and offered back on next launch if oAI crashes or is force-quit, including the model that was selected. Two real bugs found via ObjectIdentifier/log-based diagnosis before this worked correctly: - oAIApp.init() wired AppDelegate.chatViewModel from its own @State read, which returned a throwaway ChatViewModel instance distinct from the one ContentView actually renders. Wiring moved to ContentView.onAppear. - NSApplication.shared.delegate as? AppDelegate always failed silently: @NSApplicationDelegateAdaptor registers an internal SwiftUI.AppDelegate wrapper as the real NSApp.delegate (same name, different type in a different module), which forwards protocol methods but isn't castable to our type. AppDelegate now tracks itself via a static `shared`. Also guards checkForCrashRecoveryDraft() against running under XCTestConfigurationFilePath — oAITests is app-hosted, so xcodebuild test launches this same app, and a leftover draft file on disk would otherwise hang the entire test run on a blocking NSAlert with no one to click it.
oAI Help Book
This folder contains the Apple Help Book for oAI.
Adding to Xcode Project
-
Add the help folder to your project:
- In Xcode, right-click on the
Resourcesfolder in the Project Navigator - Select "Add Files to 'oAI'..."
- Select the
oAI.helpfolder - Important: Check "Create folder references" (NOT "Create groups")
- Click "Add"
- In Xcode, right-click on the
-
Configure the help book in build settings:
- Select your oAI target in Xcode
- Go to the "Info" tab
- Add a new key:
CFBundleHelpBookNamewith value:oAI Help - Add another key:
CFBundleHelpBookFolderwith value:oAI.help
-
Build and test:
- Build the app (⌘B)
- Run the app (⌘R)
- Press ⌘? or select Help → oAI Help to open the help
Structure
oAI.help/
├── Contents/
│ ├── Info.plist # Help book metadata
│ └── Resources/
│ └── en.lproj/
│ ├── index.html # Main help page
│ └── styles.css # Stylesheet
└── README.md # This file
Features
- ✅ Comprehensive coverage of all oAI features
- ✅ Searchable via macOS Help menu search
- ✅ Dark mode support
- ✅ Organized by topic with table of contents
- ✅ Keyboard shortcuts reference
- ✅ Command reference with examples
- ✅ Follows Apple Human Interface Guidelines
Customization
To update the help content:
- Edit
Contents/Resources/en.lproj/index.html - Update styles in
Contents/Resources/en.lproj/styles.css - Rebuild the app
Troubleshooting
If help doesn't open:
- Make sure you added the folder as a "folder reference" (blue folder icon in Xcode)
- Check that
CFBundleHelpBookNameandCFBundleHelpBookFolderare set in Info - Clean build folder (⇧⌘K) and rebuild
Adding More Pages
To add additional help pages:
- Create new HTML files in
Contents/Resources/en.lproj/ - Link to them from
index.html - Include proper meta tags for searchability:
<meta name="AppleTitle" content="Page Title"> <meta name="keywords" content="keyword1, keyword2">