Skip to content

fix(ui): soften collapsed user prompts and center their toggle - #150037

Merged
vyctorbrzezowski merged 1 commit into
openclaw:mainfrom
vyctorbrzezowski:fix/chat-user-prompt-collapse-fade
Sep 16, 2026
Merged

vyctorbrzezowski merged 1 commit into
openclaw:mainfrom
vyctorbrzezowski:fix/chat-user-prompt-collapse-fade

Conversation

@vyctorbrzezowski

Copy link
Copy Markdown
Member

Closes #150024

What Problem This Solves

Long user prompts end at a hard clipped edge, and their Show more toggle sits too close to the text.

Why This Change Was Made

A light alpha mask softens only the final visible line when the collapsed text overflows. The existing toggle visibility determines whether the mask applies. Moving the toggle down 6 px (3 px on image-bearing text surfaces) balances the space without changing bubble height.

User Impact

Collapsed prompts have a softer edge and a centered Show more control. Expanded prompts retain clear text and the same centered Show less control. Short prompts, bubble colors, padding, corner radii, the five-line clamp, and disclosure thresholds stay unchanged.

Evidence

Before: parent 809c4dfc151906f3e021ac94049b647754ba9912. After: this change. Captures use the real Control UI with a synthetic Gateway, the same Riley messages, loaded fonts, Chromium on Linux, and 2× pixels at 1440 px and 390 px viewport widths. Expanded screenshots show the end of the prompt and its toggle; grouped collapsed screenshots include the unchanged short follow-up.

All 16 state pairs retain identical bubble width, height, padding, background, and radius. Pixel comparisons preserve the grouped short message exactly and restrict expanded-state differences to the toggle. The ordinary bubble's gaps change from 8 / 19.69 px to 14 / 13.69 px (above / below), a 0.31 px difference, within the 1 px tolerance. Its collapsed height remains 164.69 px. Image-bearing text surfaces pass the same tolerance in browser tests with a 3 px toggle adjustment.

StateBeforeAfter
Light · 1440 px · single · collapsedBefore: Light · 1440 px · single · collapsedAfter: Light · 1440 px · single · collapsed
Light · 1440 px · single · expandedBefore: Light · 1440 px · single · expandedAfter: Light · 1440 px · single · expanded
Light · 1440 px · grouped · collapsedBefore: Light · 1440 px · grouped · collapsedAfter: Light · 1440 px · grouped · collapsed
Light · 1440 px · grouped · expandedBefore: Light · 1440 px · grouped · expandedAfter: Light · 1440 px · grouped · expanded
Light · 390 px · single · collapsedBefore: Light · 390 px · single · collapsedAfter: Light · 390 px · single · collapsed
Light · 390 px · single · expandedBefore: Light · 390 px · single · expandedAfter: Light · 390 px · single · expanded
Light · 390 px · grouped · collapsedBefore: Light · 390 px · grouped · collapsedAfter: Light · 390 px · grouped · collapsed
Light · 390 px · grouped · expandedBefore: Light · 390 px · grouped · expandedAfter: Light · 390 px · grouped · expanded
Dark · 1440 px · single · collapsedBefore: Dark · 1440 px · single · collapsedAfter: Dark · 1440 px · single · collapsed
Dark · 1440 px · single · expandedBefore: Dark · 1440 px · single · expandedAfter: Dark · 1440 px · single · expanded
Dark · 1440 px · grouped · collapsedBefore: Dark · 1440 px · grouped · collapsedAfter: Dark · 1440 px · grouped · collapsed
Dark · 1440 px · grouped · expandedBefore: Dark · 1440 px · grouped · expandedAfter: Dark · 1440 px · grouped · expanded
Dark · 390 px · single · collapsedBefore: Dark · 390 px · single · collapsedAfter: Dark · 390 px · single · collapsed
Dark · 390 px · single · expandedBefore: Dark · 390 px · single · expandedAfter: Dark · 390 px · single · expanded
Dark · 390 px · grouped · collapsedBefore: Dark · 390 px · grouped · collapsedAfter: Dark · 390 px · grouped · collapsed
Dark · 390 px · grouped · expandedBefore: Dark · 390 px · grouped · expandedAfter: Dark · 390 px · grouped · expanded

The rulers below measure the space from the clipped content to the toggle and from the toggle to the inside bottom edge of the bubble.

Close-upBeforeAfter
Light · 1440 px · rulerBefore: Light · 1440 px · rulerAfter: Light · 1440 px · ruler
Light · 390 px · rulerBefore: Light · 390 px · rulerAfter: Light · 390 px · ruler
Dark · 1440 px · rulerBefore: Dark · 1440 px · rulerAfter: Dark · 1440 px · ruler
Dark · 390 px · rulerBefore: Dark · 390 px · rulerAfter: Dark · 390 px · ruler
Coverage Result
Overflowing collapsed prompt, light/dark × 1440/390 Last-line mask; centered toggle
Expanded prompt, same matrix No mask; centered Show less
Source over 1,200 characters whose rendered link fits No mask; toggle hidden
Short multiline prompt No disclosure; original visible text
Single and grouped messages All 16 before/after pairs inspected; bubble geometry unchanged
Image-bearing user prompts Both themes and widths pass collapsed/expanded geometry and mask checks
Toggle hover and keyboard focus Color and focus outline preserved
Browser descendant reveal after reload Existing paragraph readability and sibling ordering checks pass

Validation:

  • Disclosure E2E: 11 tests pass. Before the fix, all four original theme/width regression cases failed on an 11.69 px gap mismatch; the three pre-existing cases passed.
  • oxfmt, scoped stylelint, and git diff --check: pass.
  • node scripts/check-changed.mjs -- ui/src/styles/chat/text.css ui/src/e2e/chat-user-bubble-disclosure.e2e.test.ts: pass (durable exit 0; every guard, typecheck, export scan, and lint stage passed).
  • Adjacent message rendering and Markdown tests: 280 pass (291 tests total with the disclosure E2E suite).
  • pnpm ui:build and node --import ./scripts/tsx.mjs scripts/check-control-ui-performance.mts: pass without a baseline update. Startup JS: 359,901 B gzip; startup CSS: 48,377 B gzip, below the 51,200 B hard ceiling (above its 46,080 B advisory target).
  • Independent review: no actionable findings.

Risk and coverage

The shared user Markdown disclosure serves ordinary and image-bearing transcript messages; both pass the real browser matrix. New-session draft previews and side-chat questions provide no expansion callback, task activity renders assistant text, and JSON uses its separate disclosure, so those consumers do not enter the changed selectors. Assistant messages and PR-list disclosures remain outside this CSS scope.

No production JavaScript, stored state, expansion policy, bubble surface tokens, or interaction handlers change. The existing five-line natural-layout clipping remains intact. Visual and geometry proof uses Chromium at the default text size; Safari and Firefox were not run.

Diff category Added lines Removed lines
Production CSS 15 0
Existing disclosure E2E test 119 46

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

clawsweeper Bot commented Sep 16, 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 app: web-ui App: web-ui size: S maintainer Maintainer-authored PR labels Sep 16, 2026
@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review September 16, 2026 12:18
@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 16, 2026
@clawsweeper

clawsweeper Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 16, 2026, 8:24 AM ET / 12:24 UTC.

ClawSweeper review

What this changes

The PR softens the clipped edge of long user prompts, centers their expansion toggle, and extends browser coverage across themes, widths, and image-bearing messages.

Merge readiness

✅ Ready for maintainer review

This remains a useful, narrowly scoped visual improvement with convincing screenshot evidence and no actionable patch defects found. Current main lacks the requested styling, and the member-authored PR is protected from cleanup closure.

Priority: P3
Reviewed head: f30b156112c3e1c8563bf5ec40916b65f345bc9e

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with directly relevant visual proof and meaningful browser assertions; no blocking defect was found.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after screenshots show the actual Control UI disclosure’s fade and toggle placement in Chromium with synthetic Gateway messages, including clear expanded text; the full body adds geometry measurements and broader browser 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 screenshots show the actual Control UI disclosure’s fade and toggle placement in Chromium with synthetic Gateway messages, including clear expanded text; the full body adds geometry measurements and broader browser coverage.
Evidence reviewed 8 items Introduced production change: The pinned merge-base-to-head patch adds only a content mask and relative toggle offsets to production CSS. Existing clipping, visibility measurement, event handlers, and persisted state remain unchanged.
Existing presentation owner: The renderer admits only eligible user messages with an expansion callback; its overflow observer hides the toggle when collapsed content fits. The new selector consumes that existing visibility decision instead of introducing competing overflow logic.
Current main still needs the improvement: Fetched main retains the five-line hard clip and an inline toggle with an 8px top margin, without the new fade or positioning offsets.
Findings None None.
Security None None.

How this fits together

The Control UI renders user messages received from the Gateway into chat bubbles. Its existing disclosure component determines when long text is collapsed; this change adjusts only that component’s presentation.

flowchart LR
  A[Gateway message history] --> B[User message renderer]
  B --> C[Existing disclosure eligibility]
  C --> D[Rendered overflow check]
  D --> E[Collapsed preview and fade]
  D --> F[Full text without fade]
  E --> G[Show more toggle]
  G --> F
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +15, Tests +73. Total +88 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 15 0 +15
Tests 1 119 46 +73
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 134 46 +88

Review metrics

Metric Value Why it matters
Toggle spacing Reported gap mismatch: 11.69px → 0.31px The browser measurements quantify the intended centering while retaining the reported 164.69px collapsed bubble height.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #150024
Summary: This PR implements the paired visual-refinement request, which should remain open until the implementation lands.

Members:

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

Technical review

Best possible solution:

Keep the existing disclosure owner and apply the bounded CSS refinement while preserving message content, overflow thresholds, and bubble geometry.

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

Not applicable as a broken-behavior reproduction: this is visual refinement. Current source and inspected before screenshots establish the hard edge and uneven spacing.

Is this the best way to solve the issue?

Yes. The patch reuses the existing overflow decision and changes presentation without adding state, handlers, or another rendering path.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is bounded chat presentation polish; reading and expanding messages already work.
  • add proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots show the actual Control UI disclosure’s fade and toggle placement in Chromium with synthetic Gateway messages, including clear expanded text; the full body adds geometry measurements and broader browser coverage.
  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots show the actual Control UI disclosure’s fade and toggle placement in Chromium with synthetic Gateway messages, including clear expanded text; the full body adds geometry measurements and broader browser coverage.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (screenshot): Inspected before/after screenshots show the actual Control UI disclosure’s fade and toggle placement in Chromium with synthetic Gateway messages, including clear expanded text; the full body adds geometry measurements and broader browser coverage.

Label justifications:

  • P3: This is bounded chat presentation polish; reading and expanding messages already work.
  • 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 screenshots show the actual Control UI disclosure’s fade and toggle placement in Chromium with synthetic Gateway messages, including clear expanded text; the full body adds geometry measurements and broader browser coverage.
  • proof: sufficient: Contributor real behavior proof is sufficient. Inspected before/after screenshots show the actual Control UI disclosure’s fade and toggle placement in Chromium with synthetic Gateway messages, including clear expanded text; the full body adds geometry measurements and broader browser coverage.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Inspected before/after screenshots show the actual Control UI disclosure’s fade and toggle placement in Chromium with synthetic Gateway messages, including clear expanded text; the full body adds geometry measurements and broader browser coverage.

Evidence

What I checked:

  • Introduced production change: The pinned merge-base-to-head patch adds only a content mask and relative toggle offsets to production CSS. Existing clipping, visibility measurement, event handlers, and persisted state remain unchanged. (ui/src/styles/chat/text.css:31, f30b156112c3)
  • Existing presentation owner: The renderer admits only eligible user messages with an expansion callback; its overflow observer hides the toggle when collapsed content fits. The new selector consumes that existing visibility decision instead of introducing competing overflow logic. (ui/src/pages/chat/components/chat-message-text.ts:88, f30b156112c3)
  • Current main still needs the improvement: Fetched main retains the five-line hard clip and an inline toggle with an 8px top margin, without the new fade or positioning offsets. (ui/src/styles/chat/text.css:24, ce1eb0fb3e2e)
  • Latest release comparison: The v2026.9.4 stylesheet also lacks the fade and still uses the older corner-positioned toggle; it does not supply this improvement. (ui/src/styles/chat/text.css:42, 3a9d69db306c)
  • Inspected visual proof and complete body: Inspected all four prepared images: before/after light-desktop collapsed and expanded bubbles. They show the softer clipped edge and lowered toggle, while expanded text remains clear. The complete REST body matches captured SHA-256 008445e562d45424f7264de6e6ce7ca7f50bb0b71b50f9a8733d0945d3ae784c and describes Chromium/Linux captures using the real Control UI with a synthetic Gateway. Remaining theme/width pairs are documented but were not independently viewed. (f30b156112c3)
  • Browser regression coverage: The expanded existing suite checks actual toggle geometry, collapsed and expanded masks, preserved full text, and a long Markdown source whose rendered link fits. It covers eight theme/width/image combinations and retains short-message and descendant-reveal cases. The body reports 11 passing disclosure tests and pre-fix geometry failures; tests were inspected, not executed during this read-only review. (ui/src/e2e/chat-user-bubble-disclosure.e2e.test.ts:71, f30b156112c3)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • 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.

@vyctorbrzezowski
vyctorbrzezowski merged commit 32433e1 into openclaw:main Sep 16, 2026
145 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

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 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: S 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.

Collapsed user prompt: soften the clipped edge and center the Show more toggle

1 participant