Repository navigation
Commit 4faca0a
authored
feat(chat): send photos from the composer and show them in the chat (#1683)
* feat(chat): send photos from the composer and show them in the chat
The photo UI on top of the transport and composer PRs, ported from
code-ios-app#959.
- Attach menu: + grows into a menu card drawn in non-focusable windows
above the keyboard, so the keyboard stays up. Back closes the menu only.
- Camera: the menu card grows into a camera card, 58% of the screen tall.
The camera starts while the menu is open, holds 30 fps, and a shot is
staged as a chip at the shutter while the file is still being written.
- Picker: Photos opens the system picker sheet; picks become chips and the
keyboard comes back up.
- Bubbles: photo bubbles with a BlurHash placeholder, upload progress,
retry, and "This photo can't be displayed" for one that won't open. A
sent photo keeps drawing while its row swaps to the stored copy.
- Viewer: tapping a photo opens an overlay that grows out of the bubble;
drag, close or Back shrinks it back into the bubble.
- Replies: a quoted photo shows its thumbnail in the reply strip and in
the quote panel, and a restored reply draft keeps it.
- Capture files left behind by a killed run are deleted when a chat opens.
* fix(chat-ui): blue upload fill, and aim the first shot at its chip
The upload fill used CodeTheme.colors.brand, which Flipcash sets to
0xFF19191A, so it barely showed on the dark track. It now uses
ChatMediaBlue (0xFF0A84FF, UIKit's systemBlue in dark mode), as iOS does.
The camera's more dot shares the same constant.
The first camera shot flew toward the top of the screen. Its chip's
header row eases in from behind the field's clip, and boundsInRoot()
reports a fully clipped node as Rect.Zero, the window's top-left. The
landing target now comes from the chip's unclipped position and size.
Later shots were fine because the header row was already visible.
* fix(chat-ui): keep a sent photo's progress bar up once its bubble is drawn
A photo that finished uploading in the composer reaches Sent soon after the
tap, but the list scrolls the new bubble in about 450 ms later. On the Seeker
the bar showed for 2 frames of a 20 fps recording before it faded, so it read
as missing.
Once the overlay is drawn it now stays up for at least 600 ms before honouring
Sent. A bubble first drawn already sent still never shows it.
* fix(messenger): send photos whose upload failed offline
Only a failure a retry can't fix blocks the send now. A photo that failed
offline goes into the transcript as Sending and retries from there,
instead of holding the message in the composer.
* fix(messenger): refresh reactions off the event bus
Offline, the reaction refresh's RPC doesn't return. Its handler waited on
it inline, and the event bus has no buffer, so every event after it
queued until the network came back: a picked photo never reached the
composer. The refresh is launched now, as the read pointer's already is.
* fix(chat-ui): show a moving bar until a photo's bytes start uploading
The capsule drew an empty track while the photo was encoding and before
the first bytes went up, so a slow start looked like no indicator at
all. Any phase without a byte count now slides the blue segment; the fill
follows the bytes once they report.
* fix(chat-ui): keep a photo's upload fill moving and run it to full
The fill eased to each byte report over 200 ms and then sat still until the next one, so a slow
upload moved in steps. It now follows the reports linearly over 450 ms, longer than the gap
between them, so it keeps moving. When the bytes finish it runs to the end of the track and
holds briefly before the moving segment takes over, instead of cutting from part-way.1 parent 2f62085 commit 4faca0a
54 files changed
Lines changed: 6406 additions & 93 deletions
File tree
- apps/flipcash
- app/src/main
- res/xml
- core/src/main
- kotlin/com/flipcash/app/core
- res/values
- features/messenger/src
- main/kotlin/com/flipcash/app/messenger
- internal
- screens
- components
- test/kotlin/com/flipcash/app/messenger/internal
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| 135 | + | |
134 | 136 | | |
135 | 137 | | |
136 | 138 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
460 | 460 | | |
461 | 461 | | |
462 | 462 | | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
463 | 472 | | |
464 | 473 | | |
465 | 474 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
974 | 974 | | |
975 | 975 | | |
976 | 976 | | |
| 977 | + | |
| 978 | + | |
977 | 979 | | |
978 | 980 | | |
979 | 981 | | |
| |||
1367 | 1369 | | |
1368 | 1370 | | |
1369 | 1371 | | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
1370 | 1395 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
25 | 29 | | |
26 | 30 | | |
27 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
0 commit comments