Skip to content

Studio: clip every rounded scroller in Firefox, dropping the overflow watcher - #12438

Merged
shimmyshimmer merged 3 commits into
mainfrom
studio-firefox-scroll-clip-always
Oct 2, 2026
Merged

shimmyshimmer merged 3 commits into
mainfrom
studio-firefox-scroll-clip-always

Conversation

@shimmyshimmer

@shimmyshimmer shimmyshimmer commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #12431, now on main. This drops the Firefox overflow watcher (lib/scroll-overflow.ts) and clips every .scroll-rounded box in Firefox, dialogs included, as the utility first did.

Why

The watcher clips a dialog only while it scrolls, to spare its light-mode shadow the rest of the time. That costs two observers on every open dialog and ref plumbing through DialogContent and AlertDialogContent, all for a faint 0 2px 8px shadow on a dimmed backdrop.

Changes

  • Removes lib/scroll-overflow.ts and its use in DialogContent and AlertDialogContent.
  • The Firefox rule is back to clipping every .scroll-rounded box, except those with overflow-hidden: they have no scrollbar to clip. That keeps CommandDialog, which scrolls its list inside, out of the clip, so chat search keeps the shadow that is its only edge (it is borderless, ring-0, over a clear overlay).
  • The recipe preview's error panel keeps its inner viewport, so its shadow-border survives.
  • The Recipe Studio processors, import, config and run dialogs float over the canvas on a clear overlay, with shadow-border as their edge. They now share RecipeDialogContent: the shadowed box hides its overflow and stays out of the clip, and an inner scroll-rounded viewport scrolls. Their layout is unchanged; the close button now stays put while the content scrolls.
  • Tests go back to asserting the unconditional clip.

Trade-offs

  • In Firefox light mode, plain dialogs over the dimmed backdrop lose their faint drop shadow even when they don't scroll. Dialogs whose shadow is their only edge (chat search, the Recipe Studio dialogs) keep it.
  • The clip takes its radius from the class map. A scrolling dialog whose drawn radius differs from its base rounded-4xl, such as a phone-width max-sm:rounded-none! dialog, is clipped a little rounder than it draws in Firefox. Studio: clip a scrolling dialog to the radius it draws, in Firefox only #12437 fixes that by reading the computed radius.

#12437, which tightened the watcher instead, was merged into #12431's branch after #12431 had already landed, so its changes never reached main. This PR removes the watcher it changed.

Testing

  • Rebased onto main, which resolves the conflict with Studio: keep rounded boxes rounded when they scroll #12431's branch. npm run typecheck is clean, npm test passes (9726 tests), and the build succeeds.
  • In this build in headed Firefox, Edit project is clipped at 34.6px whether or not it scrolls. The corners match what Studio: keep rounded boxes rounded when they scroll #12431 showed before the watcher was added.
  • In headless Firefox, light mode: chat search had clip-path: inset(-1px round 34.6px) and lost its shadow. It now has no clip and keeps it, and a scrolling .scroll-rounded rounded-4xl box is still clipped at 34.6px.
  • In headless Firefox, light mode: the recipe Import dialog had clip-path: inset(-1px round 34.6px) without overflowing and lost its shadow-border. It now has no clip and keeps it, at the same size. With 2000px of extra content it caps at 650px and the inner viewport scrolls.

@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-02T17:40:14.220584Z e956930 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

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 563db37438

ℹ️ 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".

… watcher

Dialogs took the Firefox clip only while lib/scroll-overflow.ts flagged them
as overflowing, to spare their light-mode shadow when nothing scrolls. That is
two observers on every open dialog, plus ref plumbing through DialogContent and
AlertDialogContent, for a faint shadow on a dimmed backdrop. Drop the watcher
and clip every .scroll-rounded box in Firefox, dialogs included, as the
utility first did. The recipe preview's error panel keeps its inner viewport.
@shimmyshimmer
shimmyshimmer force-pushed the studio-firefox-scroll-clip-always branch from 563db37 to 346a082 Compare October 1, 2026 15:04
@shimmyshimmer
shimmyshimmer changed the base branch from studio-dialog-scroll-rounded-corners to main October 1, 2026 15:04
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

DialogContent carries .scroll-rounded, so every CommandDialog took the
Firefox clip-path too, and it cut chat search's outer shadow. Chat search
is borderless, ring-0 and over a clear overlay, so that shadow is its only
edge against the page.

CommandDialog hides its overflow and scrolls the list inside, so it has
no scrollbar to clip. Skip .overflow-hidden boxes in the Firefox rule.
Boxes that scroll themselves are clipped as before.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

chatgpt-codex-connector[bot]

This comment was marked as resolved.

The processors, import, config and run dialogs float over the recipe
canvas on a clear overlay, with shadow-border as their edge. They scrolled
their own DialogContent, so Firefox's .scroll-rounded clip cut that shadow
even when nothing overflowed.

Move their shared setup into RecipeDialogContent: the shadowed box hides
its overflow and stays out of the clip, and an inner scroll-rounded
viewport carries the padding and the scrolling. Layout is unchanged; the
close button now stays put while the content scrolls.
@shimmyshimmer

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: e956930703

ℹ️ 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 2c72350 into main Oct 2, 2026
@shimmyshimmer
shimmyshimmer deleted the studio-firefox-scroll-clip-always branch October 2, 2026 18:03
JoshuaL3000 pushed a commit to JoshuaL3000/unsloth that referenced this pull request Oct 4, 2026
… watcher (unslothai#12438)

* Studio: clip every rounded scroller in Firefox, dropping the overflow watcher

Dialogs took the Firefox clip only while lib/scroll-overflow.ts flagged them
as overflowing, to spare their light-mode shadow when nothing scrolls. That is
two observers on every open dialog, plus ref plumbing through DialogContent and
AlertDialogContent, for a faint shadow on a dimmed backdrop. Drop the watcher
and clip every .scroll-rounded box in Firefox, dialogs included, as the
utility first did. The recipe preview's error panel keeps its inner viewport.

* Studio: keep chat search's shadow out of the Firefox scroller clip

DialogContent carries .scroll-rounded, so every CommandDialog took the
Firefox clip-path too, and it cut chat search's outer shadow. Chat search
is borderless, ring-0 and over a clear overlay, so that shadow is its only
edge against the page.

CommandDialog hides its overflow and scrolls the list inside, so it has
no scrollbar to clip. Skip .overflow-hidden boxes in the Firefox rule.
Boxes that scroll themselves are clipped as before.

* Studio: scroll the recipe dialogs in an inner viewport

The processors, import, config and run dialogs float over the recipe
canvas on a clear overlay, with shadow-border as their edge. They scrolled
their own DialogContent, so Firefox's .scroll-rounded clip cut that shadow
even when nothing overflowed.

Move their shared setup into RecipeDialogContent: the shadowed box hides
its overflow and stays out of the clip, and an inner scroll-rounded
viewport carries the padding and the scrolling. Layout is unchanged; the
close button now stays put while the content scrolls.

---------

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants