Repository navigation
Commit 5445042
Chat: a message that changes where it stands moves to its new look instead of jumping to it
An edit, a reaction, a reply's quote coming in, a pin, a translation or a voice message's text changed a bubble
at once: it took its new size in one frame and the list jumped by the difference. Now the bubble goes from how it
was to how it is, and the bubbles around it with it, in the times and curves of the Android and iOS apps
(ChatListItemAnimator, ChatMessageCell): across fast, up slower.
- bubbleTransitions.ts: what changes is read before the change and played after it, around the ScrollSaver of
`flushBubbleModifications` (and of a bubble rendered anew). The background is laid as bands and corners and
stretched to its new box (`bubbleShape.ts`, now shared with sendFlights); the parts are matched by their role
and move from their anchor (text from its start, time from its end); the old text stays, cut by the growing or
shrinking box, until the new one takes its place; a part that went fades out as a copy, a new one fades in,
reaction chips scale and their counts roll; quotes, code, reaction blocks and tags stretch their own background,
the quote's mark and border with it; a change of kind (text and big emoji, media with or without a caption)
crossfades the bubble as a whole; the bubbles around move by an added translate. Everything moves by transform
and opacity, every read of the page goes before every write.
- What goes through it: edits (text, formatting, "edited"), reactions (custom emoji and stars too), a reply and
its quote loaded late, views, the replies count and the comments footer, pins, translation, voice
transcription (`changeBubble`), a photo's or a file's caption coming and going. A pin now shows live: the
bubbles listen to `peer_pinned_messages` and put the icon in or out of the time (a topic's unpin-all touches
only its messages; scheduled and welcome chats are left out).
- A streamed answer: the list follows its growth on the frame it is laid out (`followGrowth`), in a long chat by
scroll and in a short one by the push of its layout, so a new line no longer moves the list in two steps.
- At the reduced animation level nothing travels: sizes grow and parts fade where they stand, counts are
replaced. With animations off, in a hidden tab or a chat that is not shown, a change is just made. A change that
cannot be read or shown is just made too, a transition is over when the window it plays in goes (Document
PiP) or a while after it should have ended, the next change waits for it, and a chat switch drops the changes
queued for the old chat.
- The structure a body is rebuilt by no longer counts reactions, views, forwards, the replies count and pins, so
an edit after a reaction or a views change is shown changing instead of rendering the bubble anew; a reply
refreshed twice keeps the latest; a reactions update for a bubble not yet in the page is no longer dropped.
- copyElement.ts: copies of custom elements are inert stand-ins (`<tag>-copy`), so a copy never registers or
mounts as the real one; custom emoji are copied as pictures of their frame; `drawMediaToCanvas` returns nothing
for a video without a frame; the custom emoji layer measures every frame while things move
(`markEmojiLayoutMoving`).
- Bubble sandbox (dev only): `showBubbleSandbox()` in the console puts a bubble of the open chat into any state
by click (text kinds, edited, replies with and without a quote or a late one, reactions, media and captions,
voice text, views, pins, a streamed answer), in this tab only, and puts everything back on close. AGENTS.md
describes it.
- e2e/bubbleEditApp.spec.ts (`pnpm test:edit:app`, signed-in preview): the edit's grow and shrink with no jump of
the list, the reduced level, a message out of sight, a streamed answer followed without a jump, and the sandbox
walked through every state and back (no reaction shown twice, the quote mark moving, a late quote stretching).
Left out: a photo changed for another photo crossfades rather than stretches; video, link previews and albums
were not checked live.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>1 parent 6c9d867 commit 5445042
23 files changed
Lines changed: 4666 additions & 525 deletions
File tree
- e2e
- src
- components
- bubbleSandbox
- chat
- bubbleParts
- helpers/canvas
- lib/customEmoji
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
133 | 155 | | |
134 | 156 | | |
135 | 157 | | |
| |||
634 | 656 | | |
635 | 657 | | |
636 | 658 | | |
637 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
638 | 663 | | |
639 | 664 | | |
640 | 665 | | |
| |||
866 | 891 | | |
867 | 892 | | |
868 | 893 | | |
| 894 | + | |
869 | 895 | | |
870 | 896 | | |
871 | 897 | | |
| |||
0 commit comments