Skip to content

feat: add dock icon toggle and default view picker - #11

Merged
grayashh merged 4 commits into
talkvalue:mainfrom
qwelpl:main
Aug 22, 2026
Merged

grayashh merged 4 commits into
talkvalue:mainfrom
qwelpl:main

Conversation

@qwelpl

@qwelpl qwelpl commented Aug 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds a Show in Dock toggle to Settings > General > System features
  • Hidden from dock by default (on by default)
  • Toggle applies NSApp.setActivationPolicy at runtime, no relaunch needed

Changes

  • Constants.swift - new showInDock key, default false
  • buddiApp.swift - applies dock policy on launch and observes changes
  • SettingsView.swift - toggle in General settings between "Show menu bar icon" and "Launch at login"

Review in cubic

Hidden from dock by default. Toggle in Settings > General > System features
applies NSApp.setActivationPolicy at runtime — no relaunch needed.
@qwelpl
qwelpl requested a review from grayashh as a code owner August 21, 2026 02:21

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 3 files

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread buddi/buddiApp.swift Outdated
--global added 2 commits August 20, 2026 21:45
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.
@qwelpl qwelpl changed the title feat: add dock icon visibility toggle feat: add dock icon toggle and default view picker Aug 21, 2026

@grayashh grayashh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

  1. The NotificationCenter observer fights the settings window. Details in the inline comment; short version is that the launch-time apply plus your relinquishFocus fix already cover it, and the observer can be deleted along with the notification name and the .onChange post.
  2. 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 every setActivationPolicy restore site.
  3. 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.

Comment thread buddi/buddiApp.swift Outdated
Comment thread buddi/models/BuddiViewModel.swift Outdated
Comment thread buddi/enums/generic.swift Outdated
- 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 grayashh left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All points addressed, and the final diff is tighter than the original. Thanks for the contribution!

@grayashh
grayashh merged commit c6719ba into talkvalue:main Aug 22, 2026
2 checks passed
@qwelpl

qwelpl commented Aug 22, 2026

Copy link
Copy Markdown
Contributor Author

Of course!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants