Repository navigation
fix(chat): fade in a cash card's counterpart and token icon when they arrive late - #1228
Merged
Merged
Conversation
… arrive late A cash card's counterpart line and token icon can land after the card is drawn (the peer's name resolves, the icon's URL arrives). The transcript's reflow spring already grows the card to fit them, but the lines themselves popped in at full opacity. They now fade in over ChatMotion.reflow's duration, as the Send Back row and footer do since #1227. A line known at first draw, a redraw with nothing new, and a recycled cell draw without animating. The fade is a CABasicAnimation on opacity: a CATransition is filed under Core Animation's own `transition` key, so it could not be told apart. Spec: orchestrator #117.
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.
A cash card's counterpart line ("from Noah Parker") and token icon popped in at full opacity when they arrived after the card was drawn. The transcript's reflow spring already grew the card to fit them; only the lines themselves didn't animate. They now fade in over
ChatMotion.reflow's duration (0.35 s), matching the Send Back row and Sent Back footer since #1227.code-payments/flipcash-client-orchestrator#117 asks for every late height change on a drawn cash card to animate with the reflow:
State known at first draw still renders at full height with no animation, and so do a redraw with nothing new and a recycled cell.
ChatCashCardCellnow keeps one record of what it last drew (Drawn: message id, Send Back state, counterpart, icon URL) in place of the Send Back-only one.The fade is a
CABasicAnimationon opacity, not aCATransition: Core Animation files a transition under its owntransitionkey whatever key it is given, so the cell couldn't tell its fade apart.Card width doesn't change:
sendBackRow_keepsCardWidthlays the card out at max widths 189.44 and 250 with no row, Available, Sending and Sent Back, and the width is identical in every state.Tests in
ChatCashCardCellTests: a counterpart arriving late (from none, or from a placeholder name) fades in and grows the card; a token icon arriving late fades in; first draw, an unchanged redraw and a recycled cell don't animate. The two late-arrival tests fail on8586fd5d9.