Skip to content

feat(gui): show contact avatar in thread header (tincan-ipv6d)#55

Merged
quad341 merged 3 commits into
mainfrom
feature/tincan-ipv6d
Jun 5, 2026
Merged

feat(gui): show contact avatar in thread header (tincan-ipv6d)#55
quad341 merged 3 commits into
mainfrom
feature/tincan-ipv6d

Conversation

@quad341
Copy link
Copy Markdown
Owner

@quad341 quad341 commented Jun 5, 2026

What this changes

The conversation thread header now shows a contact avatar on the left side of the name and phone number. When a PBAP photo has been fetched for the contact, it is displayed as a rounded thumbnail. When no photo is available — on first open, before PBAP sync, or for contacts with no photo — the header falls back to a generated initials-and-color circle, the same treatment the conversation list already uses.

The avatar updates when the user switches conversations: update_for_name() resets the widget to initials immediately, and the photo is filled in asynchronously when _on_contact_photo_received fires. The existing conversation-list photo wiring is preserved unchanged.

Review notes

  • tincan_gui/avatar.py: adds AvatarWidget.update_for_name(name) — resets the widget to the initials render for a new contact without needing to reconstruct the widget.
  • tincan_gui/thread_view.py: ThreadHeader layout changed from QVBoxLayout to QHBoxLayout; AvatarWidget added on the left. update_contact() and set_group_info() both call update_for_name(). New set_contact_photo() / set_header_photo() delegation chain.
  • tincan_gui/main.py: _on_contact_photo_received now also calls set_header_photo when the incoming conv ID matches the currently open conversation.
  • No new config, no new endpoints, no breaking changes to existing public API.

Test plan

  • pytest tests/ — 1151/1151 passed on feature/tincan-ipv6d tip
  • 18 new tests in tests/tincan_gui/test_thread_header_avatar.py cover: update_for_name, set_contact_photo (valid + garbage + empty input), update_contact avatar wiring on conversation switch, and _on_contact_photo_received routing logic including _same_conv normalisation
  • ruff check — clean
  • Release gate: release-gates/tincan-ipv6d-gate.md

🤖 Deployed by actual-factory

Jim Wordelman and others added 3 commits June 5, 2026 16:03
Conversation list already had per-contact avatars; the thread header
bar showed only name + phone with no visual identity cue.

- AvatarWidget.update_for_name(): reset initials to a new name when
  the conversation changes without recreating the widget
- ThreadHeader: refactored from QVBoxLayout to QHBoxLayout; avatar
  sits left of name/phone column; set_contact_photo() delegates to
  AvatarWidget.set_photo()
- ThreadView.set_header_photo(): thin delegation to header
- main._on_contact_photo_received(): also updates the header when the
  photo is for the currently selected conversation

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…er avatar wiring, and main photo-received handoff (tincan-ipv6d)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@quad341 quad341 merged commit 697f2f5 into main Jun 5, 2026
1 check passed
@quad341 quad341 deleted the feature/tincan-ipv6d branch June 5, 2026 23:34
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.

1 participant