Allow long messages to scroll in message menu and tweak animation#6314
Allow long messages to scroll in message menu and tweak animation#6314
Conversation
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
SDK Size Comparison 📏
|
WalkthroughThis PR refactors the selected message state mechanism by replacing a bounds-only 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.
🧹 Nitpick comments (1)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/SelectedMessageMenu.kt (1)
235-355: Please add regression coverage for the new scroll/animation path.This behavior now depends on custom layout code plus window-space positioning math, so a Paparazzi case for a tall message and one clipped at the top would make regressions much easier to catch.
Based on learnings, Applies to /stream-chat-android-compose//*Test.kt : Add Paparazzi snapshots for Compose UI regressions and run
verifyPaparazziDebug.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/SelectedMessageMenu.kt` around lines 235 - 355, Add Paparazzi snapshot tests to cover the new unclipped scroll + window-space animation path by creating Compose test cases that render SelectedMessageMenu (or a minimal composable that uses UnclippedScrollState, unclippedVerticalScroll, MenuAnimationState, and rememberMenuAnimation) with two scenarios: a very tall message and a message positioned/clipped at the top of the window; capture snapshots of the composed UI and assert they match the golden images. Put tests under stream-chat-android-compose/**/*Test.kt, use Paparazzi to set a fixed device size, supply appropriate sourceBounds and MessageAlignment to exercise the translation math, and run verifyPaparazziDebug to record/verify snapshots.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In
`@stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/SelectedMessageMenu.kt`:
- Around line 235-355: Add Paparazzi snapshot tests to cover the new unclipped
scroll + window-space animation path by creating Compose test cases that render
SelectedMessageMenu (or a minimal composable that uses UnclippedScrollState,
unclippedVerticalScroll, MenuAnimationState, and rememberMenuAnimation) with two
scenarios: a very tall message and a message positioned/clipped at the top of
the window; capture snapshots of the composed UI and assert they match the
golden images. Put tests under stream-chat-android-compose/**/*Test.kt, use
Paparazzi to set a fixed device size, supply appropriate sourceBounds and
MessageAlignment to exercise the translation math, and run verifyPaparazziDebug
to record/verify snapshots.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: eda7d0c0-3f57-4e88-a040-475947ec266d
📒 Files selected for processing (4)
stream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/components/selectedmessage/SelectedMessageMenu.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/MessagesScreen.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/MessageItem.ktstream-chat-android-compose/src/main/java/io/getstream/chat/android/compose/ui/messages/list/SelectedMessageSnapshot.kt
|


Goal
Three issues in the selected message menu:
Implementation
boundsInWindowtopositionInWindowMessagePositionthat the original message had🎨 UI Changes
Testing
You can open the message menu in these scenario and verify they work as expected
Summary by CodeRabbit
Release Notes
Bug Fixes
Refactor