Repository navigation
refactor(ui): unify user avatar rendering - #114496
Conversation
|
Exact-head proof for Reproduced on Real browser, remote Blacksmith Testbox The profile browser assertion directly proves the production image CSP, the one-request authenticated blob, a Gateway-driven v3 revision held while initials are visible, continued identity of the original sidebar image element, successful decoding after the revision resolves, and an actual awaited v4 HTTP 404 with the image Shared security/lifecycle contract: central avatar view and image renderer, hostile-origin rejection, authenticated fetch, error/load state, and retained image. The Playwright screenshots and recordings remain non-committed as required by the Control UI E2E policy; the complete real network, security, decoding, revision, fallback, and DOM assertions are checked in and linked above. |
|
Codex review: needs maintainer review before merge. Reviewed July 27, 2026, 6:04 AM ET / 10:04 UTC. ClawSweeper reviewWhat this changesThis PR centralizes Control UI user-avatar identity, authenticated image rendering, and fallback behavior so the roster, profile, and attributed chat show the same initials and color for the same person. Merge readiness✅ Ready for maintainer review This PR remains necessary: the merged avatar-cache work established secure image retrieval, while this follow-up removes the remaining divergent Control UI rendering and fallback implementations. The supplied regression and Chromium evidence support the shared renderer; the protected Likely related people: steipete is the recent area contributor for both the merged avatar-cache baseline and this presentation follow-up (medium confidence). Priority: P2 Review scores
Verification
How this fits togetherThe Control UI receives presence and sender identities from Gateway-backed state, then renders those identities in the sidebar, profile, and chat. This change places the common user-avatar presentation lifecycle between the existing identity/image cache and those UI surfaces. flowchart LR
A[Presence and chat identities] --> B[Avatar identity and gateway image cache]
B --> C[Shared user-avatar view]
C --> D[Image load and fallback lifecycle]
D --> E[Sidebar and roster]
D --> F[Settings profile]
D --> G[Attributed chat]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -36, Tests +313. Total +277 across 8 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Land one shared user-avatar presentation owner over the existing authenticated Gateway cache, retaining the current origin and credential boundary while keeping assistant, agent, and plugin icon rendering separate. Do we have a high-confidence way to reproduce the issue? Yes in source, with medium confidence: the supplied exact-head report records the current-main roster/chat initials mismatch and adds a focused cross-surface regression assertion; this read-only review could not independently execute it. Is this the best way to solve the issue? Yes: sharing the presentation lifecycle is narrower and more maintainable than keeping separate initials, hue, authenticated-image, and fallback implementations in each Control UI surface. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against b7cc6811b7c5. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Maintainer disposition before landing:
No ClawSweeper rank-up item is being skipped silently: explicit owner approval and direct Lit/browser proof address the presentation-boundary and protected-maintainer concerns. |
|
Merged via squash.
|
What Problem This Solves
Fixes an issue where the same person could show different avatar initials or identity colors in the online-user list, profile, and shared chat because each Control UI surface independently rendered user avatars and image fallback events.
Follow-up to #114444.
Why This Change Was Made
Give user avatars one narrow presentation owner:
ui/src/components/identity-avatar-view.ts. The shared view resolves the canonical user identity, derives one set of initials and hue, uses the existing origin-pinned authenticated gateway avatar cache, and owns async image rendering, stable DOM updates, blob settlement, and load/error fallback. Keep gateway storage and caching, assistant/agent avatars, and plugin icons unchanged.User Impact
The same person now looks the same in the sidebar, online roster, Settings profile, and attributed chat. Single-name users have matching initials everywhere. A changed avatar updates the existing image without flicker or stale fallback; a missing image reliably returns to the same initials and color.
Evidence
main, the sameRileyuser rendersRIin the roster andRin chat; the new cross-surface test fails before the refactor and passes afterward.<img>, releases and decodes the revised PNG, and finally waits for an actual HTTP 404 plus settled removedsrcbefore proving the initials fallback. The attributed-chat scenario separately verifies matching roster/chat initials.blacksmith-testbox, leasetbx_01kyhe6v3tre5r0qrbmvfprm8e; remote Chromium proof completed withexitCode=0.corepack pnpm check:changed; Blacksmith returnedexitCode=0.patch is correct (0.91).AI-assisted; implementation, Lit lifecycle, origin and credential boundaries, regression tests, and real-browser behavior independently reviewed.