Skip to content

macOS menubar: post a system notification when an update is available #1261

Closed

Description

@ShunmeiCho

Today UpdateChecker polls the GitHub releases API every 2 days and surfaces the result only as the "Update" badge inside the popover, the "CLI x.y.z available" banner, and the "Check for Updates" menu item. If I do not open the popover I never learn that a release shipped, and releases land roughly weekly (v0.9.23 on 08-29, v0.9.24 on 09-04). There is no UNUserNotificationCenter usage anywhere under mac/, so nothing proactive reaches the user.

Environment: macOS 26 (Darwin 25.6.0), CodeBurnMenubar 0.9.24, CLI 0.9.24 via npm -g.

Proposal

  • When check() detects updateAvailable or cliUpdateAvailable, post one UNUserNotificationCenter notification per new version (deduped with a UserDefaults key so it does not repeat every 2 days).
  • Clicking the notification calls the existing performFullUpdate(), so the one-click path stays the single update code path.
  • Add a "Notify me about updates" toggle in Settings. Notification permission is requested lazily the first time a notification would be posted. I can default it to off if you prefer no new permission prompt.
  • No change to the CLI, the check interval, or the release/install flow.

Scope is contained to UpdateChecker.swift, CodeBurnApp.swift (notification delegate + click handling) and SettingsView.swift, with unit coverage for the dedupe logic under mac/Tests.

I am happy to implement this if the approach is acceptable. Filing here first per CONTRIBUTING.

Activity

  1. iamtoruk commented on Sep 10, 2026

    @iamtoruk
    Member

    Thanks for the write-up, the diagnosis was exact. We took it on directly since it touched the app delegate and settings we were already in: #1283 follows your proposal (one notification per version pair, UserDefaults dedupe, click runs performFullUpdate, Settings toggle default on, lazy permission request) with two adjustments. The notification only fires from the background poll, since a manual Check for Updates already shows its result in an alert. And the notification side sits behind a small protocol so tests never touch UNUserNotificationCenter, which aborts outside an app bundle.

    One caveat you may hit: release builds are ad-hoc signed, so macOS can re-ask for notification permission after an update. Proper signing is a separate item on our side.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions