Repository navigation
fix(ui): keep attributed avatars beside sent messages - #112472
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a Control UI chat layout issue where attributed user avatars could shift into the message lane after sending, by removing the display: contents boundary that allowed the avatar child to be auto-placed during Lit reconciliation.
Changes:
- Replace
.chat-avatar-slot { display: contents; }with a stable 36pxdisplay: gridwrapper so the avatar/fallback stays in a single grid item. - Update grid-placement and responsive-hiding selectors to account for
.chat-avatar-slotas a first-class avatar container. - Add both a browser layout test and an E2E regression test to assert avatar placement across optimistic send and history reconciliation.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| ui/src/styles/chat/grouped.css | Makes .chat-avatar-slot a stable 36px grid item and updates placement/hiding rules so attributed avatars can’t be re-auto-placed into the message lane. |
| ui/src/pages/chat/chat-responsive.browser.test.ts | Adds a layout regression test that verifies both image and initials fallback remain beside the bubble after toggling fallback state. |
| ui/src/e2e/chat-flow.e2e.test.ts | Adds an end-to-end regression test ensuring attributed user avatars stay beside their bubbles across initial history, optimistic send, and final reconciliation. |
|
Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 8:11 PM ET / August 19, 2026, 00:11 UTC. ClawSweeper reviewWhat this changesThe PR replaces an attributed sender avatar’s layout-transparent wrapper with a stable 36px grid slot so image and initials fallbacks remain beside sent chat bubbles during reconciliation. Merge readinessKeep open for maintainer handling: current main still uses the Priority: P2 Review scores
Verification
Live VerificationCommand: Result: PASS (completed) Assertions:
How this fits togetherThe Control UI turns gateway history and optimistic sends into grouped chat rows. Attributed sender identity renders an image-plus-initials avatar slot beside those rows, while direct threads and very narrow screens hide avatar presentation. flowchart LR
A[Gateway history and sends] --> B[Grouped chat rows]
B --> C[Attributed sender identity]
C --> D[Avatar image and initials slot]
D --> E[Grid-positioned message bubble]
E --> F[Direct and narrow layout rules]
Decision needed
Why: The targeted fix is sound on its reviewed branch, but current main rewrote adjacent layout and test surfaces after the PR base and the current required UI/gate checks are red. Before merge
Agent review detailsSecurityNone. PR surfaceSource +14, Tests +182. Total +196 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Rebase onto current main, retain the single wrapper-owned grid cell, and merge only after exact-head UI checks confirm attributed, peer, direct-thread, and narrow-screen behavior. Do we have a high-confidence way to reproduce the issue? Yes: the supplied before/after screenshots and the new mock-gateway browser test define a high-confidence send-and-reconcile path, although this read-only review did not execute it. Is this the best way to solve the issue? Yes: making the existing image-and-initials wrapper the sole grid item repairs placement at the layout owner; positioning each fallback child separately would duplicate the same policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 10610d9f639e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (3 earlier review cycles) |
4201cfd to
a7189e4
Compare
Preserve attributed sender-avatar placement without shifting UUID-backed typing avatars, including direct and mobile layouts. Co-authored-by: Colin Johnson <[email protected]>
|
@clawsweeper re-review Refreshed onto current main while preserving @Solvely-Colin's original attribution and existing before/after visual evidence. The incoming global wrapper margin displaced UUID-backed typing avatars introduced by #125244; the final owner-boundary grid fix keeps message and typing avatars aligned and preserves the peer-identity behavior in #126287.
The previous ClawSweeper review contained no |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes an issue where attributed user avatars could jump into the message lane after sending a chat message. Reloading the Control UI restored the correct position, but subsequent sends could trigger the shift again.
Why This Change Was Made
The attributed avatar image and initials fallback now share one stable grid item. This removes the
display: contentsboundary that allowed the visible avatar child to be auto-placed during message reconciliation, while preserving direct-thread and narrow-screen avatar hiding.The final owner-boundary fix also preserves the existing child-owned dimensions and margins. Globally positioning the wrapper would have displaced UUID-backed typing avatars introduced after the original PR; keeping wrapper placement local to the message grid repairs both sibling surfaces without adding production code.
User Impact
Attributed user avatars remain beside their sent-message bubbles before send, during optimistic rendering, after history reconciliation, and after the final response. Image-backed and initials-only typing avatars remain aligned; direct threads and mobile layouts have no phantom avatar gutter.
Evidence
Before
The previous
display: contentsrule is applied to the same post-send DOM used for the after capture. The avatar moves 509 px left into the message lane while the bubble remains right-aligned.After
With this patch, the avatar remains in its 36 px grid slot, 10 px to the right of the sent-message bubble.
Measured browser geometry:
x=662..698, bubble rightx=1171, gap-509 px.x=1181..1217, bubble rightx=1171, gap10 px.1440x900.Current-main verification
The refreshed branch preserves the recent peer-identity work in #126287 and typing-avatar consumer in #125244. Before the final fix, real Chromium reproduced the incoming sibling regression: an initials-only typing avatar had
margin-bottom: 0px, while a UUID-backed image avatar hadmargin-bottom: 4px. After the owner-boundary simplification, both avatars are aligned at36pxwith0pxbottom margins.Isolated Blacksmith Testbox validation passed all 320 checks:
390pxmobile viewport.+6/-7(net-1). Focused regression tests:+230/-0.Original contributor validation on Blacksmith Testbox, linked run 29883526855, also passed the original avatar layout coverage and UI build.
Thanks to @Solvely-Colin for identifying the message-grid ownership bug and supplying the original visual evidence and regression coverage.
AI-assisted: yes. I reviewed and understand the CSS ownership, sibling layout invariants, and regression coverage.