Skip to content

fix(ui): keep attributed avatars beside sent messages - #112472

Merged
steipete merged 2 commits into
mainfrom
s/fix-chat-avatar-shift
Aug 20, 2026
Merged

steipete merged 2 commits into
mainfrom
s/fix-chat-avatar-shift

Conversation

@Solvely-Colin

@Solvely-Colin Solvely-Colin commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

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: contents boundary 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: contents rule 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.

Before: attributed avatar shifted into the message lane

After

With this patch, the avatar remains in its 36 px grid slot, 10 px to the right of the sent-message bubble.

After: attributed avatar remains beside the sent-message bubble

Measured browser geometry:

  • Before: avatar x=662..698, bubble right x=1171, gap -509 px.
  • After: avatar x=1181..1217, bubble right x=1171, gap 10 px.
  • Viewport: 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 had margin-bottom: 4px. After the owner-boundary simplification, both avatars are aligned at 36px with 0px bottom margins.

Isolated Blacksmith Testbox validation passed all 320 checks:

  • 88 real-Chromium responsive layout cases, including image/initials fallback, mixed typing avatars, direct threads, and a 390px mobile viewport.
  • 19 chat-avatar tests, 199 chat-message tests, and 7 chat-attachment tests, including the previously failing stale-branch attachment case.
  • 7 mocked-Gateway Chromium identity and typing flows, including optimistic sends, history reconciliation, final responses, and both current-user and peer attribution.
  • Production: +6/-7 (net -1). Focused regression tests: +230/-0.
  • Structured Codex autoreview and a separate isolated Codex review: clean.

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.

Copilot AI review requested due to automatic review settings July 22, 2026 01:40
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Jul 22, 2026

Copilot AI 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.

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 36px display: grid wrapper so the avatar/fallback stays in a single grid item.
  • Update grid-placement and responsive-hiding selectors to account for .chat-avatar-slot as 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.

@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jul 31, 2026
@clawsweeper

clawsweeper Bot commented Jul 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 18, 2026, 8:11 PM ET / August 19, 2026, 00:11 UTC.

ClawSweeper review

What this changes

The 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 readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for maintainer handling: current main still uses the display: contents avatar slot, while this focused repair makes the slot the actual grid item and supplies direct before/after UI proof. The branch is behind current main and has failing exact-head UI/gate checks, so it needs a rebase and refresh before merge.

Priority: P2
Reviewed head: a7189e4ec5037edeae244468a17efa39c84e8d6f
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused owner-boundary repair with strong visual proof, pending rebase and exact-head current-main validation.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The supplied before/after Control UI screenshots directly show the post-send avatar moving from the wrong message lane to its intended bubble-adjacent position.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The supplied before/after Control UI screenshots directly show the post-send avatar moving from the wrong message lane to its intended bubble-adjacent position.
Evidence reviewed 6 items Current main remains affected: Current main still makes the attributed avatar wrapper layout-transparent, so its children rather than the wrapper participate in the grouped-message grid.
Fix targets the layout owner: The branch positions the wrapper itself in the avatar grid column, gives it the required 36px box, and overlays its image and initials children in that one cell.
Renderer call path: Attributed user messages are rendered as an image-and-initials slot by the avatar renderer, and grouped rows place that result beside the message and footer.
Findings None None.
Security None None.

Live Verification

Command: pnpm test ui/src/e2e/chat-attributed-identity.e2e.test.ts -t 'keeps attributed user avatars beside their bubbles through send reconciliation'

Result: PASS (completed)

pnpm test ui/src/e2e/chat-attributed-identity.e2e.test.ts -t 'keeps attributed user avatars beside their bubbles through send reconciliation'
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-112472-xA9OIa/target$ pnpm test ui/src/e2e/chat-attributed-identity.e2e.test.ts -t 'keeps attributed user avata
rs beside their bubbles through send reconciliation'
$ node --import tsx scripts/test-projects.mts ui/src/e2e/chat-attributed-identity.e2e.test.ts -t 'keeps attributed user avatars beside their bubbles through sen
d reconciliation'
pnpm test ui/src/e2e/chat-attributed-identity.e2e.test.ts -t 'keeps attributed user avatars beside their bubbles through send reconciliation'
[test] starting test/vitest/vitest.ui-e2e.config.ts
[test] preflight test/vitest/vitest.ui-e2e.config.ts
[ui-e2e] Using system Chromium at /usr/bin/chromium-browser.
Downloading FFmpeg (playwright ffmpeg v1011) from https://cdn.playwright.dev/dbazure/download/playwright/builds/ffmpeg/1011/ffmpeg-linux.zip
|                                                                                |   0% of 2.3 MiB
|■■■■■■■■                                                                        |  10% of 2.3 MiB
|■■■■■■■■■■■■■■■■                                                                |  20% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■                                                        |  30% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                                |  40% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                        |  50% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                                |  60% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                        |  70% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■                |  80% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■        |  90% of 2.3 MiB
|■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■| 100% of 2.3 MiB
FFmpeg (playwright ffmpeg v1011) downloaded to /tmp/clawsweeper-live-proof-112472-xA9OIa/profile/cache/ms-playwright/ffmpeg-1011

 RUN  v4.1.10 /tmp/clawsweeper-live-proof-112472-xA9OIa/target

 ✓  ui-e2e  ui/src/e2e/chat-attributed-identity.e2e.test.ts (3 tests | 2 skipped) 15674ms
     ✓ keeps attributed user avatars beside their bubbles through send reconciliation  8441ms

 Test Files  1 passed (1)
      Tests  1 passed | 2 skipped (3)
   Start at  00:11:55
   Duration  24.06s (transform 80ms, setup 90ms, import 433ms, tests 15.67s, environment 0ms)

[test] passed 1 Vitest shard in 30.07s
runner@runnervmzvulz:/tmp/clawsweeper-live-proof-112472-xA9OIa/target$ pnpm test ui/src/e2e/chat-attributed-identity.e2e.test.ts -t 'keeps attributed user avata
rs beside their bubbles through send reconciliation'















Assertions:

  • PASS expect_output: 1 passed

How this fits together

The 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]
Loading

Decision needed

Question Recommendation
Should this maintainer-labeled UI repair be rebased and revalidated against the current chat layout before it is merged? Rebase and refresh UI proof: Update the branch to current main, rerun the focused reconciliation and responsive checks, and merge only with green exact-head checks.

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

  • Resolve merge risk (P1) - Current main substantially changed adjacent chat CSS and responsive-test structure after this branch’s base; rebase and exact-head UI validation are needed before merge. The current head’s checks-ui and CI gate are failing, so the branch is not merge-ready despite GitHub reporting it mergeable.
  • Complete next step (P2) - The protected maintainer label and stale exact-head validation require a maintainer to choose the rebase-and-verify path before merge.
Agent review details

Security

None.

PR surface

Source +14, Tests +182. Total +196 across 3 files.

View PR surface stats
Area Files Added Removed Net
Source 1 20 6 +14
Tests 2 182 0 +182
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 3 202 6 +196

Review metrics

Metric Value Why it matters
Production versus test delta production +14, tests +182 The CSS growth establishes a real grid owner for the existing fallback wrapper; the added tests cover both browser geometry and the send-to-final reconciliation path.

Merge-risk options

Maintainer options:

  1. Rebase and validate the current layout (recommended)
    Resolve the failing exact-head checks after rebasing, then verify local sender, peer sender, direct-thread, and narrow-screen avatar behavior against current main.
  2. Pause if the rebase changes the layout contract
    Do not merge the stale branch if current main’s grouped-row changes require a different repair boundary.

Technical review

Best 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.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. The supplied before/after Control UI screenshots directly show the post-send avatar moving from the wrong message lane to its intended bubble-adjacent position.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The supplied before/after Control UI screenshots directly show the post-send avatar moving from the wrong message lane to its intended bubble-adjacent position.

Label justifications:

  • P2: This repairs a visible grouped-chat layout regression with limited blast radius.
  • merge-risk: 🚨 compatibility: The default grouped-message layout changes and must preserve current direct-thread and narrow-screen avatar behavior after rebasing.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): The supplied before/after Control UI screenshots directly show the post-send avatar moving from the wrong message lane to its intended bubble-adjacent position.
  • proof: sufficient: Contributor real behavior proof is sufficient. The supplied before/after Control UI screenshots directly show the post-send avatar moving from the wrong message lane to its intended bubble-adjacent position.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The supplied before/after Control UI screenshots directly show the post-send avatar moving from the wrong message lane to its intended bubble-adjacent position.

Evidence

What I checked:

  • Current main remains affected: Current main still makes the attributed avatar wrapper layout-transparent, so its children rather than the wrapper participate in the grouped-message grid. (ui/src/styles/chat/grouped.css:529, 10610d9f639e)
  • Fix targets the layout owner: The branch positions the wrapper itself in the avatar grid column, gives it the required 36px box, and overlays its image and initials children in that one cell. (ui/src/styles/chat/grouped.css:72, a7189e4ec503)
  • Renderer call path: Attributed user messages are rendered as an image-and-initials slot by the avatar renderer, and grouped rows place that result beside the message and footer. (ui/src/pages/chat/chat-avatar.ts:173, 10610d9f639e)
  • Regression coverage exercises reconciliation: The added browser E2E sends an attributed message through the mock gateway, observes optimistic and final states, and checks both local and peer avatar geometry. (ui/src/e2e/chat-attributed-identity.e2e.test.ts:146, a7189e4ec503)
  • Visual after-fix evidence: The supplied screenshots visibly show the sender avatar moving from the message lane to the intended position immediately right of the sent bubble; the PR body also reports measured 509px-before versus 10px-after geometry. (a7189e4ec503)
  • Current-main provenance: The current grouped layout, including the transparent slot rule, is blamed to the recent current-main UI snapshot commit; this routes follow-up to its current area contributor without attributing the bug. (ui/src/styles/chat/grouped.css:72, a57d9b506081)

Likely related people:

  • steipete: Current-main blame assigns the grouped row and avatar-slot CSS around the affected grid placement to this contributor’s recent UI commit. (role: recent current-main contributor; confidence: medium; commits: a57d9b506081; files: ui/src/styles/chat/grouped.css, ui/src/pages/chat/chat-avatar.ts, ui/src/pages/chat/components/chat-message-group.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Rebase onto current main and restore green exact-head UI and gate checks.
  • Confirm the focused avatar reconciliation test and current direct/narrow layout coverage after rebase.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (3 earlier review cycles)
  • reviewed 2026-07-31T13:02:17.265Z sha 4201cfd :: needs real behavior proof before merge. :: none
  • reviewed 2026-08-05T09:48:39.872Z sha 4201cfd :: needs maintainer review before merge. :: none
  • reviewed 2026-08-14T00:10:19.681Z sha a7189e4 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 5, 2026
@Solvely-Colin
Solvely-Colin force-pushed the s/fix-chat-avatar-shift branch from 4201cfd to a7189e4 Compare August 14, 2026 00:06
@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. labels Aug 16, 2026
Preserve attributed sender-avatar placement without shifting UUID-backed typing avatars, including direct and mobile layouts.

Co-authored-by: Colin Johnson <[email protected]>
@steipete

Copy link
Copy Markdown
Contributor

@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.

  • Real Chromium before: mixed typing-avatar margins 0px versus 4px; after: both 0px, with aligned 36px avatars.
  • Original message-avatar proof: -509px displacement before versus the correct +10px bubble gap afterward.
  • Isolated Blacksmith validation: 320 passing checks, including 88 real-Chromium responsive scenarios and 7 mocked-Gateway Chromium identity/typing flows.
  • Production +6/-7 (net -1); focused tests +230/-0.
  • Structured autoreview and separate independent Codex review: clean.

The previous ClawSweeper review contained no Rank-up moves: section; its stale-head/current-main validation concern is addressed above.

@clawsweeper

clawsweeper Bot commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit 64b0e86 into main Aug 20, 2026
96 checks passed
@steipete

Copy link
Copy Markdown
Contributor

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants