fix(chat): stop the send bounce and drop the receipt reveal's scale - #1384
Merged
Conversation
…rget Sending a message ran animateScrollToItem(0) while the previous message's receipt collapsed its height away above it. The animated scroll resolves its target offset when it starts, so the collapse moved that target mid-flight and the list overshot and corrected, which read as the new bubble bouncing. Own messages now use requestScrollToItem(0, 0), so the new bubble is anchored during the next measure pass, in the same frame the receipt collapses. Incoming messages keep the animated scroll when near the bottom. iOS has no equivalent scroll to race: ChatViewController never computes a content offset by hand, and ChatLayout's keepContentOffsetAtBottomOnBatchUpdates pins the bottom edge across the single batch that inserts the new cell and reconfigures the old one's receipt away.
The "Delivered" line grew in with expandVertically() + scaleIn(0.95) + fadeIn. The scale has no counterpart on iOS: ChatColumnCell un-hides a ChatReceiptLabel inside its stack view and cross-fades the text, so the line only ever changes opacity while the cell self-sizes around it. Removes scaleIn from the reveal. The expand, the fade, the Delivered/Read swap, and every spring spec in ChatAnimations are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two animation bugs when sending a message, both reported against the iOS behaviour.
The bubble bounced on send
MessageListrananimateScrollToItem(0)for the newly sent message while the previous message's receipt label collapsed its height away above it. An animated scroll resolves its target offset when it starts, so the collapse moved that target mid-flight and the list overshot and corrected. That correction is what read as the bubble bouncing.Own messages now use
requestScrollToItem(0, 0). The new bubble is anchored during the next measure pass, in the same frame the receipt collapses, so there is no target to move. Incoming messages keep the animated scroll when the reader is near the bottom.iOS has no scroll here to race in the first place.
ChatViewControllernever computes a content offset by hand, and ChatLayout'skeepContentOffsetAtBottomOnBatchUpdatespins the bottom edge across the singleperformBatchUpdatesthat both inserts the new cell and reconfigures the old one's receipt away.One behaviour change: sending while scrolled well up the transcript now snaps to the newest message instead of the previous instant
scrollToItem(0). Same destination, and the animated branch was never taken in that case.The receipt reveal scaled
The "Delivered" line grew in with
expandVertically() + scaleIn(0.95f) + fadeIn. The scale has no counterpart on iOS:ChatColumnCellun-hides aChatReceiptLabelinside its stack view and cross-fades the text, so the line only ever changes opacity while the cell self-sizes around it. The vertical growth is the cell resizing, which is whatexpandVerticallyalready models.scaleInis removed from the reveal. The expand, the fade, the receipt's exit, the Delivered/Read swap, and every spring spec inChatAnimationsare unchanged, since design signed off on the current tuning.