Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
WalkthroughA file modification that introduces thread-click functionality to MessageContainer by adding conditional logic to its onClick handler, calling onThreadClick(message) for thread-start messages while preserving existing long-click behavior. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageContainer.kt`:
- Line 169: The current onClick in MessageContainer calls onThreadClick whenever
message.isThreadStart(), causing taps inside the thread screen to trigger
leaveThread; change MessageContainer to only invoke onThreadClick for thread
roots when it is rendered in the channel-list context by adding a boolean prop
(e.g., isInThreadScreen or isChannelList) and gate the call: onClick = { if
(message.isThreadStart() && !isInThreadScreen) onThreadClick(message) }. Update
callers (including MessageList) to pass the appropriate flag and adjust the
default onThreadClick/leaveThread wiring so tapping a root inside the thread
screen no longer fires leaveThread.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: fc5c816f-2ef3-4918-aa6b-60dbae70482d
📒 Files selected for processing (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageContainer.kt
...compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageContainer.kt
Outdated
Show resolved
Hide resolved
f5dabbc to
6e82ed4
Compare
|




Goal
In #6218 I moved the click handling for threads from the message to the annotation. However, that only applies for thread replies. Thread roots should still handle the click.
Implementation
Call
onThreadClickwhen the message is a thread root.🎨 UI Changes
None
Testing
Try opening a thread by clicking on the root
Summary by CodeRabbit