Repository navigation
fix(ui): keep the last collapsed prompt line readable - #150478
vyctorbrzezowski merged 4 commits into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 17, 2026, 10:01 AM ET / 14:01 UTC (Revision 7). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherThe 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]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +143, Tests +338. Total +481 across 5 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest 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. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
Merged via squash.
|
* 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
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
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Last-line close-ups
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Open before
Open after
Authored disclosure with hidden content
Open before
Open after