Skip to content

fix: place user file attachments above text bubbles - #142671

Merged
vyctorbrzezowski merged 4 commits into
openclaw:mainfrom
vyctorbrzezowski:fix/user-file-attachment-above-bubble
Sep 9, 2026
Merged

vyctorbrzezowski merged 4 commits into
openclaw:mainfrom
vyctorbrzezowski:fix/user-file-attachment-above-bubble

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Closes #142662. Related: #142593.

The dependency PRs #142623 and #142639 by @vyctorbrzezowski have merged. This branch is now rebased directly on main; its complete delta is four files: production +32/-25 (net +7), tests +79/-3 (net +76).

What Problem This Solves

User file cards appeared inside the colored message bubble. In mixed image/file turns, the image could also stop short of the bubble's edge. Another participant's media in a shared session retained a separate layout from the viewer's own media.

Why This Change Was Made

Documents now use the existing image/video media shell and canonical file cards. The existing own/peer participant classes select logical end or start alignment for the message column, bare shell, and media items. Fixing the shared item's intrinsic sizing keeps visible media on the same edge as the bubble, without a media-specific alignment rule or new DOM wrapper.

User Impact

Images, videos, galleries, and document cards sit above text and follow its side: the viewer's own turns align to the end; another participant's turns align to the start. Multiple documents stack vertically, and file-only messages show just the cards. Open and Download actions remain available. Assistant presentation is preserved. Avatar placement remains owned by the separate alignment change.

Evidence

All 17 cases in the remaining attachment-spacing E2E file passed after the rebase and test consolidation. Three regression witnesses were run against parent production and all failed for the intended reason: document shell still painted, the viewer's image edge offset by 108.625px, and another participant's media shell still painted.

The document invariant extends the existing mobile spacing case. Two focused desktop cases verify visible image/card edges against the own/peer text bubble using canonical sender identities. Redundant video, gallery, image-only and second-viewport permutations were removed from automated coverage; their inspected visual evidence remains below. The original spacing tests from the base retain their separate block-rhythm contract. The test delta is reduced from +220/-31 to +79/-3 without changing production behavior.

The current check:changed passed its policy, formatting, graph-boundary, and i18n stages, then stopped at Declaration input escapes checkout: the required linked dependencies are outside this nested worktree. The prior standalone UI typecheck hit the same restriction. No guard was bypassed or dependencies installed. Current scoped TypeScript lint and CSS lint passed. The unchanged production code retains the prior clean coercion and unused-export scans. Full CI and the current integrated-head review remain landing gates.

Captures use the actual Control UI with synthetic Gateway identities and attachments, and the app's Instrument Sans loaded. Each cell embeds the message crop and full viewport. The first eight pairs retain the original file-placement proof; their assistant crops are byte-for-byte identical. The remaining pairs show the alignment repair for own and shared-participant turns. The peer gallery captures use two images; the earlier browser matrix also verified five-image galleries before this test consolidation. Open ZIP/PDF, download, image preview, close, and light/dark controls were exercised in the retained mock app.

BeforeAfter
User ZIP + text — 1440px
User ZIP + text, before, 1440px
Full viewport: User ZIP + text, before, 1440px
User ZIP + text, after, 1440px
Full viewport: User ZIP + text, after, 1440px
User two files + text — 1440px
User two files + text, before, 1440px
Full viewport: User two files + text, before, 1440px
User two files + text, after, 1440px
Full viewport: User two files + text, after, 1440px
User file only — 1440px
User file only, before, 1440px
Full viewport: User file only, before, 1440px
User file only, after, 1440px
Full viewport: User file only, after, 1440px
Assistant file, unchanged — 1440px
Assistant file, unchanged, before, 1440px
Full viewport: Assistant file, unchanged, before, 1440px
Assistant file, unchanged, after, 1440px
Full viewport: Assistant file, unchanged, after, 1440px
User ZIP + text — 390px
User ZIP + text, before, 390px
Full viewport: User ZIP + text, before, 390px
User ZIP + text, after, 390px
Full viewport: User ZIP + text, after, 390px
User two files + text — 390px
User two files + text, before, 390px
Full viewport: User two files + text, before, 390px
User two files + text, after, 390px
Full viewport: User two files + text, after, 390px
User file only — 390px
User file only, before, 390px
Full viewport: User file only, before, 390px
User file only, after, 390px
Full viewport: User file only, after, 390px
Assistant file, unchanged — 390px
Assistant file, unchanged, before, 390px
Full viewport: Assistant file, unchanged, before, 390px
Assistant file, unchanged, after, 390px
Full viewport: Assistant file, unchanged, after, 390px
Own turn: image + file + text — 1440px
Own turn: image + file + text, before, 1440px
Full viewport: Own turn: image + file + text, before, 1440px
Own turn: image + file + text, after, 1440px
Full viewport: Own turn: image + file + text, after, 1440px
Own turn: image + text — 1440px
Own turn: image + text, before, 1440px
Full viewport: Own turn: image + text, before, 1440px
Own turn: image + text, after, 1440px
Full viewport: Own turn: image + text, after, 1440px
Own turn: video + text — 1440px
Own turn: video + text, before, 1440px
Full viewport: Own turn: video + text, before, 1440px
Own turn: video + text, after, 1440px
Full viewport: Own turn: video + text, after, 1440px
Own turn: image gallery + text — 1440px
Own turn: image gallery + text, before, 1440px
Full viewport: Own turn: image gallery + text, before, 1440px
Own turn: image gallery + text, after, 1440px
Full viewport: Own turn: image gallery + text, after, 1440px
Own turn: image + file + text — 390px
Own turn: image + file + text, before, 390px
Full viewport: Own turn: image + file + text, before, 390px
Own turn: image + file + text, after, 390px
Full viewport: Own turn: image + file + text, after, 390px
Own turn: image + text — 390px
Own turn: image + text, before, 390px
Full viewport: Own turn: image + text, before, 390px
Own turn: image + text, after, 390px
Full viewport: Own turn: image + text, after, 390px
Own turn: video + text — 390px
Own turn: video + text, before, 390px
Full viewport: Own turn: video + text, before, 390px
Own turn: video + text, after, 390px
Full viewport: Own turn: video + text, after, 390px
Own turn: image gallery + text — 390px
Own turn: image gallery + text, before, 390px
Full viewport: Own turn: image gallery + text, before, 390px
Own turn: image gallery + text, after, 390px
Full viewport: Own turn: image gallery + text, after, 390px
Other participant (Colin): image + file + text — 1440px
Other participant (Colin): image + file + text, before, 1440px
Full viewport: Other participant (Colin): image + file + text, before, 1440px
Other participant (Colin): image + file + text, after, 1440px
Full viewport: Other participant (Colin): image + file + text, after, 1440px
Other participant (Colin): image + text — 1440px
Other participant (Colin): image + text, before, 1440px
Full viewport: Other participant (Colin): image + text, before, 1440px
Other participant (Colin): image + text, after, 1440px
Full viewport: Other participant (Colin): image + text, after, 1440px
Other participant (Colin): video + text — 1440px
Other participant (Colin): video + text, before, 1440px
Full viewport: Other participant (Colin): video + text, before, 1440px
Other participant (Colin): video + text, after, 1440px
Full viewport: Other participant (Colin): video + text, after, 1440px
Other participant (Colin): image gallery + text — 1440px
Other participant (Colin): image gallery + text, before, 1440px
Full viewport: Other participant (Colin): image gallery + text, before, 1440px
Other participant (Colin): image gallery + text, after, 1440px
Full viewport: Other participant (Colin): image gallery + text, after, 1440px
Other participant (Colin): image + file + text — 390px
Other participant (Colin): image + file + text, before, 390px
Full viewport: Other participant (Colin): image + file + text, before, 390px
Other participant (Colin): image + file + text, after, 390px
Full viewport: Other participant (Colin): image + file + text, after, 390px
Other participant (Colin): image + text — 390px
Other participant (Colin): image + text, before, 390px
Full viewport: Other participant (Colin): image + text, before, 390px
Other participant (Colin): image + text, after, 390px
Full viewport: Other participant (Colin): image + text, after, 390px
Other participant (Colin): video + text — 390px
Other participant (Colin): video + text, before, 390px
Full viewport: Other participant (Colin): video + text, before, 390px
Other participant (Colin): video + text, after, 390px
Full viewport: Other participant (Colin): video + text, after, 390px
Other participant (Colin): image gallery + text — 390px
Other participant (Colin): image gallery + text, before, 390px
Full viewport: Other participant (Colin): image gallery + text, before, 390px
Other participant (Colin): image gallery + text, after, 390px
Full viewport: Other participant (Colin): image gallery + text, after, 390px
Own turn: long pasted text file + text — 1440px
Own turn: pasted text file, before, 1440px
Full viewport: Own turn: pasted text file, before, 1440px
Own turn: pasted text file, after, 1440px
Full viewport: Own turn: pasted text file, after, 1440px
Other participant (Colin): long pasted text file + text — 1440px
Other participant (Colin): pasted text file, before, 1440px
Full viewport: Other participant (Colin): pasted text file, before, 1440px
Other participant (Colin): pasted text file, after, 1440px
Full viewport: Other participant (Colin): pasted text file, after, 1440px
Own turn: long pasted text file + text — 390px
Own turn: pasted text file, before, 390px
Full viewport: Own turn: pasted text file, before, 390px
Own turn: pasted text file, after, 390px
Full viewport: Own turn: pasted text file, after, 390px
Other participant (Colin): long pasted text file + text — 390px
Other participant (Colin): pasted text file, before, 390px
Full viewport: Other participant (Colin): pasted text file, before, 390px
Other participant (Colin): pasted text file, after, 390px
Full viewport: Other participant (Colin): pasted text file, after, 390px

A real composer paste of 1,782 bytes generated pasted-text-1788914352304.txt; Send preserved its exact bytes, filename and text/plain MIME as a file attachment. The same captured file was then replayed through canonical transcript history for the viewer and Colin. The four added pairs at 1440px/390px show its card outside the painted text, sharing the corresponding start/end edge (0px difference), with the existing 14px gap. Open, Close, and a byte-identical download were verified. This additional case needs no production change.

Risk and coverage

Checked consumers of the shared shell and gallery: own and peer image/file/text, image/text, video/text, and multi-image/text turns; user document/text, multiple documents and document-only turns; assistant documents; and audio-only rendering. The shared alignment owner has focused decoded-image/card geometry checks for own and peer turns. Image, video, gallery and pasted-text paths retain desktop/mobile captures; decoder lifecycle coverage remains with the parent video work. Original assistant captures have pixel parity; fresh assistant content is also unchanged. Audio-only conditions and attachment actions remain unchanged. No attachment transport, storage, permission, download, preview decoder, or avatar-layout implementation changes.

Evidence uses a mock Gateway and Chromium, not authenticated live media delivery or a physical mobile device. Both dependency PRs have merged. Landing is authorized after the required checks and current review pass on the integrated head.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui size: XL maintainer Maintainer-authored PR labels Sep 8, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review September 8, 2026 23:20
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Sep 8, 2026
@clawsweeper

clawsweeper Bot commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 8, 2026, 11:56 PM ET / September 9, 2026, 03:56 UTC (Revision 7).

ClawSweeper review

What this changes

The PR places user document cards above separate text bubbles and aligns images, videos, and files with each participant’s side of the conversation.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused fix with sufficient visual evidence and no actionable findings. Both prerequisite PRs are merged, resolving the previous stack-order blocker; current main still lacks the document layout repair.

Priority: P3
Reviewed head: 2fe7c10041644508e5939f75dcd0d944ca8372ae

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with convincing visual proof, meaningful browser regressions, and no actionable correctness findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after Control UI screenshots show the changed renderer and CSS placing document cards outside painted text, including file-only turns. The actual UI uses synthetic Gateway fixtures; this directly proves the visual change without claiming live transport coverage.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Inspected before/after Control UI screenshots show the changed renderer and CSS placing document cards outside painted text, including file-only turns. The actual UI uses synthetic Gateway fixtures; this directly proves the visual change without claiming live transport coverage.
Evidence reviewed 7 items Current main still needs the repair: At fetched main, only images and video previews select the bare media shell; document cards do not. The branch adds the document condition without replacing attachment rendering.
Focused production boundary: Document detection selects the existing media shell. Participant alignment is inherited from the message group, and the CSS keeps the shell transparent while painting its text child. Attachment resolution, authorization, preview handlers, and downloads are unchanged.
Behavioral regression coverage: The retained browser tests check document-shell transparency, mobile spacing, and decoded image/card alignment for both own and peer identities through the actual transcript renderer. The matching PR body reports 17 passing cases and three witnesses failing against parent production; these tests were inspected, not executed during this review.
Findings None None.
Security None None.

How this fits together

The Control UI turns Gateway chat history into message groups, attachment previews, and text bubbles. This change adjusts their visual layout while retaining the existing attachment actions.

flowchart TD
  A[Gateway chat history] --> B[Message and attachment renderer]
  B --> C[Participant side]
  C --> D[Bare media area]
  C --> E[Colored text bubble]
  D --> F[Existing preview and download actions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +7, Tests +76. Total +83 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 3 32 25 +7
Tests 1 79 3 +76
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 111 28 +83

Review metrics

None.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #142662
Summary: This PR is the candidate fix for document placement; merged video work is a prerequisite, while avatar alignment remains separate.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep one shared media layout with participant-owned alignment and the existing file cards, preview actions, and downloads.

Do we have a high-confidence way to reproduce the issue?

Yes: render a user ZIP/PDF attachment with text through the Control UI transcript; current main omits the bare-shell condition for documents. Source and supplied before captures establish the path; this review did not execute it.

Is this the best way to solve the issue?

Yes: extending the existing media shell and participant alignment avoids a competing attachment renderer or new wrapper, with focused geometry checks protecting the result.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against b72b30249fd0.

Labels

Label justifications:

  • P3: This repairs visual grouping and alignment while attachment access and message delivery remain available.
  • 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): Inspected before/after Control UI screenshots show the changed renderer and CSS placing document cards outside painted text, including file-only turns. The actual UI uses synthetic Gateway fixtures; this directly proves the visual change without claiming live transport coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after Control UI screenshots show the changed renderer and CSS placing document cards outside painted text, including file-only turns. The actual UI uses synthetic Gateway fixtures; this directly proves the visual change without claiming live transport coverage.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after Control UI screenshots show the changed renderer and CSS placing document cards outside painted text, including file-only turns. The actual UI uses synthetic Gateway fixtures; this directly proves the visual change without claiming live transport coverage.

Evidence

What I checked:

Likely related people:

  • vyctorbrzezowski: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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 (6 earlier review cycles)
  • reviewed 2026-09-08T23:27:56.026Z sha 1502998bb8b96b3135587988aa92ff219cb79a9d :: needs changes before merge. :: none
  • reviewed 2026-09-09T00:13:22.973Z sha 0d89987460d88ed733d7b38ad1a29f42f50846c5 :: blocked before merge. :: none
  • reviewed 2026-09-09T00:41:36.310Z sha 2c5aa3e60c6f4af572d7cac43883a7e824336dd2 :: blocked before merge. :: none
  • reviewed 2026-09-09T00:49:55.393Z sha 2c5aa3e60c6f4af572d7cac43883a7e824336dd2 :: blocked before merge. :: none
  • reviewed 2026-09-09T01:38:21.713Z sha 2c5aa3e60c6f4af572d7cac43883a7e824336dd2 :: blocked before merge. :: none
  • reviewed 2026-09-09T03:33:58.835Z sha d886bb659ef9c1420a28dd7fb56527d5db2244cc :: needs changes before merge. :: none

@vyctorbrzezowski
vyctorbrzezowski force-pushed the fix/user-file-attachment-above-bubble branch from d886bb6 to 2fe7c10 Compare September 9, 2026 03:49
@vyctorbrzezowski
vyctorbrzezowski merged commit 8b0d799 into openclaw:main Sep 9, 2026
168 of 169 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

@vyctorbrzezowski
vyctorbrzezowski deleted the fix/user-file-attachment-above-bubble branch September 9, 2026 04:03
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 9, 2026
* fix: place user file attachments above text bubbles

* fix(ui): align user media with participant bubble side

* test(ui): copy media scenario fields explicitly

* test(ui): keep minimal attachment layout regression cases
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 docs Improvements or additions to documentation maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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: XL 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.

User file attachments render inside the text bubble

1 participant