Skip to content

Silent events: shown in the chat, never counted as unread - #40

Merged
danbarker merged 1 commit into
mainfrom
feat/silent-events
Nov 13, 2026
Merged

danbarker merged 1 commit into
mainfrom
feat/silent-events

Conversation

@danbarker

@danbarker danbarker commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

The journal protocol gains a payload flag, silent: true, for content the user can read but is never told about. A bridge sets it on the Send now / Cancel card it posts when an agent sets itself a reminder.

The app counts unread on the device, so it has to apply the rule too. A silent event no longer adds to a conversation's unread count, live or when a read marker or a history page recounts it. The row is still shown in the chat with its buttons, and still appears as the conversation's latest line in the list.

No screen changes: the only visible difference is an unread pill that no longer appears. Covered by a store test.

🤖 Generated with Claude Code


Note

Low Risk
Localized unread-badge logic in the journal store with a dedicated test; no auth, sync wire, or UI surface changes beyond badge counts.

Overview
The journal protocol’s silent: true payload flag is now honored when the Android client computes conversation unread badges. Message-type events with a JSON true silent field remain visible in the thread and can still drive the chat-list snippet, but they no longer add to unreadCount.

JournalEventType.isSilent centralizes the rule (only JSON boolean true counts). Live applyJournal skips the incremental unread bump for silent traffic; read_marker and insertHistory paths use a new recountUnread helper that starts from countUnread and subtracts rows flagged silent via EventDao.unreadMentioningSilent (string prefilter on "silent" in payload, then Kotlin parsing). A store test locks in behavior versus non-silent messages and read-marker recounts.

Reviewed by Cursor Bugbot for commit 51ec5e3. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Unread counts now exclude messages and prompts explicitly marked as silent, including when counts are recalculated after a read-marker update.
    • Silent prompts can still update the conversation preview.
    • Only a true Boolean value marks an event as silent; other values, and message text that merely mentions “silent,” do not affect unread counts. Normal messages continue to be counted.

An event whose payload carries silent: true (a card that only records
something, such as the one for a reminder an agent set itself) no longer
adds to a conversation's unread count. The row itself is shown as before.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 13, 2026

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Unread counts now exclude journal events whose payload has silent: true. Live message handling and unread recounts use this rule. Silent events can still update the conversation snippet.

Changes: Silent-aware unread counts

Layer / File(s) Summary
Silent payload detection and query
app/src/main/java/chat/matron/android/journal/WireModels.kt, app/src/main/java/chat/matron/android/journal/db/Daos.kt
JournalEventType.isSilent returns true only for the JSON boolean value true. EventDao selects eligible unread events whose payload text contains the silent key.
Silent-aware unread accounting
app/src/main/java/chat/matron/android/journal/JournalStore.kt, app/src/test/java/chat/matron/android/journal/JournalStoreTest.kt
Live message handling, read-marker recounts and history insertion exclude silent events from unread counts. Tests cover boolean and numeric values, message text containing “silent”, snippet updates and recounts.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Merge Risk: Minimal · up to 51ec5

Events marked silent stay visible in the chat but no longer add to unread counts. No concrete merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the two main behaviours of the change: silent events stay visible in the chat and are never counted as unread. The raw summary shows the unread-count exclusion in JournalStore, the isS…
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.
Full details: Title check

Explanation

The title names the two main behaviours of the change: silent events stay visible in the chat and are never counted as unread. The raw summary shows the unread-count exclusion in JournalStore, the isSilent helper, the unreadMentioningSilent DAO method, and tests covering both live and recount paths. The title matches the main change in the PR objectives.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks 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

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 53c730c and 51ec5e3.

Files selected for processing: 4

  • app/src/main/java/chat/matron/android/journal/JournalStore.kt
  • app/src/main/java/chat/matron/android/journal/WireModels.kt
  • app/src/main/java/chat/matron/android/journal/db/Daos.kt
  • app/src/test/java/chat/matron/android/journal/JournalStoreTest.kt

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@danbarker
danbarker merged commit 1b1eb92 into main Nov 13, 2026
9 checks passed
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