Skip to content

Studio: keep rounded boxes rounded when they scroll - #12431

Merged
shimmyshimmer merged 4 commits into
mainfrom
studio-dialog-scroll-rounded-corners
Oct 1, 2026
Merged

shimmyshimmer merged 4 commits into
mainfrom
studio-dialog-scroll-rounded-corners

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Once a rounded box was tall or wide enough to scroll, the corners on its scrollbar side stopped looking rounded. This showed up in Edit project, New project, the other project dialogs and MCP Servers, and in a number of other places. The corners now stay rounded in Chromium, WebKit and Firefox.

Cause

These boxes scroll their own rounded element (overflow-y-auto rounded-*), so the scrollbar runs the box's full length:

  • Chromium and WebKit draw the scrollbar over the corners.
  • Firefox drops the radius on the scrollbar side altogether, background and ring included, whether the scrollbar is native or styled.

Changes

  • New .scroll-rounded utility in index.css. --scroll-radius is the box's own radius, set from its rounded-* class.
    • Chromium and WebKit: the track starts and ends where the corners do. Chromium's thin standard scrollbar has no track to inset, so these boxes use the styled ::-webkit-scrollbar, the same reset the Images prompt box uses.
    • Firefox has no track to inset, so the box is clipped back to its radius. The clip sits 1px out so ring-1 survives.
    • The clip would also cut an outer shadow. Dialogs and alert dialogs carry one in light mode, so in Firefox lib/scroll-overflow.ts flags them data-overflowing, and they are clipped only while they have something to scroll.
  • .scroll-rounded is used on:
    • DialogContent and AlertDialogContent, so every dialog.
    • Inline boxes that scroll themselves: the debugging log, API monitor and export logs, research activity, provider model lists, the knowledge base lists, the stop-running-chats list, the dataset and seed previews, the raw execution tab, markdown previews, desktop log details and the fenced-code fallback.
    • Hub README code blocks, through .hub-readme-prose pre.
  • Surfaces with an outer shadow, which a clip would cut, scroll an inner viewport instead, as DropdownMenuContent and SelectContent already do:
    • ContextMenuContent and ContextMenuSubContent.
    • The message actions ("more") menu.
    • The generation presets popover, whose preset list now gives way on a short window instead of the whole popover scrolling.
    • The recipe preview's error panel, which keeps its shadow-border.

Not changed

PopoverContent still scrolls its own surface when a popover outgrows the window. Many call sites style that surface directly and several add shadows, so it needs its own change.

Testing

  • npm run typecheck is clean and npm test passes.
  • tests/dialog-scrollbar-corners.test.ts covers the utility, where it is used, and the inner viewports. Two tests that pinned the old menu classes are updated.
  • In a local build with always-visible scrollbars, in headed Firefox, Chromium and WebKit:
    • Edit project at the top and scrolled to the bottom, New project and MCP Servers keep all four corners.
    • A scrolling sidebar context menu keeps its corners.
    • A Hub README code block with a horizontal scrollbar keeps its bottom corners.

Follow-ups

They are alternatives: merge one or the other.

Dialogs scroll their own rounded box, and once a scrollbar showed it ran the
box's full height and covered both right-hand corners. Inset the track by
the dialog radius, and switch dialogs to the styled scrollbar in Chromium,
whose thin standard one has no track to inset.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 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-10-01T12:53:09.802865Z 54eefe3 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.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

The track inset did nothing in Firefox, which has no ::-webkit-scrollbar and
drops the radius on the scrollbar side of a rounded scroller altogether,
background and ring included. Generalize the dialog rule into .scroll-rounded:
Chromium and WebKit inset the track by the box's radius, and Firefox clips the
box back to it. Use it on dialogs, alert dialogs, the inline logs and lists
that scroll their own rounded box, and Hub README code blocks.

Surfaces with an outer shadow, which a clip would cut, scroll an inner
viewport instead, as DropdownMenuContent already does: the context menu and
its submenu, the message actions menu, and the generation presets popover.
@shimmyshimmer shimmyshimmer changed the title Studio: keep dialog corners rounded when the dialog scrolls Studio: keep rounded boxes rounded when they scroll Oct 1, 2026
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

The Firefox clip on .scroll-rounded also cut outer shadows, even on boxes
with nothing to scroll. Dialogs and alert dialogs, which carry one in light
mode, now flag data-overflowing while they have something to scroll
(lib/scroll-overflow.ts) and take the clip only then, since without a
scrollbar Firefox keeps their radius. The recipe preview's error panel,
which keeps a shadow-border, scrolls an inner viewport instead.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

overflow:auto draws a scrollbar for a single pixel over, but the 1px tolerance
in observeScrollOverflow left a dialog that overflowed by exactly that much
unflagged, so Firefox skipped the clip and squared its corners.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

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

Reviewed commit: 54eefe337f

ℹ️ 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 9cf98aa into main Oct 1, 2026
2 of 47 checks passed
@shimmyshimmer
shimmyshimmer deleted the studio-dialog-scroll-rounded-corners branch October 1, 2026 12:58
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