Originally created by: djui
Summary
- Adds Ignore muted conversations (experimental) (Settings → Notifications, on by default) so Facebook-muted threads — including muted communities — no longer increment the Dock/taskbar badge or fire native sound/banners.
- Mute is inferred from Messenger's unlabeled row glyph (current 16px speaker-off path, plus the older Caprine path), conversation-row labels, GraphQL
mute_until, and Mute/Unmute menu clicks, then cached by thread id.
- The toggle is marked experimental because the live row control has no accessible name: matching the icon is brittle when Facebook restyles it. Turn the setting off to restore today's counting.
- When a muted unread is present, the badge stops using Facebook's title
(N) (that total includes muted chats) and the notification fallback does not emit for that thread.
Test plan
- [ ] Settings → Notifications shows Ignore muted conversations (experimental), default on
- [ ] Mute a chat (or community) in Messenger; new messages do not bump the Dock badge and do not produce a banner/sound
- [ ] An unmuted DM still badges and notifies
- [ ] Turn the setting off: muted unreads count in the badge again (and fallback may notify)
- [ ] Global Mute Notifications still silences everything independently of this toggle
Ref [#243]
Summary by CodeRabbit
Originally posted by: kristofferR
@codex review
Originally posted by: coderabbitai[bot]
⚠️ Action not completed
Review rate limited. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Originally posted by: coderabbitai[bot]
📝 Walkthrough
## Walkthrough The change adds a persisted setting for ignoring muted Messenger conversations. It detects mute state from labels, DOM metadata, SVG paths, and payloads. It filters notifications and unread counts for muted conversations. ### Changes **Muted conversation handling** |Layer / File(s)|Summary| |---|---| |**Mute preference contract**`src-tauri/src/settings.rs`, `inject/src/types.d.ts`, `dist/settings.html`|Adds `ignore_muted_conversations`, defaults it to `true`, exposes it to injected code, and adds it to the Notifications settings tab.| |**Mute detection and state tracking**
`inject/src/messenger/lib/mute.ts`, `inject/src/messenger/features/mute-harvest.ts`, `inject/src/messenger/lib/mute.test.ts`, `src-tauri/inject/mcp-bridge.js`, `inject/src/messenger/index.ts`|Parses mute indicators, harvests mute state from Messenger payloads and menu actions, persists per-thread state, and adds diagnostics and tests.| |**Muted notification filtering**
`inject/src/messenger/features/notifications.ts`, `src-tauri/inject/messenger.js`|Suppresses page and fallback notifications for muted conversations, filters unread candidates, and reacts to `aria-label` changes.| |**Muted unread badge reconciliation**
`inject/src/messenger/features/unread-badge.ts`, `inject/src/messenger/lib/unread.ts`, `inject/src/messenger/lib/unread.test.ts`, `src-tauri/inject/messenger.js`|Excludes muted unread conversations from badge counts and uses per-conversation totals when muted unread state is known.| **Estimated code review effort:** 4 (Complex) | ~45 minutes **Merge Risk:** _🟠 High_ · up to `e1fe8` This change can suppress notifications and badges for the wrong conversations or undercount unread messages when Messenger's list is partial, while stale mute state and large response processing can cause incorrect behavior or runtime degradation. The current head should not merge until these correctness and runtime issues are fixed or explicitly accepted by the owner. **Suggested reviewers:** `kristofferr` ### Sequence Diagram(s) :::mermaid sequenceDiagram participant Messenger participant MutedThreadStore participant NotificationScanner participant UnreadBadge Messenger->>MutedThreadStore: observe row, open-thread, payload, and menu mute state NotificationScanner->>MutedThreadStore: query muted conversation state NotificationScanner->>UnreadBadge: provide filtered unread keys and counts UnreadBadge->>UnreadBadge: reconcile count without known muted unread conversations
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
| Check name | Status | Explanation | | :------------------------: | :------- | :---------------------------------------------------------------------------------------------------------------- | | Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. | | Title check | ✅ Passed | The title clearly and concisely summarizes the main change: suppressing badges and notifications for muted chats. | | Docstring Coverage | ✅ Passed | Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking. | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. |✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit testsThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)Comment
@coderabbitai helpto get the list of available commands.Originally posted by: kristofferR
Thanks for this, will check it out!
Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
❌ Action failed
Review failed. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Originally posted by: djui
Please wait for merging. Maybe even never merge. To detect that a conversation is muted seems to be very brittle and strong heuristic is needed. I'm not sure it's worth the effort or risk in making the codebase more complicated. Unfortunately.
Originally posted by: kristofferR
@codex review
Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
✅ Action performed
Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Originally posted by: kristofferR
@codex review
Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
⚠️ Action not completed
Review rate limited. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Originally posted by: djui
It's working now more robust. But I marked the settings as experimental, to be more transparent. Ready to merge, imho.
Originally posted by: kristofferR
@coderabbitai review
Originally posted by: coderabbitai[bot]
✅ Action performed
Review finished. > Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.Originally posted by: kristofferR
Thanks for this @djui, I see that my codereview-queue bot has been busy. 😛
I'll take a look at this tomorrow, maybe do a re-implementation if needed.
Originally posted by: kristofferR
@djui - I've added this functionality now, will appear in v.1.12.0, which is currently building and being released. Please test it and report back 😄
Ticket changed by: kristofferR