Repository navigation
fix(conversation): keep message bubble in place during reaction menu overlay - #2257
Conversation
There was a problem hiding this comment.
Thanks for your contribution, I did some quick testing and it looks like there are a few bugs with the current code:
- An outgoing message lands 8dp to the right of where it was (screenshot 1)
- In RTL languages, the message moves sideways by the width of its timestamp (incoming messages can end up at or past the right edge) (screenshot 2 - with force RTL enabled)
- The reaction bar can be covered by the context menu (screenshot 3)
- When the menu closes the message slides in the wrong direction before snapping back to the original position (video 1)
video 1
https://github.com/user-attachments/assets/d5724c24-78e6-4676-8c6e-04697ec06b54
|
Thanks for testing and catching those @mpretty-cyro! Fixed all 4 issues in the latest commit:
Verified with |
|
also noticed another bug when the keyboard is open and you long press the last sent/received message. hideKeyboard() was closing the keyboard after we already grabbed bubbleY, so the recyclerview would resize/drop down while the overlay snapshot stayed up at the old spot (causing a duplicate bubble sticking out underneath). i kept the keyboard as-is when long pressing and added WindowInsetsCompat.Type.ime() to the overlay insets so the reaction bar and context menu stay above the keyboard instead. let me know if you want screenshots of what was happening before |
|
also clipped the overlay message snapshot to the recyclerview's visible bounds. before this, if a tall message was partially scrolled under the top app bar or behind the input bar, the unclipped bitmap would draw over them. now it stays strictly within the chat list area between the top bar and input bar/keyboard |
|
Any updates ? |
I'll try to do some testing on this one today - there are a few more issues but if my testing goes ok I'll look to push up fixes before merging |
The picture landed a timestamp's width beside the real message on the long-press where the timestamp switched from shown to hidden: for outgoing messages in LTR and incoming ones in RTL. In RTL it also moved on the switch back.
The overlay's picture of a message taller than 2000px was drawn smaller than the message, because the snapshot is capped at that size. Capturing only the part inside the list keeps it small without scaling, so it is drawn at full size and no longer needs clipping. The reaction bar and menu are now placed around the part you can see.
Long-pressing a message near the top of the list opens the bar below it. Sliding down onto an emoji without lifting selected nothing, because the band a drag counts in only extended above the touch point.
Long-pressing a message with the keyboard open now closes the keyboard and shows the overlay once the list has settled, so the picture lands on the message. The keyboard isn't reopened afterwards.
With the keyboard open, the overlay waits for the keyboard to close and then found the message's row by list position, so a message above it coming or going in that time showed the neighbouring message while the reactions and menu acted on the pressed one. The row is now found by message id, and a request is dropped if the keyboard isn't reported hidden within a second.
With the keyboard open the overlay waits for it to close, so a press released just after the long-press fired could lift before the overlay appeared. The overlay then took the next tap as the rest of the long-press and ignored it: a tap on an emoji neither reacted nor closed the overlay.
|
@igotlinux I found a few more issues today during testing so I made the following changes before merging:
|



First time contributor checklist
Fixes #1234syntaxDescription
Previously, when long-pressing a message in the conversation view to open the reaction bar and context menu,
ConversationReactionOverlayforcefully shifted the bubble across the screen (snapping it to margin edges), scaled down the bubble snapshot, and ran translation/scaling animations. This displaced the message away from the user's touch and from its position in the chat list.This PR aligns the overlay interaction with standard modern messaging UX (like WhatsApp / Telegram):
(bubbleX, bubbleY)in local coordinates at1.0fscale, without translation or scale animations.Testing:
compilePlayDebugKotlin,compilePlayDebugJavaWithJavac, andtestPlayDebugUnitTestall pass.