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.

Desktop: keep slide-in panels below the custom titlebar (#7954)

oobaboogabbbbaae30065
diff --git a/studio/frontend/src/components/assistant-ui/message-response-details-sheet.tsx b/studio/frontend/src/components/assistant-ui/message-response-details-sheet.tsx
index 23332f8fdff..48b9d193795 100644
--- a/studio/frontend/src/components/assistant-ui/message-response-details-sheet.tsx
+++ b/studio/frontend/src/components/assistant-ui/message-response-details-sheet.tsx
@@ -339,11 +339,6 @@ export const MessageResponseDetailsSheet: FC<{
side="right"
className="w-[min(28rem,100vw)] p-0 sm:max-w-[28rem]"
showCloseButton={false}
- // Clear the desktop window controls; 0px in the browser and on macOS.
- style={{
- height: "calc(100% - var(--studio-custom-titlebar-height, 0px))",
- marginTop: "var(--studio-custom-titlebar-height, 0px)",
- }}
>
<SheetHeader className="border-b p-4">
<div className="relative">
diff --git a/studio/frontend/src/components/ui/sheet.tsx b/studio/frontend/src/components/ui/sheet.tsx
index 258eb21fe9d..f23db055186 100644
--- a/studio/frontend/src/components/ui/sheet.tsx
+++ b/studio/frontend/src/components/ui/sheet.tsx
@@ -11,6 +11,16 @@ import { cn } from "@/lib/utils";
import { Cancel01Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
+// Windows/Linux custom titlebar paints over the viewport at z-70, so a fixed
+// sheet must start below it. DesktopChromeVarsEffect mirrors the height onto
+// <html> since sheets portal to document.body; unset in browser/macOS (0px).
+const VIEWPORT_TOP_EDGE =
+ "data-[side=left]:top-[var(--studio-custom-titlebar-height,0px)] data-[side=right]:top-[var(--studio-custom-titlebar-height,0px)] data-[side=top]:top-[var(--studio-custom-titlebar-height,0px)]";
+
+// A contained sheet follows its container's top edge; no chrome sits over it.
+const CONTAINED_TOP_EDGE =
+ "data-[side=left]:top-0 data-[side=right]:top-0 data-[side=top]:top-0";
+
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
return <SheetPrimitive.Root data-slot="sheet" {...props} />;
}
@@ -94,8 +104,9 @@ function SheetContent({
data-slot="sheet-content"
data-side={side}
className={cn(
- "bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 z-50 flex flex-col bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-[side=bottom]:max-h-[85dvh] data-[side=top]:max-h-[85dvh] data-[side=bottom]:overflow-y-auto data-[side=top]:overflow-y-auto",
+ "bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 z-50 flex flex-col bg-clip-padding text-sm shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:left-0 data-[side=left]:bottom-0 data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:right-0 data-[side=right]:bottom-0 data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm data-[side=bottom]:max-h-[85dvh] data-[side=top]:max-h-[85dvh] data-[side=bottom]:overflow-y-auto data-[side=top]:overflow-y-auto",
position === "fixed" ? "fixed" : "absolute",
+ position === "fixed" ? VIEWPORT_TOP_EDGE : CONTAINED_TOP_EDGE,
className,
)}
{...props}
diff --git a/studio/frontend/src/features/chat/components/research-activity-panel.tsx b/studio/frontend/src/features/chat/components/research-activity-panel.tsx
index 33589358ce9..7679876cb12 100644
--- a/studio/frontend/src/features/chat/components/research-activity-panel.tsx
+++ b/studio/frontend/src/features/chat/components/research-activity-panel.tsx
@@ -816,7 +816,10 @@ export function ResearchActivityPanel({
return (
<aside
aria-label="Research activity"
- className="relative flex min-h-0 flex-col bg-background text-foreground"
+ className={cn(
+ "relative flex min-h-0 flex-col bg-background text-foreground",
+ variant === "sheet" && "h-full",
+ )}
style={
variant === "panel"
? {
@@ -825,11 +828,7 @@ export function ResearchActivityPanel({
marginTop:
"calc(var(--studio-content-top-inset, 0px) + var(--studio-chat-header-height, 48px))",
}
- : {
- height:
- "calc(100% - var(--studio-custom-titlebar-height, 0px))",
- marginTop: "var(--studio-custom-titlebar-height, 0px)",
- }
+ : undefined
}
>
<header className="shrink-0 border-b border-border/70 px-4 py-3.5">
diff --git a/studio/frontend/src/features/rag/components/document-preview-sheet.tsx b/studio/frontend/src/features/rag/components/document-preview-sheet.tsx
index 5c5f08c2902..032da956d19 100644
--- a/studio/frontend/src/features/rag/components/document-preview-sheet.tsx
+++ b/studio/frontend/src/features/rag/components/document-preview-sheet.tsx
@@ -408,13 +408,7 @@ export function DocumentPreviewSheet() {
<Sheet open={open} onOpenChange={(o) => !o && closePreview()}>
<SheetContent
side="right"
- // Clear the desktop window controls; 0px in the browser and on macOS.
- style={{
- width: previewWidth,
- maxWidth: "95vw",
- height: "calc(100% - var(--studio-custom-titlebar-height, 0px))",
- marginTop: "var(--studio-custom-titlebar-height, 0px)",
- }}
+ style={{ width: previewWidth, maxWidth: "95vw" }}
className={cn(
"flex w-full flex-col gap-0 p-0",
resizing && "select-none",
diff --git a/tests/studio/test_desktop_reliability_frontend_contract.py b/tests/studio/test_desktop_reliability_frontend_contract.py
index 848f37304cc..bebecfec565 100644
--- a/tests/studio/test_desktop_reliability_frontend_contract.py
+++ b/tests/studio/test_desktop_reliability_frontend_contract.py
@@ -22,6 +22,10 @@ THREAD = FRONTEND / "components/assistant-ui/thread.tsx"
THREAD_SIDEBAR = FRONTEND / "features/chat/thread-sidebar.tsx"
SHARED_COMPOSER = FRONTEND / "features/chat/shared-composer.tsx"
TITLEBAR = FRONTEND / "components/tauri/window-titlebar.tsx"
+SHEET = FRONTEND / "components/ui/sheet.tsx"
+RESEARCH_ACTIVITY_PANEL = FRONTEND / "features/chat/components/research-activity-panel.tsx"
+RESPONSE_DETAILS_SHEET = FRONTEND / "components/assistant-ui/message-response-details-sheet.tsx"
+DOCUMENT_PREVIEW_SHEET = FRONTEND / "features/rag/components/document-preview-sheet.tsx"
NATIVE_DIALOGS = REPO / "studio/src-tauri/src/native_file_dialogs.rs"
NATIVE_CLIPBOARD = REPO / "studio/src-tauri/src/native_clipboard.rs"
TAURI_MAIN = REPO / "studio/src-tauri/src/main.rs"
@@ -487,6 +491,36 @@ def test_tauri_collapse_removes_the_icon_rail_but_web_keeps_it():
assert "inert={(hasPinMode && !pinned && collapseToZero) || undefined}" in primitive
+def test_fixed_sheets_start_below_the_custom_titlebar():
+ provider = APP_PROVIDER.read_text(encoding = "utf-8")
+ sheet = SHEET.read_text(encoding = "utf-8")
+
+ # Portalled sheets read the height off <html>, so the mirror has to stay.
+ assert 'set("--studio-custom-titlebar-height", usesCustomTitlebar ? "34px" : null)' in provider
+
+ # Only viewport-fixed sheets clear the titlebar; the absolute recipe block
+ # sheet sits in its own container and keeps a plain top edge.
+ assert 'position === "fixed" ? VIEWPORT_TOP_EDGE : CONTAINED_TOP_EDGE' in sheet
+ for side in ("left", "right", "top"):
+ assert f"data-[side={side}]:top-[var(--studio-custom-titlebar-height,0px)]" in sheet
+ assert f"data-[side={side}]:top-0" in sheet
+
+ # Anchor both edges so the inset shrinks the sheet; h-full would instead
+ # push its bottom past the viewport.
+ for side in ("left", "right"):
+ assert f"data-[side={side}]:bottom-0" in sheet
+ assert f"data-[side={side}]:h-full" not in sheet
+
+ # The shared class is the only sheet offset; a local one would double up.
+ # Dialogs still read --studio-window-chrome-top (DesktopChromeVarsEffect).
+ for portalled in (
+ RESEARCH_ACTIVITY_PANEL,
+ RESPONSE_DETAILS_SHEET,
+ DOCUMENT_PREVIEW_SHEET,
+ ):
+ assert "studio-custom-titlebar-height" not in portalled.read_text(encoding = "utf-8")
+
+
def test_visible_mac_sidebar_header_is_a_drag_region():
source = APP_SIDEBAR.read_text(encoding = "utf-8")
header = source.split("<SidebarHeader", 1)[1].split("</SidebarHeader>", 1)[0]