Repository navigation
feat(chat): show the photos of a conversation - #374
Conversation
1a5df20 to
7f6740f
Compare
0248044 to
175d86d
Compare
7f6740f to
ed2f50e
Compare
175d86d to
8a0de89
Compare
ed2f50e to
adbb0fe
Compare
8a0de89 to
c7ea7da
Compare
adbb0fe to
b9ba7e9
Compare
84dbbb6 to
8528b37
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A photo's message reaches the conversation before the photo reaches Storage, so a download that finds no photo now keeps the bubble loading and tries again for about 30 s instead of failing. When this device finishes sending a photo, its bubble tries again at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A photo sent without a caption previews as an empty text, so its inbox row shows "Photo" with a small image icon instead of an empty line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two test tags on one node keep only the first, so the error placeholder was tagged messagePhoto and photoLoadError was never found. Each state now gets a single tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8528b37 to
2311956
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
adrimikh
left a comment
There was a problem hiding this comment.
Good work. The pending/uploaded split removes the earlier backoff guesswork. The same-size placeholder avoids list jumps, and failed downloads are separate from undecodable photos. Only the failed-download case offers a retry, which is right. The tests cover the pending→uploaded transition and retry.
I have just found a bug:
ConversationScreen.kt L745–L757, BubblePhoto produceState: the decoded bitmap lives only in the composition. Bytes are cached in the ViewModel, but each bubble that scrolls out of the LazyColumn and back decodes the photo again. It flashes the spinner and decodes up to 1024px each time, despite "downloads once and decodes off the main thread". ListingDetailPhotos.kt (L218–L230) hoists a decoded map for this reason. Hoist the decoded bitmaps above the list in the same way, or at least remember them per path outside the item.
The following are nits:
-
ConversationViewModel.ktL107,photoLoadErrors: it isMap<String, AppError>but only the keys are used. The UI always shows "Couldn't load the photo · Tap to retry". ForPERMISSION_DENIEDorNOT_FOUND, retrying won't help. Either use aSet<String>or showerror.message()/ hide Retry for those errors. -
ConversationScreen.ktL798,PhotoLoadError:Modifier.clickable(onClick = onRetry)has noroleoronClickLabel. Addrole = Role.Buttonso TalkBack announces it as a button. -
ConversationScreen.ktL778, the loading placeholder: itscontentDescriptionis "Photo", the same as the loaded image, so TalkBack users can't tell it is still loading. Consider "Photo, loading". -
No screenshot of the UI was provided, and it is a UI PR.
ConversationPhotosPreviewexists, so a screenshot of that preview plus the Figma comparison would help reviewers. -
Tests: the inbox tests cover a photo alone and my own photo. Add a case for a photo with a caption, which should show the caption and no "Photo" icon.
-❓ ConversationScreen.kt L659: fixedWidth = photo != null combined with ContentScale.Crop at a fixed 200dp height crops portrait photos with no way to see the whole photo. Is that intended per Figma?
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the review! Fixed in these commits:
About the crop: yes, it's on purpose. The Figma bubble is a fixed-size photo, and keeping the height fixed at 200dp means the list doesn't jump when a photo finishes loading. Opening a photo full screen to see all of it would be a nice follow-up, but it's not part of #281. I can open an issue for it if you think it's worth it. |
|
adrimikh
left a comment
There was a problem hiding this comment.
Thank you for your changes, LGTM!



Summary
Part of #281. Photo messages now show their photo in the thread for both people, and the inbox says "Photo" for a photo sent alone.
Builds on #373 (send a photo), which is merged: this PR is now based on
main.What
photoPendingtrue (from feat(chat): send and load photo messages #352). While it's pending, the bubble shows the loading placeholder and doesn't try to download anything. As soon as the sender marks it uploaded, the photo is downloaded. So a missing photo that isn't pending is a real error and shows "Couldn't load" at once. A photo whose upload never finished (Android killed the sender's app mid-upload) stays on the loading placeholder.Why
#36: both people should see the photo, not only the person who sent it.
Update (Nov 18): rebased on #352's review fix. The first version waited 1, 2, 4, 8 and 15 s after a NOT_FOUND because it couldn't tell "still uploading" from "missing". #352 now has
photoPending, so that backoff is gone (46b687a).Update (Nov 18, later): #373 is merged, so this is rebased onto
mainwithout its commits. No code change: the tree is the same as before the rebase.Validation
./gradlew ktfmtCheck assemble lint checkpass locally.AI use
Claude Code (Claude Opus 5.5) wrote the code and tests step by step, with each commit approved by me, and split the original branch into these PRs. I checked every diff.