fix(desktop): request Badge authorization so the macOS dock badge renders - #6906
Open
muguira wants to merge 1 commit into
Open
fix(desktop): request Badge authorization so the macOS dock badge renders#6906muguira wants to merge 1 commit into
muguira wants to merge 1 commit into
Conversation
…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>
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.
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/setBadgeLabelrun and the value even registers in LaunchServices (visible vialsappinfo info -only StatusLabel) — but the Dock never paints it.Root cause
macos_notifications.rsrequests notification authorization with onlyAlert | Sound:Once an app registers with
UNUserNotificationCenter, macOS scopes its notification capabilities to exactly the options granted. IfBadgewasn't part of the request, the system suppresses the dock badge entirely — even badges set through the separateNSDockTileAPI — and hides the "Badge app icon" toggle in System Settings, so there's no user-side workaround.Fix
Add
UNAuthorizationOptions::Badgeto 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
NSApp.dockTile.badgeLabeland request UN authorization — one withAlert | Sound(matching Buzz today), one withAlert | 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.🤖 Generated with Claude Code