Skip to content

fix(ui): keep Review file previews within panel - #132800

Merged
vyctorbrzezowski merged 2 commits into
mainfrom
fix/file-open-panel-overflow
Aug 29, 2026
Merged

vyctorbrzezowski merged 2 commits into
mainfrom
fix/file-open-panel-overflow

Conversation

@vyctorbrzezowski

@vyctorbrzezowski vyctorbrzezowski commented Aug 29, 2026 •

Copy link
Copy Markdown
Member

Closes #132797

What Problem This Solves

Fixes an issue where users opening a file with a long unwrapped line in the Control UI Review panel would see the file preview expand beyond the panel width on narrow screens. The outer panel clipped the excess, hiding path-bar actions and preventing the editor from owning horizontal navigation.

Why This Change Was Made

The shared full-height panel wrapper already owns the shrink-and-scroll boundary for Review content, but only released its vertical minimum size. Releasing its horizontal minimum size as well keeps the wrapper within the Review slot and lets the existing CodeMirror scroller handle long lines. Animation, focus, tab labels, panel geometry, and wrapping behavior are unchanged.

User Impact

Review file previews now stay within the available panel width. On narrow screens, the file path truncates as designed, all toolbar actions remain reachable, and long lines scroll horizontally inside the editor.

Shared wrapper consumers checked:

  • File editor: constrained; CodeMirror owns horizontal overflow.
  • Markdown preview: remains bounded by the same wrapper and its existing reader scroll behavior.
  • Files attachment preview: remains bounded across audio (audio player), video (video player), image (scaled image), document (compact download card), and unavailable-source (visible unavailable state) variants; their existing presentation behavior is unchanged.
  • Session diff: remains bounded; its own wrapping and diff scrolling controls are unchanged.

Scope gate:

  • ui/src/styles/chat/sidebar.css: fixes the shared fill-wrapper invariant with one production line.
  • ui/src/pages/chat/components/chat-sidebar-file-view.browser.test.ts: protects the visible narrow-panel behavior and scroll ownership with a long-line browser regression.

Production LOC: +1. Test LOC: +35/-4. No generated, dependency, config, protocol, or persistent-state changes.

Evidence

Deterministic mocked Control UI reproduction at 390×844 and 1440×900:

  • Before: Review was 381 px wide, while its fill wrapper grew to 576 px and the file view to 542 px. Toolbar actions were clipped.
  • After: the fill wrapper remains 381 px, the file view is 347 px, and CodeMirror owns the overflow (clientWidth=347, scrollWidth=542, overflow-x=auto).

Mobile (390×844)

Theme Before After
Light Light theme before: Review toolbar actions clipped by wide file content Light theme after: Review path truncates and all toolbar actions remain visible
Dark Dark theme before: Review toolbar actions clipped by wide file content Dark theme after: Review path truncates and all toolbar actions remain visible

Desktop (1440×900)

Theme Before After
Light Desktop light theme before: Review toolbar actions clipped by wide file content Desktop light theme after: Review content and toolbar actions remain within the panel
Dark Desktop dark theme before: Review toolbar actions clipped by wide file content Desktop dark theme after: Review content and toolbar actions remain within the panel

The captures use the same harness data, selected file, and editor state within each viewport. The before condition applies the exact pre-fix min-width: auto; the after condition uses the committed CSS. Each image was inspected before upload. This fix does not change motion, so video evidence is not applicable.

The focused Chromium regression loads the production chat stylesheet and mounts the file panel under the real .side-panel__panel flex boundary at 320 px. It fails without the production rule (fileView.clientWidth=7905, container width 320) and passes with min-width: 0; the complete file passes all 10 browser tests with the fix. No broader local suite was run.

ClawSweeper Rank-up Moves

  • Applied: marked the PR ready for review and obtained green required CI, including the focused Chromium coverage, on exact head 77a481303dbf427e35b16d559861da14259d56b8.

@vyctorbrzezowski vyctorbrzezowski self-assigned this Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Aug 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. 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 Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 5:20 PM ET / 21:20 UTC.

ClawSweeper review

What this changes

The PR lets the shared Control UI Review-panel wrapper shrink horizontally and adds a browser regression test so long file lines scroll within CodeMirror.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for normal maintainer review: current main still lacks this fix, and the small shared-wrapper repair has no concrete introduced defect in the reviewed diff.

Priority: P2
Reviewed head: 77a481303dbf427e35b16d559861da14259d56b8
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A narrow owner-boundary repair has focused browser coverage and no identified correctness or security blocker.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless supplies paired layout captures and measured Chromium-harness output for the changed wrapper path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless supplies paired layout captures and measured Chromium-harness output for the changed wrapper path.
Evidence reviewed 7 items Current main still has the defect: Fetched main retains the shared fill wrapper without a horizontal minimum-size override.
Introduced owner-boundary repair: The production commit adds min-width: 0 to the shared fill wrapper, the intervening flex item between the bounded panel and file content.
Caller and sibling coverage: The common wrapper is selected for file, markdown, attachment, and session-diff content, so this is the shared layout owner rather than a CodeMirror-only workaround.
Findings None None.
Security None None.

How this fits together

The Control UI Review sidebar renders files, previews, and session diffs inside a flex panel. The shared wrapper must stay bounded so CodeMirror, rather than the outer panel, owns long-line overflow.

flowchart LR
  A[Workspace file] --> B[Review sidebar]
  B --> C[Shared panel wrapper]
  C --> D[File preview]
  D --> E[CodeMirror editor]
  E --> F[Horizontal scrolling]
Loading

Decision needed

Question Recommendation
Should this maintainer-owned Control UI fix be approved once exact-head required checks are green? Approve after checks: Merge the focused layout repair after exact-head required checks complete successfully.

Why: The PR is authored by a repository member and carries the protected maintainer label, so automated cleanup must leave the merge decision to maintainers.

Before merge

  • Resolve merge risk (P1) - The repair adds one production CSS declaration, but it is justified because the existing shared flex wrapper owns the missing horizontal shrink constraint and no existing declaration expresses both required minimum-size axes.
  • Resolve merge risk (P1) - GitHub DNS was unavailable while reviewing, so the linked image bytes could not be independently retrieved; this is a reviewer limitation, not missing contributor action.
Agent review details

Security

None.

PR surface

Source +1, Tests +31. Total +32 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 1 0 +1
Tests 1 35 4 +31
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 36 4 +32

Review metrics

Metric Value Why it matters
Production versus test delta production +1, tests +31 net The only production growth is the shared flex minimum-size invariant; the remaining change is focused browser regression coverage.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #132797
Summary: This PR explicitly supplies the candidate fix for the still-open narrow Review-panel overflow report.

Members:

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

Merge-risk options

Maintainer options:

  1. Decide the mitigation before merge
    Retain the shared-wrapper constraint and focused browser regression so bounded Review panels consistently delegate long-line overflow to CodeMirror.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Technical review

Best possible solution:

Retain the shared-wrapper constraint and focused browser regression so bounded Review panels consistently delegate long-line overflow to CodeMirror.

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

Yes. A constrained Review panel containing a file with a long unwrapped line exercises the source-proven flex path; the added browser test encodes that scenario, though this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. The missing horizontal shrink permission belongs on the common flex wrapper, while the existing CodeMirror scroller remains the established overflow owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d3c07b02e244.

Labels

Label justifications:

  • P2: This is a bounded Control UI layout defect that can hide Review toolbar actions on narrow screens.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply; the PR body nevertheless supplies paired layout captures and measured Chromium-harness output for the changed wrapper path.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: 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.

History

Review history (2 earlier review cycles)
  • reviewed 2026-08-29T19:23:17.203Z sha 5eb0bd8 :: needs maintainer review before merge. :: none
  • reviewed 2026-08-29T20:27:13.760Z sha 77a4813 :: needs maintainer review before merge. :: none

@vyctorbrzezowski
vyctorbrzezowski marked this pull request as ready for review August 29, 2026 21:14
@vyctorbrzezowski
vyctorbrzezowski merged commit 8ca8fe2 into main Aug 29, 2026
153 of 154 checks passed
@vyctorbrzezowski
vyctorbrzezowski deleted the fix/file-open-panel-overflow branch August 29, 2026 21:24
@vyctorbrzezowski

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 30, 2026
* fix(ui): keep Review file previews within panel

* test(ui): exercise Review panel flex boundary
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 P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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.

[Bug]: Review file previews overflow their panel on narrow screens

1 participant