feat(mobile+desktop): two-tier Slack-style app icon badge#802
Draft
wpfleger96 wants to merge 1 commit into
Draft
feat(mobile+desktop): two-tier Slack-style app icon badge#802wpfleger96 wants to merge 1 commit into
wpfleger96 wants to merge 1 commit into
Conversation
Numeric badge for DMs, @mentions, and broadcast mentions;
dot-only badge for general channel unread activity. macOS
dock shows a red dot via setBadgeLabel(""); iOS approximates
with badge count 1.
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.
This PR adds Slack-style two-tier app icon badge behavior: a numeric count for high-priority notifications (DMs, @mentions, broadcast replies) and a dot for general unread channel activity.
Previously the desktop badge was a flat sum of all unread channels plus home feed items, so a top-level post in any channel you're a member of inflated the numeric count the same as a DM. The mobile app had no badge at all.
isHighPriorityEventForUser()toshouldNotify.ts(and a Dart mirror) to detect["p", pubkey]mentions and["broadcast", "1"]replieslatestHighPriorityByChannelRefinuseUnreadChannels(desktop) and_latestHighPriorityByChannelinChannelsNotifier(mobile) so high-priority events are distinguished from general activity at the channel levelAppBadgeStatediscriminated union (none | dot | count) andsetDesktopAppBadge()todesktop.ts; on macOS the dot tier usessetBadgeLabel("")for a numberless red dot, on other platforms the dot is suppressed (no Tauri equivalent)unreadBadgeProviderto mobile (RiverpodProvider<UnreadBadgeState>) and wire it inApp.buildviaref.listenusingapp_badge_plus; iOS approximates the dot with badge count1since the public badge API doesn't support numberless dots