Skip to content

feat(mobile+desktop): two-tier Slack-style app icon badge#802

Draft
wpfleger96 wants to merge 1 commit into
mainfrom
worktree-wpfleger+two-tier-badge
Draft

feat(mobile+desktop): two-tier Slack-style app icon badge#802
wpfleger96 wants to merge 1 commit into
mainfrom
worktree-wpfleger+two-tier-badge

Conversation

@wpfleger96
Copy link
Copy Markdown
Collaborator

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.

  • Add isHighPriorityEventForUser() to shouldNotify.ts (and a Dart mirror) to detect ["p", pubkey] mentions and ["broadcast", "1"] replies
  • Track a parallel latestHighPriorityByChannelRef in useUnreadChannels (desktop) and _latestHighPriorityByChannel in ChannelsNotifier (mobile) so high-priority events are distinguished from general activity at the channel level
  • Add AppBadgeState discriminated union (none | dot | count) and setDesktopAppBadge() to desktop.ts; on macOS the dot tier uses setBadgeLabel("") for a numberless red dot, on other platforms the dot is suppressed (no Tauri equivalent)
  • Add unreadBadgeProvider to mobile (Riverpod Provider<UnreadBadgeState>) and wire it in App.build via ref.listen using app_badge_plus; iOS approximates the dot with badge count 1 since the public badge API doesn't support numberless dots

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.
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