Skip to content

fix(desktop): request Badge authorization so the macOS dock badge renders - #6906

Open
muguira wants to merge 1 commit into
block:mainfrom
muguira:fix/macos-dock-badge-authorization
Open

fix(desktop): request Badge authorization so the macOS dock badge renders#6906
muguira wants to merge 1 commit into
block:mainfrom
muguira:fix/macos-dock-badge-authorization

Conversation

@muguira

@muguira muguira commented Aug 26, 2026

Copy link
Copy Markdown

Problem

On macOS, the desktop app's dock badge (unread count / dot) never renders, and the "Badge app icon" toggle is missing from the app's entry in System Settings → Notifications, so users can't enable it manually either.

The app is setting the badge — setBadgeCount / setBadgeLabel run and the value even registers in LaunchServices (visible via lsappinfo info -only StatusLabel) — but the Dock never paints it.

Root cause

macos_notifications.rs requests notification authorization with only Alert | Sound:

Once an app registers with UNUserNotificationCenter, macOS scopes its notification capabilities to exactly the options granted. If Badge wasn't part of the request, the system suppresses the dock badge entirely — even badges set through the separate NSDockTile API — and hides the "Badge app icon" toggle in System Settings, so there's no user-side workaround.

Fix

Add UNAuthorizationOptions::Badge to the authorization request. One line, plus a comment so it doesn't get dropped later (the connection between this request and the dock tile badge is non-obvious).

Verification

  • Built two identical minimal macOS apps that set NSApp.dockTile.badgeLabel and request UN authorization — one with Alert | Sound (matching Buzz today), one with Alert | Sound | Badge. The first never renders a badge and its granted-options bitmask in notification prefs is 6; the second renders the red badge and shows 7 (Badge+Sound+Alert), matching apps like Slack/Chrome/Zoom where badges work.
  • With this change, existing installs pick up the wider grant on next launch without re-prompting the user (the request is a superset; macOS extends the grant silently).
  • Full CI run on this change (fork): Desktop Build macOS, Desktop Core, Desktop E2E Relay, 4× Desktop Smoke E2E, 2× Desktop E2E Integration, Rust Lint, Windows Rust — all green.

🤖 Generated with Claude Code

…ders

The desktop app sets its unread count via the dock tile API, and macOS
registers it (visible in LaunchServices as StatusLabel), but the Dock
never draws it: once an app registers with UNUserNotificationCenter,
macOS suppresses its dock badge unless Badge was included in the
authorization grant. It also hides the "Badge app icon" toggle in
System Settings > Notifications for that app, so users cannot enable
it manually.

Requesting Alert | Sound | Badge fixes both: the dock unread badge
renders and the System Settings toggle appears.

Verified with an A/B reproducer: two identical minimal apps setting
NSApp.dockTile.badgeLabel, one requesting Alert|Sound (badge suppressed,
matching Buzz today) and one requesting Alert|Sound|Badge (badge
renders). Existing installs pick up the wider grant on next launch
without re-prompting.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@muguira
muguira requested a review from a team as a code owner August 26, 2026 22:02
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.

1 participant