Skip to content

stabilize new messages pill#1857

Merged
simo6529 merged 2 commits intomainfrom
reset-new-messages-before-chat-leave
Jan 29, 2026
Merged

stabilize new messages pill#1857
simo6529 merged 2 commits intomainfrom
reset-new-messages-before-chat-leave

Conversation

@simo6529
Copy link
Copy Markdown
Collaborator

@simo6529 simo6529 commented Jan 29, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved notification read status synchronization when leaving conversations
    • Enhanced unread message indicator state management for better accuracy
    • Fixed notification delivery tracking to properly reflect read status on the server

✏️ Tip: You can customize this high-level summary in your review settings.

Signed-off-by: Simo <simo@6529.io>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 29, 2026

📝 Walkthrough

Walkthrough

Refactored the MyStreamWaveChat component to introduce a new WaveChatLeaveHandler that clears unread divider state and marks delivered notifications as read on component unmount via API call. Updated divider state management from ref-based capture to useState, with revised target resolution logic favoring existing drop state divider.

Changes

Cohort / File(s) Summary
Unread Divider State & Leave Handler
components/brain/my-stream/MyStreamWaveChat.tsx
Introduced WaveChatLeaveHandler component that clears unread divider state and marks delivered notifications as read on unmount. Migrated from capturedDividerRef to useState for initial divider state. Updated divider target resolution to prefer existing drop state divider, then fall back to captured state's serialNo, then first unread serial number. Added imports for commonApiPostWithoutBodyAndResponse, useUnreadDivider, and useNotificationsContext.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #1583: Modifies "mark wave as read" behavior on component unmount using the same commonApiPostWithoutBodyAndResponse API utility.
  • PR #1688: Modifies MyStreamWaveChat's unread-divider logic and changes how divider target/state is derived and managed.
  • PR #1822: Modifies unread-divider handling and visibility/state logic for waves, including divider clearing and notification read status management.

Suggested reviewers

  • ragnep

Poem

🐰 A wave doth part, the handler stays,
To clear the divider's dusty ways,
Read marks are sent, the state is clean,
Most tidy unread dance I've seen!

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'stabilize new messages pill' is vague and doesn't clearly describe the actual changes, which involve managing unread divider state and marking notifications as read. Consider a more descriptive title that reflects the core changes, such as 'Clear unread divider and mark delivered notifications as read on chat leave' or 'Reset unread state when leaving wave chat'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@sonarqubecloud
Copy link
Copy Markdown

@simo6529 simo6529 merged commit 58f8fa8 into main Jan 29, 2026
7 checks passed
@simo6529 simo6529 deleted the reset-new-messages-before-chat-leave branch January 29, 2026 08:54
@coderabbitai coderabbitai Bot mentioned this pull request Apr 7, 2026
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.

2 participants