Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: one top row and layout fixes for the Windows desktop app (#12070)

Maheswar Kumarc309bd69abef
diff --git a/studio/frontend/src/app/provider.tsx b/studio/frontend/src/app/provider.tsx
index 42a112e9b78..e482186caea 100644
--- a/studio/frontend/src/app/provider.tsx
+++ b/studio/frontend/src/app/provider.tsx
@@ -501,7 +501,7 @@ function TauriUpdateLayer({
) : (
<div
// Scrolls at the cap rather than spilling cards off screen; the gutter keeps the card shadows out of that clip.
- className="pointer-events-none fixed bottom-0 right-0 flex max-h-[100dvh] flex-col items-end gap-2 overflow-y-auto overflow-x-hidden overscroll-contain"
+ className="pointer-events-none fixed bottom-0 right-0 flex max-h-[calc(100dvh-var(--studio-window-chrome-top,0px))] flex-col items-end gap-2 overflow-y-auto overflow-x-hidden overscroll-contain"
// Measured from the outside, per card, by tests/studio/playwright_update_banner_layout.py.
data-testid="overlay-rail"
// Gutters in px, never a spacing utility: those are rem, and the cards would drift off the corner.
@@ -581,6 +581,8 @@ const CUSTOM_CHROME_STYLE = {
"--studio-collapsed-chat-controls-inset": "12px",
"--studio-startup-top-inset": "42px",
"--studio-content-top-inset": "34px",
+ "--studio-non-chat-content-top-inset": "34px",
+ "--studio-non-chat-scroller-top": "34px",
"--studio-hidden-route-top-inset": "34px",
// Same split as the native-mac block: chat chrome scales, window chrome does not.
"--studio-chat-header-height": "calc(48px * var(--ui-space-scale, 1))",
@@ -588,7 +590,7 @@ const CUSTOM_CHROME_STYLE = {
"--studio-media-header-left-inset": "calc(0.5rem * var(--ui-space-scale, 1))",
"--studio-chat-control-height": "calc(33px * var(--ui-space-scale, 1))",
"--studio-chat-header-right-inset": "0px",
- "--studio-window-control-inset": "112px",
+ "--studio-window-control-inset": "138px",
} as CSSProperties;
// Mirror the titlebar heights onto <html>: overlays portalled into document.body read the wrapper styles as empty.
@@ -610,7 +612,9 @@ function DesktopChromeVarsEffect({
"--studio-mac-titlebar-height",
usesNativeMacTitlebar ? NATIVE_MAC_TITLEBAR_HEIGHT_VAR : null,
);
- set("--studio-window-control-inset", usesCustomTitlebar ? "112px" : null);
+ set("--studio-window-control-inset", usesCustomTitlebar ? "138px" : null);
+ // The toaster renders outside the wrapper.
+ set("--studio-content-top-inset", usesCustomTitlebar ? "34px" : null);
// How far body-portaled surfaces must stay clear of the top: either titlebar paints over them.
set(
"--studio-window-chrome-top",
@@ -624,6 +628,7 @@ function DesktopChromeVarsEffect({
set("--studio-custom-titlebar-height", null);
set("--studio-mac-titlebar-height", null);
set("--studio-window-control-inset", null);
+ set("--studio-content-top-inset", null);
set("--studio-window-chrome-top", null);
};
}, [usesCustomTitlebar, usesNativeMacTitlebar]);
@@ -1010,7 +1015,16 @@ function TauriWrapper({ children }: { children: ReactNode }) {
>
{chromeVars}
<WindowTitlebar showSidebarSurface={showSidebarSurface} />
- <div className="h-full min-h-0 overflow-hidden">{content}</div>
+ {/* Sign-in forms can outgrow a small window. */}
+ <div
+ className={
+ hidesTitlebarSidebar
+ ? "h-full min-h-0 overflow-x-hidden overflow-y-auto"
+ : "h-full min-h-0 overflow-hidden"
+ }
+ >
+ {content}
+ </div>
</div>
);
}
diff --git a/studio/frontend/src/app/routes/__root.tsx b/studio/frontend/src/app/routes/__root.tsx
index b53dba3f9b1..b7c83d31e8b 100644
--- a/studio/frontend/src/app/routes/__root.tsx
+++ b/studio/frontend/src/app/routes/__root.tsx
@@ -438,7 +438,7 @@ function RootLayout() {
// leave --studio-titlebar-height at 0 for the pages sized off it.
const nonChatTopInset = useIsMobileShell()
? "pt-14"
- : "pt-[var(--studio-non-chat-content-top-inset,var(--studio-content-top-inset,0px))] [--studio-titlebar-height:var(--studio-non-chat-content-top-inset,var(--studio-content-top-inset,0px))]";
+ : "pt-[calc(var(--studio-non-chat-content-top-inset,var(--studio-content-top-inset,0px))-var(--studio-non-chat-scroller-top,0px))] [--studio-titlebar-height:var(--studio-non-chat-content-top-inset,var(--studio-content-top-inset,0px))]";
useTrainingUnloadGuard();
// Global export driver: streams worker logs and tracks status from any route
@@ -703,8 +703,8 @@ function RootLayout() {
? "overflow-hidden"
: // Reserve the scrollbar so the Library does not shift when it appears.
isLibraryRoute
- ? "overflow-y-auto [scrollbar-gutter:stable]"
- : "overflow-y-auto"
+ ? "mt-[var(--studio-non-chat-scroller-top,0px)] overflow-y-auto [scrollbar-gutter:stable]"
+ : "mt-[var(--studio-non-chat-scroller-top,0px)] overflow-y-auto"
}
>
<Navbar />
diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx
index 9f1b910c5a5..b37b8fa8e55 100644
--- a/studio/frontend/src/components/app-sidebar.tsx
+++ b/studio/frontend/src/components/app-sidebar.tsx
@@ -139,7 +139,7 @@ import {
TooltipContent,
} from "@/components/ui/tooltip";
import { Tooltip as TooltipPrimitive } from "radix-ui";
-import { HugeiconsIcon } from "@hugeicons/react";
+import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";
import { ArrowRightIcon, ChevronDown, GitBranchIcon, Moon } from "lucide-react";
import {
Link,
@@ -793,6 +793,13 @@ function ImagesWorkflowList({
);
}
+// Hugeicons' three dots, spread 1.5 units and centred vertically (its own sit half a unit low).
+const MORE_DOTS_ICON: IconSvgElement = [
+ ["circle", { cx: "4.5", cy: "12", r: "1", stroke: "currentColor", strokeWidth: "1.5", key: "0" }],
+ ["circle", { cx: "12", cy: "12", r: "1", stroke: "currentColor", strokeWidth: "1.5", key: "1" }],
+ ["circle", { cx: "19.5", cy: "12", r: "1", stroke: "currentColor", strokeWidth: "1.5", key: "2" }],
+];
+
// A NavItem's affordances in dropdown-item form, for the "More" flyout.
function MoreMenuItem({
icon,
@@ -5008,7 +5015,7 @@ export function AppSidebar() {
<img
src="/circle-logo-small.png"
alt="Unsloth"
- className="relative top-px h-[calc(22px+0.5rem*var(--ui-font-scale,1))] w-[calc(22px+0.5rem*var(--ui-font-scale,1))] shrink-0 rounded-full object-cover"
+ className="relative top-px -left-px h-[calc(22px+0.5rem*var(--ui-font-scale,1))] w-[calc(22px+0.5rem*var(--ui-font-scale,1))] shrink-0 rounded-full object-cover"
/>
<span className="relative -top-px truncate font-heading text-[calc(13px+0.5rem*var(--ui-font-scale,1))] font-semibold tracking-[0em] leading-tight text-black dark:text-foreground dark:tracking-[0.02em]">
unsloth
@@ -5026,10 +5033,10 @@ export function AppSidebar() {
useChatSearchStore.getState().open();
closeMobileIfOpen();
}}
- className="inline-flex size-[calc(30px*var(--ui-space-scale,1))] cursor-pointer items-center justify-center rounded-[10px] text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
+ className="relative top-px inline-flex size-[calc(30px*var(--ui-space-scale,1))] cursor-pointer items-center justify-center rounded-[10px] text-nav-fg transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
aria-label={t("shell.navigation.search")}
>
- <HugeiconsIcon icon={Search01Icon} strokeWidth={1.75} className="size-icon" />
+ <HugeiconsIcon icon={Search01Icon} strokeWidth={1.75} className="size-4" />
</button>
</TooltipPrimitive.Trigger>
<TooltipContent
@@ -5270,9 +5277,9 @@ export function AppSidebar() {
className="sidebar-nav-btn h-[calc(33px*var(--ui-space-scale,1))] rounded-full gap-[calc(8.5px*var(--ui-space-scale,1))] pl-3 pr-2.5 font-medium group-data-[collapsible=icon]:!p-0 group-data-[collapsible=icon]:!size-[calc(28px*var(--ui-space-scale,1))] group-data-[collapsible=icon]:my-[calc(2.5px*var(--ui-space-scale,1))] group-data-[collapsible=icon]:mx-auto"
>
<HugeiconsIcon
- icon={MoreHorizontalIcon}
+ icon={MORE_DOTS_ICON}
strokeWidth={1.75}
- className="size-icon! shrink-0 group-hover/menu-button:animate-icon-pop"
+ className="size-icon! shrink-0 translate-x-0.5 group-data-[collapsible=icon]:translate-x-0 group-hover/menu-button:animate-icon-pop"
/>
<span className="text-ui-14p5 leading-ui-19 tracking-nav">
{t("shell.navigation.more")}
diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx
index b0b2142e7c7..cb6aa0ca05b 100644
--- a/studio/frontend/src/components/assistant-ui/thread.tsx
+++ b/studio/frontend/src/components/assistant-ui/thread.tsx
@@ -2161,7 +2161,7 @@ export const Thread: FC<{
: // + the chat-model notice, which is an opaque absolute bar
// directly under the header. 0px whenever it is not showing,
// so every other surface keeps the padding it had.
- "pt-[calc(var(--studio-content-top-inset,0px)+var(--studio-chat-header-height,48px)+var(--studio-chat-notice-height,0px))]",
+ "[--thread-header-offset:calc(var(--studio-content-top-inset,0px)+var(--studio-chat-header-height,48px)+var(--studio-chat-notice-height,0px))] pt-[var(--thread-header-offset)]",
)}
>
{!hideWelcome && (
@@ -2405,7 +2405,7 @@ const ThreadComposerDock: FC<{
className={cn(
// Inset both sides, not just the right: the offset keeps the bottom
// fade off the scrollbar, and a one-sided one also moves the centre.
- "aui-thread-composer-dock pointer-events-none absolute bottom-0 left-0 right-0 md:left-[calc(10px*var(--ui-space-scale,1))] md:right-[calc(10px*var(--ui-space-scale,1))]",
+ "aui-thread-composer-dock pointer-events-none absolute bottom-0 left-0 right-0 md:left-[var(--thread-scrollbar-gutter,10px)] md:right-[var(--thread-scrollbar-gutter,10px)]",
overlay ? "z-40" : "z-20",
)}
>
diff --git a/studio/frontend/src/components/llama-update-banner.tsx b/studio/frontend/src/components/llama-update-banner.tsx
index 25a8c68de2d..fd9c8cd6453 100644
--- a/studio/frontend/src/components/llama-update-banner.tsx
+++ b/studio/frontend/src/components/llama-update-banner.tsx
@@ -251,7 +251,7 @@ export function LlamaUpdateBanner({
data-testid="llama-update-banner"
>
{/* Paint the full floor even when the changelog content is short. */}
- <div className="relative flex max-h-[calc(100dvh_-_2rem)] min-h-0 grow flex-col overflow-hidden rounded-[24px] bg-white px-5 pb-4 pt-5 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:bg-card dark:shadow-[0_8px_28px_-6px_var(--background)]">
+ <div className="relative flex max-h-[calc(100dvh_-_2rem_-_var(--studio-window-chrome-top,0px))] min-h-0 grow flex-col overflow-hidden rounded-[24px] bg-white px-5 pb-4 pt-5 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:bg-card dark:shadow-[0_8px_28px_-6px_var(--background)]">
{applying ? null : (
<button
type="button"
diff --git a/studio/frontend/src/components/tauri/update-banner.tsx b/studio/frontend/src/components/tauri/update-banner.tsx
index 61b3d9e68ad..9a52bde90d3 100644
--- a/studio/frontend/src/components/tauri/update-banner.tsx
+++ b/studio/frontend/src/components/tauri/update-banner.tsx
@@ -117,7 +117,7 @@ export function UpdateBanner({
data-testid="tauri-update-banner"
>
{/* Paint the full floor even when the notes are short. */}
- <div className="relative flex max-h-[calc(100dvh_-_2rem)] min-h-0 grow flex-col overflow-hidden rounded-[24px] bg-white px-5 pb-4 pt-5 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:bg-card dark:shadow-[0_8px_28px_-6px_var(--background)]">
+ <div className="relative flex max-h-[calc(100dvh_-_2rem_-_var(--studio-window-chrome-top,0px))] min-h-0 grow flex-col overflow-hidden rounded-[24px] bg-white px-5 pb-4 pt-5 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:bg-card dark:shadow-[0_8px_28px_-6px_var(--background)]">
<button
type="button"
onClick={onDismiss}
diff --git a/studio/frontend/src/components/tauri/window-titlebar.tsx b/studio/frontend/src/components/tauri/window-titlebar.tsx
index 22debdb171b..7e7cb23c179 100644
--- a/studio/frontend/src/components/tauri/window-titlebar.tsx
+++ b/studio/frontend/src/components/tauri/window-titlebar.tsx
@@ -10,7 +10,7 @@ import { Z_LAYER } from "@/lib/z-layers";
import { LayoutAlignLeftIcon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
import type { Window as TauriWindow } from "@tauri-apps/api/window";
-import { ArrowLeft, ArrowRight, Copy, Minus, Square, X } from "lucide-react";
+import { ArrowLeft, ArrowRight } from "lucide-react";
import {
type MouseEvent,
type PointerEvent,
@@ -75,6 +75,65 @@ async function getAppWindow(): Promise<TauriWindow> {
return getCurrentWindow();
}
+/** Windows' 10-DIP caption glyph, snapped to device pixels to stay crisp at fractional scales. */
+function CaptionGlyph({
+ kind,
+}: {
+ kind: "minimize" | "maximize" | "restore" | "close";
+}): ReactElement {
+ const [scale, setScale] = useState(() => window.devicePixelRatio || 1);
+ useEffect(() => {
+ const update = () => setScale(window.devicePixelRatio || 1);
+ window.addEventListener("resize", update);
+ return () => window.removeEventListener("resize", update);
+ }, []);
+ const pixels = Math.round(10 * scale);
+ const stroke = (Math.max(1, Math.round(scale)) * 10) / pixels;
+ const inset = stroke / 2;
+ const edge = 10 - inset;
+ return (
+ <svg
+ aria-hidden="true"
+ width={pixels / scale}
+ height={pixels / scale}
+ viewBox="0 0 10 10"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={stroke}
+ className="shrink-0"
+ >
+ {kind === "minimize" && <path d="M0 5h10" />}
+ {kind === "maximize" && (
+ <rect
+ x={inset}
+ y={inset}
+ width={10 - stroke}
+ height={10 - stroke}
+ rx="0.7"
+ />
+ )}
+ {/* Windows puts the front window bottom-left. */}
+ {kind === "restore" && (
+ <>
+ <path d={`M2.5 2.5V${inset}H${edge}V7.5H7.5`} />
+ <rect
+ x={inset}
+ y="2.5"
+ width={7.5 - inset}
+ height={7.5 - inset}
+ rx="0.7"
+ />
+ </>
+ )}
+ {kind === "close" && (
+ <path
+ d={`M${inset} ${inset}L${edge} ${edge}M${edge} ${inset}L${inset} ${edge}`}
+ />
+ )}
+ </svg>
+ );
+}
+
function WindowControlButton({
label,
className,
@@ -93,7 +152,7 @@ function WindowControlButton({
title={label}
onClick={onClick}
className={cn(
- "relative z-[80] inline-flex h-[26px] w-[26px] shrink-0 items-center justify-center rounded-[10px] text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-foreground dark:hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring",
+ "relative z-[80] inline-flex h-full w-[46px] shrink-0 items-center justify-center transition-colors hover:bg-nav-surface-hover focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-ring",
className,
)}
>
@@ -121,11 +180,16 @@ export function DesktopTitlebarNavigation({
// size while the slot holding them scales.
const buttonClass =
"inline-flex size-[30px] shrink-0 items-center justify-center rounded-[10px] text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring";
+ const customTitlebar = shouldUseCustomWindowTitlebar();
+ const iconClass = customTitlebar
+ ? "size-[18px]"
+ : "size-icon !size-[calc(var(--icon-size)+1px)]";
return (
<div
className={cn(
- "flex mt-[var(--studio-titlebar-navigation-margin-top,0px)] translate-y-[var(--studio-titlebar-navigation-offset-y,0px)] items-center gap-0.5",
+ "flex mt-[var(--studio-titlebar-navigation-margin-top,0px)] translate-y-[var(--studio-titlebar-navigation-offset-y,0px)] items-center",
+ customTitlebar ? "gap-[4px]" : "gap-0.5",
className,
)}
role="toolbar"
@@ -147,7 +211,7 @@ export function DesktopTitlebarNavigation({
<HugeiconsIcon
icon={LayoutAlignLeftIcon}
strokeWidth={1.75}
- className="size-icon !size-[calc(var(--icon-size)+1px)]"
+ className={iconClass}
/>
</button>
) : (
@@ -170,7 +234,7 @@ export function DesktopTitlebarNavigation({
<ArrowLeft
aria-hidden="true"
strokeWidth={1.75}
- className="size-icon !size-[calc(var(--icon-size)+1px)]"
+ className={iconClass}
/>
</button>
<button
@@ -188,7 +252,7 @@ export function DesktopTitlebarNavigation({
<ArrowRight
aria-hidden="true"
strokeWidth={1.75}
- className="size-icon !size-[calc(var(--icon-size)+1px)]"
+ className={iconClass}
/>
</button>
</div>
@@ -202,6 +266,7 @@ export function WindowTitlebar({
}): ReactElement | null {
const [enabled] = useState(shouldUseCustomWindowTitlebar);
const [maximized, setMaximized] = useState(false);
+ const [focused, setFocused] = useState(true);
const { pinned, togglePinned } = useSidebarPin();
// Outside SidebarProvider, so read the same media query the provider does.
const isMobile = useIsMobileShell();
@@ -225,7 +290,7 @@ export function WindowTitlebar({
showSidebarSurface && !pinned
? "max(7rem, calc(7rem * var(--ui-space-scale, 1)))"
: sidebarWidth;
- const contentBorderLeft = pinned ? `calc(${sidebarWidth} + 12px)` : "0px";
+ const cornerLeft = `calc(${sidebarWidth} - 1px)`;
const refreshMaximized = useCallback(async () => {
if (!enabled) {
@@ -271,7 +336,8 @@ export function WindowTitlebar({
unlistenResize = await appWindow.onResized(() => {
scheduleMaximizedRefresh();
});
- unlistenFocus = await appWindow.onFocusChanged(() => {
+ unlistenFocus = await appWindow.onFocusChanged(({ payload }) => {
+ setFocused(payload);
scheduleMaximizedRefresh();
});
} catch {
@@ -365,24 +431,22 @@ export function WindowTitlebar({
// document element, where it would restyle the whole document once per drag frame.
data-titlebar-live-width-scope=""
aria-hidden="true"
- className="pointer-events-none absolute inset-x-0 top-[var(--studio-custom-titlebar-height)] z-[45] h-3"
+ className="pointer-events-none absolute inset-x-0 top-[var(--studio-custom-titlebar-height)] z-[45] h-[12px]"
>
{pinned && (
<div
- className="absolute top-0 size-3 -translate-x-px bg-sidebar"
- style={{ left: sidebarWidth }}
+ className="absolute top-0 size-[12px] bg-[radial-gradient(circle_at_100%_100%,transparent_11px,var(--color-sidebar)_12px)]"
+ style={{ left: cornerLeft }}
/>
)}
+ {/* One border for edge and corner: it snaps to device pixels where a 1px box blurs. */}
<div
- className="absolute top-0 h-px bg-sidebar-border"
- style={{ left: contentBorderLeft, right: 0 }}
+ className={cn(
+ "absolute top-0 right-0 h-[12px] border-t border-sidebar-border",
+ pinned && "rounded-tl-[12px] border-l",
+ )}
+ style={{ left: pinned ? cornerLeft : 0 }}
/>
- {pinned && (
- <div
- className="absolute top-0 size-3 -translate-x-px rounded-tl-[12px] border-l border-t border-sidebar-border bg-background"
- style={{ left: sidebarWidth }}
- />
- )}
</div>
)}
<header
@@ -395,10 +459,8 @@ export function WindowTitlebar({
>
{showSidebarSurface && (
<div
- className={cn(
- "pointer-events-auto absolute left-0 top-0 flex h-full min-w-0 items-center",
- "pl-4",
- )}
+ // Glyph in the sidebar's icon column, over New chat's pencil: 19px in, less 6px padding.
+ className="pointer-events-auto absolute left-0 top-0 flex h-full min-w-0 items-center pl-[calc(4.75*var(--spacing)-6px)]"
style={{ width: titlebarNavigationWidth }}
onMouseDown={handleDragMouseDown}
onDoubleClick={handleDragDoubleClick}
@@ -414,14 +476,17 @@ export function WindowTitlebar({
className="pointer-events-auto absolute top-0 h-full"
style={{
left: titlebarNavigationWidth,
- right: "var(--studio-window-control-inset,112px)",
+ right: "var(--studio-window-control-inset,138px)",
}}
onMouseDown={handleDragMouseDown}
onDoubleClick={handleDragDoubleClick}
aria-hidden="true"
/>
<div
- className="pointer-events-auto absolute right-1 top-0 flex h-full items-center gap-0.5"
+ className={cn(
+ "pointer-events-auto absolute right-0 top-0 flex h-full",
+ focused ? "text-foreground" : "text-muted-foreground",
+ )}
role="toolbar"
aria-label="Window controls"
>
@@ -429,12 +494,7 @@ export function WindowTitlebar({
label="Minimize window"
onClick={() => runWindowAction((appWindow) => appWindow.minimize())}
>
- <Minus
- aria-hidden="true"
- absoluteStrokeWidth
- strokeWidth={1.5}
- size={16}
- />
+ <CaptionGlyph kind="minimize" />
</WindowControlButton>
<WindowControlButton
label={maximized ? "Restore window" : "Maximize window"}
@@ -442,22 +502,7 @@ export function WindowTitlebar({
runWindowAction((appWindow) => appWindow.toggleMaximize())
}
>
- {maximized ? (
- <Copy
- aria-hidden="true"
- absoluteStrokeWidth
- strokeWidth={1.5}
- size={14}
- className="rotate-180"
- />
- ) : (
- <Square
- aria-hidden="true"
- absoluteStrokeWidth
- strokeWidth={1.5}
- size={14}
- />
- )}
+ <CaptionGlyph kind={maximized ? "restore" : "maximize"} />
</WindowControlButton>
<WindowControlButton
label="Close window"
@@ -467,71 +512,71 @@ export function WindowTitlebar({
// answer it before the user does. The wait this covers is the reap, and Rust's
// app-closing arrives well ahead of that.
onClick={() => runWindowAction((appWindow) => appWindow.close())}
- className="hover:bg-destructive/10 hover:text-destructive focus-visible:ring-destructive/70 dark:hover:bg-destructive/20 dark:hover:text-destructive"
+ className="hover:bg-[#c42b1c] hover:text-white active:bg-[#c42b1c]/90"
>
- <X
- aria-hidden="true"
- absoluteStrokeWidth
- strokeWidth={1.5}
- size={20}
- />
+ <CaptionGlyph kind="close" />
</WindowControlButton>
</div>
</header>
- <div
- aria-hidden="true"
- className="pointer-events-auto fixed inset-x-2 top-0 h-1 cursor-n-resize"
- style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
- onPointerDown={handleResizePointerDown("North")}
- />
- {/* resize grips stay above dialogs and notifications. */}
- <div
- aria-hidden="true"
- className="pointer-events-auto fixed inset-x-2 bottom-0 h-1 cursor-s-resize"
- style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
- onPointerDown={handleResizePointerDown("South")}
- />
- <div
- aria-hidden="true"
- className="pointer-events-auto fixed inset-y-2 left-0 w-1 cursor-w-resize"
- style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
- onPointerDown={handleResizePointerDown("West")}
- />
- <div
- aria-hidden="true"
- className="pointer-events-auto fixed inset-y-2 right-0 w-1 cursor-e-resize"
- style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
- onPointerDown={handleResizePointerDown("East")}
- />
- <div
- aria-hidden="true"
- className="pointer-events-auto fixed left-0 top-0 size-3 cursor-nw-resize"
- style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
- onPointerDown={handleResizePointerDown("NorthWest")}
- />
- <div
- aria-hidden="true"
- className="pointer-events-auto fixed right-0 top-0 size-3 cursor-ne-resize"
- style={{
- zIndex: Z_LAYER.WINDOW_RESIZE_EDGE,
- // keep the resize corner outside the close button.
- clipPath:
- "polygon(0 0, 100% 0, 100% 100%, calc(100% - 0.25rem) 100%, calc(100% - 0.25rem) 0.25rem, 0 0.25rem)",
- }}
- onPointerDown={handleResizePointerDown("NorthEast")}
- />
- <div
- aria-hidden="true"
- className="pointer-events-auto fixed bottom-0 left-0 size-3 cursor-sw-resize"
- style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
- onPointerDown={handleResizePointerDown("SouthWest")}
- />
- <div
- aria-hidden="true"
- className="pointer-events-auto fixed bottom-0 right-0 size-3 cursor-se-resize"
- style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
- onPointerDown={handleResizePointerDown("SouthEast")}
- />
+ {/* Maximized: no edges to resize, and the corner belongs to Close. */}
+ {!maximized && (
+ <>
+ <div
+ aria-hidden="true"
+ className="pointer-events-auto fixed inset-x-2 top-0 h-1 cursor-n-resize"
+ style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
+ onPointerDown={handleResizePointerDown("North")}
+ />
+ {/* resize grips stay above dialogs and notifications. */}
+ <div
+ aria-hidden="true"
+ className="pointer-events-auto fixed inset-x-2 bottom-0 h-1 cursor-s-resize"
+ style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
+ onPointerDown={handleResizePointerDown("South")}
+ />
+ <div
+ aria-hidden="true"
+ className="pointer-events-auto fixed inset-y-2 left-0 w-1 cursor-w-resize"
+ style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
+ onPointerDown={handleResizePointerDown("West")}
+ />
+ <div
+ aria-hidden="true"
+ className="pointer-events-auto fixed inset-y-2 right-0 w-1 cursor-e-resize"
+ style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
+ onPointerDown={handleResizePointerDown("East")}
+ />
+ <div
+ aria-hidden="true"
+ className="pointer-events-auto fixed left-0 top-0 size-3 cursor-nw-resize"
+ style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
+ onPointerDown={handleResizePointerDown("NorthWest")}
+ />
+ <div
+ aria-hidden="true"
+ className="pointer-events-auto fixed right-0 top-0 size-3 cursor-ne-resize"
+ style={{
+ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE,
+ // keep the resize corner outside the close button.
+ clipPath:
+ "polygon(0 0, 100% 0, 100% 100%, calc(100% - 0.25rem) 100%, calc(100% - 0.25rem) 0.25rem, 0 0.25rem)",
+ }}
+ onPointerDown={handleResizePointerDown("NorthEast")}
+ />
+ <div
+ aria-hidden="true"
+ className="pointer-events-auto fixed bottom-0 left-0 size-3 cursor-sw-resize"
+ style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
+ onPointerDown={handleResizePointerDown("SouthWest")}
+ />
+ <div
+ aria-hidden="true"
+ className="pointer-events-auto fixed bottom-0 right-0 size-3 cursor-se-resize"
+ style={{ zIndex: Z_LAYER.WINDOW_RESIZE_EDGE }}
+ onPointerDown={handleResizePointerDown("SouthEast")}
+ />
+ </>
+ )}
</>
);
}
diff --git a/studio/frontend/src/components/ui/tooltip.tsx b/studio/frontend/src/components/ui/tooltip.tsx
index b9cac4d7ca0..d2482f3dab5 100644
--- a/studio/frontend/src/components/ui/tooltip.tsx
+++ b/studio/frontend/src/components/ui/tooltip.tsx
@@ -268,6 +268,7 @@ function TooltipContent({
variant = "default",
className,
sideOffset = 0,
+ collisionPadding = 8,
children,
ref,
...props
@@ -297,6 +298,7 @@ function TooltipContent({
ref={contentRef}
data-slot="tooltip-content"
sideOffset={sideOffset}
+ collisionPadding={collisionPadding}
className={cn(
"z-[999999] w-fit max-w-xs",
variant === "default" && "tooltip-compact",
diff --git a/studio/frontend/src/features/audio/audio-page.tsx b/studio/frontend/src/features/audio/audio-page.tsx
index 476e596b602..66370083244 100644
--- a/studio/frontend/src/features/audio/audio-page.tsx
+++ b/studio/frontend/src/features/audio/audio-page.tsx
@@ -39,6 +39,7 @@ import { Button } from "@/components/ui/button";
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { Input } from "@/components/ui/input";
import { Progress } from "@/components/ui/progress";
+import { useSidebar } from "@/components/ui/sidebar";
import { Textarea } from "@/components/ui/textarea";
import { usePlatformStore } from "@/config/env";
import {
@@ -293,6 +294,7 @@ export function AudioPage({
const initialReadySent = useRef(false);
// Clear the floating sidebar toggle on mobile.
const isMobileShell = useIsMobileShell();
+ const { pinned } = useSidebar();
const [mode, setMode] = useState<CreateMode>("speak");
const { rootStyle: railRootStyle } = useMediaRailWidth("audio");
const tourSteps = useMemo(() => buildAudioTourSteps({ mode }), [mode]);
@@ -2676,7 +2678,12 @@ export function AudioPage({
<div
className={cn(
"pointer-events-none flex h-full min-w-0 items-start overflow-hidden @[50rem]:border-r @[50rem]:border-border/60",
- isMobileShell ? "pl-12" : "pl-[var(--studio-media-header-left-inset,1.5rem)]",
+ isMobileShell
+ ? "pl-12"
+ : // Collapsed desktop sidebar: clear the titlebar buttons, as Chat does.
+ !pinned && isTauri
+ ? "pl-[var(--studio-collapsed-chat-controls-inset,0.75rem)]"
+ : "pl-[var(--studio-media-header-left-inset,1.5rem)]",
)}
>
{/* A long resident model name must yield to the mode pill instead of painting over it. */}
diff --git a/studio/frontend/src/features/chat/chat-page.tsx b/studio/frontend/src/features/chat/chat-page.tsx
index 070bbe76131..8eead5a3ff8 100644
--- a/studio/frontend/src/features/chat/chat-page.tsx
+++ b/studio/frontend/src/features/chat/chat-page.tsx
@@ -826,7 +826,11 @@ function ComparePane({
)}
>
{header}
- <div className="flex min-h-0 min-w-0 flex-1 basis-0 flex-col overflow-hidden [&_.aui-thread-viewport]:px-6 lg:[&_.aui-thread-viewport]:px-10">
+ <div className="relative flex min-h-0 min-w-0 flex-1 basis-0 flex-col overflow-hidden [&_.aui-thread-viewport]:px-6 lg:[&_.aui-thread-viewport]:px-10">
+ <div
+ aria-hidden={true}
+ className="compare-pane-fade pointer-events-none absolute top-0 left-0 right-[var(--thread-scrollbar-gutter,10px)] z-20 h-6 bg-gradient-to-b from-background to-transparent"
+ />
<ChatRuntimeProvider
modelType={modelType}
pairId={pairId}
@@ -1097,7 +1101,9 @@ function GeneralCompareHeader({
side === "left"
? pinned
? "pl-12 pr-3 md:pl-2"
- : "pl-12 pr-3 md:pl-[calc(0.5rem*var(--ui-space-scale,1)+max(0px,var(--studio-mac-traffic-light-inset,0px)-var(--sidebar-width-icon,3rem)))]"
+ : isTauri
+ ? "pl-12 pr-3 md:pl-[var(--studio-collapsed-chat-controls-inset,0.75rem)]"
+ : "pl-12 pr-3 md:pl-[calc(0.5rem*var(--ui-space-scale,1)+max(0px,var(--studio-mac-traffic-light-inset,0px)-var(--sidebar-width-icon,3rem)))]"
: "pl-3 pr-[calc(3rem*var(--ui-space-scale,1)+var(--studio-chat-header-right-inset,var(--studio-window-control-inset,0px)))]",
)}
>
@@ -4199,12 +4205,12 @@ export function ChatPage({
{view.mode !== "compare" && (
<div
aria-hidden
- className="chat-header-fade pointer-events-none absolute left-0 right-[calc(10px*var(--ui-space-scale,1))] top-[calc(var(--studio-content-top-inset,0px)+var(--studio-chat-header-height,48px)+var(--studio-chat-notice-height,0px))] z-20 h-6 bg-gradient-to-b from-background to-transparent"
+ className="chat-header-fade pointer-events-none absolute left-0 right-[var(--thread-scrollbar-gutter,10px)] top-[calc(var(--studio-content-top-inset,0px)+var(--studio-chat-header-height,48px)+var(--studio-chat-notice-height,0px))] z-20 h-6 bg-gradient-to-b from-background to-transparent"
/>
)}
<div
className={cn(
- "pointer-events-none absolute top-[var(--studio-content-top-inset,0px)] left-0 right-[calc(10px*var(--ui-space-scale,1))] z-40 flex h-[var(--studio-chat-header-height,48px)] shrink-0 items-start bg-background pt-[var(--studio-chat-header-padding-top,11px)] pr-[calc(0.5rem*var(--ui-space-scale,1)+var(--studio-chat-header-right-inset,var(--studio-window-control-inset,0px)))]",
+ "pointer-events-none absolute top-[var(--studio-content-top-inset,0px)] left-0 right-[var(--thread-scrollbar-gutter,10px)] z-40 flex h-[var(--studio-chat-header-height,48px)] shrink-0 items-start bg-background pt-[var(--studio-chat-header-padding-top,11px)] pr-[calc(0.5rem*var(--ui-space-scale,1)+var(--studio-chat-header-right-inset,var(--studio-window-control-inset,0px)))]",
isMobile
? "pl-12"
: pinned
@@ -4213,7 +4219,7 @@ export function ChatPage({
? "pl-[var(--studio-collapsed-chat-controls-inset,0.75rem)]"
: "pl-[calc(0.5rem*var(--ui-space-scale,1)+max(0px,var(--studio-mac-traffic-light-inset,0px)-var(--sidebar-width-icon,3rem)))]",
view.mode === "compare" &&
- "right-[calc(10px*var(--ui-space-scale,1))] left-auto w-auto bg-transparent pl-0 pr-[calc(0.5rem*var(--ui-space-scale,1)+var(--studio-chat-header-right-inset,var(--studio-window-control-inset,0px)))]",
+ "right-[var(--thread-scrollbar-gutter,10px)] left-auto w-auto bg-transparent pl-0 pr-[calc(0.5rem*var(--ui-space-scale,1)+var(--studio-chat-header-right-inset,var(--studio-window-control-inset,0px)))]",
)}
>
<div className="pointer-events-auto flex items-center gap-1">
diff --git a/studio/frontend/src/features/chat/components/chat-model-notice.tsx b/studio/frontend/src/features/chat/components/chat-model-notice.tsx
index 0bdb36b5433..86699d0f421 100644
--- a/studio/frontend/src/features/chat/components/chat-model-notice.tsx
+++ b/studio/frontend/src/features/chat/components/chat-model-notice.tsx
@@ -86,12 +86,12 @@ export function ChatModelNotice({
const label = compareModelDisplayName(createdModel.modelId);
return (
// Positioned, not in flow. The chat header is `absolute ... z-40` with an opaque `bg-background`,
- // so an in-flow sibling starts at y=0 UNDER it and the bar is invisible bar the 10px the
- // header's `right-[calc(10px*var(--ui-space-scale,1))]` leaves uncovered. Offset by the same header height the drop overlay
+ // so an in-flow sibling starts at y=0 UNDER it and the bar is invisible bar the scrollbar gutter
+ // the header leaves uncovered. Offset by the same header height the drop overlay
// and the header fade use, above the fade (z-20) and below the header (z-40).
<div
data-chat-model-notice=""
- className="absolute left-0 right-[calc(10px*var(--ui-space-scale,1))] top-[calc(var(--studio-content-top-inset,0px)+var(--studio-chat-header-height,48px))] z-30 flex h-[var(--studio-chat-notice-height,2.25rem)] items-center gap-2 border-b border-border/60 bg-muted px-4 text-ui-12 text-muted-foreground"
+ className="absolute left-0 right-[var(--thread-scrollbar-gutter,10px)] top-[calc(var(--studio-content-top-inset,0px)+var(--studio-chat-header-height,48px))] z-30 flex h-[var(--studio-chat-notice-height,2.25rem)] items-center gap-2 border-b border-border/60 bg-muted px-4 text-ui-12 text-muted-foreground"
>
<span className="min-w-0 truncate">
This chat was started on <span className="font-medium">{label}</span>.
diff --git a/studio/frontend/src/features/chat/components/chat-search-dialog.tsx b/studio/frontend/src/features/chat/components/chat-search-dialog.tsx
index ab63f3c8f5a..f7c9f5665e6 100644
--- a/studio/frontend/src/features/chat/components/chat-search-dialog.tsx
+++ b/studio/frontend/src/features/chat/components/chat-search-dialog.tsx
@@ -128,7 +128,7 @@ export function ChatSearchDialog() {
opener.focus({ preventScroll: true });
}
}}
- className="chat-search-surface rounded-3xl! max-sm:rounded-none! top-1/2 -translate-y-1/2 w-[calc(635px*var(--ui-space-scale,1))] max-w-[calc(100%-2rem)] gap-0 p-0 ring-0 duration-[180ms] ease-[cubic-bezier(0.16,1,0.3,1)] sm:max-w-[calc(635px*var(--ui-space-scale,1))]"
+ className="chat-search-surface rounded-3xl! max-sm:rounded-none! top-[calc(50%+var(--studio-window-chrome-top,0px)/2)] -translate-y-1/2 w-[calc(635px*var(--ui-space-scale,1))] max-w-[calc(100%-2rem)] gap-0 p-0 ring-0 duration-[180ms] ease-[cubic-bezier(0.16,1,0.3,1)] sm:max-w-[calc(635px*var(--ui-space-scale,1))]"
overlayClassName="bg-transparent supports-backdrop-filter:backdrop-blur-none"
>
<Command className="rounded-3xl p-0" shouldFilter={false}>
diff --git a/studio/frontend/src/features/chat/projects-page.tsx b/studio/frontend/src/features/chat/projects-page.tsx
index d385b376207..21c7ce36a7a 100644
--- a/studio/frontend/src/features/chat/projects-page.tsx
+++ b/studio/frontend/src/features/chat/projects-page.tsx
@@ -572,7 +572,7 @@ export function ProjectsPage() {
}
return (
- <main className="mx-auto w-full max-w-5xl 4xl:max-w-6xl px-6 pb-10 pt-16 max-sm:px-4 max-sm:pt-10 font-heading sm:px-10">
+ <main className="mx-auto w-full max-w-5xl 4xl:max-w-6xl px-6 pb-10 pt-8 max-sm:px-4 font-heading sm:px-10">
<GuidedTour {...tour.tourProps} />
{/* Global import file input */}
<input
diff --git a/studio/frontend/src/features/data-recipes/pages/data-recipes-page.tsx b/studio/frontend/src/features/data-recipes/pages/data-recipes-page.tsx
index 43a9a3f30a9..0737365900e 100644
--- a/studio/frontend/src/features/data-recipes/pages/data-recipes-page.tsx
+++ b/studio/frontend/src/features/data-recipes/pages/data-recipes-page.tsx
@@ -426,7 +426,7 @@ export function DataRecipesPage(): ReactElement {
<h1 className="text-ui-30 font-semibold leading-[1.04] tracking-[-0.028em] text-foreground sm:text-ui-34">
Data Recipes
</h1>
- <p className="mt-1 text-sm text-muted-foreground">
+ <p className="mt-0.5 text-sm text-muted-foreground">
Create and manage local recipe workflows.
</p>
</div>
diff --git a/studio/frontend/src/features/hub/catalog/models-table.tsx b/studio/frontend/src/features/hub/catalog/models-table.tsx
index d2135f27f15..fdd2a99c5d8 100644
--- a/studio/frontend/src/features/hub/catalog/models-table.tsx
+++ b/studio/frontend/src/features/hub/catalog/models-table.tsx
@@ -213,7 +213,7 @@ export function HubListHeader({
return (
<div
- className="flex items-center justify-between gap-4 pb-3"
+ className="flex flex-wrap items-center justify-between gap-x-4 gap-y-2 pb-3"
aria-label={accessibleLabel}
>
<div className="flex min-w-0 items-center gap-1.5">
@@ -268,9 +268,7 @@ export function HubListHeader({
)}
</div>
{(actions || onViewChange) && (
- // min-w-0 (not shrink-0) so shrinkable actions (the On-device filter
- // pills) compress before the title is forced onto two lines.
- <div className="flex min-w-0 items-center gap-2">
+ <div className="ml-auto flex min-w-0 flex-wrap items-center justify-end gap-2">
{actions}
{onViewChange && (
<div
diff --git a/studio/frontend/src/features/images/images-page.tsx b/studio/frontend/src/features/images/images-page.tsx
index 67a1d30f67e..49b9b74daa0 100644
--- a/studio/frontend/src/features/images/images-page.tsx
+++ b/studio/frontend/src/features/images/images-page.tsx
@@ -4604,8 +4604,7 @@ export function ImagesPage({
);
return (
- // The chat-style layout gives this page no outer top inset, so clear the custom titlebar here as chat does.
- // 34px on win/linux, 0 under macOS's native one.
+ // The chat-style layout gives this page no outer top inset, so it applies the content inset itself, as chat does.
<div
{...{ [MEDIA_RAIL_ROOT_ATTR]: "" }}
style={railRootStyle}
diff --git a/studio/frontend/src/features/library/chats/chats-toolbar.tsx b/studio/frontend/src/features/library/chats/chats-toolbar.tsx
index bc77a4595b5..7720292e982 100644
--- a/studio/frontend/src/features/library/chats/chats-toolbar.tsx
+++ b/studio/frontend/src/features/library/chats/chats-toolbar.tsx
@@ -406,7 +406,8 @@ export function ChatsToolbar({
<HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-5" />
</button>
))}
- <label className="relative ml-2 flex h-9 w-[min(15rem,24vw)] min-w-40 items-center rounded-full border border-border px-4 focus-within:border-ring dark:border-transparent dark:bg-card dark:focus-within:border-ring">
+ {/* Sized by the header row (cqw), not the window, as in LibraryToolbar. */}
+ <label className="relative ml-2 flex h-9 w-[clamp(10rem,calc(100cqw-30rem),min(15rem,24vw))] min-w-40 items-center rounded-full border border-border px-4 focus-within:border-ring dark:border-transparent dark:bg-card dark:focus-within:border-ring">
<HugeiconsIcon
icon={Search01Icon}
strokeWidth={1.75}
diff --git a/studio/frontend/src/features/library/components/library-header.tsx b/studio/frontend/src/features/library/components/library-header.tsx
index d1f725279f5..33daf095407 100644
--- a/studio/frontend/src/features/library/components/library-header.tsx
+++ b/studio/frontend/src/features/library/components/library-header.tsx
@@ -208,7 +208,7 @@ export function LibraryHeader({
<>
{/* No height of its own: the controls hang from it over the title row, then stick level with
the tabs, whose row is as tall as they are plus its padding. */}
- <div className="pointer-events-none sticky top-4 z-30 flex h-0 justify-end">
+ <div className="@container pointer-events-none sticky top-4 z-30 flex h-0 justify-end">
<div ref={controlsRef} className="pointer-events-auto">
{controls}
</div>
diff --git a/studio/frontend/src/features/library/components/library-toolbar.tsx b/studio/frontend/src/features/library/components/library-toolbar.tsx
index 4e10b4bea20..a5984ba1ca1 100644
--- a/studio/frontend/src/features/library/components/library-toolbar.tsx
+++ b/studio/frontend/src/features/library/components/library-toolbar.tsx
@@ -357,8 +357,9 @@ export function LibraryToolbar({
<HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-5" />
</button>
))}
- {/* Outlined on light; a lighter fill than the page on dark, where an outline reads as a hole. */}
- <label className="relative ml-2 flex h-9 w-[min(15rem,24vw)] min-w-40 items-center rounded-full border border-border px-4 focus-within:border-ring dark:border-transparent dark:bg-card dark:focus-within:border-ring">
+ {/* Outlined on light; a lighter fill than the page on dark, where an outline reads as a hole.
+ Sized by the header row (cqw), not the window, so it never reaches the title. */}
+ <label className="relative ml-2 flex h-9 w-[clamp(10rem,calc(100cqw-30rem),min(15rem,24vw))] min-w-40 items-center rounded-full border border-border px-4 focus-within:border-ring dark:border-transparent dark:bg-card dark:focus-within:border-ring">
<HugeiconsIcon
icon={Search01Icon}
strokeWidth={1.75}
diff --git a/studio/frontend/src/features/library/library-page.tsx b/studio/frontend/src/features/library/library-page.tsx
index 7eeaf61f713..586cf497ddb 100644
--- a/studio/frontend/src/features/library/library-page.tsx
+++ b/studio/frontend/src/features/library/library-page.tsx
@@ -679,7 +679,8 @@ function LibraryView({ search }: { search: LibrarySearch }) {
))}
</nav>
) : (
- <h1 className="text-[calc(1.6875rem*var(--ui-font-scale,1))] font-semibold leading-[1.04] tracking-[-0.028em] text-foreground">
+ // truncate clips at the padding box, which the y overhangs; the margins give the padding back.
+ <h1 className="-my-[0.15em] min-w-0 truncate py-[0.15em] pr-[0.08em] text-[calc(1.6875rem*var(--ui-font-scale,1))] font-semibold leading-[1.04] tracking-[-0.028em] text-foreground">
{t("shell.navigation.library")}
</h1>
);
diff --git a/studio/frontend/src/features/settings/components/decision-api-section.tsx b/studio/frontend/src/features/settings/components/decision-api-section.tsx
index 168d907ed60..5426d2f88fe 100644
--- a/studio/frontend/src/features/settings/components/decision-api-section.tsx
+++ b/studio/frontend/src/features/settings/components/decision-api-section.tsx
@@ -366,7 +366,6 @@ export function DecisionApiSection(): ReactElement | null {
})
: t("settings.apiKeys.decisionApi.enableDescription")
}
- alignTop={true}
>
<Switch
checked={enabled}
diff --git a/studio/frontend/src/features/settings/components/documents-rag-section.tsx b/studio/frontend/src/features/settings/components/documents-rag-section.tsx
index dfda5fbad67..6e4fab12dd2 100644
--- a/studio/frontend/src/features/settings/components/documents-rag-section.tsx
+++ b/studio/frontend/src/features/settings/components/documents-rag-section.tsx
@@ -352,8 +352,73 @@ export function DocumentsRagSection(): ReactElement {
defaultModel: embeddingModel?.defaultEmbeddingModel ?? "",
})}
className="max-[360px]:flex-col max-[360px]:items-stretch max-[360px]:gap-3"
+ below={
+ <div className="flex flex-col items-end gap-1 max-[360px]:w-full">
+ {embeddingModelError ? (
+ <span className="max-w-[calc(300px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
+ {embeddingModelError}
+ </span>
+ ) : null}
+ <div className="flex min-h-7 w-full items-center justify-between gap-3">
+ <span className="flex min-w-0 items-center gap-2 text-xs text-muted-foreground">
+ {statusTone ? (
+ <span
+ className={cn(
+ "size-1.5 shrink-0 rounded-full",
+ statusTone === "pending"
+ ? "animate-pulse bg-current"
+ : statusTone === "ready"
+ ? "bg-emerald-500"
+ : "bg-destructive",
+ )}
+ />
+ ) : null}
+ <span className="truncate">{statusText}</span>
+ </span>
+ {forceCandidate ? (
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7 shrink-0 px-2.5 text-xs"
+ disabled={isSavingEmbeddingModel}
+ onClick={() => void applyEmbeddingModel(forceCandidate, true)}
+ >
+ {t("settings.general.rag.saveAnyway")}
+ </Button>
+ ) : canDownload ? (
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7 shrink-0 px-2.5 text-xs"
+ disabled={downloading || isSavingEmbeddingModel}
+ onClick={() => resolution && void startDownload(resolution)}
+ >
+ {downloading ? <Spinner className="mr-1.5" /> : null}
+ {t("settings.general.rag.download")}
+ </Button>
+ ) : null}
+ {/* Outside the chain above: saving a new model does not release the old one, so while Download shows the previous model can still be resident. */}
+ {embeddingModel?.backendLoaded ? (
+ <Button
+ variant="outline"
+ size="sm"
+ className="h-7 shrink-0 px-2.5 text-xs"
+ disabled={isSavingEmbeddingModel}
+ onClick={() => void unload()}
+ >
+ {t("settings.general.rag.unload")}
+ </Button>
+ ) : null}
+ </div>
+ <span className="max-w-[calc(300px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground">
+ {t("settings.general.rag.reindexWarning")}
+ </span>
+ </div>
+ }
>
- <div className="flex flex-col items-end gap-1 max-[360px]:w-full">
+ {/* Sets the trigger's width, since its own w-full outranks the 260px
+ class: 300px, as wide as the notes below it. */}
+ <div className="w-[calc(300px*var(--ui-space-scale,1))] max-[360px]:w-full">
<EmbeddingModelPicker
value={embeddingModel?.embeddingModel ?? ""}
onSelect={(model) => void applyEmbeddingModel(model, false)}
@@ -364,65 +429,6 @@ export function DocumentsRagSection(): ReactElement {
busy={isSavingEmbeddingModel}
className="w-[calc(260px*var(--ui-space-scale,1))] max-[360px]:w-full"
/>
- {embeddingModelError ? (
- <span className="max-w-[calc(300px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
- {embeddingModelError}
- </span>
- ) : null}
- <div className="flex min-h-7 w-full items-center justify-between gap-3">
- <span className="flex min-w-0 items-center gap-2 text-xs text-muted-foreground">
- {statusTone ? (
- <span
- className={cn(
- "size-1.5 shrink-0 rounded-full",
- statusTone === "pending"
- ? "animate-pulse bg-current"
- : statusTone === "ready"
- ? "bg-emerald-500"
- : "bg-destructive",
- )}
- />
- ) : null}
- <span className="truncate">{statusText}</span>
- </span>
- {forceCandidate ? (
- <Button
- variant="outline"
- size="sm"
- className="h-7 shrink-0 px-2.5 text-xs"
- disabled={isSavingEmbeddingModel}
- onClick={() => void applyEmbeddingModel(forceCandidate, true)}
- >
- {t("settings.general.rag.saveAnyway")}
- </Button>
- ) : canDownload ? (
- <Button
- variant="outline"
- size="sm"
- className="h-7 shrink-0 px-2.5 text-xs"
- disabled={downloading || isSavingEmbeddingModel}
- onClick={() => resolution && void startDownload(resolution)}
- >
- {downloading ? <Spinner className="mr-1.5" /> : null}
- {t("settings.general.rag.download")}
- </Button>
- ) : null}
- {/* Outside the chain above: saving a new model does not release the old one, so while Download shows the previous model can still be resident. */}
- {embeddingModel?.backendLoaded ? (
- <Button
- variant="outline"
- size="sm"
- className="h-7 shrink-0 px-2.5 text-xs"
- disabled={isSavingEmbeddingModel}
- onClick={() => void unload()}
- >
- {t("settings.general.rag.unload")}
- </Button>
- ) : null}
- </div>
- <span className="max-w-[calc(300px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground">
- {t("settings.general.rag.reindexWarning")}
- </span>
</div>
</SettingsRow>
</SettingsSection>
diff --git a/studio/frontend/src/features/settings/components/download-transport-row.tsx b/studio/frontend/src/features/settings/components/download-transport-row.tsx
index cca6abe8366..7480d2df309 100644
--- a/studio/frontend/src/features/settings/components/download-transport-row.tsx
+++ b/studio/frontend/src/features/settings/components/download-transport-row.tsx
@@ -102,7 +102,6 @@ export function DownloadTransportRow() {
return (
<SettingsRow
- alignTop={true}
label={t("settings.general.downloads.transport")}
description={t(
partialsResumable
@@ -110,71 +109,75 @@ export function DownloadTransportRow() {
: "settings.general.downloads.transportDescriptionNoResume",
)}
hint={t("settings.general.downloads.transportHint")}
+ below={
+ status || statusReason ? (
+ <div className="flex flex-col items-end gap-1.5">
+ {status ? (
+ <span className="max-w-[calc(280px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground">
+ {status}
+ </span>
+ ) : null}
+ {statusReason ? (
+ <span
+ lang="en"
+ className="max-w-[calc(280px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground/70"
+ >
+ {statusReason}
+ </span>
+ ) : null}
+ </div>
+ ) : null
+ }
>
- <div className="flex flex-col items-end gap-1.5">
- <div
- role="radiogroup"
- aria-label={t("settings.general.downloads.transport")}
- className="hub-tab-toggle inline-flex h-8 items-center rounded-full"
- >
- {OPTIONS.map((opt) => {
- const active = mode === opt.value;
- const disabled = opt.value === "xet" && xetUnavailable;
- return (
- <Tooltip key={opt.value}>
- <TooltipTrigger asChild={true}>
- <button
- type="button"
- role="radio"
- // Indexed for settings search, so the result has somewhere to scroll to.
- data-settings-label={t(opt.labelKey)}
- aria-checked={active}
- aria-disabled={disabled || undefined}
- onClick={() => {
- if (!disabled) setMode(opt.value);
- }}
- className={cn(
- "relative flex h-8 items-center rounded-full px-3 text-xs font-medium transition-colors",
- disabled
- ? "cursor-not-allowed text-muted-foreground/45"
- : active
- ? "hub-tab-toggle-pill text-foreground"
- : "text-muted-foreground hover:text-foreground",
- )}
- >
- <span className="relative z-10">{t(opt.labelKey)}</span>
- </button>
- </TooltipTrigger>
- <TooltipContent
- side="bottom"
- sideOffset={6}
- className="max-w-[calc(260px*var(--ui-space-scale,1))]"
+ <div
+ role="radiogroup"
+ aria-label={t("settings.general.downloads.transport")}
+ className="hub-tab-toggle inline-flex h-8 items-center rounded-full"
+ >
+ {OPTIONS.map((opt) => {
+ const active = mode === opt.value;
+ const disabled = opt.value === "xet" && xetUnavailable;
+ return (
+ <Tooltip key={opt.value}>
+ <TooltipTrigger asChild={true}>
+ <button
+ type="button"
+ role="radio"
+ // Indexed for settings search, so the result has somewhere to scroll to.
+ data-settings-label={t(opt.labelKey)}
+ aria-checked={active}
+ aria-disabled={disabled || undefined}
+ onClick={() => {
+ if (!disabled) setMode(opt.value);
+ }}
+ className={cn(
+ "relative flex h-8 items-center rounded-full px-3 text-xs font-medium transition-colors",
+ disabled
+ ? "cursor-not-allowed text-muted-foreground/45"
+ : active
+ ? "hub-tab-toggle-pill text-foreground"
+ : "text-muted-foreground hover:text-foreground",
+ )}
>
- {disabled && !capabilityPending
- ? xetReason
- : t(
- opt.value === "http" && !partialsResumable
- ? "settings.general.downloads.httpsHintNoResume"
- : opt.hintKey,
- )}
- </TooltipContent>
- </Tooltip>
- );
- })}
- </div>
- {status ? (
- <span className="max-w-[calc(280px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground">
- {status}
- </span>
- ) : null}
- {statusReason ? (
- <span
- lang="en"
- className="max-w-[calc(280px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground/70"
- >
- {statusReason}
- </span>
- ) : null}
+ <span className="relative z-10">{t(opt.labelKey)}</span>
+ </button>
+ </TooltipTrigger>
+ <TooltipContent
+ side="bottom"
+ sideOffset={6}
+ className="max-w-[calc(260px*var(--ui-space-scale,1))]"
+ >
+ {disabled && !capabilityPending
+ ? xetReason
+ : t(
+ opt.value === "http" && !partialsResumable
+ ? "settings.general.downloads.httpsHintNoResume"
+ : opt.hintKey,
+ )}
+ </TooltipContent>
+ </Tooltip>
+ );
+ })}
</div>
</SettingsRow>
);
diff --git a/studio/frontend/src/features/settings/components/hub-settings-section.tsx b/studio/frontend/src/features/settings/components/hub-settings-section.tsx
index 26deb9696ca..7926eef708f 100644
--- a/studio/frontend/src/features/settings/components/hub-settings-section.tsx
+++ b/studio/frontend/src/features/settings/components/hub-settings-section.tsx
@@ -104,6 +104,7 @@ export function HubSettingsSection() {
};
const showEndpointRows = settings?.activeSource !== "modelscope";
+ const sourceFallback = settings && settings.source !== settings.activeSource;
const errorNote = error ? (
<span className="max-w-[calc(300px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{error}
@@ -121,82 +122,82 @@ export function HubSettingsSection() {
return (
<SettingsSection ref={sectionRef} title={t("settings.general.hub.sectionTitle")}>
<SettingsRow
- alignTop={true}
label={t("settings.general.hub.source")}
description={t("settings.general.hub.sourceDescription")}
+ below={
+ sourceFallback || (!showEndpointRows && errorNote) ? (
+ <div className="flex flex-col items-end gap-1">
+ {sourceFallback ? (
+ <span className="max-w-[calc(300px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
+ {t("settings.general.hub.sourceFallback")}
+ </span>
+ ) : null}
+ {showEndpointRows ? null : errorNote}
+ </div>
+ ) : null
+ }
>
- <div className="flex flex-col items-end gap-1">
- <div
- role="radiogroup"
- aria-label={t("settings.general.hub.source")}
- className="hub-tab-toggle inline-flex h-8 items-center rounded-full"
- >
- {SOURCES.map((option) => {
- const active = settings?.source === option.value;
- return (
- <button
- key={option.value}
- type="button"
- role="radio"
- data-settings-label={option.label}
- aria-checked={active}
- disabled={locked}
- onClick={() => {
- if (!active) void saveSource(option.value);
- }}
- className={cn(
- "relative flex h-8 items-center rounded-full px-3 text-xs font-medium transition-colors disabled:cursor-not-allowed",
- active
- ? "hub-tab-toggle-pill text-foreground"
- : "text-muted-foreground hover:text-foreground",
- )}
- >
- <span className="relative z-10">{option.label}</span>
- </button>
- );
- })}
- </div>
- {settings && settings.source !== settings.activeSource ? (
- <span className="max-w-[calc(300px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
- {t("settings.general.hub.sourceFallback")}
- </span>
- ) : null}
- {showEndpointRows ? null : errorNote}
+ <div
+ role="radiogroup"
+ aria-label={t("settings.general.hub.source")}
+ className="hub-tab-toggle inline-flex h-8 items-center rounded-full"
+ >
+ {SOURCES.map((option) => {
+ const active = settings?.source === option.value;
+ return (
+ <button
+ key={option.value}
+ type="button"
+ role="radio"
+ data-settings-label={option.label}
+ aria-checked={active}
+ disabled={locked}
+ onClick={() => {
+ if (!active) void saveSource(option.value);
+ }}
+ className={cn(
+ "relative flex h-8 items-center rounded-full px-3 text-xs font-medium transition-colors disabled:cursor-not-allowed",
+ active
+ ? "hub-tab-toggle-pill text-foreground"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ <span className="relative z-10">{option.label}</span>
+ </button>
+ );
+ })}
</div>
</SettingsRow>
{showEndpointRows ? (
<>
<SettingsRow
- alignTop={true}
label={t("settings.general.hub.endpoint")}
description={t("settings.general.hub.endpointDescription")}
+ below={errorNote}
>
- <div className="flex flex-col items-end gap-1">
- <div className="flex items-center gap-2">
- <Input
- type="url"
- value={draftEndpoint}
- placeholder={DEFAULT_HF_ENDPOINT}
- disabled={locked}
- aria-label={t("settings.general.hub.endpoint")}
- onChange={(event) => setDraftEndpoint(event.target.value)}
- onKeyDown={(event) => {
- if (event.key === "Enter" && endpointChanged) {
- saveEndpoint();
- }
- }}
- className="h-8 w-60"
- />
- <Button
- variant="outline"
- size="sm"
- disabled={locked || !endpointChanged}
- onClick={saveEndpoint}
- >
- {saving ? t("common.saving") : t("common.save")}
- </Button>
- </div>
- {errorNote}
+ <div className="flex items-center gap-2">
+ <Input
+ type="url"
+ value={draftEndpoint}
+ placeholder={DEFAULT_HF_ENDPOINT}
+ disabled={locked}
+ aria-label={t("settings.general.hub.endpoint")}
+ onChange={(event) => setDraftEndpoint(event.target.value)}
+ onKeyDown={(event) => {
+ if (event.key === "Enter" && endpointChanged) {
+ saveEndpoint();
+ }
+ }}
+ className="h-8 w-60"
+ />
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={locked || !endpointChanged}
+ onClick={saveEndpoint}
+ >
+ {saving ? t("common.saving") : t("common.save")}
+ </Button>
</div>
</SettingsRow>
<SettingsRow
diff --git a/studio/frontend/src/features/settings/components/keyless-api-access-section.tsx b/studio/frontend/src/features/settings/components/keyless-api-access-section.tsx
index 10f03ac2c2d..1ade65d0e7b 100644
--- a/studio/frontend/src/features/settings/components/keyless-api-access-section.tsx
+++ b/studio/frontend/src/features/settings/components/keyless-api-access-section.tsx
@@ -220,7 +220,6 @@ export function KeylessApiAccessSection({
<SettingsRow
label="Chat and inference"
description="Serve the approved OpenAI and Anthropic inference endpoints on localhost and an active private LAN."
- alignTop={true}
>
<Switch
checked={scope !== "off"}
@@ -235,7 +234,6 @@ export function KeylessApiAccessSection({
<SettingsRow
label="Everything else"
description="Also serve training, files and settings, but only to local loopback callers."
- alignTop={true}
>
<Switch
checked={scope === "full"}
@@ -248,7 +246,6 @@ export function KeylessApiAccessSection({
<SettingsRow
label="Allow tools"
description="Let keyless callers use the built-in Python, terminal and web search tools. Off unless you turn it on."
- alignTop={true}
>
<Switch
checked={tools}
diff --git a/studio/frontend/src/features/settings/components/lan-access-section.tsx b/studio/frontend/src/features/settings/components/lan-access-section.tsx
index 6a706051b62..e8917b81ce1 100644
--- a/studio/frontend/src/features/settings/components/lan-access-section.tsx
+++ b/studio/frontend/src/features/settings/components/lan-access-section.tsx
@@ -421,60 +421,9 @@ export function LanAccessSection() {
<SettingsRow
label="Port"
description="Automatic tries 8888, then 8889–8908. Custom uses only the selected port. Stop LAN access before changing it."
- >
- <div className="flex flex-col items-end gap-1.5">
- <div className="flex items-center gap-2">
- <Select
- value={portMode}
- disabled={busy !== null || lanAccessPortReadOnly(status)}
- onValueChange={(value) => {
- setPortMode(value as PortMode);
- setPortError(null);
- }}
- >
- <SelectTrigger
- size="sm"
- className="w-28"
- aria-label="LAN port mode"
- >
- <SelectValue />
- </SelectTrigger>
- <SelectContent>
- <SelectItem value="automatic">Automatic</SelectItem>
- <SelectItem value="custom">Custom</SelectItem>
- </SelectContent>
- </Select>
- {portMode === "custom" ? (
- <Input
- type="number"
- min={1}
- max={65535}
- value={portDraft}
- disabled={busy !== null || lanAccessPortReadOnly(status)}
- aria-label="Custom LAN port"
- aria-invalid={portInvalid}
- aria-describedby={portErrorVisible ? portErrorId : undefined}
- className="h-8 w-24"
- onChange={(event) => {
- setPortDraft(event.target.value);
- setPortError(null);
- }}
- />
- ) : null}
- <Button
- type="button"
- size="sm"
- onClick={savePort}
- disabled={
- busy !== null ||
- lanAccessPortReadOnly(status) ||
- portInvalid ||
- !portDirty
- }
- >
- Save
- </Button>
- </div>
+ // Always mounted, even when empty: a live region has to exist before its
+ // text changes for the change to be announced.
+ below={
<span
id={portErrorId}
role="status"
@@ -487,6 +436,59 @@ export function LanAccessSection() {
: portError
: null}
</span>
+ }
+ >
+ <div className="flex items-center gap-2">
+ <Select
+ value={portMode}
+ disabled={busy !== null || lanAccessPortReadOnly(status)}
+ onValueChange={(value) => {
+ setPortMode(value as PortMode);
+ setPortError(null);
+ }}
+ >
+ <SelectTrigger
+ size="sm"
+ className="w-28"
+ aria-label="LAN port mode"
+ >
+ <SelectValue />
+ </SelectTrigger>
+ <SelectContent>
+ <SelectItem value="automatic">Automatic</SelectItem>
+ <SelectItem value="custom">Custom</SelectItem>
+ </SelectContent>
+ </Select>
+ {portMode === "custom" ? (
+ <Input
+ type="number"
+ min={1}
+ max={65535}
+ value={portDraft}
+ disabled={busy !== null || lanAccessPortReadOnly(status)}
+ aria-label="Custom LAN port"
+ aria-invalid={portInvalid}
+ aria-describedby={portErrorVisible ? portErrorId : undefined}
+ className="h-8 w-24"
+ onChange={(event) => {
+ setPortDraft(event.target.value);
+ setPortError(null);
+ }}
+ />
+ ) : null}
+ <Button
+ type="button"
+ size="sm"
+ onClick={savePort}
+ disabled={
+ busy !== null ||
+ lanAccessPortReadOnly(status) ||
+ portInvalid ||
+ !portDirty
+ }
+ >
+ Save
+ </Button>
</div>
</SettingsRow>
) : null}
diff --git a/studio/frontend/src/features/settings/components/llama-backend-section.tsx b/studio/frontend/src/features/settings/components/llama-backend-section.tsx
index 00d36089cce..490618aac1e 100644
--- a/studio/frontend/src/features/settings/components/llama-backend-section.tsx
+++ b/studio/frontend/src/features/settings/components/llama-backend-section.tsx
@@ -118,8 +118,33 @@ function LlamaCppPathRow({ onChanged }: { onChanged: () => void }) {
)}
hint={t("settings.resources.llamaBackend.customPath.hint")}
className="max-[840px]:flex-col max-[840px]:items-stretch max-[840px]:gap-2"
+ below={
+ detail || settings?.source === "studio" ? (
+ <div className="w-[calc(392px*var(--ui-space-scale,1))] min-w-0 max-[840px]:w-full">
+ <div className="flex min-w-0 items-center justify-between gap-2 pl-3.5 pr-1 text-xs text-muted-foreground">
+ {detail ? (
+ <span title={detail} className="min-w-0 truncate">
+ {detail}
+ </span>
+ ) : null}
+ {settings?.source === "studio" ? (
+ <Button
+ variant="link"
+ size="xs"
+ className="h-auto shrink-0 px-0 text-xs"
+ disabled={saving}
+ onClick={() => void save(null)}
+ data-testid="llama-cpp-path-reset"
+ >
+ {t("settings.resources.llamaBackend.customPath.useBundled")}
+ </Button>
+ ) : null}
+ </div>
+ </div>
+ ) : null
+ }
>
- <div className="grid w-[calc(392px*var(--ui-space-scale,1))] min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] gap-x-2 gap-y-1.5 max-[840px]:w-full">
+ <div className="grid w-[calc(392px*var(--ui-space-scale,1))] min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] gap-x-2 max-[840px]:w-full">
<Input
readOnly={!settings?.editable}
aria-label={t("settings.resources.llamaBackend.customPath.label")}
@@ -161,27 +186,6 @@ function LlamaCppPathRow({ onChanged }: { onChanged: () => void }) {
? t("settings.resources.llamaBackend.customPath.saving")
: t("settings.resources.llamaBackend.customPath.change")}
</Button>
- {detail || settings?.source === "studio" ? (
- <div className="col-span-3 flex min-w-0 items-center justify-between gap-2 pl-3.5 pr-1 text-xs text-muted-foreground">
- {detail ? (
- <span title={detail} className="min-w-0 truncate">
- {detail}
- </span>
- ) : null}
- {settings?.source === "studio" ? (
- <Button
- variant="link"
- size="xs"
- className="h-auto shrink-0 px-0 text-xs"
- disabled={saving}
- onClick={() => void save(null)}
- data-testid="llama-cpp-path-reset"
- >
- {t("settings.resources.llamaBackend.customPath.useBundled")}
- </Button>
- ) : null}
- </div>
- ) : null}
</div>
</SettingsRow>
diff --git a/studio/frontend/src/features/settings/components/managed-provider-urls-section.tsx b/studio/frontend/src/features/settings/components/managed-provider-urls-section.tsx
index c3fa046f1fe..df49b216694 100644
--- a/studio/frontend/src/features/settings/components/managed-provider-urls-section.tsx
+++ b/studio/frontend/src/features/settings/components/managed-provider-urls-section.tsx
@@ -76,24 +76,30 @@ export function ManagedProviderUrlsSection() {
description={t(
"settings.general.managedProviderUrls.enableDescription",
)}
+ below={
+ settings?.lockedByEnvironment || error ? (
+ <div className="flex flex-col items-end gap-1">
+ {settings?.lockedByEnvironment ? (
+ <span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground">
+ {t(
+ "settings.general.managedProviderUrls.lockedByEnvironment",
+ )}
+ </span>
+ ) : null}
+ {error ? (
+ <span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
+ {error}
+ </span>
+ ) : null}
+ </div>
+ ) : null
+ }
>
- <div className="flex flex-col items-end gap-1">
- <Switch
- checked={settings?.allowed ?? false}
- disabled={!settings || saving || settings.lockedByEnvironment}
- onCheckedChange={(allowed) => void save(allowed)}
- />
- {settings?.lockedByEnvironment ? (
- <span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground">
- {t("settings.general.managedProviderUrls.lockedByEnvironment")}
- </span>
- ) : null}
- {error ? (
- <span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
- {error}
- </span>
- ) : null}
- </div>
+ <Switch
+ checked={settings?.allowed ?? false}
+ disabled={!settings || saving || settings.lockedByEnvironment}
+ onCheckedChange={(allowed) => void save(allowed)}
+ />
</SettingsRow>
</SettingsSection>
);
diff --git a/studio/frontend/src/features/settings/components/model-auto-switch-section.tsx b/studio/frontend/src/features/settings/components/model-auto-switch-section.tsx
index 79103cadfed..b6850ebddf4 100644
--- a/studio/frontend/src/features/settings/components/model-auto-switch-section.tsx
+++ b/studio/frontend/src/features/settings/components/model-auto-switch-section.tsx
@@ -50,34 +50,8 @@ function MediaIdleUnloadRow({
description={t(
"settings.general.modelAutoSwitch.mediaIdleUnloadDescription",
)}
- >
- <div className="flex flex-col items-end gap-1">
- <div className="flex items-center gap-2">
- <div className="flex items-center gap-1.5">
- <Input
- type="number"
- min={0}
- step={1}
- value={draftSeconds}
- aria-label={t(
- "settings.general.modelAutoSwitch.mediaIdleSecondsAriaLabel",
- )}
- disabled={disabled}
- onChange={(event) => onDraftChange(event.target.value)}
- className="h-8 w-24"
- />
- <span className="text-xs font-medium text-muted-foreground">s</span>
- </div>
- <Button
- variant="outline"
- size="sm"
- disabled={disabled}
- onClick={onSave}
- >
- {isSaving ? t("common.saving") : t("common.save")}
- </Button>
- </div>
- {error ? (
+ below={
+ error ? (
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{error}
</span>
@@ -85,7 +59,33 @@ function MediaIdleUnloadRow({
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground">
{t("settings.general.modelAutoSwitch.mediaIdlePaused")}
</span>
- ) : null}
+ ) : null
+ }
+ >
+ <div className="flex items-center gap-2">
+ <div className="flex items-center gap-1.5">
+ <Input
+ type="number"
+ min={0}
+ step={1}
+ value={draftSeconds}
+ aria-label={t(
+ "settings.general.modelAutoSwitch.mediaIdleSecondsAriaLabel",
+ )}
+ disabled={disabled}
+ onChange={(event) => onDraftChange(event.target.value)}
+ className="h-8 w-24"
+ />
+ <span className="text-xs font-medium text-muted-foreground">s</span>
+ </div>
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={disabled}
+ onClick={onSave}
+ >
+ {isSaving ? t("common.saving") : t("common.save")}
+ </Button>
</div>
</SettingsRow>
);
@@ -271,36 +271,8 @@ export function ModelAutoSwitchSection() {
description={t(
"settings.general.modelAutoSwitch.idleUnloadDescription",
)}
- >
- <div className="flex flex-col items-end gap-1">
- <div className="flex items-center gap-2">
- <div className="flex items-center gap-1.5">
- <Input
- type="number"
- min={0}
- step={1}
- value={draftIdleSeconds}
- aria-label={t(
- "settings.general.modelAutoSwitch.idleSecondsAriaLabel",
- )}
- disabled={!settings?.enabled || isSaving}
- onChange={(event) => setDraftIdleSeconds(event.target.value)}
- className="h-8 w-24"
- />
- <span className="text-xs font-medium text-muted-foreground">
- s
- </span>
- </div>
- <Button
- variant="outline"
- size="sm"
- disabled={!settings?.enabled || isSaving}
- onClick={handleSaveIdle}
- >
- {isSaving ? t("common.saving") : t("common.save")}
- </Button>
- </div>
- {error ? (
+ below={
+ error ? (
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{error}
</span>
@@ -312,7 +284,33 @@ export function ModelAutoSwitchSection() {
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground">
{t("settings.general.modelAutoSwitch.idleNeedsEnable")}
</span>
- ) : null}
+ ) : null
+ }
+ >
+ <div className="flex items-center gap-2">
+ <div className="flex items-center gap-1.5">
+ <Input
+ type="number"
+ min={0}
+ step={1}
+ value={draftIdleSeconds}
+ aria-label={t(
+ "settings.general.modelAutoSwitch.idleSecondsAriaLabel",
+ )}
+ disabled={!settings?.enabled || isSaving}
+ onChange={(event) => setDraftIdleSeconds(event.target.value)}
+ className="h-8 w-24"
+ />
+ <span className="text-xs font-medium text-muted-foreground">s</span>
+ </div>
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={!settings?.enabled || isSaving}
+ onClick={handleSaveIdle}
+ >
+ {isSaving ? t("common.saving") : t("common.save")}
+ </Button>
</div>
</SettingsRow>
<SettingsRow
diff --git a/studio/frontend/src/features/settings/components/settings-row.tsx b/studio/frontend/src/features/settings/components/settings-row.tsx
index 9101a613b36..eed90267c69 100644
--- a/studio/frontend/src/features/settings/components/settings-row.tsx
+++ b/studio/frontend/src/features/settings/components/settings-row.tsx
@@ -19,7 +19,7 @@ export function SettingsRow({
children,
destructive,
className,
- alignTop,
+ below,
}: {
label: string;
description?: ReactNode;
@@ -32,8 +32,8 @@ export function SettingsRow({
children?: ReactNode;
destructive?: boolean;
className?: string;
- /** Top-align the control instead of centering it, for tall descriptions. */
- alignTop?: boolean;
+ /** Right-aligned line under the control, kept out of its box so the control stays centred. */
+ below?: ReactNode;
}) {
return (
<div
@@ -41,18 +41,14 @@ export function SettingsRow({
className={cn(
// Controls are fixed-width and shrink-0, so an unwrapped row starves the label. justify-end
// right-aligns a wrapped control without breaking items-stretch for flex-col callers.
- "flex flex-wrap justify-end gap-x-6 gap-y-2 py-3",
- alignTop ? "items-start" : "items-center",
+ "flex flex-wrap items-center justify-end gap-x-6 gap-y-2 py-3",
destructive && "border-t border-border/60 mt-2 pt-4",
className,
)}
>
<div
- className={cn(
- // Widest floor that leaves already-fitting rows unchanged.
- "flex min-w-[calc(11rem*var(--ui-space-scale,1))] flex-1 basis-0 gap-2.5",
- alignTop ? "items-start" : "items-center",
- )}
+ // Widest floor that leaves already-fitting rows unchanged.
+ className="flex min-w-[calc(11rem*var(--ui-space-scale,1))] flex-1 basis-0 items-center gap-2.5"
>
{icon ? (
<span className="flex shrink-0 items-center text-foreground">
@@ -103,16 +99,10 @@ export function SettingsRow({
</div>
</div>
{children ? (
- <div
- className={cn(
- "flex max-w-full shrink-0",
- // Line the control up with the first description line, not the label.
- alignTop ? "items-start pt-[calc(21px*var(--ui-space-scale,1))]" : "items-center",
- )}
- >
- {children}
- </div>
+ <div className="flex max-w-full shrink-0 items-center">{children}</div>
) : null}
+ {/* A line of its own, so it wraps under the control without moving it. */}
+ {below ? <div className="flex basis-full justify-end">{below}</div> : null}
</div>
);
}
diff --git a/studio/frontend/src/features/settings/tabs/accounts-tab.tsx b/studio/frontend/src/features/settings/tabs/accounts-tab.tsx
index 41997e084c1..391b99b8bb6 100644
--- a/studio/frontend/src/features/settings/tabs/accounts-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/accounts-tab.tsx
@@ -456,7 +456,7 @@ function OwnerAccountsTab() {
>
<DialogContent
showCloseButton={false}
- className="sm:max-w-md max-sm:max-w-[calc(100%-2rem)] max-sm:top-1/2 max-sm:left-1/2 max-sm:-translate-1/2 max-sm:h-auto max-sm:w-[calc(100%-2rem)] max-sm:max-h-[calc(100dvh-var(--studio-window-chrome-top,0px)-2rem)] max-sm:rounded-2xl"
+ className="sm:max-w-md max-sm:max-w-[calc(100%-2rem)] max-sm:top-[calc(50%+var(--studio-window-chrome-top,0px)/2)] max-sm:left-1/2 max-sm:-translate-1/2 max-sm:h-auto max-sm:w-[calc(100%-2rem)] max-sm:max-h-[calc(100dvh-var(--studio-window-chrome-top,0px)-2rem)] max-sm:rounded-2xl"
onCloseAutoFocus={(event) => {
event.preventDefault();
const trigger = actionTrigger.current;
diff --git a/studio/frontend/src/features/settings/tabs/chat-tab.tsx b/studio/frontend/src/features/settings/tabs/chat-tab.tsx
index 9e8cafc394a..9bfcdf694c2 100644
--- a/studio/frontend/src/features/settings/tabs/chat-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/chat-tab.tsx
@@ -470,23 +470,23 @@ export function ChatTab() {
<SettingsRow
label={t("settings.chat.currentDate.label")}
description={t("settings.chat.currentDate.description")}
- >
- <div className="flex flex-col items-end gap-1">
- <Switch
- aria-label={t("settings.chat.currentDate.label")}
- checked={currentDatePrompt?.enabled ?? false}
- disabled={!currentDatePrompt || isSavingCurrentDatePrompt}
- onCheckedChange={(enabled) => void saveCurrentDatePrompt(enabled)}
- />
- {currentDatePromptError ? (
+ below={
+ currentDatePromptError ? (
<span
role="alert"
className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive"
>
{currentDatePromptError}
</span>
- ) : null}
- </div>
+ ) : null
+ }
+ >
+ <Switch
+ aria-label={t("settings.chat.currentDate.label")}
+ checked={currentDatePrompt?.enabled ?? false}
+ disabled={!currentDatePrompt || isSavingCurrentDatePrompt}
+ onCheckedChange={(enabled) => void saveCurrentDatePrompt(enabled)}
+ />
</SettingsRow>
<SettingsRow
label={t("settings.chat.projectAttachments")}
diff --git a/studio/frontend/src/features/settings/tabs/general-tab.tsx b/studio/frontend/src/features/settings/tabs/general-tab.tsx
index e9bbd723a0b..278fab1a75f 100644
--- a/studio/frontend/src/features/settings/tabs/general-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/general-tab.tsx
@@ -451,64 +451,8 @@ export function GeneralTab() {
<SettingsRow
label={t("settings.general.huggingFaceToken")}
description={t("settings.general.huggingFaceTokenDescription")}
- >
- <div className="flex min-w-0 flex-col items-end gap-1.5">
- <div className="flex max-w-full items-center gap-2">
- <div className="relative w-[calc(260px*var(--ui-space-scale,1))] min-w-0">
- <Input
- type={showToken ? "text" : "password"}
- name="hf-token"
- autoComplete="new-password"
- spellCheck={false}
- placeholder="hf_…"
- value={draftToken}
- onChange={(e) => setDraftToken(e.target.value)}
- onBlur={commitToken}
- className={cn(
- "h-8 w-full font-mono text-xs",
- tokenValidated ? "pr-14" : "pr-8",
- )}
- />
- {tokenValidated ? (
- // Decorative: pointer-events-none lets clicks reach the input underneath.
- <span
- className="pointer-events-none absolute right-7 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center text-emerald-600 duration-150 animate-in fade-in zoom-in dark:text-emerald-500"
- role="img"
- aria-label={t("settings.general.tokenValidated")}
- >
- <Check className="size-4" strokeWidth={2.5} />
- </span>
- ) : null}
- <button
- type="button"
- onClick={() => setShowToken((s) => !s)}
- className="absolute right-1.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground"
- aria-label={
- showToken
- ? t("settings.general.hideToken")
- : t("settings.general.showToken")
- }
- tabIndex={-1}
- >
- {showToken ? (
- <EyeOff className="size-3.5" />
- ) : (
- <Eye className="size-3.5" />
- )}
- </button>
- </div>
- <Button
- type="button"
- variant="outline"
- size="sm"
- className="h-8"
- disabled={!draftToken && !hfToken}
- onClick={clearHfToken}
- >
- {t("settings.general.clearToken")}
- </Button>
- </div>
- {hfTokenPersistenceError ? (
+ below={
+ hfTokenPersistenceError ? (
<p className="max-w-[calc(330px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{hfTokenPersistenceError}
</p>
@@ -520,7 +464,63 @@ export function GeneralTab() {
<p className="max-w-[calc(330px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{tokenValidation.error}
</p>
- ) : null}
+ ) : null
+ }
+ >
+ <div className="flex max-w-full items-center gap-2">
+ <div className="relative w-[calc(260px*var(--ui-space-scale,1))] min-w-0">
+ <Input
+ type={showToken ? "text" : "password"}
+ name="hf-token"
+ autoComplete="new-password"
+ spellCheck={false}
+ placeholder="hf_…"
+ value={draftToken}
+ onChange={(e) => setDraftToken(e.target.value)}
+ onBlur={commitToken}
+ className={cn(
+ "h-8 w-full font-mono text-xs",
+ tokenValidated ? "pr-14" : "pr-8",
+ )}
+ />
+ {tokenValidated ? (
+ // Decorative: pointer-events-none lets clicks reach the input underneath.
+ <span
+ className="pointer-events-none absolute right-7 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center text-emerald-600 duration-150 animate-in fade-in zoom-in dark:text-emerald-500"
+ role="img"
+ aria-label={t("settings.general.tokenValidated")}
+ >
+ <Check className="size-4" strokeWidth={2.5} />
+ </span>
+ ) : null}
+ <button
+ type="button"
+ onClick={() => setShowToken((s) => !s)}
+ className="absolute right-1.5 top-1/2 flex size-5 -translate-y-1/2 items-center justify-center rounded text-muted-foreground transition-colors hover:text-foreground"
+ aria-label={
+ showToken
+ ? t("settings.general.hideToken")
+ : t("settings.general.showToken")
+ }
+ tabIndex={-1}
+ >
+ {showToken ? (
+ <EyeOff className="size-3.5" />
+ ) : (
+ <Eye className="size-3.5" />
+ )}
+ </button>
+ </div>
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ className="h-8"
+ disabled={!draftToken && !hfToken}
+ onClick={clearHfToken}
+ >
+ {t("settings.general.clearToken")}
+ </Button>
</div>
</SettingsRow>
{/* The desktop owner authenticates via desktop auto-auth with a generated
@@ -559,42 +559,42 @@ export function GeneralTab() {
<SettingsRow
label={t("settings.general.startup.launchAtLogin")}
description={t("settings.general.startup.launchAtLoginDescription")}
- >
- <div className="flex flex-col items-end gap-1">
- <Switch
- checked={launchAtLoginSetting.value ?? false}
- disabled={
- launchAtLoginSetting.value === null || launchAtLoginSetting.saving
- }
- onCheckedChange={(enabled) => void launchAtLoginSetting.update(enabled)}
- />
- {launchAtLoginSetting.error ? (
+ below={
+ launchAtLoginSetting.error ? (
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{launchAtLoginSetting.error}
</span>
- ) : null}
- </div>
+ ) : null
+ }
+ >
+ <Switch
+ checked={launchAtLoginSetting.value ?? false}
+ disabled={
+ launchAtLoginSetting.value === null || launchAtLoginSetting.saving
+ }
+ onCheckedChange={(enabled) => void launchAtLoginSetting.update(enabled)}
+ />
</SettingsRow>
{closeToTraySetting.supported ? (
<SettingsRow
label={t("settings.general.startup.closeToTray")}
description={t("settings.general.startup.closeToTrayDescription")}
- >
- <div className="flex flex-col items-end gap-1">
- <Switch
- checked={closeToTraySetting.value ?? false}
- disabled={
- closeToTraySetting.value === null || closeToTraySetting.saving
- }
- onCheckedChange={(enabled) => void closeToTraySetting.update(enabled)}
- />
- {closeToTraySetting.error ? (
+ below={
+ closeToTraySetting.error ? (
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{closeToTraySetting.error}
</span>
- ) : null}
- </div>
+ ) : null
+ }
+ >
+ <Switch
+ checked={closeToTraySetting.value ?? false}
+ disabled={
+ closeToTraySetting.value === null || closeToTraySetting.saving
+ }
+ onCheckedChange={(enabled) => void closeToTraySetting.update(enabled)}
+ />
</SettingsRow>
) : null}
</SettingsSection>
@@ -645,19 +645,19 @@ export function GeneralTab() {
<SettingsRow
label={t("settings.general.previewSharing.enableLabel")}
description={t("settings.general.previewSharing.enableDescription")}
- >
- <div className="flex flex-col items-end gap-1">
- <Switch
- checked={previewSharing?.enabled ?? false}
- disabled={!previewSharing || isSavingPreviewSharing}
- onCheckedChange={(enabled) => void savePreviewSharing(enabled)}
- />
- {previewSharingError ? (
+ below={
+ previewSharingError ? (
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{previewSharingError}
</span>
- ) : null}
- </div>
+ ) : null
+ }
+ >
+ <Switch
+ checked={previewSharing?.enabled ?? false}
+ disabled={!previewSharing || isSavingPreviewSharing}
+ onCheckedChange={(enabled) => void savePreviewSharing(enabled)}
+ />
</SettingsRow>
<SettingsRow
destructive={true}
@@ -691,38 +691,38 @@ export function GeneralTab() {
uploadLimit?.defaultUploadSizeMb ?? DEFAULT_UPLOAD_LIMIT_MB,
),
})}
- >
- <div className="flex flex-col items-end gap-1">
- <div className="flex items-center gap-2">
- <div className="flex items-center gap-1.5">
- <Input
- type="number"
- min={uploadLimit?.minUploadSizeMb ?? 1}
- max={uploadLimit?.maxAllowedUploadSizeMb ?? 8192}
- step={1}
- value={draftUploadLimit}
- aria-label={t("settings.general.uploads.maxUploadSize")}
- onChange={(event) => setDraftUploadLimit(event.target.value)}
- className="h-8 w-24"
- />
- <span className="text-xs font-medium text-muted-foreground">
- MB
- </span>
- </div>
- <Button
- variant="outline"
- size="sm"
- disabled={isSavingUploadLimit}
- onClick={() => void saveUploadLimit()}
- >
- {isSavingUploadLimit ? t("common.saving") : t("common.save")}
- </Button>
- </div>
- {uploadLimitError ? (
+ below={
+ uploadLimitError ? (
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{uploadLimitError}
</span>
- ) : null}
+ ) : null
+ }
+ >
+ <div className="flex items-center gap-2">
+ <div className="flex items-center gap-1.5">
+ <Input
+ type="number"
+ min={uploadLimit?.minUploadSizeMb ?? 1}
+ max={uploadLimit?.maxAllowedUploadSizeMb ?? 8192}
+ step={1}
+ value={draftUploadLimit}
+ aria-label={t("settings.general.uploads.maxUploadSize")}
+ onChange={(event) => setDraftUploadLimit(event.target.value)}
+ className="h-8 w-24"
+ />
+ <span className="text-xs font-medium text-muted-foreground">
+ MB
+ </span>
+ </div>
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={isSavingUploadLimit}
+ onClick={() => void saveUploadLimit()}
+ >
+ {isSavingUploadLimit ? t("common.saving") : t("common.save")}
+ </Button>
</div>
</SettingsRow>
</SettingsSection>
@@ -734,18 +734,8 @@ export function GeneralTab() {
description={t(
"settings.general.helperLlm.preloadOnStartupDescription",
)}
- >
- <div className="flex flex-col items-end gap-1">
- <Switch
- checked={helperPrecache?.enabled ?? false}
- disabled={
- !helperPrecache ||
- isSavingHelperPrecache ||
- helperPrecache.disabledByEnv
- }
- onCheckedChange={(enabled) => void saveHelperPrecache(enabled)}
- />
- {helperPrecache?.disabledByEnv ? (
+ below={
+ helperPrecache?.disabledByEnv ? (
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-muted-foreground">
{t("settings.general.helperLlm.disabledByEnv")}
</span>
@@ -753,8 +743,18 @@ export function GeneralTab() {
<span className="max-w-[calc(260px*var(--ui-space-scale,1))] text-right text-xs text-destructive">
{helperPrecacheError}
</span>
- ) : null}
- </div>
+ ) : null
+ }
+ >
+ <Switch
+ checked={helperPrecache?.enabled ?? false}
+ disabled={
+ !helperPrecache ||
+ isSavingHelperPrecache ||
+ helperPrecache.disabledByEnv
+ }
+ onCheckedChange={(enabled) => void saveHelperPrecache(enabled)}
+ />
</SettingsRow>
</SettingsSection>
</>
diff --git a/studio/frontend/src/features/settings/tabs/resources-tab.tsx b/studio/frontend/src/features/settings/tabs/resources-tab.tsx
index ddceff93894..e2f4031f955 100644
--- a/studio/frontend/src/features/settings/tabs/resources-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/resources-tab.tsx
@@ -855,8 +855,35 @@ export function ResourcesTab() {
description={t("settings.resources.storage.modelsFolderDescription")}
hint={t("settings.resources.storage.modelsFolderHint")}
className="max-[840px]:flex-col max-[840px]:items-stretch max-[840px]:gap-2"
+ below={
+ cacheLocationDetail || hfCache?.isCustom ? (
+ <div className="w-[calc(392px*var(--ui-space-scale,1))] min-w-0 max-[840px]:w-full">
+ <div className="flex min-w-0 items-center justify-between gap-2 pl-3.5 pr-1 text-xs text-muted-foreground">
+ {cacheLocationDetail ? (
+ <span
+ title={cacheLocationDetail}
+ className="min-w-0 truncate"
+ >
+ {cacheLocationDetail}
+ </span>
+ ) : null}
+ {hfCache?.isCustom ? (
+ <Button
+ variant="link"
+ size="xs"
+ className="h-auto px-0 text-xs"
+ disabled={cacheSaving}
+ onClick={() => void saveCacheFolder(null)}
+ >
+ {t("settings.resources.storage.resetAction")}
+ </Button>
+ ) : null}
+ </div>
+ </div>
+ ) : null
+ }
>
- <div className="grid w-[calc(392px*var(--ui-space-scale,1))] min-w-0 grid-cols-[minmax(0,1fr)_auto] gap-x-2 gap-y-1.5 max-[840px]:w-full">
+ <div className="grid w-[calc(392px*var(--ui-space-scale,1))] min-w-0 grid-cols-[minmax(0,1fr)_auto] gap-x-2 max-[840px]:w-full">
<div className="relative min-w-0">
<Input
readOnly
@@ -897,29 +924,6 @@ export function ResourcesTab() {
>
{t("settings.resources.storage.changeAction")}
</Button>
- {cacheLocationDetail || hfCache?.isCustom ? (
- <div className="col-span-2 flex min-w-0 items-center justify-between gap-2 pl-3.5 pr-1 text-xs text-muted-foreground">
- {cacheLocationDetail ? (
- <span
- title={cacheLocationDetail}
- className="min-w-0 truncate"
- >
- {cacheLocationDetail}
- </span>
- ) : null}
- {hfCache?.isCustom ? (
- <Button
- variant="link"
- size="xs"
- className="h-auto px-0 text-xs"
- disabled={cacheSaving}
- onClick={() => void saveCacheFolder(null)}
- >
- {t("settings.resources.storage.resetAction")}
- </Button>
- ) : null}
- </div>
- ) : null}
</div>
</SettingsRow>
<CacheStorageRows />
diff --git a/studio/frontend/src/features/settings/tabs/voice-tab.tsx b/studio/frontend/src/features/settings/tabs/voice-tab.tsx
index 471fbe6ba7e..9166201563d 100644
--- a/studio/frontend/src/features/settings/tabs/voice-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/voice-tab.tsx
@@ -1015,22 +1015,10 @@ export function VoiceTab() {
<SettingsRow
label={t("settings.voice.dictation.sttModelLabel")}
description={t("settings.voice.dictation.sttModelDescription")}
- >
- <div className="flex w-56 flex-col items-stretch gap-2">
- <SttModelPicker
- value={sttModel}
- language={dictationLanguage}
- onChange={(next) => {
- if (next !== sttModel) {
- void unloadSttModel().catch(() => {});
- void autoLoadSttModel(next);
- }
- setSttModel(next);
- }}
- />
- {/* Progress lives in the shared downloads panel; a second bar
- here said the same thing twice. */}
- <div className="flex min-h-7 items-center justify-between gap-3">
+ // Progress lives in the shared downloads panel; a second bar here
+ // said the same thing twice.
+ below={
+ <div className="flex min-h-7 w-56 items-center justify-between gap-3">
<span className="flex min-w-0 items-center gap-2 text-xs text-muted-foreground">
{effectiveSttDownloadAvailability === "checking" ||
sttPhase === "loading" ||
@@ -1122,6 +1110,20 @@ export function VoiceTab() {
)
) : null}
</div>
+ }
+ >
+ <div className="w-56">
+ <SttModelPicker
+ value={sttModel}
+ language={dictationLanguage}
+ onChange={(next) => {
+ if (next !== sttModel) {
+ void unloadSttModel().catch(() => {});
+ void autoLoadSttModel(next);
+ }
+ setSttModel(next);
+ }}
+ />
</div>
</SettingsRow>
) : (
diff --git a/studio/frontend/src/features/studio/studio-page.tsx b/studio/frontend/src/features/studio/studio-page.tsx
index 1d2601703b8..563701ce246 100644
--- a/studio/frontend/src/features/studio/studio-page.tsx
+++ b/studio/frontend/src/features/studio/studio-page.tsx
@@ -186,7 +186,7 @@ export function StudioPage(): ReactElement {
onValueChange={(value) => handleTabChange(value as TrainSubTab)}
className="contents"
>
- <div className="mx-auto flex w-full max-w-[calc(1180px*var(--ui-space-scale,1))] 3xl:max-w-[calc(1440px*var(--ui-space-scale,1))] 4xl:max-w-[calc(1760px*var(--ui-space-scale,1))] flex-col gap-7 px-5 pb-20 pt-8 max-sm:px-4 sm:px-9 sm:pt-10">
+ <div className="mx-auto flex w-full max-w-[calc(1180px*var(--ui-space-scale,1))] 3xl:max-w-[calc(1440px*var(--ui-space-scale,1))] 4xl:max-w-[calc(1760px*var(--ui-space-scale,1))] flex-col gap-7 px-5 pb-20 pt-8 max-sm:px-4 sm:px-9">
<header className="font-heading flex flex-col gap-5">
<div className="flex flex-col gap-0.5">
<h1 className="page-title-halo text-ui-30 font-semibold leading-[1.04] tracking-[-0.028em] text-foreground sm:text-ui-34">
@@ -215,7 +215,7 @@ export function StudioPage(): ReactElement {
showTrainingView={showTrainingView}
/>
{/* Finished runs land in the Library's Fine-tunes tab. */}
- <div className="ml-auto flex items-center gap-2 pb-2">
+ <div className="ml-auto flex items-center gap-2">
<MediaPageLink
to="/library"
libraryTab="models"
diff --git a/studio/frontend/src/features/video/video-page.tsx b/studio/frontend/src/features/video/video-page.tsx
index 5a5a9e1fe3b..5d7c3ca8f23 100644
--- a/studio/frontend/src/features/video/video-page.tsx
+++ b/studio/frontend/src/features/video/video-page.tsx
@@ -104,6 +104,7 @@ import {
TooltipTrigger,
} from "@/components/ui/tooltip";
import { InfoHint } from "@/components/ui/info-hint";
+import { useSidebar } from "@/components/ui/sidebar";
import { NegativePromptField } from "@/components/negative-prompt-field";
import { usePersistedChoice } from "@/hooks/use-persisted-choice";
import { useScrollFades } from "@/hooks/use-scroll-fades";
@@ -937,6 +938,7 @@ function VideoGenerator({
const initialReadySent = useRef(false);
// Clear the floating sidebar toggle on mobile.
const isMobileShell = useIsMobileShell();
+ const { pinned } = useSidebar();
const hostClass = useHostClass();
const denseQuantSchemes = useDenseQuantSchemes();
const nvfp4Diffusion = useNvfp4Diffusion();
@@ -3594,13 +3596,14 @@ function VideoGenerator({
);
return (
- // The chat-style layout gives this page no outer top inset, so clear the custom titlebar here as chat does.
- // 34px on win/linux, 0 under macOS's native one.
+ // The chat-style layout gives this page no outer top inset, so it applies the content inset itself, as chat does.
<div
{...{ [MEDIA_RAIL_ROOT_ATTR]: "" }}
style={railRootStyle}
- className="diffusion-surface flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden pt-[var(--studio-content-top-inset,0px)]"
+ className="diffusion-surface @container relative flex h-full min-h-0 min-w-0 flex-1 flex-col overflow-hidden pt-[var(--studio-content-top-inset,0px)]"
>
+ {/* Page-level, so the handle covers the divider through the header too. */}
+ <MediaRailResizeHandle kind="video" placement="page" className="hidden @[50rem]:block" />
{/* Portals to body, and this page stays mounted off-route, so gate it like the composer. */}
{active && <GuidedTour {...tour.tourProps} />}
<AlertDialog
@@ -3678,56 +3681,64 @@ function VideoGenerator({
</div>
</DialogContent>
</Dialog>
- {/* Top: the model selector, clear of the sidebar and level with the controls column. Load
- progress shows in a toast. */}
- <div
- className={cn(
- "@container pointer-events-none relative z-40 flex h-[calc(48px*var(--ui-space-scale,1))] shrink-0 items-start justify-between pr-2 pt-[var(--studio-chat-header-padding-top,11px)]",
- isMobileShell ? "pl-12" : "pl-[var(--studio-media-header-left-inset,1.5rem)]",
- )}
- >
- {/* min-w-0: without it a long resident model name pushes the Images link off a phone screen. */}
- <div className="pointer-events-auto flex min-w-0 items-center gap-3">
- <ModelSelector
- triggerDataTour="video-model"
- models={videoModels}
- value={status?.loaded ? status.repo_id ?? undefined : undefined}
- activeGgufVariant={quant}
- onValueChange={handleModelSelect}
- resolveDownloadFootprint={resolveDownloadFootprint}
- onEject={status?.loaded ? handleUnload : undefined}
- variant="ghost"
- className="!h-[calc(34px*var(--ui-space-scale,1))]"
- task={VIDEO_GEN_TASKS}
- catalog={VIDEO_CATALOG}
- hubCapability="diffusion"
- placeholder="Select video model"
- open={active && selectorOpen}
- onOpenChange={(o) => setSelectorOpen(active && o)}
- />
- {/* The load's own cancel, beside the selector rather than inside it: the selector's eject needs
- a resident model, so it is hidden for exactly the span a first load runs. A real button,
- so it is keyboard reachable. Says "load", never "download": that Cancel stops another job. */}
- {busy === "loading" && (
- <Tooltip>
- <TooltipTrigger asChild={true}>
- <Button
- type="button"
- variant="outline"
- size="sm"
- aria-label="Cancel load"
- className="!h-[calc(34px*var(--ui-space-scale,1))] rounded-full text-xs"
- onClick={() => void handleCancelLoad()}
- >
- Cancel load
- </Button>
- </TooltipTrigger>
- <TooltipContent>Stop loading this model</TooltipContent>
- </Tooltip>
+ {/* Header: selector over the rail, Library link over the preview, as on Images and Audio. */}
+ <div className="pointer-events-none relative z-40 grid h-[calc(48px*var(--ui-space-scale,1))] shrink-0 grid-cols-[minmax(0,var(--media-rail-width,calc(408px*var(--ui-space-scale,1))))_minmax(13rem,1fr)] @max-[30rem]:grid-cols-[minmax(0,1fr)_auto]">
+ <div
+ className={cn(
+ "pointer-events-none flex h-full min-w-0 items-start overflow-hidden @[50rem]:border-r @[50rem]:border-border/60",
+ isMobileShell
+ ? "pl-12"
+ : // Collapsed desktop sidebar: clear the titlebar buttons, as Chat does.
+ !pinned && isTauri
+ ? "pl-[var(--studio-collapsed-chat-controls-inset,0.75rem)]"
+ : "pl-[var(--studio-media-header-left-inset,1.5rem)]",
)}
- {/* Loaded-model status line: family / kind / offload / speed. Hidden until a model is resident. */}
+ >
+ {/* min-w-0: without it a long resident model name pushes the Library link off a phone screen. */}
+ <div className="pointer-events-auto flex min-w-0 max-w-full items-center gap-2 overflow-hidden pt-[var(--studio-chat-header-padding-top,11px)]">
+ <ModelSelector
+ triggerDataTour="video-model"
+ models={videoModels}
+ value={status?.loaded ? status.repo_id ?? undefined : undefined}
+ activeGgufVariant={quant}
+ onValueChange={handleModelSelect}
+ resolveDownloadFootprint={resolveDownloadFootprint}
+ onEject={status?.loaded ? handleUnload : undefined}
+ variant="ghost"
+ className="!h-[calc(34px*var(--ui-space-scale,1))]"
+ task={VIDEO_GEN_TASKS}
+ catalog={VIDEO_CATALOG}
+ hubCapability="diffusion"
+ placeholder="Select video model"
+ open={active && selectorOpen}
+ onOpenChange={(o) => setSelectorOpen(active && o)}
+ />
+ {/* The load's own cancel, beside the selector rather than inside it: the selector's eject needs
+ a resident model, so it is hidden for exactly the span a first load runs. A real button,
+ so it is keyboard reachable. Says "load", never "download": that Cancel stops another job. */}
+ {busy === "loading" && (
+ <Tooltip>
+ <TooltipTrigger asChild={true}>
+ <Button
+ type="button"
+ variant="outline"
+ size="sm"
+ aria-label="Cancel load"
+ className="!h-[calc(34px*var(--ui-space-scale,1))] rounded-full text-xs"
+ onClick={() => void handleCancelLoad()}
+ >
+ Cancel load
+ </Button>
+ </TooltipTrigger>
+ <TooltipContent>Stop loading this model</TooltipContent>
+ </Tooltip>
+ )}
+ </div>
+ </div>
+ <div className="grid h-full min-w-0 grid-cols-[minmax(0,1fr)_auto] gap-2">
+ {/* Loaded-model status line; chips that do not fit wrap onto a clipped second line. */}
{status?.loaded && (
- <div className="hidden min-w-0 items-center gap-3 text-ui-11 @min-[720px]:flex">
+ <div className="pointer-events-auto col-start-1 mt-[var(--studio-chat-header-padding-top,11px)] flex h-[var(--studio-chat-control-height,34px)] min-w-0 flex-wrap content-start gap-x-3 overflow-hidden pl-4 text-ui-11 leading-[var(--studio-chat-control-height,34px)]">
{status.family && <StatusChip label="Family" value={status.family} />}
{status.engine && <StatusChip label="Engine" value={status.engine} />}
{status.model_kind && <StatusChip label="Kind" value={status.model_kind} />}
@@ -3737,34 +3748,30 @@ function VideoGenerator({
{status.speed_mode && <StatusChip label="Speed" value={status.speed_mode} />}
</div>
)}
- </div>
- <div className="pointer-events-auto flex shrink-0 items-center gap-2">
- {/* A separate page, so it sits outside this page's controls. */}
- <LibraryPageLink
- tab="videos"
- labelClassName="@max-[30rem]:hidden"
- arrowClassName="@max-[30rem]:hidden"
- />
+ <div className="pointer-events-none col-start-2 flex min-w-0 items-start justify-end pr-2 pt-[var(--studio-chat-header-padding-top,11px)]">
+ <div className="pointer-events-auto flex min-w-0 items-center gap-2">
+ <LibraryPageLink
+ tab="videos"
+ labelClassName="hidden @[50rem]:inline"
+ arrowClassName="hidden @[50rem]:block"
+ />
+ </div>
+ </div>
</div>
</div>
- {/* Controls rail and preview canvas, as on the Images tabs. Gutters match Images, so both
- pages' content starts at the same 40px. */}
{/* overflow-x-hidden: an unset overflow-x computes to auto beside overflow-y-auto, letting a
wide row pan the page sideways on a phone. */}
- <div className="flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden pl-2 pr-5 pt-9 max-sm:pl-0 max-sm:pr-0 sm:pr-8 lg:flex-row lg:overflow-hidden">
- {/* Widened by the pl-8 so the controls keep their old width. */}
+ <div className="flex min-h-0 w-full min-w-0 flex-1 flex-col overflow-y-auto overflow-x-hidden @[50rem]:flex-row @[50rem]:overflow-hidden">
<div
data-tour="video-settings"
- className="relative flex w-full shrink-0 flex-col border-b border-border/60 pl-8 max-sm:pl-5 lg:w-[min(var(--media-rail-width,calc(400px*var(--ui-space-scale,1))),calc(100%-13rem))] lg:overflow-hidden lg:border-r lg:border-b-0"
+ className="flex w-full shrink-0 flex-col border-b border-border/60 @[50rem]:w-[min(var(--media-rail-width,calc(408px*var(--ui-space-scale,1))),calc(100%-13rem))] @[50rem]:overflow-hidden @[50rem]:border-r @[50rem]:border-b-0"
>
- <MediaRailResizeHandle kind="video" className="hidden lg:contents" />
- {/* pl-0.5 keeps focus rings off the scroll container's edge. */}
<div
ref={attachSettingsScroll}
onScroll={onSettingsScroll}
className={cn(
- "hover-scrollbar panel-scroll-fade-action flex min-h-0 flex-1 flex-col gap-4 pb-6 pl-0.5 pr-7 max-sm:pr-5 lg:overflow-y-auto",
+ "hover-scrollbar panel-scroll-fade-action flex min-h-0 flex-1 flex-col gap-4 px-10 max-sm:px-5 pt-9 pb-6 @[50rem]:overflow-y-auto",
settingsFadeClass,
)}
>
@@ -4285,7 +4292,7 @@ function VideoGenerator({
</div>
{/* The scroll mask provides the fade; leave the footer unpainted to avoid dark-mode banding. */}
- <div className="relative z-10 flex shrink-0 flex-wrap justify-center gap-2 pt-0.5 pb-4 pl-4 pr-3">
+ <div className="relative z-10 flex shrink-0 flex-wrap justify-center gap-2 px-4 pt-0.5 pb-4">
{busy === "generating" ? (
<Button
// Kept in step with the Images Stop control, which uses the same fill.
@@ -4328,7 +4335,7 @@ function VideoGenerator({
<div
data-tour="video-preview"
- className="relative flex min-h-[60dvh] min-w-0 flex-1 flex-col overflow-hidden pl-2 lg:min-h-0"
+ className="relative flex min-h-[60dvh] min-w-0 flex-1 flex-col overflow-hidden @[50rem]:min-h-0"
>
{viewer && viewerVideo && viewerSrc && (
<MediaViewer
diff --git a/studio/frontend/src/hooks/use-media-rail-width.ts b/studio/frontend/src/hooks/use-media-rail-width.ts
index 541e7c09c28..29870583df5 100644
--- a/studio/frontend/src/hooks/use-media-rail-width.ts
+++ b/studio/frontend/src/hooks/use-media-rail-width.ts
@@ -22,7 +22,7 @@ const stores = {
key: "video_rail_width",
min: MEDIA_RAIL_WIDTH_MIN,
max: MEDIA_RAIL_WIDTH_MAX,
- fallback: 400,
+ fallback: 408,
maxViewportFraction: 0.6,
}),
audio: createPanelWidthStore({
diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css
index 8b54f8508d8..60df490f63e 100644
--- a/studio/frontend/src/index.css
+++ b/studio/frontend/src/index.css
@@ -138,12 +138,17 @@
+/* usWinAscent carries the line gap (no USE_TYPO_METRICS), so DirectWrite set text 0.1em low;
+ the overrides are the hhea values (units / 2048). */
@font-face {
font-family: "Hellix";
src: url("/fonts/Hellix-Regular.woff") format("woff");
font-weight: 400;
font-style: normal;
font-display: swap;
+ ascent-override: 81.5918%;
+ descent-override: 18.4082%;
+ line-gap-override: 20.0195%;
}
@font-face {
@@ -152,6 +157,9 @@
font-weight: 500;
font-style: normal;
font-display: swap;
+ ascent-override: 82.1777%;
+ descent-override: 17.8223%;
+ line-gap-override: 20.0195%;
}
@font-face {
@@ -4229,6 +4237,34 @@ html[data-chat-font] .aui-root {
}
}
+ /* Streamdown's table controls, drawn like the code block's (ACTION_BUTTON_CLASS in
+ markdown-text.tsx). Without controls the table box is the only child. */
+ .aui-thread-root [data-streamdown="table-wrapper"] > div:first-child:not(:last-child) {
+ margin-right: calc(var(--spacing) * 1);
+ }
+
+ .aui-thread-root [data-streamdown="table-wrapper"] > div:first-child:not(:last-child) > .relative {
+ display: flex;
+ }
+
+ .aui-thread-root [data-streamdown="table-wrapper"] > div:first-child:not(:last-child) > button,
+ .aui-thread-root [data-streamdown="table-wrapper"] > div:first-child:not(:last-child) > .relative > button {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ width: calc(var(--spacing) * 8);
+ height: calc(var(--spacing) * 8);
+ padding: 0;
+ border-radius: 10px;
+ color: var(--color-chat-icon-fg);
+ }
+
+ .aui-thread-root [data-streamdown="table-wrapper"] > div:first-child:not(:last-child) > button:hover:not(:disabled),
+ .aui-thread-root [data-streamdown="table-wrapper"] > div:first-child:not(:last-child) > .relative > button:hover:not(:disabled) {
+ background-color: var(--color-chat-icon-bg-hover);
+ color: var(--color-chat-icon-fg-hover);
+ }
+
/* Chat: use the app sans stack for UI + prose. */
.aui-thread-root {
--font-heading: var(--font-sans);
@@ -4933,20 +4969,34 @@ html.force-reduced-motion .sidebar-section-drop-line {
background: oklch(0.72 0 0 / 0.4);
}
-/* Chromium ignores ::-webkit-scrollbar styling while scrollbar-width/color are
- set; on Windows reset both (:hover too, or it flips back) to restore it. */
+/* Chromium ignores ::-webkit-scrollbar while scrollbar-width/color are set, and its standard
+ Windows scrollbar draws arrows. :hover too, or the reveal rules flip it back; the width
+ stays overridable so !important and inline hides still win. */
@supports selector(::-webkit-scrollbar) {
- :root.client-windows .sidebar-scroll-fade,
- :root.client-windows .sidebar-scroll-fade:hover,
- :root.client-windows .run-settings-scroll,
- :root.client-windows .run-settings-scroll:hover,
- :root.client-windows .aui-thread-viewport,
- :root.client-windows .aui-thread-viewport:hover,
- :root.client-windows .hover-scrollbar,
- :root.client-windows .hover-scrollbar:hover {
+ :root.client-windows *,
+ :root.client-windows *:hover {
scrollbar-width: auto;
- scrollbar-color: auto;
+ scrollbar-color: auto !important;
+ }
+
+ /* Set inline for Firefox, which this block never reaches. */
+ :root.client-windows [data-radix-select-viewport] {
+ scrollbar-width: auto !important;
}
+
+ /* The unlayered thin default kept these visible; keep them so, without arrows. */
+ :root.client-windows .no-scrollbar::-webkit-scrollbar {
+ display: block;
+ }
+
+ :root.client-windows {
+ --thread-scrollbar-gutter: 8px;
+ }
+}
+
+/* Start the classic scrollbar below the chat header, which overlays the thread. */
+:root.client-windows .aui-thread-viewport::-webkit-scrollbar-track {
+ margin-top: var(--thread-header-offset, 0px);
}
/* Run settings: always reserve the scrollbar gutter so the header close
@@ -4960,6 +5010,11 @@ html.force-reduced-motion .sidebar-section-drop-line {
padding-right: var(--overlay-scrollbar-gutter, 0px);
}
+/* Chromium's thin scrollbar width; scrollbars ignore the UI scale. */
+:root {
+ --thread-scrollbar-gutter: 10px;
+}
+
/* Chat viewport: scrollbar styled with Run settings above, so no track to clip at the corner. */
.aui-thread-viewport {
/* Reserve scrollbar space always so absolute-positioned overlays (topbar)
@@ -5460,6 +5515,12 @@ html.force-reduced-motion .sidebar-section-drop-line {
box-shadow: 0 4px 20px 6px var(--background);
}
+/* Toasts stack under the open find bar: its top, its h-13, then 8px. */
+:root:has(.find-bar-surface) [data-sonner-toaster][data-y-position="top"] {
+ --offset-top: calc(var(--studio-content-top-inset, 0px) + 3.5rem + 3.25rem * var(--ui-space-scale, 1) + 0.5rem) !important;
+ --mobile-offset-top: calc(var(--studio-content-top-inset, 0px) + 3.5rem + 3.25rem * var(--ui-space-scale, 1) + 0.5rem) !important;
+}
+
@layer components {
/* Align the arrow with page content while retaining its hit area. */
.settings-back-button {
diff --git a/studio/frontend/src/lib/toast-offset.ts b/studio/frontend/src/lib/toast-offset.ts
index d3e023a88f7..65f2a9d6419 100644
--- a/studio/frontend/src/lib/toast-offset.ts
+++ b/studio/frontend/src/lib/toast-offset.ts
@@ -19,7 +19,7 @@ export function chatSettingsInsetMinColumn(uiSpaceScale = 1): number {
);
}
-const HEADER_ROUTES = new Set(["/chat", "/images", "/video"]);
+const HEADER_ROUTES = new Set(["/chat", "/images", "/video", "/audio"]);
export type ToastOffset = {
top: number;
diff --git a/studio/frontend/tests/chat-column-centering.test.ts b/studio/frontend/tests/chat-column-centering.test.ts
index b3ecd8a9344..f719b540ed0 100644
--- a/studio/frontend/tests/chat-column-centering.test.ts
+++ b/studio/frontend/tests/chat-column-centering.test.ts
@@ -6,6 +6,13 @@ import test from "node:test";
import { atDefaultUiScale, readSrcAsync } from "./helpers/kit.ts";
+const DOCK_INSETS =
+ /aui-thread-composer-dock[^"]*md:left-\[var\(--thread-scrollbar-gutter,10px\)\] md:right-\[var\(--thread-scrollbar-gutter,10px\)\]/;
+const DOCK_ONE_SIDED =
+ /aui-thread-composer-dock[^"]*right-0 md:right-\[var\(--thread-scrollbar-gutter,10px\)\]"/;
+const SCALED_GUTTER_INSET =
+ /(?:left|right)-\[calc\(10px\*var\(--ui-space-scale,1\)\)\]/;
+
// The chat column is centred by margin, so every inset around it has to be
// symmetric. A one-sided scrollbar gutter counts as an inset.
@@ -35,6 +42,25 @@ test("nothing around the composer re-adds a one-sided inset", async () => {
// The dock offset keeps the bottom fade off the scrollbar, so it stays,
// but one-sided it also shifts the composer half its width off centre.
- assert.match(thread, /aui-thread-composer-dock[^"]*md:left-\[10px\] md:right-\[10px\]/);
- assert.doesNotMatch(thread, /aui-thread-composer-dock[^"]*right-0 md:right-\[10px\]"/);
+ assert.match(thread, DOCK_INSETS);
+ assert.doesNotMatch(thread, DOCK_ONE_SIDED);
+});
+
+// The gutter is a scrollbar, which the UI scale does not touch, so a scaled inset drifted the
+// composer off the message column. Windows lets the 8px ::-webkit-scrollbar through.
+test("the overlays around the thread stop at its real scrollbar gutter", async () => {
+ const css = await readSrcAsync("index.css");
+ for (const rule of [
+ ":root {\n\t--thread-scrollbar-gutter: 10px;",
+ ":root.client-windows {\n\t\t--thread-scrollbar-gutter: 8px;",
+ ]) {
+ assert.ok(css.includes(rule), rule);
+ }
+ for (const file of [
+ "features/chat/chat-page.tsx",
+ "components/assistant-ui/thread.tsx",
+ "features/chat/components/chat-model-notice.tsx",
+ ]) {
+ assert.doesNotMatch(await readSrcAsync(file), SCALED_GUTTER_INSET, file);
+ }
});
diff --git a/studio/frontend/tests/chat-remembers-its-model.test.ts b/studio/frontend/tests/chat-remembers-its-model.test.ts
index c5b3a65e4c3..90c0e9b3c42 100644
--- a/studio/frontend/tests/chat-remembers-its-model.test.ts
+++ b/studio/frontend/tests/chat-remembers-its-model.test.ts
@@ -254,7 +254,7 @@ test("the conversation reserves the space the notice overlay takes", () => {
// 0px so every surface without a notice keeps exactly the padding it had.
assert.match(
thread,
- /pt-\[calc\(var\(--studio-content-top-inset,0px\)\+var\(--studio-chat-header-height,48px\)\+var\(--studio-chat-notice-height,0px\)\)\]/,
+ /\[--thread-header-offset:calc\(var\(--studio-content-top-inset,0px\)\+var\(--studio-chat-header-height,48px\)\+var\(--studio-chat-notice-height,0px\)\)\] pt-\[var\(--thread-header-offset\)\]/,
);
// And the fade moves down with it, or it would dissolve behind the opaque bar.
const fade = slice(page, "chat-header-fade", '"');
diff --git a/studio/frontend/tests/code-fence-body.test.ts b/studio/frontend/tests/code-fence-body.test.ts
index aaeebb1693c..ddff6feb662 100644
--- a/studio/frontend/tests/code-fence-body.test.ts
+++ b/studio/frontend/tests/code-fence-body.test.ts
@@ -284,3 +284,18 @@ test("a fence source is highlighted once per revision, not twice", () => {
"the surviving effect runs before paint",
);
});
+
+const TABLE_CONTROLS =
+ '[data-streamdown="table-wrapper"] > div:first-child:not(:last-child)';
+const TABLE_BUTTON =
+ /height: calc\(var\(--spacing\) \* 8\);[\s\S]*border-radius: 10px;\s*color: var\(--color-chat-icon-fg\);/;
+
+// Streamdown draws the table's buttons itself, 23px with no hover fill, beside these 32px ones.
+test("a table's toolbar buttons are drawn like the code block's", () => {
+ const css = readSrc("index.css");
+ const at = css.indexOf(`${TABLE_CONTROLS} > .relative > button {`);
+ assert.match(css.slice(at, css.indexOf("}", at)), TABLE_BUTTON);
+ assert.ok(
+ css.includes(`${TABLE_CONTROLS} > .relative {\n\t\tdisplay: flex;`),
+ );
+});
diff --git a/studio/frontend/tests/find-in-page.test.ts b/studio/frontend/tests/find-in-page.test.ts
index 0ff4d64aed0..4a6e6c075e5 100644
--- a/studio/frontend/tests/find-in-page.test.ts
+++ b/studio/frontend/tests/find-in-page.test.ts
@@ -1511,6 +1511,25 @@ test("the bar stays out of a backgrounded scope, and off the document origin", a
assert.equal(/\bw-(?:40|64)\b/.test(input[1]), false);
});
+// The toasts' offset under the open bar is written against the bar's top and h-13.
+const FIND_SURFACE_GEOMETRY =
+ /className="find-bar-surface [^"]*top-\[calc\(var\(--studio-content-top-inset,0px\)\+3\.5rem\)\] [^"]*\bh-13\b/;
+const TOAST_UNDER_FIND_BAR =
+ /offset-top: calc\(var\(--studio-content-top-inset, 0px\) \+ 3\.5rem \+ 3\.25rem \* var\(--ui-space-scale, 1\) \+ 0\.5rem\) !important;\s*--mobile-offset-top: calc\(var\(--studio-content-top-inset, 0px\) \+ 3\.5rem \+ 3\.25rem \* var\(--ui-space-scale, 1\) \+ 0\.5rem\) !important;/;
+
+test("toasts clear the bar while it is open", () => {
+ assert.match(FIND_BAR, FIND_SURFACE_GEOMETRY);
+ assert.match(FIND_IN_PAGE, FIND_SURFACE_GEOMETRY);
+ const toaster = '[data-sonner-toaster][data-y-position="top"]';
+ const rule = cssRule(INDEX, `:root:has(.find-bar-surface) ${toaster}`);
+ assert.match(rule, TOAST_UNDER_FIND_BAR);
+ // The toaster renders outside the chrome wrapper, so the bar's inset has to reach <html>.
+ assert.match(
+ readSrc("app/provider.tsx"),
+ /set\("--studio-content-top-inset", usesCustomTitlebar \? "34px" : null\);/,
+ );
+});
+
test("the reveal looks again while the scroll is still moving", async () => {
// Such a subtree contributes placeholder height until it renders, clamping the first scroll
// 3415px short on all three engines. The node suite cannot see a scroll.
diff --git a/studio/frontend/tests/lan-access-state.test.ts b/studio/frontend/tests/lan-access-state.test.ts
index 95ced09d1fa..2b4898af6ca 100644
--- a/studio/frontend/tests/lan-access-state.test.ts
+++ b/studio/frontend/tests/lan-access-state.test.ts
@@ -136,7 +136,7 @@ test("the port form is capability-gated and keeps its live error region mounted"
);
assert.match(
SECTION_SOURCE,
- /<\/div>\s*<span\s+id=\{portErrorId\}\s+role="status"\s+aria-live="polite"[\s\S]*?>[\s\S]*?\{portErrorVisible\s*\?\s*portInvalid/,
+ /below=\{\s*<span\s+id=\{portErrorId\}\s+role="status"\s+aria-live="polite"[\s\S]*?>[\s\S]*?\{portErrorVisible\s*\?\s*portInvalid/,
);
assert.doesNotMatch(
SECTION_SOURCE,
diff --git a/studio/frontend/tests/library-chats.test.ts b/studio/frontend/tests/library-chats.test.ts
index 53d578432db..150fc3e56c4 100644
--- a/studio/frontend/tests/library-chats.test.ts
+++ b/studio/frontend/tests/library-chats.test.ts
@@ -482,6 +482,13 @@ test("library menus take the sidebar menu look, with a shadow, in dark mode", ()
assert.equal(page.match(/className="library-menu /g)?.length, 2);
});
+test("every library toolbar's search narrows with the header row, so it never reaches the title", () => {
+ for (const file of ["features/library/components/library-toolbar.tsx", "features/library/chats/chats-toolbar.tsx"]) {
+ assert.match(readSrc(file), /w-\[clamp\(10rem,calc\(100cqw-30rem\),min\(15rem,24vw\)\)\]/, file);
+ }
+ assert.match(readSrc("features/library/components/library-header.tsx"), /className="@container /);
+});
+
test("the library header row casts a light shadow once stuck", () => {
const css = readSrc("index.css");
assert.match(
diff --git a/studio/frontend/tests/mac-titlebar-optical-alignment.test.ts b/studio/frontend/tests/mac-titlebar-optical-alignment.test.ts
index 2f3ad08209c..545b5431fcc 100644
--- a/studio/frontend/tests/mac-titlebar-optical-alignment.test.ts
+++ b/studio/frontend/tests/mac-titlebar-optical-alignment.test.ts
@@ -22,9 +22,12 @@ test("mac titlebar navigation shifts buttons with centered glyphs", async () =>
/mt-\[var\(--studio-titlebar-navigation-margin-top,0px\)\]/,
);
- const enlargedIconClass =
- 'className="size-icon !size-[calc(var(--icon-size)+1px)]"';
- assert.equal(titlebar.split(enlargedIconClass).length - 1, 3);
+ // macOS keeps the one-step-up icon; the custom titlebar's are a fixed 18px.
+ assert.match(
+ titlebar,
+ /const iconClass = customTitlebar\s*\?\s*"size-\[18px\]"\s*:\s*"size-icon !size-\[calc\(var\(--icon-size\)\+1px\)\]";/,
+ );
+ assert.equal(titlebar.split("className={iconClass}").length - 1, 3);
});
test("mac chat and media headers share the lowered control row", async () => {
diff --git a/studio/frontend/tests/overlay-shadow-gutter.test.ts b/studio/frontend/tests/overlay-shadow-gutter.test.ts
index ec67fb87584..c36873bf3aa 100644
--- a/studio/frontend/tests/overlay-shadow-gutter.test.ts
+++ b/studio/frontend/tests/overlay-shadow-gutter.test.ts
@@ -67,8 +67,11 @@ test("the rail's edge drops by the gutter, so the cards keep their inset", () =>
test("the cap grows by both gutters, so the cards' band is unchanged", () => {
// 100dvh less N, N being the band's trim less the gutters added back, so a
// bare 100dvh once they cover it. Anything smaller spends the cards' own room,
- // and a cap past 100dvh puts the scrollport's top off screen.
- const caps = PROVIDER.match(/max-h-\[(?:calc\()?100dvh(?:_-_(\d+)px\))?\]/g);
+ // and a cap past 100dvh puts the scrollport's top off screen. The window
+ // chrome comes off too, since the window controls sit above the rail.
+ const caps = PROVIDER.match(
+ /max-h-\[(?:calc\()?100dvh(?:_-_(\d+)px\)|-var\(--studio-window-chrome-top,0px\)\))?\]/g,
+ );
assert.equal(caps?.length, 2, "a rail lost its cap");
for (const cap of caps ?? []) {
const trim = Number(cap.match(/_-_(\d+)px/)?.[1] ?? 0);
diff --git a/studio/frontend/tests/sidebar-action-rows-inert.test.ts b/studio/frontend/tests/sidebar-action-rows-inert.test.ts
index bf40aedc0d2..229793a6a3c 100644
--- a/studio/frontend/tests/sidebar-action-rows-inert.test.ts
+++ b/studio/frontend/tests/sidebar-action-rows-inert.test.ts
@@ -134,15 +134,18 @@ test("the sidebar list measures its scroll rail", async () => {
source,
/absolute start-0 end-\[var\(--sidebar-rail,0px\)\] bottom-full/,
);
- // Only the Windows auto reset may set a width; hiding the rail is what a
+ // Only the Windows-wide auto reset may set a width; hiding the rail is what a
// width override caused before.
const railWidthDecls = (
INDEX.match(
/\.sidebar-scroll-fade[^{]*\{[^}]*scrollbar-width:\s*[^;}]+/g,
) ?? []
).map((rule) => /scrollbar-width:\s*([^;}]+)/.exec(rule)?.[1].trim());
- assert.deepEqual(railWidthDecls, ["auto"]);
- assert.match(INDEX, /:root\.client-windows \.sidebar-scroll-fade,/);
+ assert.deepEqual(railWidthDecls, []);
+ assert.match(
+ INDEX,
+ /:root\.client-windows \*,\s*:root\.client-windows \*:hover \{\s*scrollbar-width: auto;/,
+ );
assert.equal(
/\.sidebar-scroll-fade::-webkit-scrollbar \{/.test(INDEX),
false,
diff --git a/studio/frontend/tests/titlebar-modal-layering.test.ts b/studio/frontend/tests/titlebar-modal-layering.test.ts
index c52491c2331..5795785630a 100644
--- a/studio/frontend/tests/titlebar-modal-layering.test.ts
+++ b/studio/frontend/tests/titlebar-modal-layering.test.ts
@@ -2,6 +2,8 @@
// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
import assert from "node:assert/strict";
+import { readdirSync } from "node:fs";
+import { join } from "node:path";
import test from "node:test";
import { readSrc } from "./helpers/kit.ts";
@@ -16,6 +18,15 @@ const ALERT_DIALOG_OVERLAY_PATTERN =
/data-slot="alert-dialog-overlay"[\s\S]*?"([^"]*\bz-50\b[^"]*)"/;
const TOP_FULL_PATTERN = /top-full/;
const CLOSED_DECORATION_PATTERN = /<\/div>\s*\)\}\s*$/;
+const DIALOG_SURFACE_CLASSES =
+ /<(?:DialogContent|AlertDialogContent|CommandDialog)\b(?:[^>]|=>)*?\bclassName="([^"]*)"/g;
+const WHOLE_WINDOW_CENTRE = /(?:^|\s)(?:max-sm:)?top-1\/2(?:\s|$)/;
+
+/** Every component under src, so a new dialog cannot slip past. */
+const COMPONENTS = readdirSync(join(import.meta.dirname, "../src"), {
+ recursive: true,
+ encoding: "utf8",
+}).filter((path) => path.endsWith(".tsx"));
function zIndex(block: string): number {
const match = block.match(Z_INDEX_PATTERN);
@@ -69,3 +80,16 @@ test("below-titlebar decoration is not trapped in the titlebar stacking context"
const header = titlebar.slice(headerIndex, headerEnd);
assert.doesNotMatch(header, TOP_FULL_PATTERN);
});
+
+// A top-* class at a call site makes twMerge drop the base's chrome-aware centre, so a plain
+// top-1/2 centres on the whole window and the titlebar covers the dialog's top.
+test("dialogs that set their own top still centre below the window chrome", () => {
+ let checked = 0;
+ for (const file of COMPONENTS) {
+ for (const [, classes] of readSrc(file).matchAll(DIALOG_SURFACE_CLASSES)) {
+ checked += 1;
+ assert.doesNotMatch(classes, WHOLE_WINDOW_CENTRE, file);
+ }
+ }
+ assert.ok(checked > 10, `only ${checked} dialog surfaces matched`);
+});
diff --git a/studio/frontend/tests/toast-offset.test.ts b/studio/frontend/tests/toast-offset.test.ts
index 9ed1a0cb49e..198dd01f733 100644
--- a/studio/frontend/tests/toast-offset.test.ts
+++ b/studio/frontend/tests/toast-offset.test.ts
@@ -47,7 +47,7 @@ test("desktop routes without page headers clear the titlebar", () => {
});
test("custom-titlebar desktop headers clear both titlebar bands", () => {
- for (const pathname of ["/chat", "/images", "/video"]) {
+ for (const pathname of ["/chat", "/images", "/video", "/audio"]) {
assert.deepEqual(getToastOffsets(pathname, true, true), {
default: { top: 86, right: 12 },
mobile: { top: 86, right: 16 },
@@ -56,7 +56,7 @@ test("custom-titlebar desktop headers clear both titlebar bands", () => {
});
test("macOS desktop headers overlay the native titlebar", () => {
- for (const pathname of ["/chat", "/images", "/video"]) {
+ for (const pathname of ["/chat", "/images", "/video", "/audio"]) {
assert.deepEqual(getToastOffsets(pathname, true, false), {
default: { top: 52, right: 12 },
mobile: { top: 52, right: 16 },
diff --git a/studio/frontend/tests/ui-font-size-scales-spacing.test.ts b/studio/frontend/tests/ui-font-size-scales-spacing.test.ts
index 9895d5bf791..918be707776 100644
--- a/studio/frontend/tests/ui-font-size-scales-spacing.test.ts
+++ b/studio/frontend/tests/ui-font-size-scales-spacing.test.ts
@@ -172,7 +172,8 @@ test("the titlebar reserves room for its controls, which stay in the band", () =
// The spacer stands in for one of those buttons while the navbar renders
// its own trigger, so it holds the same fixed width.
assert.match(titlebar, /aria-hidden="true" className="size-\[30px\] shrink-0"/);
- assert.match(titlebar, /inline-flex h-\[26px\] w-\[26px\] shrink-0/);
+ // The window controls are Windows caption buttons: the band's full height, 46px wide.
+ assert.match(titlebar, /inline-flex h-full w-\[46px\] shrink-0/);
// The padding and gaps around them still scale, so the drag region has to
// start further out or it covers the last button.
// max(), because the buttons are fixed: the slot may grow with the padding
@@ -399,23 +400,21 @@ test("a scaled media rail leaves the preview its minimum", () => {
// At 200% a shrink-0 rail passed the 50rem split it sits in, clipping the
// preview. The header column shrinks the same way, so the dividers line up.
// The width is the draggable --media-rail-width, falling back to the old fixed one.
- for (const [file, width, split] of [
- ["features/images/images-page.tsx", "408px", "@[50rem]"],
- ["features/audio/audio-page.tsx", "408px", "@[50rem]"],
- ["features/video/video-page.tsx", "400px", "lg"],
- ] as const) {
+ const rail = "var(--media-rail-width,calc(408px*var(--ui-space-scale,1)))";
+ for (const file of [
+ "features/images/images-page.tsx",
+ "features/audio/audio-page.tsx",
+ "features/video/video-page.tsx",
+ ]) {
const source = readSrc(file);
- const rail = `var(--media-rail-width,calc(${width}*var(--ui-space-scale,1)))`;
assert.ok(
- source.includes(`${split}:w-[min(${rail},calc(100%-13rem))]`),
+ source.includes(`@[50rem]:w-[min(${rail},calc(100%-13rem))]`),
`${file} rail can outgrow its split`,
);
- if (split !== "lg") {
- assert.ok(
- source.includes(`grid-cols-[minmax(0,${rail})_minmax(13rem,1fr)]`),
- `${file} header column drifts from its rail`,
- );
- }
+ assert.ok(
+ source.includes(`grid-cols-[minmax(0,${rail})_minmax(13rem,1fr)]`),
+ `${file} header column drifts from its rail`,
+ );
}
});
@@ -466,7 +465,7 @@ test("composite settings controls shrink inside their row", () => {
// wrapper can shrink.
assert.ok(
readSrc("features/settings/tabs/general-tab.tsx").includes(
- '<div className="flex min-w-0 flex-col items-end gap-1.5">\n <div className="flex max-w-full items-center gap-2">\n <div className="relative w-[calc(260px*var(--ui-space-scale,1))] min-w-0">',
+ '<div className="flex max-w-full items-center gap-2">\n <div className="relative w-[calc(260px*var(--ui-space-scale,1))] min-w-0">',
),
);
assert.ok(
diff --git a/studio/frontend/tests/update-banner-flex-priority.test.ts b/studio/frontend/tests/update-banner-flex-priority.test.ts
index 8cdb21b4d35..0ae3a6de9cd 100644
--- a/studio/frontend/tests/update-banner-flex-priority.test.ts
+++ b/studio/frontend/tests/update-banner-flex-priority.test.ts
@@ -138,7 +138,7 @@ test("a floored card paints all the height its slot reserves", () => {
// Short notes content must not leave an unpainted gap inside the floor.
for (const [name, source] of [...CARDS, ["llama.cpp", LLAMA] as const]) {
assert.match(
- classes(source, "relative flex max-h-[calc(100dvh_-_2rem)] "),
+ classes(source, "relative flex max-h-[calc(100dvh_-_2rem"),
/\bgrow\b/,
`the ${name} card can be shorter than the slot it sits in`,
);
@@ -362,10 +362,11 @@ test("the rail's block gutter costs the cards no room", () => {
const rules = rail.slice(0, rail.indexOf('"'));
const style = rail.slice(rail.indexOf("style={{"), rail.indexOf("}}"));
// 2rem for the cards' own band, less the 24px of gutter the rail adds
- // around them, so the cards keep exactly the band they had.
+ // around them, so the cards keep exactly the band they had. The desktop
+ // rail also stops below the window chrome.
assert.match(
rules,
- /max-h-\[(?:calc\()?100dvh(?:_-_\d+px\))?\]/,
+ /max-h-\[(?:calc\()?100dvh(?:_-_\d+px\)|-var\(--studio-window-chrome-top,0px\)\))?\]/,
"the rail lost the cap that pays for its gutters",
);
// From the constants, not pb-4/pt-2: those are rem, so at any root size but
diff --git a/tests/studio/test_desktop_reliability_frontend_contract.py b/tests/studio/test_desktop_reliability_frontend_contract.py
index ce8354a1bd9..3f45ac3fdad 100644
--- a/tests/studio/test_desktop_reliability_frontend_contract.py
+++ b/tests/studio/test_desktop_reliability_frontend_contract.py
@@ -632,25 +632,23 @@ def test_expanded_titlebar_button_and_corner_match_sidebar_edge():
assert "style={{ width: titlebarNavigationWidth }}" in source
assert "left: titlebarNavigationWidth" in source
assert "<DesktopTitlebarNavigation" in source
- assert "const contentBorderLeft = pinned" in source
- assert ': "0px";' in source
+ # The card's corner starts on the sidebar's last column, so its left edge meets the sidebar's.
+ assert "const cornerLeft = `calc(${sidebarWidth} - 1px)`;" in source
# Keep the decoration below z-50 modals and outside the z-[70] header.
assert 'data-slot="window-titlebar-decoration"' in source
decoration = source.split('data-slot="window-titlebar-decoration"', 1)[1].split("<header", 1)[0]
assert (
'className="pointer-events-none absolute inset-x-0 '
- 'top-[var(--studio-custom-titlebar-height)] z-[45] h-3"' in decoration
- )
- # The border is always visible.
- assert 'className="absolute top-0 h-px bg-sidebar-border"' in decoration
- # The backing and corner only appear when pinned.
- assert decoration.count("{pinned && (") == 2
- assert 'className="absolute top-0 size-3 -translate-x-px bg-sidebar"' in decoration
- assert (
- 'className="absolute top-0 size-3 -translate-x-px rounded-tl-[12px] border-l border-t border-sidebar-border bg-background"'
- in decoration
+ 'top-[var(--studio-custom-titlebar-height)] z-[45] h-[12px]"' in decoration
)
+ # One border draws the edge and, when pinned, its rounded corner; the top edge always shows.
+ assert '"absolute top-0 right-0 h-[12px] border-t border-sidebar-border",' in decoration
+ assert 'pinned && "rounded-tl-[12px] border-l",' in decoration
+ assert "style={{ left: pinned ? cornerLeft : 0 }}" in decoration
+ # The sidebar-coloured mask outside the corner only appears when pinned.
+ assert decoration.count("{pinned && (") == 1
+ assert "transparent_11px,var(--color-sidebar)_12px" in decoration
def test_desktop_titlebar_separates_navigation_from_sidebar_brand():
diff --git a/tests/studio/test_update_release_notes.py b/tests/studio/test_update_release_notes.py
index 50764e10e28..a83c05d29eb 100644
--- a/tests/studio/test_update_release_notes.py
+++ b/tests/studio/test_update_release_notes.py
@@ -40,6 +40,13 @@ WEB_BANNER = FRONTEND / "components/web/update-banner.tsx"
TAURI_BANNER = FRONTEND / "components/tauri/update-banner.tsx"
+# The desktop card also stops below the window chrome.
+CARD_CAP = {
+ WEB_BANNER: "max-h-[calc(100dvh_-_2rem)]",
+ TAURI_BANNER: "max-h-[calc(100dvh_-_2rem_-_var(--studio-window-chrome-top,0px))]",
+}
+
+
# An apostrophe in JSX text is prose, not the start of a string: "We're ready"
# in a banner's copy would otherwise run a scanner to the next apostrophe or off
# the end of the file, and a copy edit would fail these tests. The frontend is
@@ -1231,7 +1238,7 @@ def test_expanded_popup_fits_a_short_viewport(banner):
# The notes region shrinks inside the capped card, so header and actions stay on screen.
assert "min-h-0 flex-1" in panel, "notes height must follow the viewport"
src = banner.read_text(encoding = "utf-8")
- assert "max-h-[calc(100dvh_-_2rem)]" in src, "card is the backstop on tiny viewports"
+ assert CARD_CAP[banner] in src, "card is the backstop on tiny viewports"
def test_relative_release_body_links_point_at_the_repository():
@@ -1359,7 +1366,7 @@ def test_only_the_notes_region_scrolls(banner):
surface = _card_surface(src)
# The painted surface: capped, and a column, so the region inside it is the
# one that scrolls.
- _assert_classes(surface, "flex", "max-h-[calc(100dvh_-_2rem)]", "flex-col")
+ _assert_classes(surface, "flex", CARD_CAP[banner], "flex-col")
# Neither card scrolls. Asserted as the absence of a scrolling overflow
# rather than as the presence of `overflow-hidden`, because those are two
# different claims: the browser card now clips nothing at all, and reading
@@ -1842,7 +1849,9 @@ def _capped_rails(provider: str) -> int:
"""
# _only_under and not a substring: `md:max-h-[100dvh]` contains the utility while leaving
# every smaller viewport uncapped, which is the spill this test exists to prevent.
- return sum(1 for rail in _corner_rails(provider) if _only_under(rail, "max-h-[100dvh]"))
+ # The desktop rail stops below the window chrome; there is none in the browser.
+ caps = ("max-h-[100dvh]", "max-h-[calc(100dvh-var(--studio-window-chrome-top,0px))]")
+ return sum(1 for rail in _corner_rails(provider) if any(_only_under(rail, c) for c in caps))
def test_the_class_matchers_tell_a_gated_rule_from_an_ungated_one():