Remove click lambdas from quoted message parameters#6293
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
WalkthroughTwo click-handling callbacks ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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 docstrings
🧪 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/api/stream-chat-android-compose.api`:
- Around line 5629-5636: Add a breaking-change entry to CHANGELOG.md documenting
that the callbacks onLongItemClick and onQuotedMessageClick were removed from
MessageQuotedContentParams, explain that destructuring semantics changed so
component4() now returns Modifier (previous callback positions are gone), and
provide a short migration note showing how to update code that constructs,
copies or destructures MessageQuotedContentParams (e.g., remove or replace
callback usages, adjust destructuring to expect Modifier as the fourth component
and migrate any callback logic to the new consumer APIs). Ensure you reference
the type MessageQuotedContentParams and the affected symbols component4(),
copy(), onLongItemClick, and onQuotedMessageClick in the changelog entry.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 32f6683e-4cac-43a8-b315-1069fd4df09d
📒 Files selected for processing (5)
stream-chat-android-compose/api/stream-chat-android-compose.apistream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/MessageContent.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/QuotedMessage.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactoryParams.kt
💤 Files with no reviewable changes (3)
- stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactory.kt
- stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/theme/ChatComponentFactoryParams.kt
- stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/messages/QuotedMessage.kt
|



Goal
At the moment, we pass click listeners down to the quoted message component. However, this is a bit problematic because:
onLongItemClickis semantically used for the click on the message, not on the quoted message, which basically means we're leaking responsibility that should live in the message componentSo, while on v6 we're fixing the bug as in #6292 to avoid breaking changes, here in v7 we're fixing the problem at the root, so we also address the problems above.
Implementation
onLongItemClickandonQuotedMessageClickfrom the quoted message parametersDefaultMessageContent🎨 UI Changes
None
Testing
Same steps as in #6292, i.e. the message menu that shows on long clicks should always operate on the quoting message (never on the quoted message).
Summary by CodeRabbit