Skip to content

fix(chat): show unread badges on selected conversations - #1278

Merged
rinchen merged 1 commit into
mainfrom
fix/stale-unread-counts
Oct 16, 2026
Merged

rinchen merged 1 commit into
mainfrom
fix/stale-unread-counts

Conversation

@cj-vana

@cj-vana cj-vana commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Selected channels and DMs hid their unread badges even when the saved read position still left messages unread. The App sidebar continued to count those messages, so a selected channel could look clear while the sidebar showed 69 unread. Selected conversation-picker rows also hid unread counts and MECP severity.

Show the computed unread count on selected channel pills, DM pills, and picker rows until an actual read action advances the watermark. Include DM counts in accessible names. Keep the picker's existing aggregate of other conversations.

This follows the badge/Catch up discrepancy reported alongside #1277. That PR fixes Catch up's saved-read-position fallback; this independent change fixes badge presentation. The screenshot alone does not establish the cause of Zeva's particular persistent count.

Validation:

  • Regression tests cover channel re-entry, remaining above the bottom, and clearing after scrolling to the bottom across Meshtastic/MeshCore and Linux/macOS/Windows.
  • DM regressions cover all three protocols and platforms while unfocused, followed by clearing on refocus.
  • Picker tests verify selected counts, MECP severity, and accessibility.
  • Full pnpm run check:pr: lint, all type checks, and 15,980 passing tests (5 skipped).

Summary by CodeRabbit

  • Bug Fixes
    • Unread counts and MECP severity indicators now remain visible for selected channels and direct messages, including while the app window is unfocused or the conversation is scrolled above the bottom.
    • Unread counts clear when the conversation’s read position advances.
    • Conversation picker rows now show unread counts for the selected channel as well as other conversations.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: Colorado-Mesh/mesh-client/.coderabbit.yaml
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 9d9fa3cf-b586-44b8-8acb-5ce12afc216a
📥 Commits

Reviewing files that changed from the base of the PR and between d6c6a8d and ab05257.

📒 Files selected for processing: 5
  • docs/development/chat.md
  • src/renderer/components/ChatPanel.test.tsx
  • src/renderer/components/ChatPanel.tsx
  • src/renderer/components/chat/ChatChannelSwitcher.test.tsx
  • src/renderer/components/chat/ChatChannelSwitcher.tsx

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

📝 Walkthrough

Selected channels and direct messages now retain visible unread counts. The changes include accessibility labels, channel-picker rows, cross-platform tests, and updated chat reference documentation.

Changes: Conversation unread indicators

Layer / File(s) Summary
Selected channel unread indicators
src/renderer/components/ChatPanel.tsx, src/renderer/components/chat/ChatChannelSwitcher.tsx, src/renderer/components/ChatPanel.test.tsx, src/renderer/components/chat/ChatChannelSwitcher.test.tsx, docs/development/chat.md
Selected channels retain unread counts in the chat view and picker. Tests cover channel badges, unread totals, and MECP labels. The documentation describes when counts clear.
Active direct-message unread indicators
src/renderer/components/ChatPanel.tsx, src/renderer/components/ChatPanel.test.tsx
Active direct-message tabs display unread counts in their badges and accessibility labels. Tests cover multiple protocols and platforms, including unread updates while the window is unfocused and read-watermark advancement after focus returns.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: rinchen

Merge Risk: ⚪ Minimal · up to ab052

No actionable merge-blocking issue is established for the unread-indicator change; it is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 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 describes the main change: showing unread badges on selected chat conversations.
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: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 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

Comment @coderabbitai help to get the list of available commands.

@rinchen
rinchen merged commit 9ffbb63 into main Oct 16, 2026
28 checks passed
@rinchen
rinchen deleted the fix/stale-unread-counts branch October 16, 2026 14:55
RobertMTalbot added a commit to RobertMTalbot/mesh-client that referenced this pull request Oct 16, 2026
Since Colorado-Mesh#1278, renderer-ui shard 3/3 fails on main (and so on every PR that
runs the full suite). The new "keeps selected channel unread visible until
read" cases render the whole Chat panel twice and take 2-5 s each on their
own, so the 5 s default times them out under a full shard's load; locally,
`pnpm run check:pr` times out four of the six. locale-quality runs the whole
i18n checker in a child process, about 5 s alone, and times out the same way.

Both get a 30 s limit. No test logic changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EHFPfW7vZXpRdR3tBBTX3r
@rinchen rinchen added the bug Something isn't working as expected label Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants