Skip to content

Studio: round the right corners of scrollable tool result and thinking panes - #11409

Merged
shimmyshimmer merged 1 commit into
mainfrom
studio/rounded-scroll-panes
Sep 21, 2026
Merged

shimmyshimmer merged 1 commit into
mainfrom
studio/rounded-scroll-panes

Conversation

@shimmyshimmer

Copy link
Copy Markdown
Member

Capped scrollable panes rendered square on the scrollbar's side: right corners for a vertical scrollbar, bottom corners for a horizontal one. The other two corners rounded normally, so tool results and thinking traces looked lopsided.

Cause

The scrollbar. We set scrollbar-width: thin globally, so about 11px is reserved inside the border box (width 724 against clientWidth 713), and Chromium paints that gutter outside the element's border-radius clip.

What does not fix it

All four of these were tried against a real thread and all four left the corners square:

Approach Result
clip-path: inset(0 round r) square
contain: paint square
opaque mask-image square
wrapper with overflow: hidden square
scrollbar removed entirely rounded

The last row is the one that isolates it. A composited scroller's scrollbar escapes an ancestor's rounded clip as well as its own, so nothing that merely clips it works.

Fix

Keep the scrollbar away from the corners instead of trying to clip it. The new ScrollPane puts the background, radius and padding on a wrapper, and the scroller sits inside that padding, transparent:

wrapper   min-w-0 mt-1 rounded bg-muted/50 p-2    radius 17.6px, gutter 0, 160 to 884
scroller  max-h-64 overflow-auto ...              transparent, radius 0, 168 to 876, gutter 11

The scrollbar ends up 8px clear of the rounded edge, so it cannot square anything off, and it stays visible. Text padding is unchanged, it just comes from the wrapper now.

Applied to the web search, code execution, knowledge base and read-skill result panes, thinking traces, the pasted-text dialog body and the composer draft preview. The four dead ends are written into the component so nobody re-tries them.

Testing

Verified in the real thread, which is the context where the clipping approaches failed, with the scrollbar still visible and the corners rounded. Typecheck clean, full suite passes (8154 tests).

Trade-off

max-height now caps the scroller rather than the whole box, so a saturated pane is its padding taller than before (16px for the p-2 panes). Easy to subtract back off the cap if we would rather hold the old outer height.

…g panes

A capped pane with a scrollbar rendered square on the scrollbar's side: right
corners for a vertical bar, bottom corners for a horizontal one.

The scrollbar is the cause. The app sets scrollbar-width: thin, so ~11px is
reserved inside the border box, and Chromium paints that gutter outside the
element's border-radius clip. Clipping it does not help: clip-path,
contain: paint, an opaque mask-image and an overflow: hidden parent were all
tried against a real thread and all left the corners square, since a composited
scroller's scrollbar escapes an ancestor's rounded clip too. Suppressing the
scrollbar was the only thing that restored the corners.

So the new ScrollPane keeps the scrollbar away from the corners instead. The
wrapper paints the background, radius and padding; the scroller sits inside it,
transparent, with its gutter 8px clear of the rounded edge. Text padding is
unchanged, and the scrollbar stays visible.

Applied to the web search, code execution, knowledge base and read-skill result
panes, thinking traces, the pasted-text dialog and the composer draft preview.

One behaviour change worth noting: max-height now caps the scroller rather than
the whole box, so a saturated pane is its padding taller than before.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-21T05:04:13.999313Z 876cc4b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: 876cc4bbc0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@shimmyshimmer
shimmyshimmer merged commit 175c070 into main Sep 21, 2026
47 of 51 checks passed
@shimmyshimmer
shimmyshimmer deleted the studio/rounded-scroll-panes branch September 21, 2026 05:15
shaojun pushed a commit to shaojun/unsloth that referenced this pull request Sep 29, 2026
…g panes (unslothai#11409)

A capped pane with a scrollbar rendered square on the scrollbar's side: right
corners for a vertical bar, bottom corners for a horizontal one.

The scrollbar is the cause. The app sets scrollbar-width: thin, so ~11px is
reserved inside the border box, and Chromium paints that gutter outside the
element's border-radius clip. Clipping it does not help: clip-path,
contain: paint, an opaque mask-image and an overflow: hidden parent were all
tried against a real thread and all left the corners square, since a composited
scroller's scrollbar escapes an ancestor's rounded clip too. Suppressing the
scrollbar was the only thing that restored the corners.

So the new ScrollPane keeps the scrollbar away from the corners instead. The
wrapper paints the background, radius and padding; the scroller sits inside it,
transparent, with its gutter 8px clear of the rounded edge. Text padding is
unchanged, and the scrollbar stays visible.

Applied to the web search, code execution, knowledge base and read-skill result
panes, thinking traces, the pasted-text dialog and the composer draft preview.

One behaviour change worth noting: max-height now caps the scroller rather than
the whole box, so a saturated pane is its padding taller than before.

Co-authored-by: Unsloth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant