Repository navigation
feat: add dock icon toggle and default view picker - #11
Conversation
Hidden from dock by default. Toggle in Settings > General > System features applies NSApp.setActivationPolicy at runtime — no relaunch needed.
There was a problem hiding this comment.
All reported issues were addressed across 3 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Picker in Settings > General > Notch behavior lets user choose which view opens first (Buddy, Widgets, or Shelf). Disabled when Remember last tab is on. Defaults to Buddy.
relinquishFocus hardcoded .accessory, overriding showInDock toggle. Now reads Defaults[.showInDock] to restore correct policy.
grayashh
left a comment
There was a problem hiding this comment.
Build passes and the Settings-close fix from the earlier thread looks right. The verdict differs per feature, so splitting it up.
Show in Dock: requesting changes, direction is fine.
- The NotificationCenter observer fights the settings window. Details in the inline comment; short version is that the launch-time apply plus your
relinquishFocusfix already cover it, and the observer can be deleted along with the notification name and the.onChangepost. - The preference is still clobbered on one restore path:
BuddiViewModel.swift:187(camera-permission alert) hardcodes.accessory, so a user with Show in Dock enabled loses the Dock icon after hitting that alert. Consider a single helper that reads the preference and use it at everysetActivationPolicyrestore site. - Clicking the Dock icon does nothing, since there is no
applicationShouldHandleReopen. An icon without behavior reads as a bug. Opening the settings window on reopen would be enough.
Default view picker: please drop it from this PR.
"Remember last tab" already covers the use case, and openShelfByDefault (default true) overrides the picker whenever the shelf has items, which makes three overlapping start-view policies. The wiring is also partial: BuddiViewCoordinator.swift hardcodes .buddy for the initial value (line 53), in the alwaysShowTabs didSet (line 70), and in showEmpty() (line 300), so the very first open after launch ignores the setting. If you want to pursue it, a separate PR that wires all the sites and resolves the openShelfByDefault interaction would be welcome.
- Remove showInDockChanged observer + notification; relinquishFocus and launch-time apply already cover all policy transitions - Fix BuddiViewModel camera-permission alert hardcoding .accessory, breaking dock icon for users with Show in Dock enabled - Add applicationShouldHandleReopen to open Settings on dock icon click - Drop default view picker: partially wired (coordinator hardcodes .buddy at multiple sites), conflicts with openShelfByDefault; revert to .buddy default and remove defaultView key and NotchViews Serializable conformance
grayashh
left a comment
There was a problem hiding this comment.
All points addressed, and the final diff is tighter than the original. Thanks for the contribution!
|
Of course! |
Summary
Changes
Constants.swift- newshowInDockkey, defaultfalsebuddiApp.swift- applies dock policy on launch and observes changesSettingsView.swift- toggle in General settings between "Show menu bar icon" and "Launch at login"