Skip to content

feat(chat): expose the listing and photos to the conversation screen - #367

Merged
alexxg20 merged 5 commits into
mainfrom
feature/conversation-figma-state
Nov 19, 2026
Merged

alexxg20 merged 5 commits into
mainfrom
feature/conversation-figma-state

Conversation

@alexxg20

@alexxg20 alexxg20 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Part of #305. ConversationViewModel now exposes what the rest of the conversation screen's Figma needs: the listing, whether I'm the renter, and the listing and profile photos. No UI yet. The screen that shows them is the next PR, stacked on this one.

#305 is split in two to keep each review small: this PR (5 files, about +290/−30) and the screen PR, #368 (10 files, about +810/−95).

On its own, this PR downloads the two photos without showing them. #368 is the only user of the new fields, so please merge it right after this one.

What

  • New fields on ConversationUiState:
    • listing: the observed listing. It is kept after a deletion and null if the listing was never read.
    • isRenter.
    • listingPhoto and otherUserPhoto.
  • Photos follow the inbox's rules (feat(chat): load listing state and photos for inbox rows #300):
    • Each Storage path is downloaded once.
    • A new path cancels the old download, and a late result for an old path is never shown.
    • A failure leaves the photo empty, without a load error.
    • A removed profile photo clears it.
  • attempt {} moved from InboxViewModel to chat/viewmodel/Attempt.kt, so both ViewModels use it. The code is unchanged.
  • FakeProfileRepository keeps its users in a MutableStateFlow, so observeProfile emits again when a test changes a profile. Its API is unchanged.

Why

The screen should stay dumb. Downloading in the ViewModel keeps Firebase out of the UI, and puts the cancellation and stale-result rules where they can be tested.

Validation

  • ./gradlew ktfmtCheck check assemble lint on this branch: passed (1403 unit tests, 0 failures; no lint issue in the changed files).
  • New ConversationViewModelTest cases:
    • the listing kept after a deletion and null when it was never read;
    • both roles;
    • each photo downloaded once, again on a new path, never replaced by a late result for an old path, and empty on failure;
    • the profile photo cleared when it is removed.

AI use

Claude Code (Claude Opus 5.5) planned the change from the issue and the Figma. It implemented it and wrote the tests, then ran two adversarial reviews and applied their fixes. I reviewed and approved the plan and the split.

🤖 Generated with Claude Code

@alexxg20
alexxg20 marked this pull request as ready for review November 18, 2026 09:51
@alexxg20 alexxg20 linked an issue Nov 18, 2026 that may be closed by this pull request
2 tasks
Mamel0uk
Mamel0uk previously approved these changes Nov 18, 2026

@Mamel0uk Mamel0uk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, could you open an issue for the nitpick below?

Keeps both sides in ConversationViewModel and its test: the listing,
role and photos of this branch, and main's photo messages.

The stale-download test now builds its ViewModel through the viewModel()
helper, which takes an optional listing repository, instead of calling
the constructor by hand.

@peng-0110 peng-0110 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked logic, LGTM

@sonarqubecloud

Copy link
Copy Markdown

@alexxg20
alexxg20 merged commit 033d979 into main Nov 19, 2026
3 checks passed
@alexxg20
alexxg20 deleted the feature/conversation-figma-state branch November 19, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Match the conversation screen to the rest of its Figma

3 participants