Skip to content

fix studio responsiveness across desktop and mobile web - #8016

Merged
shimmyshimmer merged 9 commits into
unslothai:mainfrom
mahiatlinux:studio-responsiveness
Aug 6, 2026
Merged

shimmyshimmer merged 9 commits into
unslothai:mainfrom
mahiatlinux:studio-responsiveness

Conversation

@mahiatlinux

Copy link
Copy Markdown
Contributor

Studio had several layout failures where content became unreachable rather than just cramped. This fixes the blocking ones on both the desktop app and mobile web, and cleans up the obvious cosmetic cases alongside them.

Dialogs had no height limit

DialogContent and AlertDialogContent set no max-height and no scroll. 56 of 69 modal surfaces inherited that, so any dialog taller than the window clipped its actions off screen with no way to reach them. It hits the desktop app at its 900x600 minimum window as much as it hits phones.

Both primitives now cap at the viewport and scroll. Call sites that manage their own height still win: tailwind-merge treats a later overflow-* as conflicting with the base overflow-y-auto, and a later max-h-* replaces the base cap. The attachment lightbox opts out explicitly since it is deliberately full-bleed.

Desktop dialogs sat under the titlebar

The custom titlebar paints at z-70 over body-portaled dialogs. The chrome CSS variables in provider.tsx are inline on a wrapper div, which portaled content never inherits from, so no dialog could account for the 34px strip. At a 600px-tall window, Settings rendered 568px tall centred at y=16, putting its top 18px behind the titlebar.

WindowChromeTopInsetEffect publishes the titlebar height on <html> as --studio-window-chrome-top. Dialogs subtract it from their max height and centre at calc(50% + chrome/2). Web never sets the variable, so it falls back to 0px and nothing changes there. Container-portaled dialogs (position="absolute") keep their existing centring.

Fixed left columns wider than a phone

Images (408px), Video (400px) and the diffusion training panel (416px) each dock a fixed-width settings column inside an overflow-hidden parent. Below roughly 430px the canvas is off screen and unreachable. None of the three had a single breakpoint.

All three stack below 768px and keep their current classes from md: up, so desktop rendering is unchanged.

Onboarding clipped at the minimum window size

wizard-layout centres a min-h-[620px] card (lg:h-[660px]) inside an overflow-hidden container. At 900x600 the available height is 502px after the titlebar and padding, so the footer was cut off with no way to scroll to Continue. The container scrolls now and the card uses my-auto, which centres it when it fits and lets it scroll from the top when it does not.

Window resize died whenever a modal opened

Radix sets document.body.style.pointerEvents = "none" while a modal is open. The eight resize strips in window-titlebar.tsx inherit that, so every window edge went dead as soon as any dialog appeared. z-70 was never the problem. They now set pointer-events-auto.

Smaller fixes

  • 19 height rules move from vh to dvh, so panels stop sitting under mobile browser chrome
  • Dialogs go full screen below 640px rather than floating on a sliver of backdrop; the close button switches to fixed so it stays visible while the dialog scrolls
  • Confirms stay centred cards but take calc(100% - 2rem) on phones instead of a fixed 20rem
  • Seven two-column grids stack below 640px (sm:grid-cols-2)
  • Top and bottom sheets gain an 85dvh cap and scroll; nothing mounts those sides today

Manual testing

UI-only change, so this was verified by hand rather than with automated tests.

Desktop app:

  1. Resize to the 900x600 minimum. Open Settings and several other dialogs. Each stays fully on screen and scrolls internally; none clip their buttons.
  2. Confirm dialogs clear the titlebar rather than sliding underneath it.
  3. With a dialog open, drag a window edge. Resizing works.
  4. Start onboarding at the minimum window size. The card scrolls and Continue is reachable.
  5. On a tall display, Settings grows to 820px instead of stopping at 680px.

Web:

  1. At 390px wide, open Images and Video. The settings column stacks above the canvas with no horizontal scroll.
  2. Open any dialog at phone width. It fills the screen and the close button stays put while scrolling.
  3. Above 768px, every page renders as it did before.

tsc is clean and the 472 frontend tests pass, though none of them cover layout.

Out of scope

Left deliberately, none of it blocking: recipe-studio (a node graph, not cheaply adaptable to phones), the roughly ten files that hardcode 48px and 34px fallbacks for the titlebar inset variables, and the Windows text-scaling compensation in provider.tsx that only runs at first launch and not on resize.

Dialogs had no height limit, so any dialog taller than the window clipped its
actions off screen with no way to scroll to them. DialogContent and
AlertDialogContent now cap at the viewport and scroll; call sites that manage
their own height still override both, since tailwind-merge treats a later
overflow-* as conflicting with the base overflow-y-auto.

On desktop the custom titlebar paints at z-70 over body-portaled dialogs, and
the chrome CSS variables live inline on a wrapper div that portaled content
never inherits from. A new WindowChromeTopInsetEffect publishes the titlebar
height on <html> as --studio-window-chrome-top, and dialogs subtract it from
their max height and centre below it. Web leaves the variable unset, so it
falls back to 0px.

The Images, Video and diffusion training panes docked a fixed 400-416px left
column inside an overflow-hidden parent, which is wider than a phone and left
the canvas unreachable. All three stack below 768px and keep their existing
classes from md: up. Onboarding centred a 620-660px card inside an
overflow-hidden container, so at the 900x600 minimum window the footer was cut
off and unreachable; the container scrolls now and the card uses my-auto.

Also in this change: 19 height rules move from vh to dvh so panels stop sitting
under mobile browser chrome; dialogs go full screen below 640px instead of
floating on a sliver of backdrop, with the close button fixed so it survives
scrolling; confirms stay centred cards but take the available width; seven
two-column grids stack on phones; the eight window resize strips get
pointer-events-auto, because Radix sets pointer-events none on the body while a
modal is open, which killed window resizing entirely; and top and bottom sheets
gain a height cap.
@shimmyshimmer

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6afdc84edd

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

// managing its own height overrides both (twMerge drops the base classes).
"bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/5 grid max-h-[calc(100dvh-var(--studio-window-chrome-top,0px)-2rem)] max-w-[calc(100%-2rem)] gap-6 overflow-y-auto rounded-4xl px-7 pt-8 pb-7 text-sm ring-1 duration-100 sm:max-w-md top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2",
// Phone-width dialogs fill the screen instead of floating on a sliver of backdrop.
"max-sm:top-0 max-sm:left-0 max-sm:h-dvh max-sm:w-dvw max-sm:max-h-none max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-none max-sm:ring-0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Constrain absolute dialogs to their portal container

At widths below 640px, these viewport-sized rules also apply to DialogContent instances using position="absolute". Recipe Studio portals its config, import, processors, and run dialogs into an overflow-hidden editor container that is shorter than the viewport because the mobile route reserves space above it; h-dvh therefore extends past the container, while max-h-none overrides the callers' max-h-[650px], leaving lower form controls clipped and unreachable. Apply the full-viewport treatment only to fixed dialogs, or size absolute dialogs against their container.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in b86d812.

Good catch. The full-screen block was in the shared base string, so it landed on position="absolute" dialogs too. Both the phone full-screen rules and the titlebar offset now live in the fixed branch only, since both are viewport-sized. The four Recipe Studio dialogs keep their own max-h-[650px] and their container-relative sizing, and the close button keeps the absolute corner when the dialog is container-portaled.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed, and already handled in b86d812: the whole max-sm block is gated behind position === "fixed", so a container-portaled dialog keeps plain absolute. Re-checked in the browser with config-dialog.tsx's real classes at 390x844 with --studio-window-chrome-top: 34px: position absolute, top 149px (container centre, no chrome term), 486x650 rather than 390 x 100dvh, and the close button stays absolute. Same at 1280x800.

The phone full-screen block sat in the shared base class string, so it also
applied to DialogContent with position="absolute". Recipe Studio portals its
config, import, processors and preview dialogs into a short overflow-hidden
editor container; there max-sm:h-dvh ran past the container and
max-sm:max-h-none dropped the callers' own max-h-[650px], clipping the lower
form controls. The full-screen and titlebar-offset rules now live in the fixed
branch only, and the close button keeps its absolute corner when the dialog is
container-portaled.
@shimmyshimmer

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b86d8126a2

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


return (
<div className="relative flex min-h-[calc(100dvh-var(--studio-titlebar-height,0px))] items-center justify-center overflow-hidden bg-gradient-to-br from-primary/5 via-background to-primary/3 p-4 sm:p-6 md:p-8">
<div className="relative flex min-h-[calc(100dvh-var(--studio-titlebar-height,0px))] justify-center overflow-y-auto overflow-x-hidden bg-gradient-to-br from-primary/5 via-background to-primary/3 p-4 sm:p-6 md:p-8">

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Constrain the onboarding scroll container

On Windows/Linux Tauri at the supported 900×600 minimum, this element still expands to its contents because it has only min-h-*, so overflow-y-auto never creates an internal scrollport. The md:min-h-[620px] card plus padding exceeds the viewport, while the custom-chrome wrappers in provider.tsx are fixed to h-dvh with overflow-hidden; consequently the wizard footer remains clipped and Continue is unreachable. Give this container a constrained height (rather than only a minimum height) so the new overflow rule can actually scroll.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 88ca439.

Right, min-h-* alone meant the container grew to the card and overflow-y-auto never had anything to scroll. It now uses h-[calc(100dvh-var(--studio-titlebar-height,0px))] instead of min-h-. That variable is the correct one to subtract here: __root.tsx:282 redefines --studio-titlebar-height to --studio-hidden-route-top-inset for hidden-navbar routes and applies the same value as main's padding-top, so the container ends up exactly the area below the titlebar and the whole thing sums to dvh inside the h-dvh overflow-hidden chrome wrapper. Nothing changes when the card fits, since my-auto still centres it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed, fixed in 88ca439. With the old min-h the scroller grew to its content and never scrolled, and the overflow-hidden ancestor in __root.tsx:292 then made the bottom of the wizard permanently unreachable. Measured inside that real ancestor: at 390x600 the scroller was 1620px, scrollable: false, last row 980px off screen; at 1000x500 it was 902px, last row 346px off screen. With h-[calc(...)] the scroller matches the viewport, scrolls, and the last row is fully visible at both sizes.

mahiatlinux and others added 2 commits August 6, 2026 23:31
The container only had min-height, so it grew to fit the card and
overflow-y-auto never created a scrollport. At the 900x600 minimum window the
md:min-h-[620px] card plus padding still overflowed the h-dvh overflow-hidden
chrome wrapper, leaving Continue clipped. It now takes the height that main
already pads for: __root.tsx redefines --studio-titlebar-height to the
hidden-route inset, so 100dvh minus that variable is exactly the area below the
titlebar.
…en dialog

Three fixes on top of the responsiveness work, all verified in Chromium.

max-sm:translate-x-0/translate-y-0 compiles to `translate: 0px`, which is not
`none`, so the dialog stayed a containing block and the close button's
max-sm:fixed behaved like absolute inside the new scrollport: it moved the full
200px of a 200px scroll at 320, 390 and 639 wide. max-sm:translate-none drops
the containing block and the button now moves 0px, with the dialog box and
horizontal overflow unchanged.

The eight resize strips stopped propagation on mousedown, but Radix dismisses
modals on pointerdown, which fires first. Grabbing a window edge with a dialog
open started the resize and closed the dialog underneath it. Moving the handler
to onPointerDown keeps the resize and leaves the dialog open.

Below md the settings rail is no longer a scrollport, so pb-20 rendered as 80px
of blank space above the divider; it is now pb-6 with md:pb-20. On the same
containers an unset overflow-x computes to auto next to overflow-y-auto, so a
wide row could pan the whole page sideways on touch; overflow-x-hidden pins it.
md:overflow-hidden still wins from md up, so desktop is unchanged.

typecheck, 472/472 tests, i18n parity and build all pass.
@danielhanchen

Copy link
Copy Markdown
Member

Went through this one carefully, including a pre/post build of Studio driven in a real browser. The core of the PR holds up well. Pushed three fixes to your branch in 03fbf0f rather than leaving them as review notes, since each one is a single class or handler change.

What the measurements confirmed

Running the shared dialog primitives at 9 viewports across 7 dialog shapes, pre-PR vs this branch:

before after
AlertDialog at 320x568 top -1047, bottom +1615 top 50, bottom 552
AlertDialog at 900x600 top -634, bottom +1234 top 50, bottom 584
off-viewport failures 36 0
under-titlebar failures 19 0

The chrome inset does exactly what you described: at 900x600 with --studio-window-chrome-top: 34px the dialog moves top 16 -> 50 and max-height 568 -> 534, and with the variable unset it is byte-identical to main.

On two real Studio installs at 390x844, /images before this PR has a 408px rail in a 390px viewport with nothing on the page scrolling at all, so the canvas is genuinely unreachable. After, the outer container scrolls 1307/796. /video the same, 400px to none. Desktop at 768/820/1024/1280/1920 is geometrically identical apart from one inert min-height: auto -> 0 on a pane that carries overflow-hidden at every breakpoint.

Also worth recording, since it is the thing the whole diff rests on: tailwind-merge 3.5.0 does cancel the base overflow-y-auto with a later overflow-hidden or overflow-auto, so your comment in dialog.tsx is right. Across 126 measurements no dialog ended up with more than one scroll owner. And pointer-events-auto on the resize strips is load-bearing, not cosmetic: without it a z-70 fixed strip computes pointer-events: none with a modal open and an edge hit-test misses it entirely.

What I changed

1. The phone close button was not actually fixed. max-sm:translate-x-0 max-sm:translate-y-0 compiles to translate: 0px, and a zero translate is still not none, so the dialog kept establishing a containing block and max-sm:fixed degraded to absolute inside the new scrollport:

viewport close position dialog translate scrolled close moved
320x568 fixed 0px 200px 200px
390x844 fixed 0px 200px 200px
639x600 fixed 0px 200px 200px

max-sm:translate-none gives translate: none, and the button now moves 0px across the same 200px scroll with the dialog box and horizontal overflow unchanged.

One thing I did not change: from sm up the button is absolute and still scrolls away, which is new behaviour now that the dialog scrolls, and it affects 25 of the 38 DialogContent call sites. Escape and outside-click still work so it degrades rather than traps. A zero-height sticky top-0 first grid item fixes that case too, but it makes the button a grandchild and breaks the ten [&>button]:* utilities on the attachment lightbox, so I left the call for you.

2. Grabbing a resize strip dismissed the open dialog. Radix dismisses on pointerdown, which fires before mousedown, so the stopPropagation in handleResizeMouseDown was too late:

resize fired dialog
onMouseDown yes dismissed
onPointerDown yes survived

Not a regression against main, where the click fell through and dismissed with no resize at all, but the feature only half worked. All eight strips now use onPointerDown.

3. Two mobile layout details. pb-20 was bottom scroll padding on a rail that is no longer a scrollport below md, so it rendered as 81px of measured blank space above the divider; it is now pb-6 md:pb-20. On the same containers an unset overflow-x computes to auto next to overflow-y-auto (confirmed auto here vs hidden on main at 390px), so a long repo id could pan the whole page sideways on touch; overflow-x-hidden pins it. md:overflow-hidden still wins from md up, so desktop is untouched.

typecheck, 472/472 tests, i18n parity and build all pass, and biome reports the same 10 errors and 58 warnings on these files with and without the changes.

Two things left for you

The branch stopped merging while I was reviewing. main moved to ccb8dff86 and b52d3b56e feat(studio): rework train page setup flow (#7633) refactored the files you touch. A clean three-way merge now conflicts in three places, and resolving them toward this PR breaks the build, so it is worth flagging which side to keep:

  • features/studio/sections/params-section.tsx: keep main, then move grid-cols-1 sm:grid-cols-2 to sections/lora-params-section.tsx:219, which still has a bare grid grid-cols-2 gap-2.
  • features/studio/sections/dataset-section.tsx: keep main. Its sections/dataset-advanced-settings.tsx:94 is already grid-cols-1 gap-3 sm:grid-cols-3, so the change is redundant there.
  • features/studio/history-card-grid.tsx: keep main, which gained z-10 plus resume gating and artifact deletion, and append pointer-coarse:opacity-100 to its delete button.

Smaller notes, no action needed from me:

  • max-sm:top-0 max-sm:h-dvh drops the chrome inset the same class string just added. MIN_WINDOW_WIDTH = 900 is in logical px while max-sm is a CSS-px query, and the codebase already accounts for that divergence at navbar.tsx:41-42, so it is reachable on a Windows desktop under text scaling.
  • sections/training-section.tsx:206 is a grid-cols-3 of three labelled buttons, roughly 105px per column at 375px, which will overflow in German or Japanese. sections/dataset-section.tsx:1447 is a grid-cols-2 of two labelled buttons in a file you already converted elsewhere.
  • The two new data-[side=top|bottom]:overflow-y-auto rules in sheet.tsx are dead today (all 7 call sites are left/right, and sidebar.tsx:229 types side as "left" | "right"), and they pre-ship the same close-button problem as fix 1 into a path nobody exercises. The max-h-[85dvh] pair is harmless.
  • --studio-window-chrome-top is a third name for a value both style maps already carry as --studio-desktop-titlebar-height: 34px, so "34px" now lives in four places that have to move together. provider.tsx:599's Toaster top: isTauri ? 46 : 12 is a fifth, and could read the new variable now that it is on <html>.
  • The alert-dialog.tsx phone width reads as "take the width available instead of a fixed 20rem", but measured it is 92 to 95% of the viewport at 430 and 600px, so effectively full width. The real gap is only at 352px and below, where max-w-xs leaves under 16px of gutter. max-sm:max-w-[min(20rem,calc(100%-2rem))]! would cover that case alone. Your call, it is a design decision rather than a bug.

One correction to something I nearly raised: I thought the macOS branch should publish 0px rather than 34px, on the grounds that nothing occludes a dialog there. That is wrong. navbar.tsx:31-37 renders the nav toolbar at z-[60] in the root stacking context, and the native traffic lights sit at roughly x 14-66, y 26-38 where no z-index can reach them. At 0px the Settings dialog at 900x600 would span [16,884]x[16,584] and contain both. The 34px is correct and should stay.

Nice work on this, the onboarding container fix in 88ca439 was the right shape too.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03fbf0f606

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

onScroll={onSettingsScroll}
className={cn(
"hover-scrollbar panel-scroll-fade flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto pb-20 pl-0.5 pr-8",
"hover-scrollbar panel-scroll-fade flex min-h-0 flex-1 flex-col gap-4 pb-6 pl-0.5 pr-8 md:pb-20 md:overflow-y-auto",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve clearance for floating mobile actions

Below the md breakpoint, reducing this padding to pb-6 leaves only 24px beneath the final control, but the absolutely positioned Generate button still occupies roughly the bottom 72px of this panel (h-11 plus pb-7). It consequently overlays the Advanced section at the end of the settings form. The same responsive padding change is duplicated in diffusion-train-panel.tsx and video-page.tsx, where it similarly causes the Start training or Generate button to cover the last controls; retain enough bottom clearance in all three mobile rails.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, and it was my regression from 03fbf0f. The floating action is absolute inset-x-0 bottom-0 ... pb-7 over an h-11 button, so it stands 72px tall, and pb-6 only clears 24px. Measured in Chromium, Firefox and WebKit at 390x844: the button overlapped the last control by 32px on the Images rail and 48px on the diffusion rail, and elementFromPoint at the control centre returned the button rather than the control. Reverted to pb-20 at every width in images-page.tsx, video-page.tsx and diffusion-train-panel.tsx, which is byte identical to before at md and up. Post fix the overlap is 0px in all three engines. Fixed in 6f87ddd.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addendum, now measured on the running Studio rather than a replica, and one correction to my numbers above. On the live /images and /video pages at 390x844 the last control in the rail is the Advanced disclosure row, and the floating button overlaps it by 48px with pb-6 and 0px with pb-20, identical in Chromium, Firefox and WebKit. Because that row is full width and the button is not, its centre stays hit-testable, so the accurate statement for these two pages is that the bottom 48px of the row is covered rather than that the row is unclickable; the elementFromPoint result I quoted was from the narrower diffusion-panel control. On head the live pages report padding-bottom: 80px against a 72px button stack, overlap 0, last control in view, in all three engines on both routes.

@danielhanchen

Copy link
Copy Markdown
Member

Ran the change through a cross-engine simulation before signing off, since the close-button fix rests on a detail the CSSWG still has open. Three trees served side by side (pre-PR 24efe618e, this branch before my commit 88ca43958, and 03fbf0f60) driven by Playwright on Chromium, Firefox and WebKit. 2340 geometry measurements plus 216 reachability probes.

The bug is bigger than the description says

I tested reachability the only way that counts: scroll every scroll container in the dialog to its end, then check the primary action is inside the viewport and is the topmost element at its own centre.

tree primary action reachable
pre-PR 36 / 72
this branch 72 / 72

The failures were not marginal. Any dialog on the base primitive without its own max-h, which is 25 of the 38 DialogContent call sites and all 24 AlertDialogContent ones, was unreachable at every viewport tested including 1440x900, in all three engines. Not cramped on a phone: Save could not be clicked on a desktop monitor. Dialogs that already set their own max-h plus an inner scroller were fine, which is presumably why this survived so long.

The containing-block detail, per engine

Individual translate is not listed on MDN's containing-block page and csswg-drafts#12083 is open on exactly this, so I measured it directly rather than assuming:

value Chromium Firefox WebKit
translate: none no containing block no containing block no containing block
translate: 0px containing block containing block containing block
transform: translate(0,0) containing block containing block containing block

Unanimous, so the bug and the fix both behave the same everywhere: close button moved 200px per 200px of scroll before, 0px after, in all three engines. Worth noting the browser floor does not move either, since translate-x-0 already required the same property.

Cross-engine results for the rest

  • Resize strip with a dialog open: onMouseDown fires the resize and dismisses the dialog; onPointerDown fires the resize and the dialog survives. Same in all three engines. I also checked a synthetic touch pointerdown, since it fires without the compatibility delay mousedown had, and it does not dismiss either.
  • Escape closes and focus stays inside the dialog across 12 Tab presses, all engines.
  • Forcing classic 15px scrollbars, the phone-width dialog is 390 wide in a 390 viewport with no document horizontal scroll, so max-sm:w-dvw is safe on Windows Firefox.
  • overflow-y: auto with overflow-x unset computes to auto, and a real horizontal wheel gesture pans the container by 300px on Chromium, 180px on Firefox, 300px on WebKit. With explicit overflow-x: hidden it does not pan in any engine.
  • Rail padding is 24px below md and 80px from md up, all engines, no document horizontal scroll.

One residual I left alone

During the open animation tw-animate-css's zoom-in-95 emits a transform, which re-establishes the containing block for its duration, so the close button rides the scroll for a moment:

engine 0ms 50ms 100ms 150ms 200ms
Chromium 190px 190px 190px 190px 0px
Firefox 0px 200px 0px 0px 0px
WebKit 200px 199px 0px 0px 0px

Clear everywhere by 200ms and identical before my commit, so nothing regressed. I did not add max-sm:animate-none to close it: Radix drives unmount off animationend, so suppressing the animation risks the close transition to buy a window nobody can hit.

Nothing regressed, and what is still failing was already failing

Zero regressions from my commit across all 2340 measurements. Everything still failing is identical on pre-PR main:

  • The bare CommandDialog default overhangs at 844x390, byte-identical top=130 bottom=418 on all three trees and all three engines. The shipped chat-search call site overrides it, so it is latent.
  • Sheets still sit under the titlebar at top=0 with the chrome variable set, since they never got the offset dialogs did.

Two entries in my first pass were my own measurement artifacts rather than real problems, worth saying so they do not get chased: an action-not-hittable count of 240 came from a probe that scrolled 200px of a 2100px range, and a doc-hscroll count came from a fixed-width container in my harness. Both are corrected above.

Compatibility

The whole PR is confined to studio/frontend/src, every changed file is .tsx, and the diff touches no localStorage, fetch, /api/ or Tauri invoke call, so there is no backend contract, storage key or migration involved and old installs have nothing to carry across. No service worker is registered, so there is no half-applied-cache path either. On macOS WindowTitlebar returns null, so the resize strips do not exist there and the onPointerDown change is inert; outside Tauri the chrome variable is never set and every consumer takes its 0px fallback, which I verified is identical to pre-PR. The app never sets dir on <html>, so dialog layout is LTR for ar too.

typecheck, 472/472 tests, i18n parity and build all pass on 03fbf0f, and biome reports the same 10 errors and 58 warnings on these files with and without the change.

One thing to flag: GitHub still has this as conflicting with main, so CI has not actually run any of the above. All of it is local. Resolving the three conflicts as described in my earlier comment should let the real pipeline confirm it.

Resolves the three conflicts left by the train page setup rework (unslothai#7633), which
extracted the sections this branch had edited in place.

dataset-section.tsx and params-section.tsx: kept main's componentised versions
whole. The grid this branch stacked in dataset-section now lives in
dataset-advanced-settings.tsx, where main already ships it as
grid-cols-1 sm:grid-cols-3, so that hunk was redundant. The LoRA variant grid
moved to lora-params-section.tsx and still had a bare grid-cols-2, so the
responsive class is transplanted there.

history-card-grid.tsx: kept main's z-10 and resume/artifact-deletion work and
re-applied pointer-coarse:opacity-100 on the delete button.

Both resolved files are byte-identical to main apart from those two one-liners.
typecheck, 678/678 tests, i18n parity and build pass on the merge.
The max-sm branch set top-0/h-dvh, dropping the --studio-window-chrome-top inset
the same class string had just applied, so a full-screen dialog rendered under the
z-70 titlebar. That breakpoint is reachable on desktop: MIN_WINDOW_WIDTH is 900
logical px while max-sm is a CSS-px query, and the two diverge under Windows text
scaling, which navbar.tsx:41-42 already accounts for.

It now starts at the inset and takes the remaining height. The variable is only
ever set inside TauriWrapper, so on web it resolves to 0px and the geometry is
byte-identical to before.

Measured in Chromium, Firefox and WebKit at 320x568, 390x844 and 639x600:
web unchanged (top 0, full height); with the inset at 34px the dialog moves to
top 34 with height reduced by 34. Close button drift stays 0px and no viewport
gains horizontal overflow. Primary action reachable in 144/144 probes.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 91cfd0bed3

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

// iPad-portrait widths where a fixed width overflows. Height caps
// the same way so short viewports don't get a clipped dialog.
"settings-surface !max-w-[min(960px,calc(100vw-2rem))] h-[min(680px,calc(100dvh-2rem))] w-[min(960px,calc(100vw-2rem))] p-0 overflow-hidden",
"settings-surface !max-w-[min(960px,calc(100vw-2rem))] h-[min(820px,calc(100dvh-var(--studio-window-chrome-top,0px)-2rem))] w-[min(960px,calc(100vw-2rem))] p-0 overflow-hidden",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the chrome-subtracted Settings height

When a Windows/Linux Tauri window falls below the 640px CSS breakpoint, such as under high display scaling, the shared DialogContent starts the dialog below the 34px titlebar and sizes it to the remaining viewport. However, this call site's later max-sm:h-dvh wins tailwind-merge, so Settings still occupies the full viewport height from that offset and extends 34px below the window; because the surface is overflow-hidden, its bottom content can be clipped. Remove that override or subtract --studio-window-chrome-top there as well.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. max-sm:h-dvh and the base max-sm:h-[calc(100dvh-var(--studio-window-chrome-top,0px))] are the same tailwind-merge group with the same modifier, so the later call site won; confirmed against the locked tailwind-merge, which returns only max-sm:h-dvh. Measured with the chrome var at 34px, identical in Chromium, Firefox and WebKit: dialog top 34, height 844, bottom 878 in an 844px viewport, so 34px hangs below the window and roughly 10px of real content is clipped behind overflow-hidden with the body scrolled to its end. Now uses the same chrome-subtracted calc: height 810, overhang 0, last row visible. On web the var resolves to 0px so it stays 100dvh. Fixed in 6f87ddd.

Comment on lines +117 to +118
"absolute top-5 right-5 z-10",
position === "fixed" && "max-sm:fixed",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Offset the fixed close button below desktop chrome

When a Tauri window falls below the sm breakpoint, the dialog now begins below the 34px desktop titlebar, but its close button switches to viewport-fixed positioning while retaining top-5. The button therefore starts at 20px and is partially covered by the higher-z-index titlebar or window controls, even though the dialog itself starts at 34px; include --studio-window-chrome-top in the fixed button's top offset.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, and worse than described. At top-5 the fixed button sits at 20px against the 34px titlebar, so 14 of its 32px are underneath it, and its rect intersects the window's own close control by 18x12px. A real mouse click inside the dialog close button's rect was received by the window close control, which would quit Studio rather than close the dialog. Identical in Chromium, Firefox and WebKit. Now max-sm:top-[calc(1.25rem+var(--studio-window-chrome-top,0px))]: top 54px, 0px under the titlebar, no intersection with the window controls, and the centre hit test returns the dialog close again. Web (var 0px) stays at 20px and sm and up is untouched at absolute. Fixed in 6f87ddd.

@danielhanchen

Copy link
Copy Markdown
Member

Merged main into the branch and pushed two commits, so CI can finally run on this. It now does, and the frontend job is green.

Merge (acc5afc)

The train page setup rework (#7633) extracted the sections this branch had edited in place, which is what the three conflicts were. Resolved by keeping main whole in both refactored files and transplanting only the intent:

  • params-section.tsx: kept main. The LoRA variant grid moved to lora-params-section.tsx:219 and still had a bare grid-cols-2, so the responsive class went there.
  • dataset-section.tsx: kept main. That grid now lives in dataset-advanced-settings.tsx:94, where main already ships grid-cols-1 gap-3 sm:grid-cols-3, so the hunk was redundant and is dropped rather than reinstated.
  • history-card-grid.tsx: kept main's z-10 and its resume-gating and artifact-deletion work, and re-applied pointer-coarse:opacity-100 on the delete button.

Both resolved files are byte-identical to main apart from those two one-liners, so none of main's work is reverted.

Phone-width dialogs and the titlebar (91cfd0b)

The max-sm branch set top-0/h-dvh, which dropped the --studio-window-chrome-top inset that the same class string had just applied, so a full-screen dialog rendered under the z-70 titlebar. That breakpoint is reachable on desktop rather than phone-only: MIN_WINDOW_WIDTH is 900 logical px while max-sm is a CSS-px query, and the two diverge under Windows text scaling, which navbar.tsx:41-42 already accounts for.

It now starts at the inset and takes the remaining height. The variable is only ever set inside TauriWrapper, so on web it resolves to 0px.

Measured in Chromium, Firefox and WebKit at 320x568, 390x844 and 639x600:

web (var unset) desktop (var 34px)
before top 0, full height top 0, full height (under the titlebar)
after top 0, full height, byte-identical top 34, height reduced by 34

Close button drift stays 0px, no viewport gains horizontal overflow, and the primary action is reachable in 144/144 probes on the merged tree.

CI

Frontend build and bundle sanity passes, Source lint passes, Tauri Linux debug build passes, pre-commit.ci passes. 27 green.

One job fails: Core (HF=4.57.6 + TRL<1), at the step unsloth_zoo @ main - full pytest (CPU). That is a Python suite run against unsloth_zoo's moving main branch. This PR is 34 .tsx files and contains no .py at all, so it cannot be the cause.

Checked against the newest main

#8025 landed after my merge and touches provider.tsx and window-titlebar.tsx, so I re-ran the merge against it. It auto-merges cleanly, it does not change the titlebar height or the chrome variables, and all the changes here survive intact: max-sm:translate-none present, the chrome inset present, all 8 resize strips still on onPointerDown. typecheck, 706/706 tests and build pass on that combination. I have not pushed that second merge since GitHub resolves it cleanly on its own.

Still open, deliberately not changed here

Fixed sheets still use inset-y-0, so a right-side sheet's first 34px sits under the titlebar. I measured it 24 times, and it is the same bug class the dialog inset fixes, but an additive top-[var(...)] does not work: tailwind-merge keeps inset-y-0 alongside it, leaving two competing top rules decided by stylesheet order. Doing it properly means restructuring the shared base string for all 7 sheet call sites, which is more than belongs in this PR. It is pre-existing on main either way.

Also unchanged, all pre-existing and noted earlier: the bare CommandDialog default overhangs at 844x390 (masked by its only call site), and --studio-window-chrome-top duplicates --studio-desktop-titlebar-height, which both style maps already carry.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

danielhanchen added a commit to danielhanchen/unsloth-staging-2 that referenced this pull request Aug 6, 2026
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: c5a79a09b3

ℹ️ 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 6095b1f into unslothai:main Aug 6, 2026
27 of 32 checks passed
danielhanchen added a commit to oobabooga/unsloth that referenced this pull request Aug 6, 2026
…s landed

unslothai#7957 merged first and gave the response details and document preview
sheets their own compensation for the same overlap: a marginTop plus
height: calc(100% - var(--studio-custom-titlebar-height)).

With SheetViewportInsetProvider both apply, pushing those two panels to
68px and leaving them 34px past the viewport bottom. Remove the per-sheet
compensation so the context is the only offset for sheets, and extend the
contract test to pin that.

DesktopChromeVarsEffect stays: unslothai#8016 gave it a second job, mirroring
--studio-window-chrome-top for the dialogs that portal to body.
danielhanchen added a commit to oobabooga/unsloth that referenced this pull request Aug 7, 2026
…s landed

unslothai#7957 merged first and gave the response details and document preview
sheets their own compensation for the same overlap: a marginTop plus
height: calc(100% - var(--studio-custom-titlebar-height)).

With SheetViewportInsetProvider both apply, pushing those two panels to
68px and leaving them 34px past the viewport bottom. Remove the per-sheet
compensation so the context is the only offset for sheets, and extend the
contract test to pin that.

DesktopChromeVarsEffect stays: unslothai#8016 gave it a second job, mirroring
--studio-window-chrome-top for the dialogs that portal to body.
danielhanchen added a commit that referenced this pull request Aug 7, 2026
* Studio: Keep sheets below the custom titlebar

* Studio: drop the per-sheet titlebar offset now that #7957 has landed

#7957 merged first and gave the response details and document preview
sheets their own compensation for the same overlap: a marginTop plus
height: calc(100% - var(--studio-custom-titlebar-height)).

With SheetViewportInsetProvider both apply, pushing those two panels to
68px and leaving them 34px past the viewport bottom. Remove the per-sheet
compensation so the context is the only offset for sheets, and extend the
contract test to pin that.

DesktopChromeVarsEffect stays: #8016 gave it a second job, mirroring
--studio-window-chrome-top for the dialogs that portal to body.

* Tidy comment wording for PR #7954

* Inset sheets with the mirrored titlebar variable, not a React context

* Tighten the sheet inset comments for PR #7954

---------

Co-authored-by: Daniel Han <[email protected]>
danielhanchen added a commit that referenced this pull request Aug 9, 2026
…ss (#8215)

* remove the unused images train dialog and fix media page responsiveness

diffusion-train-dialog.tsx has been dead since #6822 replaced it with
train/diffusion-train-panel.tsx. Nothing imports it, DiffusionTrainDialog is its
only export, and #8016 spent responsiveness edits on it while it was already
unreachable.

DatasetLabelingGrid capped its height at 420px with default auto rows, so once
the tiles passed the cap Chrome divided the definite height between them instead
of scrolling. Each tile is overflow-hidden, so its automatic minimum size is
zero and the aspect-square thumbnail collapsed: measured tile 26px, thumbnail
170x0. auto-rows-min restores tile 404px, thumbnail 170x170 and a scrolling grid.

The Images header positioned the Create | Train switch absolutely over a
justify-between row, so at a 390px header it painted 124px over the model
selector and 44px over the Video link. It is now a three column grid with equal
side tracks, and the pill padding keys off the header width rather than the
viewport, since the header is the viewport minus a resizable sidebar.

The train run pane sized its stat grids and charts on viewport breakpoints while
its own width is whatever is left beside the 416px form column, which put four
stat cells needing 396px into a 266px pane. The pane is a container now and both
break on its width.

The Video header's left group had no min-w-0, so a long resident model name
pushed the Images link 51px off a 390px viewport.

test_desktop_reliability_frontend_contract.py matched the header band on an
order coupled class literal. The marker is the band size now and the group
pattern allows utilities between the tokens; every assertion is intact and was
mutation tested against four violations it must catch.

* hide the video status chips when the header cannot hold them

md: is a viewport query, but the header is the viewport minus a sidebar that is
resizable to 480px. At a 420px header the chips kept their intrinsic width and
squeezed the model name to zero. They now key off the header's own width, so the
name stays 230px readable below 720px and the chips return above it.

* let the media page link truncate instead of overlapping the mode switch

The link button was shrink-0, so below a roughly 370px header its equal side
track underflowed the 90px control and the link overflowed left across the Train
tab. It now shrinks and truncates its label the way the model selector already
does, keeping the icon, the arrow and the tooltip. Measured at header widths 300
through 1000: link-left minus pill-right is -8 everywhere, previously +25 at 300.

* Fix the Images header pill sitting 8px right of the page centre for PR #8215

---------

Co-authored-by: danielhanchen <[email protected]>
@mahiatlinux
mahiatlinux deleted the studio-responsiveness branch August 13, 2026 22:21
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.

3 participants