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: steady the Images and Video loading spinners, and tidy the progress card (#11643)

Michael Han62cc1e0ef4f9
diff --git a/studio/frontend/src/components/ui/spinner.tsx b/studio/frontend/src/components/ui/spinner.tsx
index 34543ed7639..68fbeeea9a1 100644
--- a/studio/frontend/src/components/ui/spinner.tsx
+++ b/studio/frontend/src/components/ui/spinner.tsx
@@ -7,16 +7,51 @@ import { Loader2Icon } from "lucide-react";
import { cn } from "@/lib/utils";
/** App-wide spinner inheriting the current text color. `label` overrides the announcement
- * where "loading" is not what it means (a sidebar chat is generating). */
+ * where "loading" is not what it means (a sidebar chat is generating). `variant="ring"` turns
+ * only an arc over a static track, so it reads as fixed in place rather than drifting. */
function Spinner({
className,
label = "Loading",
+ variant = "arc",
"data-testid": dataTestId,
}: {
className?: string;
label?: string;
+ variant?: "arc" | "ring";
"data-testid"?: string;
}) {
+ if (variant === "ring") {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ role="status"
+ aria-label={label}
+ data-testid={dataTestId}
+ className={cn("size-4 shrink-0", className)}
+ >
+ <circle
+ cx="12"
+ cy="12"
+ r="9"
+ stroke="currentColor"
+ strokeOpacity={0.2}
+ strokeWidth={2.5}
+ />
+ <circle
+ cx="12"
+ cy="12"
+ r="9"
+ stroke="currentColor"
+ strokeWidth={2.5}
+ strokeLinecap="round"
+ // About a quarter of the circumference.
+ strokeDasharray="14 43"
+ className="origin-center animate-spin [transform-box:view-box] will-change-transform"
+ />
+ </svg>
+ );
+ }
return (
<Loader2Icon
role="status"
diff --git a/studio/frontend/src/features/chat/components/model-load-status.tsx b/studio/frontend/src/features/chat/components/model-load-status.tsx
index 6df15c1724a..222a16e6f3d 100644
--- a/studio/frontend/src/features/chat/components/model-load-status.tsx
+++ b/studio/frontend/src/features/chat/components/model-load-status.tsx
@@ -13,6 +13,8 @@ type ModelLoadDescriptionProps = {
progressLabel?: string | null;
// Extra classes for the root row (e.g. a titleless caller dropping min-h-12).
className?: string;
+ /** "floating": the Images / Video progress card. Ring spinner, brighter text on its dark card. */
+ variant?: "default" | "floating";
};
function clampProgress(value: number): number {
@@ -40,8 +42,10 @@ export function ModelLoadDescription({
progressPercent,
progressLabel,
className,
+ variant = "default",
}: ModelLoadDescriptionProps) {
const hasProgress = typeof progressPercent === "number";
+ const floating = variant === "floating";
// Split once at the top so the JSX below stays flat (no IIFE).
const { primary: labelPrimary, secondary: labelSecondary } =
splitProgressLabel(progressLabel);
@@ -49,30 +53,58 @@ export function ModelLoadDescription({
return (
<div className={cn("relative flex min-h-12 w-full items-stretch gap-2", className)}>
<div className="flex h-full shrink-0 items-center self-center">
- <Spinner className="size-3.5 text-muted-foreground" />
+ <Spinner
+ variant={floating ? "ring" : "arc"}
+ className={cn(
+ "size-3.5 text-muted-foreground",
+ floating && "size-4 dark:text-foreground/70",
+ )}
+ />
</div>
<div className="flex min-w-0 flex-1 flex-col justify-center">
{title ? <p className="text-foreground leading-tight font-semibold">{title}</p> : null}
{hasProgress ? (
<div className="w-full pt-1">
- <div className="flex items-center justify-between gap-2 text-ui-10 font-medium tracking-[0.08em] text-muted-foreground/80">
+ <div
+ className={cn(
+ "flex items-center justify-between gap-2 text-ui-10 font-medium tracking-[0.08em] text-muted-foreground/80",
+ floating && "dark:text-foreground/85",
+ )}
+ >
<span className="min-w-0 truncate">{labelPrimary}</span>
<span className="shrink-0 tabular-nums">
{Math.round(clampProgress(progressPercent))}%
</span>
</div>
{labelSecondary ? (
- <div className="truncate pt-0.5 text-ui-10 font-medium tracking-[0.08em] text-muted-foreground/60">
+ <div
+ className={cn(
+ "truncate pt-0.5 text-ui-10 font-medium tracking-[0.08em] text-muted-foreground/60",
+ floating && "dark:text-foreground/65",
+ )}
+ >
{labelSecondary}
</div>
) : null}
<Progress
value={clampProgress(progressPercent)}
- className="mt-1 h-1 bg-[color-mix(in_oklab,var(--foreground)_calc(8%*var(--contrast-wash-gain,1)),transparent)]"
+ className={cn(
+ "mt-1 h-1 bg-[color-mix(in_oklab,var(--foreground)_calc(8%*var(--contrast-wash-gain,1)),transparent)]",
+ // The lighter card would swallow the 8% track.
+ floating &&
+ "dark:bg-[color-mix(in_oklab,var(--foreground)_calc(14%*var(--contrast-wash-gain,1)),transparent)]",
+ )}
/>
</div>
) : message ? (
- <p className="pt-1 text-xs leading-relaxed text-muted-foreground">{message}</p>
+ <p
+ className={cn(
+ "pt-1 text-xs leading-relaxed text-muted-foreground",
+ floating && "dark:text-foreground/85",
+ )}
+ >
+ {message}
+ </p>
) : null}
</div>
</div>
diff --git a/studio/frontend/src/features/images/images-page.tsx b/studio/frontend/src/features/images/images-page.tsx
index 99a27d6ebaf..0ccd1659192 100644
--- a/studio/frontend/src/features/images/images-page.tsx
+++ b/studio/frontend/src/features/images/images-page.tsx
@@ -1225,7 +1225,7 @@ export function ImagesPage({
const imageModels = useImageModels(hostClass, denseQuantSchemes);
const [quant, setQuant] = useState<string | null>(galleryCache.quant);
const [prompt, setPrompt] = useState(
- "Cinematic wide shot of a whimsical Alice in Wonderland tea party in an overgrown Victorian garden. Exactly three figures at a long white lace-draped table: a tall eccentric gentleman in an oversized emerald velvet top hat pouring tea from a silver pot mid-motion; a young woman in a pale blue Victorian dress seated left, holding a porcelain teacup with both hands, looking up and laughing; an older woman in deep burgundy seated right in profile, reaching for a tiered cake stand. Detailed embroidered fabrics, realistic skin texture, natural expressions. The table holds mismatched porcelain, antique silverware, towering pastel cakes, and wildflowers. Giant red-capped mushrooms rise behind the table, with ancient trees overhead and golden sunlight streaming through leaves. Shot on 85mm, f/2.8, focus on the gentleman, soft background falloff. Photorealistic, saturated storybook color, warm amber and deep green palette.",
+ "A rally car speeding across vast desert dunes, throwing a dramatic trail of sand behind it. Low-angle action photograph, crisp vehicle details, motion blur in the foreground, harsh afternoon light, realistic textures.",
);
const [negativePrompt, setNegativePrompt] = useState("");
const [negativeOpen, setNegativeOpen] = useState(false);
@@ -4163,7 +4163,8 @@ export function ImagesPage({
<div className="pointer-events-none relative z-40 grid h-[calc(48px*var(--ui-space-scale,1))] shrink-0 grid-cols-[minmax(0,408px)_minmax(13rem,1fr)]">
<div
className={cn(
- "pointer-events-none flex h-full min-w-0 items-start overflow-hidden @[50rem]:border-r @[50rem]:border-border/60",
+ // Centered over the settings column. A left obstruction keeps its inset on that side only.
+ "pointer-events-none flex h-full min-w-0 items-start justify-center overflow-hidden pr-[var(--studio-media-header-left-inset,1.5rem)] @[50rem]:border-r @[50rem]:border-border/60",
isMobile
? "pl-12"
: !pinned && isTauri
@@ -5043,7 +5044,7 @@ export function ImagesPage({
variant="outline"
onClick={handleCancelGenerate}
>
- <Spinner className="mr-2 size-4" />
+ <Spinner variant="ring" className="mr-2 size-4" />
{genDone != null && count > 1 ? `Stop (${genDone}/${count})` : "Stop"}
</Button>
) : (
@@ -5116,7 +5117,7 @@ export function ImagesPage({
) : selected ? (
// The selected record's blob is still loading; spin in place.
<div className="flex flex-col items-center gap-3 text-muted-foreground">
- <Spinner className="size-8" />
+ <Spinner variant="ring" className="size-8" />
<p className="text-sm">Loading…</p>
</div>
) : busy === "generating" ? null : (
@@ -5139,8 +5140,9 @@ export function ImagesPage({
selectedSrc ? "inset-x-0 bottom-4" : "inset-0 items-center",
)}
>
- <div className="w-72 max-w-full rounded-xl bg-background/85 p-3 shadow-lg ring-1 ring-border backdrop-blur">
+ <div className="w-72 max-w-full rounded-xl bg-background/85 p-3 shadow-lg backdrop-blur dark:bg-card/95">
<ModelLoadDescription
+ variant="floating"
// Drop the chat min-height: this floating card has no layout to stabilise.
className="min-h-0"
title={
@@ -5171,8 +5173,8 @@ export function ImagesPage({
{/* In-progress generation: a placeholder tile at the front so past images stay browsable while
the new one renders. */}
{busy === "generating" && (
- <div className="flex size-16 shrink-0 animate-pulse items-center justify-center rounded-lg bg-muted/50 ring-2 ring-primary/30">
- <Spinner className="size-5 text-muted-foreground" />
+ <div className="flex size-16 shrink-0 animate-pulse items-center justify-center rounded-lg bg-muted/50">
+ <Spinner variant="ring" className="size-6 text-muted-foreground" />
</div>
)}
{/* The tile is a wrapper, not a button: the actions menu must be the select button's SIBLING,
diff --git a/studio/frontend/src/features/video/video-page.tsx b/studio/frontend/src/features/video/video-page.tsx
index 88bacb8059b..7666b2e681b 100644
--- a/studio/frontend/src/features/video/video-page.tsx
+++ b/studio/frontend/src/features/video/video-page.tsx
@@ -4048,7 +4048,7 @@ function VideoGenerator({
variant="outline"
onClick={handleCancelGenerate}
>
- <Spinner className="mr-2 size-4" />
+ <Spinner variant="ring" className="mr-2 size-4" />
Cancel
</Button>
) : (
@@ -4143,7 +4143,7 @@ function VideoGenerator({
) : selected ? (
// The selected record's link has not landed yet; spin in place.
<div className="flex flex-col items-center gap-3 text-muted-foreground">
- <Spinner className="size-8" />
+ <Spinner variant="ring" className="size-8" />
<p className="text-sm">Loading…</p>
</div>
) : busy === "generating" ? null : (
@@ -4167,8 +4167,9 @@ function VideoGenerator({
selectedSrc ? "inset-x-0 bottom-4" : "inset-0 items-center",
)}
>
- <div className="w-72 max-w-full rounded-xl bg-background/85 p-3 shadow-lg ring-1 ring-border backdrop-blur">
+ <div className="w-72 max-w-full rounded-xl bg-background/85 p-3 shadow-lg backdrop-blur dark:bg-card/95">
<ModelLoadDescription
+ variant="floating"
className="min-h-0"
title={null}
message="Starting…"
@@ -4197,8 +4198,8 @@ function VideoGenerator({
{/* In-progress generation: a placeholder tile at the front so past clips stay browsable while
the new one renders. */}
{busy === "generating" && (
- <div className="flex size-16 shrink-0 animate-pulse items-center justify-center rounded-[10px] bg-muted/50 ring-2 ring-primary/30">
- <Spinner className="size-5 text-muted-foreground" />
+ <div className="flex size-16 shrink-0 animate-pulse items-center justify-center rounded-[10px] bg-muted/50">
+ <Spinner variant="ring" className="size-6 text-muted-foreground" />
</div>
)}
{/* The card is a wrapper, not a button: the actions menu must be the select button's SIBLING,