Settings → Presence: choose Dock icon / menu bar / both / neither - #33
Merged
Merged
Conversation
AppPresence (OpenPromptrCore) stores the choice as two independent facts — shows a Dock icon, shows a menu bar item — persisted in AppSettings, default Dock and menu bar (today's fixed behavior, unchanged for existing users). AppDelegate observes AppModel.$presence and applies it: activation policy (.regular/.accessory) and creating/discarding AppStatusItemController, which now removes its own status item on deinit. The existing applicationShouldHandleReopen already reopens the control window, which is what makes 'neither' recoverable without a Dock icon or menu bar item. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EGjbE4ZXFZyXFd2GQ7xRAp
Scripts/make-icon.swift now also renders Resources/MenuBarIcon.png: the same 'T over a mirror line' mark as the Dock icon, without the reflection (too faint to survive scaling to menu bar size) or the background plate, as a template image so macOS recolors it for light/dark/highlighted. build-app.sh copies it into the bundle; AppStatusItemController loads it with a fallback to the old SF Symbol for a bare 'swift build' executable with no Resources. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EGjbE4ZXFZyXFd2GQ7xRAp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #32.
What
AppPresence(OpenPromptrCore):dockAndMenuBar(default, today's fixed behavior) /dockOnly/menuBarOnly/backgroundOnly, stored as two independent facts (showsDockIcon,showsMenuBarItem) and persisted inAppSettings(backward compatible: missing key decodes to the default).AppModel.setPresence(_:)persists it, following thesetEnableLocalAPIpattern.AppDelegatesubscribes tomodel.$presenceand appliesNSApplication.setActivationPolicyplus creates/discardsAppStatusItemController(now removes its own status item indeinit, since a removedNSStatusItemcan't be brought back).Picker, plus the current choice's explanation).Design notes
applicationShouldHandleReopenalready exists and already reopens the control window; this makes it the load-bearing recovery path formenuBarOnly/backgroundOnlyinstead of an incidental one.applicationDidFinishLaunchingstill defaults to.regularbefore the model exists, corrected moments later onceconfigure()subscribes — same brief-Dock-icon-flash tradeoff a fully event-free launch would need a bigger restructuring to avoid; noted as a known limitation.Verified
swift build,swift test(64, +5 new),swift format lint --strict,./build-app.sh+--version, and the UI snapshot renderer (Settings window shows the new section correctly in light/dark).Not verified
The app was not run. Everything AppKit-level here — activation policy actually hiding/showing the Dock icon, the status item actually appearing/disappearing at runtime,
applicationShouldHandleReopenactually reopening the window in each mode, Cmd-Tab visibility — needs a real run, whichswift testcannot exercise (OpenPromptrCoreTestsonly covers theAppPresence/AppSettingslogic).🤖 Generated with Claude Code