Skip to content

Conversation

@alltheseas
Copy link
Collaborator

@alltheseas alltheseas commented Jan 16, 2026

Summary

Fixed expanded profile picture showing robot emoji instead of actual profile picture.

ProfilePicImageView (the full-screen expanded PFP view) was not streaming profile updates from the network. When the profile wasn't cached at view creation, it fell back to robohash and never updated. Added profile streaming via profilesManager.streamProfile() to match the pattern used by ProfilePicView.

Checklist

Standard PR Checklist

  • I have read (or I am familiar with) the Contribution Guidelines
  • I have tested the changes in this PR
  • I have profiled the changes to ensure there are no performance regressions, or I do not need to profile the changes.
    • Not needed: Minor change adding an async stream that already exists in the small PFP view (ProfilePicView). No new computation or blocking operations.
  • I have opened or referred to an existing github issue related to this change: clicks on profile picture to expand -> robot shows #3540
  • My PR is either small, or I have split it into smaller logical commits that are easier to review
  • I have added the signoff line to all my commits. See Signing off your work
  • I have added appropriate changelog entries for the changes in this PR. See Adding changelog entries
  • I have added appropriate Closes: or Fixes: tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patches

Test report

Device: iPhone 17 Pro (Simulator)

iOS: 26.2

Damus: 5e29ce4

Setup:

  • Debugger attached
  • Log filter: ProfilePicImageView

Steps:

  1. Navigate to any profile in the app
  2. Tap on the profile picture to expand it to full screen
  3. Observe console logs showing profile stream activity
  4. Verify the actual profile picture loads (not robohash)

Results:

  • PASS

Console logs confirm fix works - profile that initially showed robohash URL updated to actual picture URL after stream delivered the profile data.

Other notes

Debug logging (Log.debug) added to ProfilePicImageView to aid future debugging. These logs only appear in debug builds (uses OSLogType.debug).

Summary by CodeRabbit

  • New Features

    • Profile pictures now receive live streamed updates so changes appear in real time.
  • Bug Fixes

    • Improved UI responsiveness, padding, and interaction behavior for profile picture display.
    • Preserved overlay and gesture behavior while fixing update/display glitches.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 16, 2026

📝 Walkthrough

Walkthrough

ProfilePicImageView gained a new public dependency damusState and now starts a SwiftUI .task to stream profile updates from damusState.nostrNetwork.profilesManager, updating an internal picture state and recomputing the image URL for rendering.

Changes

Cohort / File(s) Summary
Profile View Integration
damus/Features/Profile/Views/ProfileView.swift
Call site updated: ProfilePicImageView(...) now passes damusState: damus_state to match the new initializer.
Profile Picture Image View Enhancement
damus/Shared/Media/Images/ProfilePicImageView.swift
Added public let damusState: DamusState; new @State private var picture: String?; computes URL via get_profile_url(...); attaches .task to stream profile updates from damusState.nostrNetwork.profilesManager.streamProfile(pubkey:), updating picture and adding logging; previews updated to supply damusState.

Sequence Diagram

sequenceDiagram
    participant PV as ProfileView
    participant PPIV as ProfilePicImageView
    participant Task as SwiftUI.Task
    participant PM as ProfilesManager

    PV->>PPIV: Initialize (includes damusState)
    PPIV->>PPIV: initialize `@State` picture
    PPIV->>Task: attach .task { streamProfile(pubkey) }
    Task->>PM: streamProfile(pubkey)
    PM-->>Task: profile updates (async stream)
    loop for each profile update
        Task->>PPIV: send profile (picture)
        PPIV->>PPIV: update picture state, recompute URL, render
    end
    PM-->>Task: stream completes
    Task->>PPIV: log completion
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped in with a tiny cheer,
A stream of faces now appears,
damusState hums, the picture springs,
Fresh portraits flutter on soft wings,
I nibble bugs and toast these gears.

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'ui: fix expanded profile picture showing robot instead of actual PFP' directly summarizes the main fix: addressing the robohash issue in the expanded profile picture view, which is the core change across both modified files.
Description check ✅ Passed The PR description provides a clear summary, completes the Standard PR Checklist with all items checked, includes a thorough test report with device details and reproduction steps, and references the related GitHub issue.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

@alltheseas alltheseas added the bug Something is not working, or not working as intended label Jan 16, 2026
ProfilePicImageView was not streaming profile updates from the network.
When the profile wasn't cached at view creation, it fell back to robohash
and never updated. Added profile streaming via profilesManager to match
the pattern used by ProfilePicView.

Added debug logging (Log.debug) to aid future debugging of profile
picture loading in the expanded view.

Closes: damus-io#3540
Changelog-Fixed: Fixed expanded profile picture showing robot emoji instead of actual profile picture

Signed-off-by: alltheseas
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@danieldaquino danieldaquino added the pr-in-queue This PR is waiting in a queue behind their other PRs marked with the label `pr-active-review`. label Jan 22, 2026
@danieldaquino danieldaquino added the pr-short Pull request with less than 100 lines of code changed label Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something is not working, or not working as intended pr-in-queue This PR is waiting in a queue behind their other PRs marked with the label `pr-active-review`. pr-short Pull request with less than 100 lines of code changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants