Repository navigation
feat(chat): draw the typing dots as the newest transcript row - #1620
Merged
Merged
Conversation
The typing dots move out of the message bar and sit under the newest message, as iOS draws them since code-ios-app#908. When the only typist's message lands, its bubble grows out of the dots bubble instead of being inserted beside it. The dots are drawn inside the newest row rather than as a lazy item of their own, so list indices keep matching paging indices for the helpers that assume it. The newest row opens and closes by the dots' height on the insertion push spring while the list rests on it, and scrolled up the scroll offset absorbs the change so nothing on screen moves. Which arrival takes the dots follows the shared rule in the orchestrator's cross-platform-parity doc: the newest arrival, if its sender was typing and nobody is still typing after it. The tracker now holds an arrived typist for up to 1.5s so the dots are still there when the message reaches the paged list.
…rows above The arrival row read the handoff decision before the model had made it, so the message appeared at full height and the dots vanished with nothing to grow from. The decision is now made idempotently by whichever of update() or the arrival row reaches it first. The first handoff frame also shifted the rows above by the change in the gap above the row; the model now carries that delta into the starting height.
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.
Ports the last piece of code-payments/code-ios-app#908: the typing dots leave the message bar and sit in the transcript as the newest row. When the only person typing sends, their bubble grows out of the dots bubble instead of appearing separately. Builds on #1617, which brought over the insertion springs, receipt handoff and 800 ms linger.
How the row is drawn. The dots render inside the newest message's lazy item, below its bubble, not as a lazy item of their own.
MessageList's read tracking, focus pin and headroom helpers all treat a lazy index as a paging index, and a leading item would have offset every one of them. Growing the newest row by the dots' height has the same effect on layout: resting at the bottom, the rows above ride up and down oninsertionPush. Scrolled up, the change goes into the scroll offset, so nothing on screen moves.Handoff.
TypingRowModelcompares each paged snapshot with the last one. When messages land while the dots are showing,takesTypingDotsdecides whether the newest one takes their frame. It applies the shared rule merged in flipcash-client-orchestrator#31: the sender was typing, and nobody is still typing afterwards. If so, the new row starts at the dots' height and grows to its own on iOS'sfromTypingspring. Its outline grows from the dots bubble's size, the content fades in after 58 ms, and the dots fade out over 80 ms. If not, the new row still opens from the dots' height, so the rows above don't jump, and the dots stay under it minus the sender's avatar. The starting height also accounts for the gap change on the row above: it had the tight newest-row gap and now has whateverrowGapBelowgives against the arrival.Tracker.
messageArrivedused to drop the typist at once. The message reaches the paged list a beat later, so the dots vanished before there was anything to grow out of them. The typist is now kept for up to 1.5 s witharrived = true, and the transcript lets go as soon as the message lands. A trailing STOPPED doesn't extend the hold, and typing again starts a new session.Grouping. The dots never join a run, matching iOS's
interItemSpacing: a normal gap under the typist's own bubble, a wide one under anyone else's. A handed-off bubble starts from solo corners and settles into its run on the existing corner spring.TypingHandoffTestcovers each case in the shared table.TypingIndicatorTrackerTestcovers the arrival hold.