Skip to content

improve(chat): show pending attachments as compact pills - #2150

Merged
bkudiess merged 9 commits into
openclaw:mainfrom
bkudiess:bkudiess-web-vs-native-chat-styling
Nov 13, 2026
Merged

bkudiess merged 9 commits into
openclaw:mainfrom
bkudiess:bkudiess-web-vs-native-chat-styling

Conversation

@bkudiess

@bkudiess bkudiess commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The native chat composer shows each pending attachment as a wide, borderless 56px card that blends into the composer, with the remove button stranded at the far end.

User Impact

User impact: attached images appear as square thumbnails on their own row, and files as compact, Copilot-style pills that size to the file name. When they don't fit on one line they wrap onto more rows and the composer grows, up to about four rows before the attachment area scrolls.

The remove target shrinks from 32px to 24px (the WCAG 2.5.8 minimum) and appears on hover, keyboard focus or touch-capable devices (not on pointer focus alone). It always stays in keyboard and Narrator order.

Why This Change Was Made

A new ChatAttachmentChip Reactor component renders each pending attachment as a pill: at least 28px tall, fully rounded, subtle fill, 14px document glyph and a 12px SemiBold name, up to 216px wide. Colors come from two new theme brushes; high contrast adds an outline.

Pills are keyed to their attachment, so hover and focus state never moves to another file. Removing a file moves focus to the next file's remove button, or to the editor after the last file. Remove buttons are named for their file (Remove attachment {name}, in all six locales) and keep the composer's existing layout-readiness guard.

The rail is a wrapping flex row rather than a horizontal scroller. It grows the composer up to 136px (four rows at default text size), then scrolls vertically with a permanently reserved gutter so the overlaid scroll bar never covers remove buttons. Pills use content-sized columns so the flex layout cannot squeeze short names into an ellipsis, and their maximum width follows the rail's real row width so long pills never overflow narrow panes.

Dual-model review dispositions

A two-model review (claude-opus-5.5 and gpt-6-astra) of the first version found six issues; all are fixed in this PR:

Finding Consensus Fix
Fixed 28px height clips scaled file names Both models MinHeight instead of Height
Test did not prove reveal, sizing or which file was removed Both models UI test extended
Remove button skipped ComposerAutomationVisibility One model Guard applied; source test covers the chip
Scroll bar could cover pills One model Reserved scroll-bar gutter
Unkeyed pills carried state to the next file One model Keys and deliberate focus handoff
Remove buttons announced without a file name One model (pre-existing) Named, localized label

A follow-up rubber-duck review of these fixes found that focus selection read a render-time attachment list; it now reads the live list, with a regression for two removals before a re-render. The reviewer confirmed all its findings resolved with no new blocking issues.

A repeat two-model review of 65eb6ab1 (claude-opus-5.5 and gpt-6-astra, high reasoning) found no blocking issues and confirmed the earlier fixes. Its five findings are fixed in 0b320470: pill width now accounts for the rail border and gutter (overflow below about 286px), the test measures rows instead of counting them, pointer focus no longer reveals the remove button, touch hardware is queried once per process, and the design doc wording is corrected.

A review of the later switch to wrapping rows found that toggling the scroll-bar gutter with overflow could keep its own overflow alive after widening the window; the gutter is now always reserved. It also asked for the cap to be stated as pixels (scaled text fits fewer rows) and for proof that keyboard focus scrolls an off-screen pill into view; both are addressed.

Evidence

After (current head, light theme, 480px), from the AttachmentRail_BoundsManyFilesAndKeepsRemovalReachable visual capture after three keyboard removals:

Composer with attachment pills wrapped onto two rows; keyboard focus is on a remove button

Pills wrap onto a second row and the composer grows to fit. a.txt shows in full, long names trim inside 216px pills, and keyboard focus has moved to the surviving file's remove button.

Image attachments render as 56px tiles (the web composer's thumbnail size) on their own row above the file pills, with the remove badge on the corner (480px, keyboard focus on the badge; the test image is an 8x8 PNG scaled up):

Composer with an image tile above two file pills

Before (synthetic chat, previous composer card for draft.txt):

Composer with the previous wide borderless attachment card

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Required proof pools

  • windows-winui-interactive: the composer attachment UI changed; hover reveal, dark and high-contrast rendering and Narrator announcements still need interactive proof in the isolated WinUI app.

Validation

Run locally on Windows 11 ARM64 against the working tree committed as b67863bc (includes the main merge at bd6a2dbd) (no source edits after the final run).

  • ./build.ps1: all five projects built.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj: 5,862 passed, 29 skipped, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj: 6,441 passed, 0 failed (includes localization validation and the composer readiness-guard source test).
  • dotnet test tests/OpenClaw.Tray.UITests -c Debug -r win-arm64 --no-build --filter "FullyQualifiedName~AttachmentRail_BoundsManyFilesAndKeepsRemovalReachable|FullyQualifiedName~ComposerStatusRows_KeepNativeInputCaretAndToolbar": 7 passed (rail at 260, 320, 480 and 800; image tiles at 260 and 480; composer status rows). The rail test asserts no horizontal scrolling, at least two wrapped rows, the 136px cap with vertical scrolling only when the measured rows exceed it, an untrimmed short name, remove buttons clear of the scroll-bar gutter, pointer focus not revealing the remove button, and that keyboard focus scrolls an off-screen pill into view.
  • After merging main, its new timing-pattern guard rejected the rail test's fixed SettleAsync waits. The test now waits for observable state (stable pill layout, revealed buttons, focus scrolling, focus handoff) with WaitForRenderedConditionAsync, keeping one annotated settle for the negative pointer-focus check. The guard passes.
  • Mutation checks on 0b320470: restoring the old width formula failed the 260px case; letting pointer focus reveal the button failed all four widths. Source restored before the final run.
  • Mutation check (on an earlier commit): temporarily reading the render-time attachment list in the remove handler made the rail test fail at all three widths (focus fell to the editor); source restored before the final run.

Notes:

  • The UI test project was built through a shorter drive mapping because this worktree's FileWorker staging paths exceed 260 characters with Windows long paths disabled.
  • One earlier Shared run through that mapping with --no-restore reported 207 failures in unchanged shared code; the final run from the real worktree path passed. No shared code changed in this PR.

Real Behavior Proof

  • Environment tested: Windows 11 ARM64, isolated WinUI UI-test host, light theme, synthetic chat and attachments.
  • PR head or commit tested: b67863bc (working tree identical to the commit at test time).
  • Exact steps or command run: OPENCLAW_VISUAL_TEST=1 with dotnet test tests/OpenClaw.Tray.UITests -c Debug -r win-arm64 --no-build --filter FullyQualifiedName~AttachmentRail_BoundsManyFilesAndKeepsRemovalReachable
  • Evidence after fix: screenshot above.
  • Observed result: six pills wrap onto multiple rows without horizontal scrolling; at 320px the rail caps at 136px and scrolls, and focusing the last remove button scrolls it into view; a short name gives a narrower, untrimmed pill; remove buttons stay hidden at rest and appear on keyboard focus; removing a file keeps the others in order and moves keyboard focus to the next file's remove button, including two removals before a re-render.
  • Screenshot or artifact links verified? (Yes/No/N/A) Yes
  • Not verified or blocked: pointer hover reveal on screen, dark and high-contrast rendering, Narrator announcement, and text scaling above 100% (covered by MinHeight in code, not by a capture).

Security Impact

  • New permissions or capabilities? (Yes/No) No
  • Secrets or tokens handling changed? (Yes/No) No
  • New or changed network calls? (Yes/No) No
  • Command or tool execution surface changed? (Yes/No) No
  • Data access scope changed? (Yes/No) No
  • If any answer is Yes, explain the risk and mitigation: N/A

Compatibility and Migration

  • Backward compatible? (Yes/No) Yes
  • Config or environment changes? (Yes/No) No
  • Migration needed? (Yes/No) No
  • If yes, list the exact upgrade steps: N/A

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

Replace the wide 56px composer attachment card with a Copilot-style pill:
at least 28px tall (grows with text scaling), sized to the file name up
to 216px, with a 24px remove button revealed on hover, keyboard focus or
touch. Pills are keyed to their attachment; removing one moves focus to
the next file's remove button or the editor. Remove buttons are named
for their file in all six locales, keep the composer readiness guard,
and the rail clears the overlaid scroll bar while it can scroll.

Co-authored-by: Copilot App <[email protected]>
@clawsweeper

clawsweeper Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

🦞👀
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.

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 13, 2026
@clawsweeper

clawsweeper Bot commented Nov 13, 2026

Copy link
Copy Markdown

Codex review: needs changes before merge.

What this changes

This PR replaces wide pending-attachment cards with compact pills, localized remove labels, and deliberate focus handoff.

Example: Attach draft.txt to a chat message.

  • Before: The file occupies a wide card at least 56 pixels tall.
  • After: The file appears in a name-sized pill at least 28 pixels tall, with a 24-pixel remove target.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Useful and focused presentation work with direct visual evidence, but a confirmed timing-guard failure and incomplete interactive evidence prevent readiness.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

Product

Kind: Preference · Worth it: Yes · Fix scope: Complete
User problem: Pending attachments occupy oversized cards whose remove controls sit far from their file names.
Reason: The maintainer-authored direction has clear scanability and space benefits, follows the author's prior composer work, and introduces no configuration or protocol changes.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open: this maintainer-authored improvement is absent from main, but two added readiness waits cause the current CI timing guard to fail.

Priority: P3
Reviewed head: 6b03a5d22ab14cda435cf2dc314fa020ce4d1670

Before merge

  • [P2] Replace the added settle calls with observable-condition waits (P2) - The two additional SettleAsync calls increase this file's fixed-delay-readiness count from 151 to 153. The current timing guard consequently fails fast-validation, as its annotation confirms, and the same evaluator is enforced by Tray tests. SettleAsync waits a fixed four delay/render cycles rather than the required opacity or focus outcome. Replace these added waits with TestSupport.WaitForRenderedConditionAsync predicates for the relevant visible/focused state, preserving the existing assertions and baseline.

Findings

  • [P2] [P2] Replace the added settle calls with observable-condition waits — tests/OpenClaw.Tray.UITests/ReactorChatLayoutProofTests.cs:3072

Tests

  • Missing end-to-end proof: Provide current-head isolated-app evidence of pointer reveal/removal, high-contrast and enlarged-text rendering, and file-specific Narrator output; the supplied capture establishes light-theme layout and keyboard focus.
Agent review details

How this fits together

The Reactor composer reads pending attachments from ChatComposerViewModel, renders native WinUI controls, and forwards removals to ChatComposerController.

flowchart LR
  A[Pending attachments] --> B[ChatComposerViewModel]
  B --> C[ReactorChatComposer]
  C --> D[ChatAttachmentChip]
  D --> E[Remove activation]
  E --> F[ChatComposerController]
  F --> B
Loading

Technical review

Best possible solution:

Keep the focused chip component and existing attachment owners, replacing the added fixed-delay waits with observable rendered-state waits.

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

This is an intentional presentation change; current-main source and the supplied before screenshot establish the existing wide-card behavior.

Is this the best way to solve the issue?

The problem is bulky attachment presentation; the invariant is bounded, removable attachments with stable editor and focus behavior. A keyed chip component is justified by its independent hover and focus state, while removal remains with the existing controller and view model.

Full review comments:

  • [P2] [P2] Replace the added settle calls with observable-condition waits — tests/OpenClaw.Tray.UITests/ReactorChatLayoutProofTests.cs:3072
    The two additional SettleAsync calls increase this file's fixed-delay-readiness count from 151 to 153. The current timing guard consequently fails fast-validation, as its annotation confirms, and the same evaluator is enforced by Tray tests. SettleAsync waits a fixed four delay/render cycles rather than the required opacity or focus outcome. Replace these added waits with TestSupport.WaitForRenderedConditionAsync predicates for the relevant visible/focused state, preserving the existing assertions and baseline.
    Confidence: 1

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Attachment card dimensions and horizontal rail changes intended behavior with a stated reason (5164faa: Native chat modernization introduced bounded horizontal attachment cards with space for focus visuals.)
  • Composer mutation and focus ownership keeps the original intent (686afdc: Composer extraction assigned attachment mutation to the controller/view model and native focus application to the Reactor view.)
  • Automation readiness keeps the original intent (4712e22: Unloaded or zero-size controls must remain outside the actionable UI Automation view until usable layout exists.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • ./scripts/validate-test-timing-patterns.ps1
  • ./build.ps1
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore
  • dotnet test ./tests/OpenClaw.Tray.UITests/OpenClaw.Tray.UITests.csproj -c Debug -r win-arm64 --filter FullyQualifiedName~AttachmentRail_BoundsManyFilesAndKeepsRemovalReachable

What I checked:

Likely related people:

  • Barbara Kudiess: Raw commit 686afdc adds src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs:35 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 686afdc8d4a2; files: src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs)
  • Scott Hanselman: Raw commit 4712e22 adds tests/OpenClaw.Tray.Tests/ChatTimelinePresentationTests.cs:216 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 4712e227d110; files: tests/OpenClaw.Tray.Tests/ChatTimelinePresentationTests.cs)

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Introduced change size Production +215/-18; tests +77/-13; documentation +14/-3 Growth supports a focused stateful presentation component, localized accessibility labels, and distinct mounted-control regressions.

Labels

Label changes:

  • add P3: This is a bounded chat presentation improvement without an established broken core workflow.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • P3: This is a bounded chat presentation improvement without an established broken core workflow.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 13, 2026, 12:24 AM ET / 05:24 UTC.

bkudiess and others added 8 commits November 12, 2026 22:23
Pending attachment pills now wrap onto new rows and grow the composer,
like the GitHub Copilot app. Past four rows at default text size (136px)
the rail scrolls vertically, with a permanently reserved gutter for the
overlaid scroll bar. Pills keep their content width inside the flex row
so short names are not trimmed.

Co-authored-by: Copilot App <[email protected]>
… focus

Size the pill's maximum width from the rail's real row width (border and
reserved scroll-bar gutter included, no floor) so long pills never
overflow narrow chat panes. Pointer focus no longer reveals the remove
button. Query touch hardware once per process. Measure rail rows instead
of counting them in the UI test, add a 260px case, and correct the
design doc's rail and focus wording.

Co-authored-by: Copilot App <[email protected]>
Main's timing-pattern guard rejects fixed SettleAsync readiness. Replace
the rail test's settle waits with WaitForRenderedConditionAsync on stable
pill layout, revealed buttons, focus scrolling and focus handoff. Keep one
annotated settle for the negative pointer-focus check, which has no
positive signal to wait for.

Co-authored-by: Copilot App <[email protected]>
…e-chat-styling

# Conflicts:
#	src/OpenClaw.Tray.WinUI/Chat/ReactorChatComposer.cs
Raster image attachments in the composer now render as 96px square
thumbnails on their own wrapping row above the file pills, like the
GitHub Copilot app, with the named remove button as an opaque badge on
the tile's top-right corner. Thumbnails decode once per attachment at a
256px bound. SVG and undecodable images stay file pills. Focus order and
removal handoff follow the visual order (tiles, then pills).

Co-authored-by: Copilot App <[email protected]>
Shrink composer image tiles from 96px to the web composer's 56px and
lower the thumbnail decode bound to 192 physical pixels.

Co-authored-by: Copilot App <[email protected]>
@bkudiess
bkudiess merged commit e9ed3ba into openclaw:main Nov 13, 2026
27 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant