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: keep rounded boxes rounded when they scroll (#12431)

Michael Han9cf98aa359ff
diff --git a/studio/frontend/src/components/assistant-ui/markdown-block-boundary.tsx b/studio/frontend/src/components/assistant-ui/markdown-block-boundary.tsx
index be2844f8098..39263e84427 100644
--- a/studio/frontend/src/components/assistant-ui/markdown-block-boundary.tsx
+++ b/studio/frontend/src/components/assistant-ui/markdown-block-boundary.tsx
@@ -127,7 +127,7 @@ export function MarkdownBlockFallbackView({ content }: { content: string }) {
const fallback = markdownBlockFallback(content);
if (fallback.fenced) {
return (
- <div className="my-4 w-full overflow-x-auto rounded-xl border border-border bg-sidebar p-2">
+ <div className="my-4 w-full overflow-x-auto scroll-rounded rounded-xl border border-border bg-sidebar p-2">
{fallback.language && (
<div className="flex h-8 items-center text-muted-foreground text-xs">
<span className="ml-1 font-mono lowercase">
@@ -135,7 +135,7 @@ export function MarkdownBlockFallbackView({ content }: { content: string }) {
</span>
</div>
)}
- <pre className="overflow-x-auto rounded-md border border-border bg-background p-4 text-sm">
+ <pre className="overflow-x-auto scroll-rounded rounded-md border border-border bg-background p-4 text-sm">
<code>{fallback.text}</code>
</pre>
</div>
diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx
index 588312aba88..41dfc06e2b0 100644
--- a/studio/frontend/src/components/assistant-ui/thread.tsx
+++ b/studio/frontend/src/components/assistant-ui/thread.tsx
@@ -8520,100 +8520,104 @@ const AssistantActionBar: FC = () => {
align="start"
collisionPadding={moreMenuCollisionPadding}
onCloseAutoFocus={(e) => e.preventDefault()}
- className="aui-action-bar-more-content z-50 min-w-32 max-h-(--radix-dropdown-menu-content-available-height) overflow-x-hidden overflow-y-auto rounded-[21px] bg-popover px-[calc(9px*var(--ui-space-scale,1))] py-2 text-popover-foreground shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:shadow-[0_8px_28px_-6px_var(--background)]"
+ className="aui-action-bar-more-content z-50 min-w-32 max-h-(--radix-dropdown-menu-content-available-height) flex flex-col overflow-hidden rounded-[21px] bg-popover px-[calc(9px*var(--ui-space-scale,1))] py-2 text-popover-foreground shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:shadow-[0_8px_28px_-6px_var(--background)]"
>
- {/* Prevent an outside dismissal from triggering Delete. */}
- <MenuDismissGuard triggerRef={moreMenuTriggerRef} />
- <MessageMenuTime onShowDetails={() => setDetailsOpen(true)} />
- {!inlineReadAloud && ttsEnabled && (
- <MessagePrimitive.If speaking={false}>
- <ActionBarPrimitive.Speak asChild={true}>
- <ActionBarMorePrimitive.Item className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50">
- <HugeiconsIcon
- icon={Volume02Icon}
- strokeWidth={1.75}
- className="size-icon"
- />
- Read aloud
- </ActionBarMorePrimitive.Item>
- </ActionBarPrimitive.Speak>
- </MessagePrimitive.If>
- )}
- {!inlineEdit && <EditAssistantMessageMenuItem />}
- <ActionBarMorePrimitive.Item
- disabled={forkDisabled}
- onSelect={() => void forkMessage()}
- className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
- >
- <GitBranchIcon strokeWidth={1.75} className="size-icon" />
- Fork in new chat
- </ActionBarMorePrimitive.Item>
- <ActionBarPrimitive.ExportMarkdown
- asChild={true}
- onExport={exportMessageMarkdown}
- >
- <ActionBarMorePrimitive.Item className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
- <HugeiconsIcon
- icon={Download01Icon}
- strokeWidth={1.75}
- className="size-icon"
- />
- Export as markdown
- </ActionBarMorePrimitive.Item>
- </ActionBarPrimitive.ExportMarkdown>
- {activeProjectId && (
+ {/* Scroll an inner viewport: a scrollbar on the rounded surface squares its corners.
+ The surface padding insets it clear of the curve. */}
+ <div className="min-h-0 flex-1 overflow-x-hidden overflow-y-auto">
+ {/* Prevent an outside dismissal from triggering Delete. */}
+ <MenuDismissGuard triggerRef={moreMenuTriggerRef} />
+ <MessageMenuTime onShowDetails={() => setDetailsOpen(true)} />
+ {!inlineReadAloud && ttsEnabled && (
+ <MessagePrimitive.If speaking={false}>
+ <ActionBarPrimitive.Speak asChild={true}>
+ <ActionBarMorePrimitive.Item className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50">
+ <HugeiconsIcon
+ icon={Volume02Icon}
+ strokeWidth={1.75}
+ className="size-icon"
+ />
+ Read aloud
+ </ActionBarMorePrimitive.Item>
+ </ActionBarPrimitive.Speak>
+ </MessagePrimitive.If>
+ )}
+ {!inlineEdit && <EditAssistantMessageMenuItem />}
<ActionBarMorePrimitive.Item
- onSelect={() => {
- // Not getCopyText: it joins text parts alone, so a reply's
- // reasoning, tool calls and citations would be dropped and a
- // tool-only reply would read as empty. Same conversion the
- // whole-chat save runs.
- // Stripped: a project source is retrieved back into context, so
- // saved tokens would teach the model ids that resolve to nothing.
- const text = stripSearchImageTokens(
- replySourceMarkdown(
- aui.message().getState().content,
- toolResultModelText,
- ),
- );
- if (!text.trim()) {
- toast.info("No content to save.");
- return;
- }
- const state = aui.threadListItem().getState();
- // The list item's title belongs to the whole chat, so mark the
- // reply apart or saving both lists two identical names.
- const title = state.title ? `${state.title} - reply` : "reply";
- // activeProjectId can lag a thread switch while the stored
- // thread loads; resolve the destination from this thread.
- const remoteId =
- state.remoteId ||
- useChatRuntimeStore.getState().activeThreadId;
- void (async () => {
- const thread = remoteId
- ? await getStoredChatThread(remoteId).catch(() => null)
- : null;
- if (!thread?.projectId) {
- toast.info("This chat isn't in a project.");
- return;
- }
- await saveMarkdownAsProjectSource(
- thread.projectId,
- text,
- title,
- );
- })();
- }}
- className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
+ disabled={forkDisabled}
+ onSelect={() => void forkMessage()}
+ className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50"
>
- <HugeiconsIcon
- icon={FolderAttachmentIcon}
- strokeWidth={1.75}
- className="size-icon"
- />
- Save to project sources
+ <GitBranchIcon strokeWidth={1.75} className="size-icon" />
+ Fork in new chat
</ActionBarMorePrimitive.Item>
- )}
+ <ActionBarPrimitive.ExportMarkdown
+ asChild={true}
+ onExport={exportMessageMarkdown}
+ >
+ <ActionBarMorePrimitive.Item className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground">
+ <HugeiconsIcon
+ icon={Download01Icon}
+ strokeWidth={1.75}
+ className="size-icon"
+ />
+ Export as markdown
+ </ActionBarMorePrimitive.Item>
+ </ActionBarPrimitive.ExportMarkdown>
+ {activeProjectId && (
+ <ActionBarMorePrimitive.Item
+ onSelect={() => {
+ // Not getCopyText: it joins text parts alone, so a reply's
+ // reasoning, tool calls and citations would be dropped and a
+ // tool-only reply would read as empty. Same conversion the
+ // whole-chat save runs.
+ // Stripped: a project source is retrieved back into context, so
+ // saved tokens would teach the model ids that resolve to nothing.
+ const text = stripSearchImageTokens(
+ replySourceMarkdown(
+ aui.message().getState().content,
+ toolResultModelText,
+ ),
+ );
+ if (!text.trim()) {
+ toast.info("No content to save.");
+ return;
+ }
+ const state = aui.threadListItem().getState();
+ // The list item's title belongs to the whole chat, so mark the
+ // reply apart or saving both lists two identical names.
+ const title = state.title ? `${state.title} - reply` : "reply";
+ // activeProjectId can lag a thread switch while the stored
+ // thread loads; resolve the destination from this thread.
+ const remoteId =
+ state.remoteId ||
+ useChatRuntimeStore.getState().activeThreadId;
+ void (async () => {
+ const thread = remoteId
+ ? await getStoredChatThread(remoteId).catch(() => null)
+ : null;
+ if (!thread?.projectId) {
+ toast.info("This chat isn't in a project.");
+ return;
+ }
+ await saveMarkdownAsProjectSource(
+ thread.projectId,
+ text,
+ title,
+ );
+ })();
+ }}
+ className="aui-action-bar-more-item flex cursor-pointer select-none items-center gap-2 rounded-[12px] px-3 py-2 text-sm outline-none hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
+ >
+ <HugeiconsIcon
+ icon={FolderAttachmentIcon}
+ strokeWidth={1.75}
+ className="size-icon"
+ />
+ Save to project sources
+ </ActionBarMorePrimitive.Item>
+ )}
+ </div>
</ActionBarMorePrimitive.Content>
</ActionBarMorePrimitive.Root>
<MessageTiming side="top" className="h-8 px-2" />
diff --git a/studio/frontend/src/components/markdown/markdown-preview.tsx b/studio/frontend/src/components/markdown/markdown-preview.tsx
index a14cee895ad..dda01b1ce9e 100644
--- a/studio/frontend/src/components/markdown/markdown-preview.tsx
+++ b/studio/frontend/src/components/markdown/markdown-preview.tsx
@@ -92,7 +92,7 @@ function MarkdownPreviewImpl({
className={cn(
plain
? "h-full w-full min-w-0 overflow-auto p-2 text-xs leading-relaxed pointer-events-none select-none"
- : "nodrag max-h-56 w-full min-w-0 overflow-auto rounded-md border border-border/60 bg-muted/20 p-2 text-xs leading-relaxed",
+ : "nodrag max-h-56 w-full min-w-0 overflow-auto scroll-rounded rounded-md border border-border/60 bg-muted/20 p-2 text-xs leading-relaxed",
className,
)}
>
diff --git a/studio/frontend/src/components/tauri/log-details.tsx b/studio/frontend/src/components/tauri/log-details.tsx
index ebf77e9d9cd..fb0ddd9a8ae 100644
--- a/studio/frontend/src/components/tauri/log-details.tsx
+++ b/studio/frontend/src/components/tauri/log-details.tsx
@@ -91,7 +91,7 @@ export function LogDetails({
<pre
ref={logRef}
onScroll={handleScroll}
- className="mt-2 max-h-28 overflow-auto whitespace-pre-wrap break-words rounded-lg border border-border/50 bg-muted/30 p-3 font-mono text-ui-10 leading-relaxed text-muted-foreground"
+ className="mt-2 max-h-28 overflow-auto whitespace-pre-wrap break-words scroll-rounded rounded-lg border border-border/50 bg-muted/30 p-3 font-mono text-ui-10 leading-relaxed text-muted-foreground"
>
{text}
</pre>
diff --git a/studio/frontend/src/components/ui/alert-dialog.tsx b/studio/frontend/src/components/ui/alert-dialog.tsx
index 3fcb1051f2c..50e4d8c9218 100644
--- a/studio/frontend/src/components/ui/alert-dialog.tsx
+++ b/studio/frontend/src/components/ui/alert-dialog.tsx
@@ -6,6 +6,7 @@ import { AlertDialog as AlertDialogPrimitive } from "radix-ui";
import type * as React from "react";
import { Button } from "@/components/ui/button";
+import { useScrollOverflowRef } from "@/lib/scroll-overflow";
import { cn } from "@/lib/utils";
function AlertDialog({
@@ -53,6 +54,7 @@ function AlertDialogContent({
size = "default",
overlayClassName,
onOverlayClick,
+ ref,
...props
}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {
size?: "default" | "sm";
@@ -60,15 +62,18 @@ function AlertDialogContent({
/** Alert dialogs ignore outside clicks; set this to cancel on backdrop click. */
onOverlayClick?: () => void;
}) {
+ // Clipped to its radius in Firefox only while it overflows, like DialogContent.
+ const contentRef = useScrollOverflowRef(ref);
return (
<AlertDialogPortal>
<AlertDialogOverlay className={overlayClassName} onClick={onOverlayClick} />
<AlertDialogPrimitive.Content
+ ref={contentRef}
data-slot="alert-dialog-content"
data-size={size}
className={cn(
// Same short-viewport guard as DialogContent: scroll rather than clip the actions off screen.
- "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-[color-mix(in_oklab,var(--foreground)_calc(5%*var(--contrast-edge-gain,1)),transparent)] max-h-[calc(100dvh-var(--studio-window-chrome-top,0px)-2rem)] gap-6 overflow-y-auto rounded-4xl p-6 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-md group/alert-dialog-content fixed top-[calc(50%+var(--studio-window-chrome-top,0px)/2)] left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",
+ "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-[color-mix(in_oklab,var(--foreground)_calc(5%*var(--contrast-edge-gain,1)),transparent)] max-h-[calc(100dvh-var(--studio-window-chrome-top,0px)-2rem)] gap-6 overflow-y-auto scroll-rounded rounded-4xl p-6 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-md group/alert-dialog-content fixed top-[calc(50%+var(--studio-window-chrome-top,0px)/2)] left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",
// Confirms stay centered cards on phones rather than going full screen, but take the
// width available instead of a fixed 20rem. Important: the data-[size] rules outrank a plain max-w.
"max-sm:max-w-[calc(100%-2rem)]!",
diff --git a/studio/frontend/src/components/ui/context-menu.tsx b/studio/frontend/src/components/ui/context-menu.tsx
index 52598e0f03b..be7e80b0154 100644
--- a/studio/frontend/src/components/ui/context-menu.tsx
+++ b/studio/frontend/src/components/ui/context-menu.tsx
@@ -67,6 +67,7 @@ function ContextMenuRadioGroup({
function ContextMenuContent({
className,
+ children,
collisionPadding,
ref,
...props
@@ -81,11 +82,20 @@ function ContextMenuContent({
data-slot="context-menu-content"
collisionPadding={useWindowChromeCollisionPadding(collisionPadding)}
className={cn(
- "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-[color-mix(in_oklab,var(--foreground)_calc(5%*var(--contrast-edge-gain,1)),transparent)] bg-popover text-popover-foreground min-w-48 max-w-[calc(100vw-32px)] rounded-2xl p-1 shadow-2xl ring-1 duration-100 z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto",
+ "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-[color-mix(in_oklab,var(--foreground)_calc(5%*var(--contrast-edge-gain,1)),transparent)] bg-popover text-popover-foreground min-w-48 max-w-[calc(100vw-32px)] rounded-2xl p-1 shadow-2xl ring-1 duration-100 z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) flex flex-col overflow-hidden",
className,
)}
{...props}
- />
+ >
+ {/* Scroll an inner viewport, as DropdownMenuContent does: a scrollbar on the rounded
+ surface squares its corners, and the surface padding insets it clear of the curve. */}
+ <div
+ data-slot="context-menu-viewport"
+ className="min-h-0 flex-1 overflow-x-hidden overflow-y-auto"
+ >
+ {children}
+ </div>
+ </ContextMenuPrimitive.Content>
</ContextMenuPrimitive.Portal>
);
}
@@ -143,6 +153,7 @@ function ContextMenuSubTrigger({
function ContextMenuSubContent({
className,
+ children,
collisionPadding,
ref,
...props
@@ -159,11 +170,18 @@ function ContextMenuSubContent({
collisionPadding={useWindowChromeCollisionPadding(collisionPadding)}
// Capped and scrolled like ContextMenuContent, so a long list stays reachable.
className={cn(
- "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-popover text-popover-foreground min-w-32 max-w-[calc(100vw-32px)] rounded-md p-1 shadow-lg duration-100 z-50 origin-(--radix-context-menu-content-transform-origin) max-h-(--radix-context-menu-content-available-height) overflow-x-hidden overflow-y-auto",
+ "data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 bg-popover text-popover-foreground min-w-32 max-w-[calc(100vw-32px)] rounded-md p-1 shadow-lg duration-100 z-50 origin-(--radix-context-menu-content-transform-origin) max-h-(--radix-context-menu-content-available-height) flex flex-col overflow-hidden",
className,
)}
{...props}
- />
+ >
+ <div
+ data-slot="context-menu-viewport"
+ className="min-h-0 flex-1 overflow-x-hidden overflow-y-auto"
+ >
+ {children}
+ </div>
+ </ContextMenuPrimitive.SubContent>
</ContextMenuPrimitive.Portal>
);
}
diff --git a/studio/frontend/src/components/ui/dialog.tsx b/studio/frontend/src/components/ui/dialog.tsx
index f259d38ab38..ef081388087 100644
--- a/studio/frontend/src/components/ui/dialog.tsx
+++ b/studio/frontend/src/components/ui/dialog.tsx
@@ -10,6 +10,7 @@ import type * as React from "react";
import { createContext, useContext } from "react";
import { Button } from "@/components/ui/button";
+import { useScrollOverflowRef } from "@/lib/scroll-overflow";
import { cn } from "@/lib/utils";
import { Cancel01Icon } from "@hugeicons/core-free-icons";
import { HugeiconsIcon } from "@hugeicons/react";
@@ -77,6 +78,7 @@ function DialogContent({
overlayClassName,
overlayPosition,
onInteractOutside,
+ ref,
...props
}: React.ComponentProps<typeof DialogPrimitive.Content> & {
showCloseButton?: boolean;
@@ -86,6 +88,8 @@ function DialogContent({
overlayPosition?: "fixed" | "absolute";
}) {
const resolvedContainer = container ?? null;
+ // Firefox clips a scrolling dialog to its radius only while it overflows, keeping its shadow.
+ const contentRef = useScrollOverflowRef(ref);
return (
<DialogPortalContainerContext.Provider value={resolvedContainer}>
<DialogPortal container={resolvedContainer ?? undefined}>
@@ -94,11 +98,12 @@ function DialogContent({
position={overlayPosition ?? position}
/>
<DialogPrimitive.Content
+ ref={contentRef}
data-slot="dialog-content"
className={cn(
// max-h + scroll keeps tall dialogs reachable on short viewports; a call site
// managing its own height overrides both (twMerge drops the base classes).
- "bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-[color-mix(in_oklab,var(--foreground)_calc(5%*var(--contrast-edge-gain,1)),transparent)] grid max-h-[calc(100dvh-var(--studio-window-chrome-top,0px)-2rem)] max-w-[calc(100%-2rem)] gap-6 overflow-y-auto rounded-4xl px-7 pt-8 pb-7 text-sm ring-1 duration-100 sm:max-w-md top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2",
+ "bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-[color-mix(in_oklab,var(--foreground)_calc(5%*var(--contrast-edge-gain,1)),transparent)] grid max-h-[calc(100dvh-var(--studio-window-chrome-top,0px)-2rem)] max-w-[calc(100%-2rem)] gap-6 overflow-y-auto scroll-rounded rounded-4xl px-7 pt-8 pb-7 text-sm ring-1 duration-100 sm:max-w-md top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2",
// Viewport-fixed dialogs center below the desktop titlebar, which paints over them at
// z-70, and fill the screen at phone width instead of floating on a sliver of backdrop.
// Both are viewport-sized, so neither applies to a dialog portaled into a container.
diff --git a/studio/frontend/src/features/api-monitor/api-monitor-page.tsx b/studio/frontend/src/features/api-monitor/api-monitor-page.tsx
index ac187027e4e..79059dc7b36 100644
--- a/studio/frontend/src/features/api-monitor/api-monitor-page.tsx
+++ b/studio/frontend/src/features/api-monitor/api-monitor-page.tsx
@@ -374,7 +374,7 @@ function PayloadBlock({
<pre
data-reload-snapshot-sensitive
className={cn(
- "max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-lg bg-muted/50 p-3 text-ui-11 leading-[1.55]",
+ "max-h-72 overflow-auto whitespace-pre-wrap break-words scroll-rounded rounded-lg bg-muted/50 p-3 text-ui-11 leading-[1.55]",
tone === "error" && "bg-red-500/5 text-red-700 dark:text-red-400",
)}
>
diff --git a/studio/frontend/src/features/chat/chat-providers-dialog.tsx b/studio/frontend/src/features/chat/chat-providers-dialog.tsx
index e715585d142..2ab12a01782 100644
--- a/studio/frontend/src/features/chat/chat-providers-dialog.tsx
+++ b/studio/frontend/src/features/chat/chat-providers-dialog.tsx
@@ -1957,7 +1957,7 @@ export function ChatProvidersSettings({
</Button>
</div>
</div>
- <ul className="max-h-56 overflow-y-auto rounded-md border border-border/70 bg-background/50">
+ <ul className="max-h-56 overflow-y-auto scroll-rounded rounded-md border border-border/70 bg-background/50">
{filteredAvailableModels.length === 0 ? (
<li className="px-3 py-3 text-xs text-muted-foreground">
No matching models
@@ -2046,7 +2046,7 @@ export function ChatProvidersSettings({
</Button>
</div>
</div>
- <ul className="max-h-56 overflow-y-auto rounded-md border border-border/70 bg-background/50">
+ <ul className="max-h-56 overflow-y-auto scroll-rounded rounded-md border border-border/70 bg-background/50">
{filteredAvailableModels.length === 0 ? (
<li className="px-3 py-3 text-xs text-muted-foreground">
No matching models
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 439796edc25..ec20d219a24 100644
--- a/studio/frontend/src/features/chat/components/research-activity-panel.tsx
+++ b/studio/frontend/src/features/chat/components/research-activity-panel.tsx
@@ -390,7 +390,7 @@ const ActivityRow = memo(function ActivityRow({
</ul>
) : null}
{activity.reasoning ? (
- <div className="max-h-64 overflow-y-auto whitespace-pre-wrap break-words rounded-xl bg-muted/35 px-3 py-2 leading-relaxed text-foreground/80">
+ <div className="max-h-64 overflow-y-auto whitespace-pre-wrap break-words scroll-rounded rounded-xl bg-muted/35 px-3 py-2 leading-relaxed text-foreground/80">
{activity.state === "running" && activity.reasoning.length > 8000
? `…\n${activity.reasoning.slice(-8000)}`
: activity.reasoning}
diff --git a/studio/frontend/src/features/chat/components/stop-running-chats-dialog.tsx b/studio/frontend/src/features/chat/components/stop-running-chats-dialog.tsx
index 47083179e66..c69bbf2a813 100644
--- a/studio/frontend/src/features/chat/components/stop-running-chats-dialog.tsx
+++ b/studio/frontend/src/features/chat/components/stop-running-chats-dialog.tsx
@@ -63,7 +63,7 @@ export function StopRunningChatsDialog() {
</AlertDialogDescription>
</AlertDialogHeader>
{shown.length > 0 && (
- <ul className="max-h-40 overflow-y-auto rounded-md border bg-muted/40 px-3 py-2 text-sm">
+ <ul className="max-h-40 overflow-y-auto scroll-rounded rounded-md border bg-muted/40 px-3 py-2 text-sm">
{shown.map((title) => (
<li key={title} className="truncate py-0.5">
{title}
diff --git a/studio/frontend/src/features/export/components/export-run-panel.tsx b/studio/frontend/src/features/export/components/export-run-panel.tsx
index 55fc62825f6..6c9086dd971 100644
--- a/studio/frontend/src/features/export/components/export-run-panel.tsx
+++ b/studio/frontend/src/features/export/components/export-run-panel.tsx
@@ -578,7 +578,7 @@ export function ExportRunPanel(props: ExportRunPanelProps) {
<div
ref={logScrollRef}
onScroll={handleLogScroll}
- className="h-56 w-full overflow-auto rounded-lg border border-border/40 bg-black/85 p-3 font-mono text-ui-11 leading-[1.45] text-emerald-200/90"
+ className="h-56 w-full overflow-auto scroll-rounded rounded-lg border border-border/40 bg-black/85 p-3 font-mono text-ui-11 leading-[1.45] text-emerald-200/90"
>
{run.logLines.length === 0 ? (
<div className="flex h-full items-center justify-center text-muted-foreground/70">
diff --git a/studio/frontend/src/features/generation-presets/media-generation-preset-control.tsx b/studio/frontend/src/features/generation-presets/media-generation-preset-control.tsx
index f9edd30c8b1..b7792f76fb5 100644
--- a/studio/frontend/src/features/generation-presets/media-generation-preset-control.tsx
+++ b/studio/frontend/src/features/generation-presets/media-generation-preset-control.tsx
@@ -127,8 +127,10 @@ export function MediaGenerationPresetControl({
align="end"
sideOffset={8}
collisionPadding={12}
- className="max-h-[var(--radix-popover-content-available-height)] w-[min(320px,calc(100vw-24px))] gap-0 overflow-x-hidden overflow-y-auto overscroll-contain rounded-xl border-border/70 p-0 shadow-xl"
+ className="max-h-[var(--radix-popover-content-available-height)] w-[min(320px,calc(100vw-24px))] gap-0 overflow-hidden rounded-xl border-border/70 p-0 shadow-xl"
>
+ {/* The list gives way on a short window, not the popover: a scrollbar on the rounded,
+ shadowed surface squares its corners. */}
<div className="shrink-0 border-b border-border/60 px-4 py-3.5">
<div className="flex items-center justify-between gap-3">
<p className="font-heading text-sm font-medium">
@@ -142,7 +144,7 @@ export function MediaGenerationPresetControl({
</div>
</div>
- <div className="max-h-48 shrink-0 overflow-y-auto p-2">
+ <div className="max-h-48 min-h-0 overflow-y-auto overscroll-contain p-2">
{presets.map((preset, index) => {
const isActive = preset.name === activePreset;
diff --git a/studio/frontend/src/features/rag/components/knowledge-base-dialog.tsx b/studio/frontend/src/features/rag/components/knowledge-base-dialog.tsx
index 967365e2ba5..02cb2a63e17 100644
--- a/studio/frontend/src/features/rag/components/knowledge-base-dialog.tsx
+++ b/studio/frontend/src/features/rag/components/knowledge-base-dialog.tsx
@@ -249,7 +249,7 @@ export function KnowledgeBaseDialog({
No knowledge bases yet.
</div>
) : (
- <ul className="flex max-h-[60dvh] flex-col divide-y overflow-y-auto rounded-md border">
+ <ul className="flex max-h-[60dvh] flex-col divide-y overflow-y-auto scroll-rounded rounded-md border">
{kbs.map((kb) => (
<li
key={kb.id}
@@ -401,7 +401,7 @@ function KnowledgeBaseDocuments({
) : (
<div
className={cn(
- "flex max-h-[55dvh] flex-wrap gap-1.5 overflow-y-auto rounded-md pr-0.5 transition-colors",
+ "flex max-h-[55dvh] flex-wrap gap-1.5 overflow-y-auto scroll-rounded rounded-md pr-0.5 transition-colors",
dragging && "bg-primary/5 ring-1 ring-primary/60",
)}
>
diff --git a/studio/frontend/src/features/recipe-studio/components/executions/execution-raw-tab.tsx b/studio/frontend/src/features/recipe-studio/components/executions/execution-raw-tab.tsx
index 4cf591f9583..2bf08419cb7 100644
--- a/studio/frontend/src/features/recipe-studio/components/executions/execution-raw-tab.tsx
+++ b/studio/frontend/src/features/recipe-studio/components/executions/execution-raw-tab.tsx
@@ -13,7 +13,7 @@ export function ExecutionRawTab({
return (
<div className="mt-3 rounded-xl border p-3">
<p className="mb-2 text-sm font-semibold">Raw execution</p>
- <pre className="max-h-96 overflow-auto rounded-md bg-muted/40 p-3 text-xs">
+ <pre className="max-h-96 overflow-auto scroll-rounded rounded-md bg-muted/40 p-3 text-xs">
{JSON.stringify(rawExecution, null, 2)}
</pre>
</div>
diff --git a/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx b/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx
index 77855927fd3..b9b8d3e0296 100644
--- a/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx
+++ b/studio/frontend/src/features/recipe-studio/dialogs/preview-dialog.tsx
@@ -645,24 +645,28 @@ function RunDialogBody({
</Collapsible>
{errors.length > 0 && (
- <div className="max-h-44 space-y-2 overflow-y-auto rounded-2xl border border-destructive/30 bg-destructive/5 p-4 shadow-border">
- <div className="flex items-center gap-2">
- <HugeiconsIcon
- icon={AlertCircleIcon}
- className="size-4 text-destructive"
- />
- <Badge
- variant="outline"
- className="rounded-full text-ui-10 text-destructive"
- >
- Before you run
- </Badge>
+ // Scrolls an inner viewport: the shadow would not survive the clip .scroll-rounded takes in
+ // Firefox. The surface padding keeps the scrollbar clear of the curve. 11rem in all, as before.
+ <div className="overflow-hidden rounded-2xl border border-destructive/30 bg-destructive/5 py-3 shadow-border">
+ <div className="max-h-38 space-y-2 overflow-y-auto px-4 py-1">
+ <div className="flex items-center gap-2">
+ <HugeiconsIcon
+ icon={AlertCircleIcon}
+ className="size-4 text-destructive"
+ />
+ <Badge
+ variant="outline"
+ className="rounded-full text-ui-10 text-destructive"
+ >
+ Before you run
+ </Badge>
+ </div>
+ {errors.map((error) => (
+ <p key={error} className="break-words text-xs text-destructive">
+ {error}
+ </p>
+ ))}
</div>
- {errors.map((error) => (
- <p key={error} className="break-words text-xs text-destructive">
- {error}
- </p>
- ))}
</div>
)}
diff --git a/studio/frontend/src/features/recipe-studio/dialogs/seed/seed-dialog.tsx b/studio/frontend/src/features/recipe-studio/dialogs/seed/seed-dialog.tsx
index dd4e1231acf..58d81bc2f2c 100644
--- a/studio/frontend/src/features/recipe-studio/dialogs/seed/seed-dialog.tsx
+++ b/studio/frontend/src/features/recipe-studio/dialogs/seed/seed-dialog.tsx
@@ -1324,7 +1324,7 @@ export function SeedDialog({
<div className="text-xs text-muted-foreground">
Loaded columns: {previewColumns.join(", ") || "None"}
</div>
- <div className="max-h-[calc(360px*var(--ui-space-scale,1))] overflow-y-auto overflow-x-hidden rounded-xl corner-squircle border border-border/60">
+ <div className="max-h-[calc(360px*var(--ui-space-scale,1))] overflow-y-auto overflow-x-hidden scroll-rounded rounded-xl corner-squircle border border-border/60">
<Table className="corner-squircle min-w-max">
<TableHeader>
<TableRow>
diff --git a/studio/frontend/src/features/settings/tabs/debugging-tab.tsx b/studio/frontend/src/features/settings/tabs/debugging-tab.tsx
index d0890af82dd..642d72995ad 100644
--- a/studio/frontend/src/features/settings/tabs/debugging-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/debugging-tab.tsx
@@ -722,7 +722,7 @@ export function DebuggingTab() {
onScroll={onScroll}
data-testid="debug-log-pane"
className={cn(
- "h-[min(26rem,45vh)] w-full overflow-auto [overflow-anchor:none] rounded-xl border border-border/60 bg-muted/20 px-3.5 py-3 font-mono text-ui-11 leading-[1.55] text-foreground/90 dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.04*var(--contrast-wash-gain,1)))]",
+ "h-[min(26rem,45vh)] w-full overflow-auto [overflow-anchor:none] scroll-rounded rounded-xl border border-border/60 bg-muted/20 px-3.5 py-3 font-mono text-ui-11 leading-[1.55] text-foreground/90 dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.04*var(--contrast-wash-gain,1)))]",
wrap ? "whitespace-pre-wrap break-words" : "whitespace-pre",
!text && "text-muted-foreground",
)}
diff --git a/studio/frontend/src/features/studio/sections/dataset-preview-dialog.tsx b/studio/frontend/src/features/studio/sections/dataset-preview-dialog.tsx
index 40161e379ef..afc3b1ac995 100644
--- a/studio/frontend/src/features/studio/sections/dataset-preview-dialog.tsx
+++ b/studio/frontend/src/features/studio/sections/dataset-preview-dialog.tsx
@@ -689,7 +689,7 @@ export function DatasetPreviewDialog({
)}
{/* Data table */}
- <div className="flex-1 min-h-[calc(250px*var(--ui-space-scale,1))] rounded-xl corner-squircle ring-1 ring-border/60 overflow-auto">
+ <div className="flex-1 min-h-[calc(250px*var(--ui-space-scale,1))] scroll-rounded rounded-xl corner-squircle ring-1 ring-border/60 overflow-auto">
<DataTable columns={tableColumns} data={rows} />
</div>
diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css
index 8e7ef66e2d3..b13684b066e 100644
--- a/studio/frontend/src/index.css
+++ b/studio/frontend/src/index.css
@@ -4872,6 +4872,52 @@ html.force-reduced-motion .sidebar-section-drop-line {
background-clip: padding-box;
}
+/* Rounded boxes that scroll themselves: dialogs, and inline logs and lists. Their scrollbar runs
+ the box's full length, over the corners in Chromium and WebKit, and Firefox drops the radius on
+ that side altogether, background and ring included. --scroll-radius is the box's own radius,
+ set below from its rounded-* class; an arbitrary radius sets it alongside. */
+.scroll-rounded.rounded-sm { --scroll-radius: var(--radius-sm); }
+.scroll-rounded.rounded-md { --scroll-radius: var(--radius-md); }
+.scroll-rounded.rounded-lg { --scroll-radius: var(--radius-lg); }
+.scroll-rounded.rounded-xl { --scroll-radius: var(--radius-xl); }
+.scroll-rounded.rounded-2xl { --scroll-radius: var(--radius-2xl); }
+.scroll-rounded.rounded-3xl { --scroll-radius: var(--radius-3xl); }
+.scroll-rounded.rounded-4xl { --scroll-radius: var(--radius-4xl); }
+/* Model card READMEs: markdown, so their wide code blocks take it from here. */
+.hub-readme-prose pre { --scroll-radius: 12px; }
+
+/* Dialogs go square or 2xl on phones. */
+@media (width < 40rem) {
+ .scroll-rounded.max-sm\:rounded-none { --scroll-radius: 0px; }
+ .scroll-rounded.max-sm\:rounded-2xl { --scroll-radius: var(--radius-2xl); }
+}
+
+/* Chromium and WebKit: start and end the track where the corners do. Same reset as the prompt
+ box above, since the thin standard scrollbar has no track to inset. */
+@supports selector(::-webkit-scrollbar) {
+ :is(.scroll-rounded, .hub-readme-prose pre) {
+ scrollbar-width: auto;
+ scrollbar-color: auto;
+ }
+}
+
+:is(.scroll-rounded, .hub-readme-prose pre)::-webkit-scrollbar-track:vertical {
+ margin-block: var(--scroll-radius, 0px);
+}
+
+:is(.scroll-rounded, .hub-readme-prose pre)::-webkit-scrollbar-track:horizontal {
+ margin-inline: var(--scroll-radius, 0px);
+}
+
+/* Firefox has no track to inset, so clip the box back to its radius. 1px out keeps a ring-1.
+ The clip also cuts an outer shadow: dialogs, which carry one, are watched and clipped only while
+ they overflow (lib/scroll-overflow.ts), and shadowed menus and panels scroll an inner viewport. */
+@supports (-moz-appearance: none) {
+ :is(.scroll-rounded:not([data-overflow-watched]), .scroll-rounded[data-overflowing], .hub-readme-prose pre) {
+ clip-path: inset(-1px round calc(var(--scroll-radius, 0px) + 1px));
+ }
+}
+
/* Attachment card page previews: drop the viewer's gray backdrop, padding and
scrollbars so the first page fills the card. */
.attachment-card-preview-page > * {
diff --git a/studio/frontend/src/lib/scroll-overflow.ts b/studio/frontend/src/lib/scroll-overflow.ts
new file mode 100644
index 00000000000..d196a0ab6ff
--- /dev/null
+++ b/studio/frontend/src/lib/scroll-overflow.ts
@@ -0,0 +1,72 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import type * as React from "react";
+import { useCallback } from "react";
+
+/**
+ * Marks a scroll container `data-overflowing` while it has something to scroll.
+ *
+ * Firefox drops a rounded scroller's radius on its scrollbar side, and `.scroll-rounded` clips the
+ * box back to it. The clip also cuts an outer shadow, so a surface that carries one (a dialog)
+ * takes it only while it overflows: with nothing to scroll there is no scrollbar to square it.
+ *
+ * Watches the box and each child in it, since content growing inside a capped box leaves the box
+ * itself the same size. Writes the DOM only on a change, never state. `data-overflow-watched` says
+ * the flag is live, so the clip can wait for it.
+ */
+export function observeScrollOverflow(element: HTMLElement): () => void {
+ element.setAttribute("data-overflow-watched", "");
+ const sync = () => {
+ // No tolerance: a single pixel over is enough for overflow:auto to draw a scrollbar. A rounding
+ // false positive only clips a shadow; a miss squares the corners.
+ const overflowing =
+ element.scrollHeight > element.clientHeight ||
+ element.scrollWidth > element.clientWidth;
+ if (overflowing !== element.hasAttribute("data-overflowing")) {
+ element.toggleAttribute("data-overflowing", overflowing);
+ }
+ };
+ const sizes = new ResizeObserver(sync);
+ sizes.observe(element);
+ for (const child of element.children) sizes.observe(child);
+ const children = new MutationObserver((records) => {
+ for (const record of records) {
+ for (const node of record.removedNodes) {
+ if (node instanceof Element) sizes.unobserve(node);
+ }
+ for (const node of record.addedNodes) {
+ if (node instanceof Element) sizes.observe(node);
+ }
+ }
+ sync();
+ });
+ children.observe(element, { childList: true });
+ sync();
+ return () => {
+ sizes.disconnect();
+ children.disconnect();
+ element.removeAttribute("data-overflow-watched");
+ element.removeAttribute("data-overflowing");
+ };
+}
+
+/** A callback ref that forwards to `ref` and runs {@link observeScrollOverflow} while mounted. */
+export function useScrollOverflowRef<T extends HTMLElement>(
+ ref: React.Ref<T> | undefined,
+): (element: T | null) => (() => void) | undefined {
+ return useCallback(
+ (element: T | null) => {
+ if (typeof ref === "function") ref(element);
+ else if (ref) ref.current = element;
+ if (!element || typeof ResizeObserver === "undefined") return undefined;
+ const stop = observeScrollOverflow(element);
+ return () => {
+ stop();
+ if (typeof ref === "function") ref(null);
+ else if (ref) ref.current = null;
+ };
+ },
+ [ref],
+ );
+}
diff --git a/studio/frontend/tests/dialog-scrollbar-corners.test.ts b/studio/frontend/tests/dialog-scrollbar-corners.test.ts
new file mode 100644
index 00000000000..3c7880c32e3
--- /dev/null
+++ b/studio/frontend/tests/dialog-scrollbar-corners.test.ts
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrc } from "./helpers/kit.ts";
+
+// A rounded box that scrolls itself loses its corners once a scrollbar shows: Chromium and WebKit
+// draw the scrollbar over them, and Firefox drops the radius on that side altogether. Boxes with no
+// outer shadow take .scroll-rounded; shadowed surfaces scroll an inner viewport instead.
+
+test("scroll-rounded insets the track in Chromium and WebKit and clips in Firefox", () => {
+ const css = readSrc("index.css");
+ const targets = String.raw`:is\(\.scroll-rounded, \.hub-readme-prose pre\)`;
+ for (const radius of ["sm", "md", "lg", "xl", "2xl", "3xl", "4xl"]) {
+ assert.ok(
+ css.includes(`.scroll-rounded.rounded-${radius} { --scroll-radius: var(--radius-${radius}); }`),
+ radius,
+ );
+ }
+ assert.match(
+ css,
+ new RegExp(`${targets}::-webkit-scrollbar-track:vertical \\{\\s*margin-block: var\\(--scroll-radius, 0px\\);`),
+ );
+ assert.match(
+ css,
+ new RegExp(`${targets}::-webkit-scrollbar-track:horizontal \\{\\s*margin-inline: var\\(--scroll-radius, 0px\\);`),
+ );
+ // The thin standard scrollbar has no track to inset, so Chromium is switched to the styled one.
+ assert.match(
+ css,
+ new RegExp(
+ String.raw`@supports selector\(::-webkit-scrollbar\) \{\s*` +
+ `${targets} \\{\\s*scrollbar-width: auto;\\s*scrollbar-color: auto;`,
+ ),
+ );
+ // Watched surfaces (dialogs, which carry a shadow the clip would cut) take it only while they
+ // overflow; everything else always does.
+ assert.ok(
+ css.includes(
+ "@supports (-moz-appearance: none) {\n\t:is(.scroll-rounded:not([data-overflow-watched]), .scroll-rounded[data-overflowing], .hub-readme-prose pre) {\n\t\tclip-path: inset(-1px round calc(var(--scroll-radius, 0px) + 1px));",
+ ),
+ );
+ // Phone-width dialogs go square, and the clip must follow.
+ assert.ok(css.includes(String.raw`.scroll-rounded.max-sm\:rounded-none { --scroll-radius: 0px; }`));
+});
+
+test("dialogs flag their overflow so Firefox clips them only while they scroll", () => {
+ for (const file of ["components/ui/dialog.tsx", "components/ui/alert-dialog.tsx"]) {
+ const source = readSrc(file);
+ assert.match(source, /const contentRef = useScrollOverflowRef\(ref\);/, file);
+ assert.match(source, /ref=\{contentRef\}/, file);
+ }
+ const lib = readSrc("lib/scroll-overflow.ts");
+ assert.match(lib, /element\.setAttribute\("data-overflow-watched", ""\);/);
+ assert.match(lib, /element\.toggleAttribute\("data-overflowing", overflowing\);/);
+ // Any overflow counts: one pixel over already draws a scrollbar.
+ assert.match(
+ lib,
+ /element\.scrollHeight > element\.clientHeight \|\|\s*element\.scrollWidth > element\.clientWidth;/,
+ );
+ // Content growing inside a capped box leaves the box the same size, so the children are watched.
+ assert.match(lib, /for \(const child of element\.children\) sizes\.observe\(child\);/);
+ assert.match(lib, /children\.observe\(element, \{ childList: true \}\);/);
+});
+
+test("dialogs and inline rounded scrollers use it", () => {
+ for (const [file, needle] of [
+ ["components/ui/dialog.tsx", "overflow-y-auto scroll-rounded rounded-4xl"],
+ ["components/ui/alert-dialog.tsx", "overflow-y-auto scroll-rounded rounded-4xl"],
+ ["features/settings/tabs/debugging-tab.tsx", "scroll-rounded rounded-xl"],
+ ["features/api-monitor/api-monitor-page.tsx", "scroll-rounded rounded-lg"],
+ ["features/export/components/export-run-panel.tsx", "scroll-rounded rounded-lg"],
+ ["features/chat/components/research-activity-panel.tsx", "scroll-rounded rounded-xl"],
+ ["features/rag/components/knowledge-base-dialog.tsx", "scroll-rounded rounded-md border"],
+ ["components/tauri/log-details.tsx", "scroll-rounded rounded-lg"],
+ ] as const) {
+ assert.ok(readSrc(file).includes(needle), `${file}: ${needle}`);
+ }
+});
+
+test("shadowed menus scroll an inner viewport, not their rounded surface", () => {
+ const contextMenu = readSrc("components/ui/context-menu.tsx");
+ assert.equal(contextMenu.match(/data-slot="context-menu-viewport"/g)?.length, 2);
+ assert.doesNotMatch(contextMenu, /rounded-2xl p-1 shadow-2xl[^"]*overflow-y-auto/);
+ const thread = readSrc("components/assistant-ui/thread.tsx");
+ assert.match(thread, /aui-action-bar-more-content[^"]*flex flex-col overflow-hidden rounded-\[21px\]/);
+ // The recipe preview's error panel keeps its shadow-border.
+ const preview = readSrc("features/recipe-studio/dialogs/preview-dialog.tsx");
+ assert.match(preview, /overflow-hidden rounded-2xl border border-destructive\/30 bg-destructive\/5 py-3 shadow-border">\s*<div className="max-h-38 space-y-2 overflow-y-auto px-4 py-1">/);
+ assert.doesNotMatch(preview, /scroll-rounded rounded-2xl border border-destructive/);
+ const presets = readSrc("features/generation-presets/media-generation-preset-control.tsx");
+ assert.match(presets, /gap-0 overflow-hidden rounded-xl border-border\/70 p-0 shadow-xl/);
+ assert.match(presets, /max-h-48 min-h-0 overflow-y-auto overscroll-contain p-2/);
+});
diff --git a/studio/frontend/tests/dialog-toast-outside.test.ts b/studio/frontend/tests/dialog-toast-outside.test.ts
index 63ac4aed972..c40d7ad77d5 100644
--- a/studio/frontend/tests/dialog-toast-outside.test.ts
+++ b/studio/frontend/tests/dialog-toast-outside.test.ts
@@ -62,6 +62,7 @@ test("an interaction on a toast does not dismiss the dialog under it", () => {
"@/components/app-readiness": { AppPortalGate: "AppPortalGate" },
"@/components/ui/button": { Button: "Button" },
"@/lib/utils": { cn: (...classes: unknown[]) => classes.join(" ") },
+ "@/lib/scroll-overflow": { useScrollOverflowRef: () => () => undefined },
"@hugeicons/core-free-icons": { Cancel01Icon: {} },
"@hugeicons/react": { HugeiconsIcon: "HugeiconsIcon" },
});
diff --git a/studio/frontend/tests/window-chrome-collision.test.ts b/studio/frontend/tests/window-chrome-collision.test.ts
index 48631ee54f6..d3bc6f66513 100644
--- a/studio/frontend/tests/window-chrome-collision.test.ts
+++ b/studio/frontend/tests/window-chrome-collision.test.ts
@@ -67,7 +67,7 @@ test("the message More menu clears the titlebar", async () => {
// Padding alone can't stop a flipped menu growing under the titlebar.
assert.match(
thread,
- /aui-action-bar-more-content[^"]*max-h-\(--radix-dropdown-menu-content-available-height\)[^"]*overflow-y-auto/,
+ /aui-action-bar-more-content[^"]*max-h-\(--radix-dropdown-menu-content-available-height\)[^"]*overflow-hidden/,
);
});
@@ -106,6 +106,11 @@ test("context submenus stop at the titlebar and scroll", async () => {
const sub = menu.slice(menu.indexOf("function ContextMenuSubContent"));
assert.match(
sub,
- /max-h-\(--radix-context-menu-content-available-height\) overflow-x-hidden overflow-y-auto"/,
+ /max-h-\(--radix-context-menu-content-available-height\) flex flex-col overflow-hidden"/,
+ );
+ // An inner viewport scrolls, so the rounded surface keeps its corners.
+ assert.match(
+ sub,
+ /data-slot="context-menu-viewport"\s*className="min-h-0 flex-1 overflow-x-hidden overflow-y-auto"/,
);
});