Repository navigation
Commit d2fe576
authored
feat(chat): float the message bar over a fade and retune chat motion (#1617)
* feat(chat): float the message bar over a fade and retune chat motion
Ports code-ios-app#907 and the tuning values from code-ios-app#908.
The message bar drops its own background and sits on a fade that
reaches 0.9 opacity. With the keyboard down it narrows to a grid.x6
side margin and sinks grid.x2 into the navigation bar area; both follow
the keyboard's open fraction, so the bar resizes with the keyboard
instead of after it. The transcript moves grid.x2 closer to the bar
while the keyboard is up, on the same fraction.
New messages use iOS's retuned insertion spring (0.27s, bounce 0.15),
start at 0.9 scale from the sender's bottom corner, and rise 35% of
their height plus the gap below them. The receipt line fades out in
80ms while its row closes on a no-bounce 0.35s spring, which the
reaction reflow now shares. Bubble fills go to 0.10 (outgoing) and
0.05 (incoming) white, and the swipe-to-reply arrow starts at 0.35.
The $ button stays "$" whenever a message field sits next to it, so it
no longer flashes "Send $" in contact DMs as text comes and goes.
* feat(chat): push the transcript up when a message arrives at the bottom
A new message at index 0 used to land by requestScrollToItem for our own
messages, a one-frame jump, and by animateScrollToItem for incoming ones,
on its own curve. When the transcript is resting on the newest message,
it now scrolls by the new row's measured height on insertionPush, the
insertion stiffness without the bounce. The older rows ride up while the
new row rises into its slot, as on iOS.
animateItem can't do this: the move is a scroll, and a jump in scroll
position resets placement animations. The scroll ends with a snap to
index 0 if the row above resized during it.
* fix(chat): wait for the new row's layout before pushing the transcript
The newest-message flow fires when the paged snapshot changes, before the
list lays it out, so the scroll position still described the old list:
firstVisibleItemIndex read 0 rather than 1, the push was skipped, and our
own messages fell through to requestScrollToItem's one-frame jump. Wait
for the next layout pass, with a 250ms guard, before reading it.
* feat(chat): hand the receipt to a new send in one step
The previous message's receipt dropped when a send was confirmed and the
new one's line appeared 700ms later, so the line hopped. The newest send
now holds the receipt on the row above until it is confirmed and 700ms
have passed, then the line moves down as the old one leaves, matching
iOS #908. A failed send still shows its own line straight away.
* feat(chat): port #908's typing linger, Read/Delivered rule and receipt grouping
- Typing dots stay 800ms after STOPPED, and the typist's own message
clears them straight away.
- A row carries a status line if it is the newest confirmed send or the
newest of mine they have read, so Read and Delivered can show together.
- A bubble carrying a line ends its run: round corners and the normal gap
until the line moves on.
* fix(chat): move the receipt line without a jump
At the handoff the new line drew at full height for a frame before its
own expand started, and it grew on a different spring than the old line
shrank on, while the old row's gap snapped from x2 to x1. The transcript
jumped about 20px and snapped back.
The row's AnimatedVisibility now owns the entrance on the reflow spring
the exit uses, so one row grows as the other shrinks, and the row gap
animates on the same spring. ReceiptLabel loses its own entrance.1 parent cf124aa commit d2fe576
14 files changed
Lines changed: 518 additions & 213 deletions
File tree
- apps/flipcash
- features/messenger/src
- main/kotlin/com/flipcash/app/messenger/internal/screens/components
- test/kotlin/com/flipcash/app/messenger/internal
- screens/components
Lines changed: 93 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
24 | 32 | | |
25 | 33 | | |
26 | 34 | | |
| |||
39 | 47 | | |
40 | 48 | | |
41 | 49 | | |
| 50 | + | |
42 | 51 | | |
43 | 52 | | |
| 53 | + | |
| 54 | + | |
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
47 | 58 | | |
| 59 | + | |
48 | 60 | | |
49 | 61 | | |
50 | 62 | | |
51 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
52 | 67 | | |
53 | 68 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 69 | | |
| 70 | + | |
| 71 | + | |
59 | 72 | | |
60 | 73 | | |
61 | | - | |
62 | 74 | | |
63 | 75 | | |
64 | 76 | | |
| |||
68 | 80 | | |
69 | 81 | | |
70 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
71 | 104 | | |
72 | 105 | | |
73 | 106 | | |
| |||
154 | 187 | | |
155 | 188 | | |
156 | 189 | | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
157 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
158 | 212 | | |
159 | 213 | | |
160 | 214 | | |
161 | 215 | | |
162 | 216 | | |
163 | 217 | | |
164 | | - | |
| 218 | + | |
165 | 219 | | |
166 | 220 | | |
167 | 221 | | |
168 | 222 | | |
169 | 223 | | |
170 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
171 | 235 | | |
172 | 236 | | |
173 | 237 | | |
| |||
231 | 295 | | |
232 | 296 | | |
233 | 297 | | |
234 | | - | |
235 | | - | |
| 298 | + | |
| 299 | + | |
236 | 300 | | |
237 | 301 | | |
238 | 302 | | |
| |||
241 | 305 | | |
242 | 306 | | |
243 | 307 | | |
244 | | - | |
| 308 | + | |
245 | 309 | | |
246 | 310 | | |
247 | 311 | | |
| |||
375 | 439 | | |
376 | 440 | | |
377 | 441 | | |
378 | | - | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
Lines changed: 76 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
39 | 42 | | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | | - | |
46 | | - | |
47 | | - | |
| 48 | + | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| 68 | + | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
| |||
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
| 82 | + | |
80 | 83 | | |
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
| 88 | + | |
85 | 89 | | |
86 | 90 | | |
87 | 91 | | |
| |||
150 | 154 | | |
151 | 155 | | |
152 | 156 | | |
| 157 | + | |
153 | 158 | | |
154 | 159 | | |
155 | 160 | | |
| |||
258 | 263 | | |
259 | 264 | | |
260 | 265 | | |
261 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
262 | 271 | | |
263 | 272 | | |
264 | 273 | | |
| |||
420 | 429 | | |
421 | 430 | | |
422 | 431 | | |
| 432 | + | |
423 | 433 | | |
424 | 434 | | |
425 | 435 | | |
| |||
562 | 572 | | |
563 | 573 | | |
564 | 574 | | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
565 | 585 | | |
566 | 586 | | |
567 | 587 | | |
| |||
579 | 599 | | |
580 | 600 | | |
581 | 601 | | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
582 | 621 | | |
583 | 622 | | |
584 | 623 | | |
| |||
610 | 649 | | |
611 | 650 | | |
612 | 651 | | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
613 | 682 | | |
614 | 683 | | |
615 | 684 | | |
| |||
767 | 836 | | |
768 | 837 | | |
769 | 838 | | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
770 | 842 | | |
771 | 843 | | |
772 | 844 | | |
0 commit comments