Expand message long-press hit area to entire cell#6405
Expand message long-press hit area to entire cell#6405aleksandar-apostolov merged 4 commits intodevelopfrom
Conversation
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
PR checklist ✅All required conditions are satisfied:
🎉 Great job! This PR is ready for review. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe message container's click behavior is now controlled by computed flags ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
SDK Size Comparison 📏
|
Move the click modifier from the inner content Row (wrap-content) to the outer Box (full-width) so long-press can be triggered anywhere across the row, not only on the avatar+bubble area. Aligns the long-press surface with the swipe surface and matches iOS behaviour. Adds a ripple indication so the gesture target is visible to the user.
Replace inline boolean expressions inside the click and long-click lambdas with `canOpenThread` and `canOpenActions`, so the gesture handlers read as intent rather than condition bookkeeping.
Replace the outer `Box(fillMaxWidth, contentAlignment)` + inner `Row(wrapContentWidth)` pair with a single `Row(fillMaxWidth, horizontalArrangement)`. The Box was only providing edge alignment, which a Row achieves directly via `horizontalArrangement` mapped from `MessageAlignment`. Drops the now-redundant `Stream_MessageItem` test tag (zero references outside this file) and keeps `Stream_MessageCell` on the merged Row, where it accurately labels the message cell that the gesture surface lives on.
2a695fe to
f645c2b
Compare
|
|
🚀 Available in v7.1.0 |



Goal
Long-press to open the message actions menu now targets the entire message cell, not the bubble alone. Aligns the long-press surface with the existing swipe-to-reply surface (already cell-wide), gives short one or two character messages an adequate gesture target, and matches the dominant convention on WhatsApp / iMessage.
Implementation
Three commits, intentionally separate so the structural change is reviewable in isolation:
Expand message long-press hit area to entire cell— moves theModifier.combinedClickablefrom the inner content row (wrapContentWidth) to the outer container (fillMaxWidth), so the click and long-click handlers fire anywhere across the row. Switchesindication = nulltoindication = ripple()so the gesture target is visible to the user. Reaction bar and actions menu remain anchored to the bubble; only the gesture surface widens.Extract message click predicates into named locals— replaces the inline boolean expressions inside the click and long-click lambdas withcanOpenThreadandcanOpenActions, so the gesture handlers read as intent.Collapse message item Box+Row wrapper into a single Row— the outerBox(fillMaxWidth, contentAlignment)was only providing edge alignment, which a Row achieves directly viahorizontalArrangement. Drops the redundantStream_MessageItemtest tag (zero references outside this file) and keepsStream_MessageCellon the merged Row, where it accurately labels the cell that the gesture surface lives on.API surface
No public API changes.
apiDumpproduces no diff.🎨 UI Changes
Screen_recording_20260430_144412.webm
Screen_recording_20260430_140334.webm
Testing
Run the Compose sample app on a device and open any channel.
SwipeToReplyis still the parent of the merged Row.canOpenActions).Summary by CodeRabbit