Skip to content

fix(ui): keep the last collapsed prompt line readable - #150478

Merged
vyctorbrzezowski merged 4 commits into
openclaw:mainfrom
vyctorbrzezowski:fix/chat-collapse-last-line
Sep 17, 2026
Merged

vyctorbrzezowski merged 4 commits into
openclaw:mainfrom
vyctorbrzezowski:fix/chat-collapse-last-line

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Closes #150403

What Problem This Solves

Collapsed user prompts can cut through the top of their last visible line when paragraph or list spacing shifts the text below a fixed-height preview.

User Impact

Long prompts keep up to five readable preview lines, with a half-line fade ending near 74% of the final line. Prompts that fit the full preview remain fully visible without a fade or expansion button.

Why This Change Was Made

The existing disclosure controller measures the rendered line boxes and updates its cutoff when the viewport or font changes. It checks overflow against the full preview before shortening the last line, so the cut cannot manufacture overflow in a fitting five-line message. Hidden content inside a closed disclosure is excluded from line selection, and browser-generated disclosure titles count toward the five-line preview. Opening and closing the disclosure triggers measurement of the visible content. Paragraph spacing, typography, and expansion controls retain their existing owners.

Evidence

Before is a production build of the original merge-base, 4e44dbfb428ad11cb20dbaf9ba82b87be7853651. After is the reviewed landing head, db15e8421a2747aeab7e7cd22352e1df34613cc4, including the fitting-preview and visible-disclosure-line repairs. Each pair uses the same synthetic fixture, Chromium, fonts, English locale, 2x DPR, sRGB profile, disabled font hinting, 844 px viewport height, and light/dark themes at 1440/390 px widths. These screenshots compare the complete PR with its original base.

All 50 captures were inspected. In every After case of the 48-image text-layout matrix the last visible line is 73.96% tall, the baseline remains visible, and the fade spans 10.5 px of a 21 px line. The Before fixed cutoff is 105 px; paragraph spacing leaves only 33.33% of the fifth line visible. Font, padding, radius, toggle gaps, and expanded geometry match across each text-layout pair. Recaptures after the hidden-content repair preserve the application pixels and measured geometry. The additional pair covers an authored disclosure whose closed content must not contribute visible line boxes.

The fitting-five-line reproduction changes from 100 px clipped / 105 px natural height to 105 / 105 px, with no fade or toggle. Formatting and stylesheet lint pass. The final-head remote regression run verified the committed source hashes and passed 32 browser cases plus 8 line-selection tests. All four selected regression cases fail on the original production code: fitting five-line links, closed paragraph content, escaped HTML inside a disclosure, and browser-generated disclosure titles. The complete changed-file gate also passed, including core and UI type checks, unused-export scans, formatting, and lint. The exact-head hosted CI is green. One unrelated native-Bash fixture exceeded its deadline on the first attempt; the single failed-job rerun passed without code or test changes.

Risk and coverage

Checked visual consumers: active-user and peer multiplayer prompts; continuous text, paragraphs, lists, short neighboring messages, and expanded content. Browser regression coverage also exercises image-containing bubbles, history reload, descendant reveal, viewport/font reflow, dense block art, and fully fitting source-heavy links. Disclosure coverage exercises closing, opening, and closing again with paragraphs, escaped HTML, and browser-generated titles.

The measurement visits the complete rendered text. Firefox/Safari, arbitrary custom fonts, and very large rich-text messages are outside this visual matrix. Forwarded-message disclosure remains separate work in #150440 by @vyctorbrzezowski. No dependency or data-format changes are included.

The exact-head hosted performance check passed: startup JavaScript is 359,437 B, below the 363,282 B limit; startup CSS is 48,355 B, below its 51,200 B ceiling. No performance baseline was changed.

Collapsed messages

StateBeforeAfter
Light, 1440px, continuousBefore: Light, 1440px, continuous, collapsed messages
Open before
After: Light, 1440px, continuous, collapsed messages
Open after
Light, 1440px, paragraphsBefore: Light, 1440px, paragraphs, collapsed messages
Open before
After: Light, 1440px, paragraphs, collapsed messages
Open after
Light, 1440px, listBefore: Light, 1440px, list, collapsed messages
Open before
After: Light, 1440px, list, collapsed messages
Open after
Light, 390px, continuousBefore: Light, 390px, continuous, collapsed messages
Open before
After: Light, 390px, continuous, collapsed messages
Open after
Light, 390px, paragraphsBefore: Light, 390px, paragraphs, collapsed messages
Open before
After: Light, 390px, paragraphs, collapsed messages
Open after
Light, 390px, listBefore: Light, 390px, list, collapsed messages
Open before
After: Light, 390px, list, collapsed messages
Open after
Dark, 1440px, continuousBefore: Dark, 1440px, continuous, collapsed messages
Open before
After: Dark, 1440px, continuous, collapsed messages
Open after
Dark, 1440px, paragraphsBefore: Dark, 1440px, paragraphs, collapsed messages
Open before
After: Dark, 1440px, paragraphs, collapsed messages
Open after
Dark, 1440px, listBefore: Dark, 1440px, list, collapsed messages
Open before
After: Dark, 1440px, list, collapsed messages
Open after
Dark, 390px, continuousBefore: Dark, 390px, continuous, collapsed messages
Open before
After: Dark, 390px, continuous, collapsed messages
Open after
Dark, 390px, paragraphsBefore: Dark, 390px, paragraphs, collapsed messages
Open before
After: Dark, 390px, paragraphs, collapsed messages
Open after
Dark, 390px, listBefore: Dark, 390px, list, collapsed messages
Open before
After: Dark, 390px, list, collapsed messages
Open after

Last-line close-ups

StateBeforeAfter
Light, 1440px, continuousBefore: Light, 1440px, continuous, last-line close-ups
Open before
After: Light, 1440px, continuous, last-line close-ups
Open after
Light, 1440px, paragraphsBefore: Light, 1440px, paragraphs, last-line close-ups
Open before
After: Light, 1440px, paragraphs, last-line close-ups
Open after
Light, 1440px, listBefore: Light, 1440px, list, last-line close-ups
Open before
After: Light, 1440px, list, last-line close-ups
Open after
Light, 390px, continuousBefore: Light, 390px, continuous, last-line close-ups
Open before
After: Light, 390px, continuous, last-line close-ups
Open after
Light, 390px, paragraphsBefore: Light, 390px, paragraphs, last-line close-ups
Open before
After: Light, 390px, paragraphs, last-line close-ups
Open after
Light, 390px, listBefore: Light, 390px, list, last-line close-ups
Open before
After: Light, 390px, list, last-line close-ups
Open after
Dark, 1440px, continuousBefore: Dark, 1440px, continuous, last-line close-ups
Open before
After: Dark, 1440px, continuous, last-line close-ups
Open after
Dark, 1440px, paragraphsBefore: Dark, 1440px, paragraphs, last-line close-ups
Open before
After: Dark, 1440px, paragraphs, last-line close-ups
Open after
Dark, 1440px, listBefore: Dark, 1440px, list, last-line close-ups
Open before
After: Dark, 1440px, list, last-line close-ups
Open after
Dark, 390px, continuousBefore: Dark, 390px, continuous, last-line close-ups
Open before
After: Dark, 390px, continuous, last-line close-ups
Open after
Dark, 390px, paragraphsBefore: Dark, 390px, paragraphs, last-line close-ups
Open before
After: Dark, 390px, paragraphs, last-line close-ups
Open after
Dark, 390px, listBefore: Dark, 390px, list, last-line close-ups
Open before
After: Dark, 390px, list, last-line close-ups
Open after

Authored disclosure with hidden content

StateBeforeAfter
Light, 1440px, closed authored disclosureBefore: Light, 1440px, details, collapsed messages
Open before
After: Light, 1440px, details, collapsed messages
Open after

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

clawsweeper Bot commented Sep 17, 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: M maintainer Maintainer-authored PR labels Sep 17, 2026
@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: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 17, 2026
@clawsweeper

clawsweeper Bot commented Sep 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 10:01 AM ET / 14:01 UTC (Revision 7).

ClawSweeper review

What this changes

The PR measures rendered user-prompt lines to keep the last collapsed line readable, preserves fully fitting messages, and adds browser regression coverage.

Merge readiness

✅ Ready for maintainer review

This remains a useful fix absent from current main. The earlier fitting-preview finding is resolved, inspected screenshots demonstrate the improvement, and no new blocking defect was found.

Priority: P3
Reviewed head: db15e8421a2747aeab7e7cd22352e1df34613cc4

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, well-demonstrated repair with meaningful regression coverage and no supported blocking finding.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): The inspected Chromium before/after screenshots exercise the production Markdown bubble and disclosure presentation with synthetic conversation data and visibly demonstrate improved final-line readability. The body ties the captures to the original merge-base and reviewed head; broader browser and regression results remain contributor-reported.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): The inspected Chromium before/after screenshots exercise the production Markdown bubble and disclosure presentation with synthetic conversation data and visibly demonstrate improved final-line readability. The body ties the captures to the original merge-base and reviewed head; broader browser and regression results remain contributor-reported.
Evidence reviewed 9 items Verified introduced changes: The merge-base-to-head comparison confines production changes to line measurement and the existing disclosure stylesheet; unrelated endpoint drift was excluded.
Prior finding resolved: The controller removes the measured cutoff before checking overflow against the full preview. Fully fitting five-line messages therefore avoid manufacturing their own overflow; the browser matrix explicitly checks that their toggle and mask remain absent.
Current main still needs the fix: Fetched main retains the fixed five-line height and nominal-line fade. Its intervening stylesheet changes concern headings and attribution, and its disclosure controller has not acquired this branch's measurement.
Findings None None.
Security None None.

How this fits together

The Control UI renders conversation messages as Markdown bubbles. Its disclosure controller decides whether long user prompts need an expandable preview and supplies the clipping geometry to the stylesheet.

flowchart TD
  A[Conversation messages] --> B[Markdown rendering]
  B --> C[User prompt disclosure]
  C --> D{Full preview overflows?}
  D -->|No| E[Fully visible text]
  D -->|Yes| F[Measure visible lines]
  F --> G[Readable clipped preview]
  G --> H[Show more control]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +143, Tests +338. Total +481 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 146 3 +143
Tests 2 356 18 +338
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 502 21 +481

Review metrics

Metric Value Why it matters
Production versus test growth production +143 net lines; tests +338 net lines Production growth supports rendered-line measurement and reflow handling; tests exercise the resulting browser geometry and regression cases.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #150403
Summary: This PR addresses the linked issue's user-prompt clipping; forwarded-message disclosure remains a separate related surface.

Members:

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

Technical review

Best possible solution:

Keep clipping geometry in the existing disclosure controller while preserving Markdown layout, fitting-message visibility, and expansion state.

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

Yes: long user prompts with paragraph spacing expose the fixed-height clipping problem in current source and the supplied baseline screenshots; no new current-main browser run was performed.

Is this the best way to solve the issue?

Yes: measuring actual line positions addresses paragraph and list spacing without changing typography or introducing a competing disclosure controller.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P3: This improves collapsed-preview readability while full message content remains available through expansion.
  • 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 inspected Chromium before/after screenshots exercise the production Markdown bubble and disclosure presentation with synthetic conversation data and visibly demonstrate improved final-line readability. The body ties the captures to the original merge-base and reviewed head; broader browser and regression results remain contributor-reported.
  • proof: sufficient: Contributor real behavior proof is sufficient. The inspected Chromium before/after screenshots exercise the production Markdown bubble and disclosure presentation with synthetic conversation data and visibly demonstrate improved final-line readability. The body ties the captures to the original merge-base and reviewed head; broader browser and regression results remain contributor-reported.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. The inspected Chromium before/after screenshots exercise the production Markdown bubble and disclosure presentation with synthetic conversation data and visibly demonstrate improved final-line readability. The body ties the captures to the original merge-base and reviewed head; broader browser and regression results remain contributor-reported.

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)
  • steipete: 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-17T01:49:42.059Z sha 5ffbbab :: needs changes before merge. :: [P2] Preserve fully fitting five-line prompts before applying the cut
  • reviewed 2026-09-17T02:18:40.035Z sha 29f9c9a :: needs changes before merge. :: [P2] Preserve fully fitting five-line prompts before applying the cut
  • reviewed 2026-09-17T03:05:08.553Z sha e5eae97 :: needs changes before merge. :: [P2] Preserve fully fitting five-line prompts before applying the cut
  • reviewed 2026-09-17T03:21:50.163Z sha e5eae97 :: needs changes before merge. :: [P2] Preserve fully fitting five-line prompts before applying the cut
  • reviewed 2026-09-17T13:04:04.540Z sha e5eae97 :: blocked before merge. :: [P2] Preserve fully fitting five-line prompts before applying the cut
  • reviewed 2026-09-17T13:32:52.512Z sha db15e84 :: needs maintainer review before merge. :: none

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review September 17, 2026 13:18
@clawsweeper clawsweeper Bot added 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Sep 17, 2026
@vyctorbrzezowski
vyctorbrzezowski merged commit 32c91f3 into openclaw:main Sep 17, 2026
386 of 389 checks passed
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

@vyctorbrzezowski
vyctorbrzezowski deleted the fix/chat-collapse-last-line branch September 17, 2026 14:16
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
* fix(ui): keep the last collapsed prompt line readable

* fix(ui): keep the final collapsed line readable

* fix(ui): extend the final collapsed line fade

* fix(ui): preserve fitting previews and visible disclosure lines
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: L 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.

Chat: collapsed messages should keep more of their last visible line

1 participant