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.

Rework Studio dark mode onto a single surface and text scale (#11502)

Michael Han83c5278b7e98
diff --git a/studio/frontend/public/reload-snapshot.js b/studio/frontend/public/reload-snapshot.js
index 7bee638334f..f3738891538 100644
--- a/studio/frontend/public/reload-snapshot.js
+++ b/studio/frontend/public/reload-snapshot.js
@@ -48,6 +48,7 @@
"--contrast-control-mix",
"--contrast-edge-gain",
"--contrast-line-mix",
+ "--contrast-state-mix",
"--contrast-surface-mix",
"--contrast-target",
"--contrast-text-mix",
diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx
index 4be3698f9ec..5ecc9e0dfed 100644
--- a/studio/frontend/src/components/app-sidebar.tsx
+++ b/studio/frontend/src/components/app-sidebar.tsx
@@ -436,7 +436,7 @@ function NavBadge({ label, className }: { label: string; className?: string }) {
return (
<span
className={cn(
- "nav-badge inline-flex shrink-0 items-center justify-center rounded-full border border-nav-beta-border px-[calc(5px*var(--ui-space-scale,1))] pt-[calc(3px*var(--ui-space-scale,1))] pb-[calc(2px*var(--ui-space-scale,1))] text-[calc(0.5rem*var(--ui-font-scale,1))] font-medium uppercase leading-none tracking-[0.04em] text-nav-fg-muted antialiased subpixel-antialiased shadow-[0_1px_2px_rgba(0,0,0,0.06)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]",
+ "nav-badge inline-flex shrink-0 items-center justify-center rounded-full border border-nav-beta-border px-[calc(5px*var(--ui-space-scale,1))] pt-[calc(3px*var(--ui-space-scale,1))] pb-[calc(2px*var(--ui-space-scale,1))] text-[calc(0.5rem*var(--ui-font-scale,1))] font-medium uppercase leading-none tracking-[0.04em] text-nav-fg-muted antialiased subpixel-antialiased shadow-[0_1px_2px_rgba(0,0,0,0.06)] dark:shadow-[0_1px_2px_var(--background)]",
className,
)}
>
@@ -3940,10 +3940,10 @@ export function AppSidebar() {
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"
/>
- <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-white dark:tracking-[0.02em]">
+ <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
</span>
- <span className="nav-badge ml-0.5 inline-flex shrink-0 items-center justify-center rounded-full border border-nav-beta-border px-[calc(5px*var(--ui-space-scale,1))] pt-[calc(3px*var(--ui-space-scale,1))] pb-[calc(2px*var(--ui-space-scale,1))] text-[calc(0.5rem*var(--ui-font-scale,1))] font-medium leading-none tracking-[0.04em] text-nav-fg-muted antialiased subpixel-antialiased shadow-[0_1px_2px_rgba(0,0,0,0.06)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]">
+ <span className="nav-badge ml-0.5 inline-flex shrink-0 items-center justify-center rounded-full border border-nav-beta-border px-[calc(5px*var(--ui-space-scale,1))] pt-[calc(3px*var(--ui-space-scale,1))] pb-[calc(2px*var(--ui-space-scale,1))] text-[calc(0.5rem*var(--ui-font-scale,1))] font-medium leading-none tracking-[0.04em] text-nav-fg-muted antialiased subpixel-antialiased shadow-[0_1px_2px_rgba(0,0,0,0.06)] dark:shadow-[0_1px_2px_var(--background)]">
{t("shell.beta")}
</span>
</Link>
diff --git a/studio/frontend/src/components/assistant-ui/tool-ui-image-generation.tsx b/studio/frontend/src/components/assistant-ui/tool-ui-image-generation.tsx
index 439ef52e98d..9a74ed6a503 100644
--- a/studio/frontend/src/components/assistant-ui/tool-ui-image-generation.tsx
+++ b/studio/frontend/src/components/assistant-ui/tool-ui-image-generation.tsx
@@ -148,7 +148,7 @@ function GeneratedImagePlaceholder({ label }: { label: string }) {
return (
<div
className={cn(
- "generated-image-loading-card flex aspect-square w-[480px] max-w-full items-center justify-center rounded-2xl bg-muted/20 shadow-[0_0_12px_rgba(15,23,42,0.05),0_6px_18px_rgba(15,23,42,0.04)] dark:shadow-[0_0_12px_rgba(0,0,0,0.18),0_6px_18px_rgba(0,0,0,0.12)]",
+ "generated-image-loading-card flex aspect-square w-[480px] max-w-full items-center justify-center rounded-2xl bg-muted/20 shadow-[0_0_12px_rgba(15,23,42,0.05),0_6px_18px_rgba(15,23,42,0.04)] dark:shadow-[0_0_12px_var(--background),0_6px_18px_var(--background)]",
)}
aria-busy="true"
aria-label={label}
diff --git a/studio/frontend/src/components/llama-update-banner.tsx b/studio/frontend/src/components/llama-update-banner.tsx
index f1f12d03d55..78560950edb 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_rgba(0,0,0,0.28)]">
+ <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)]">
{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 d4a30131179..2a08fd1cca9 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_rgba(0,0,0,0.28)]">
+ <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)]">
<button
type="button"
onClick={onDismiss}
diff --git a/studio/frontend/src/components/ui/sidebar.tsx b/studio/frontend/src/components/ui/sidebar.tsx
index 6b5e44ea913..30efe660aa2 100644
--- a/studio/frontend/src/components/ui/sidebar.tsx
+++ b/studio/frontend/src/components/ui/sidebar.tsx
@@ -686,7 +686,7 @@ function SidebarGroupLabel({
data-slot="sidebar-group-label"
data-sidebar="group-label"
className={cn(
- "text-[#94a3b8] dark:text-[#666] ring-sidebar-ring h-auto pt-3 pb-2 px-4 rounded-md text-ui-10 font-semibold uppercase tracking-[0em] group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-1 [&>svg]:size-3 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0",
+ "text-[#94a3b8] dark:text-muted-foreground ring-sidebar-ring h-auto pt-3 pb-2 px-4 rounded-md text-ui-10 font-semibold uppercase tracking-[0em] group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-1 [&>svg]:size-3 flex shrink-0 items-center outline-hidden [&>svg]:shrink-0",
className
)}
{...props}
diff --git a/studio/frontend/src/components/web/update-banner.tsx b/studio/frontend/src/components/web/update-banner.tsx
index 90ff73a081a..68bbf3e75cd 100644
--- a/studio/frontend/src/components/web/update-banner.tsx
+++ b/studio/frontend/src/components/web/update-banner.tsx
@@ -106,7 +106,8 @@ export function WebUpdateBanner({
yields. That is the floor the constant was approximating, except
it is measured rather than guessed and it holds at every type
size. */}
- <div className="relative flex max-h-[calc(100dvh_-_2rem)] grow flex-col 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_rgba(0,0,0,0.28)]">
+ <div className="relative flex max-h-[calc(100dvh_-_2rem)] grow flex-col 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={dismiss}
diff --git a/studio/frontend/src/features/chat/components/project-switcher.tsx b/studio/frontend/src/features/chat/components/project-switcher.tsx
index 44e52ad8c9d..0b60422563c 100644
--- a/studio/frontend/src/features/chat/components/project-switcher.tsx
+++ b/studio/frontend/src/features/chat/components/project-switcher.tsx
@@ -77,7 +77,7 @@ export function ProjectSwitcher({
className="size-icon shrink-0 text-foreground/70"
/>
<span className="flex min-w-0 flex-1 items-baseline">
- <span className="min-w-0 flex max-w-[150px] flex-1 items-baseline truncate font-heading text-ui-16 font-medium leading-tight text-black dark:text-white">
+ <span className="min-w-0 flex max-w-[150px] flex-1 items-baseline truncate font-heading text-ui-16 font-medium leading-tight text-black dark:text-foreground">
{label}
</span>
</span>
diff --git a/studio/frontend/src/features/hub/catalog/gguf-download-card.tsx b/studio/frontend/src/features/hub/catalog/gguf-download-card.tsx
index d35f97c55de..485eb8b7458 100644
--- a/studio/frontend/src/features/hub/catalog/gguf-download-card.tsx
+++ b/studio/frontend/src/features/hub/catalog/gguf-download-card.tsx
@@ -481,8 +481,14 @@ const GgufVariantMenuRow = memo(function GgufVariantMenuRow({
className={cn(
"group relative mx-2 flex cursor-pointer items-center gap-2 rounded-[12px] px-2.5 py-2 text-left transition-colors",
selected
- ? "bg-[color-mix(in_oklab,var(--foreground)_calc(7%*var(--contrast-wash-gain,1)),transparent)] dark:bg-[color-mix(in_oklab,var(--foreground)_calc(12%*var(--contrast-wash-gain,1)),transparent)]"
- : "hover:bg-[color-mix(in_oklab,var(--foreground)_calc(5%*var(--contrast-wash-gain,1)),transparent)] dark:hover:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)]",
+ ? // Dark: --accent, the app's one selection colour. The 12% wash it
+ // carried matched --accent at the default but was scaled by the
+ // wash gain, so it fell away from the token across the slider.
+ "bg-[color-mix(in_oklab,var(--foreground)_calc(7%*var(--contrast-wash-gain,1)),transparent)] dark:bg-accent"
+ : // Dark hover is --accent held back, so it stays under the selected
+ // row at every contrast. As its own wash it closed to within a few
+ // levels of the selection at the top of the slider.
+ "hover:bg-[color-mix(in_oklab,var(--foreground)_calc(5%*var(--contrast-wash-gain,1)),transparent)] dark:hover:bg-[color-mix(in_srgb,var(--accent)_55%,transparent)]",
)}
>
{/* Status (On device / Partial) sits beside the quant on the
@@ -1011,7 +1017,7 @@ export function GgufDownloadCard({
e.preventDefault();
setOpen((o) => !o);
}}
- className="hub-menu-trigger flex h-9 min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-full px-3 text-left transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)] data-[state=open]:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)] disabled:cursor-wait disabled:opacity-60 disabled:hover:bg-transparent dark:hover:bg-[rgb(255_255_255_/_calc(0.04*var(--contrast-wash-gain,1)))] dark:data-[state=open]:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))] dark:disabled:hover:bg-transparent"
+ className="hub-menu-trigger flex h-9 min-w-0 flex-1 cursor-pointer items-center gap-2 rounded-full px-3 text-left transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)] data-[state=open]:bg-[color-mix(in_oklab,var(--foreground)_calc(6%*var(--contrast-wash-gain,1)),transparent)] disabled:cursor-wait disabled:opacity-60 disabled:hover:bg-transparent dark:hover:bg-[color-mix(in_srgb,var(--accent)_55%,transparent)] dark:data-[state=open]:bg-accent dark:disabled:hover:bg-transparent"
>
{/* Quant label + status tags travel together as one left-aligned
group so the fit-info icon never floats orphaned from its tags.
diff --git a/studio/frontend/src/features/hub/catalog/hub-option-menu.tsx b/studio/frontend/src/features/hub/catalog/hub-option-menu.tsx
index 5a11c474d4a..a22c77aaa6c 100644
--- a/studio/frontend/src/features/hub/catalog/hub-option-menu.tsx
+++ b/studio/frontend/src/features/hub/catalog/hub-option-menu.tsx
@@ -193,7 +193,7 @@ export function HubOptionMenu<T extends string>({
{showChevron && (
<HugeiconsIcon
icon={ChevronDownStandardIcon}
- className="size-3.5 shrink-0 text-muted-foreground"
+ className="size-3.5 shrink-0 text-foreground"
/>
)}
</button>
diff --git a/studio/frontend/src/features/hub/catalog/models-table.tsx b/studio/frontend/src/features/hub/catalog/models-table.tsx
index 403a97afc02..53b670130f6 100644
--- a/studio/frontend/src/features/hub/catalog/models-table.tsx
+++ b/studio/frontend/src/features/hub/catalog/models-table.tsx
@@ -881,7 +881,7 @@ export const ResultSplitRow = memo(function ResultSplitRow({
aria-current={selected || undefined}
data-selected={selected || undefined}
onClick={() => onSelect(row.id)}
- className="group/row flex h-full w-full cursor-pointer items-center gap-2.5 rounded-[12px] px-2.5 text-left outline-none transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)] data-[selected]:bg-[color-mix(in_oklab,var(--foreground)_calc(7%*var(--contrast-wash-gain,1)),transparent)] focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset dark:hover:bg-[rgb(255_255_255_/_calc(0.05*var(--contrast-wash-gain,1)))] dark:data-[selected]:bg-[rgb(255_255_255_/_calc(0.08*var(--contrast-wash-gain,1)))]"
+ className="group/row flex h-full w-full cursor-pointer items-center gap-2.5 rounded-[12px] px-2.5 text-left outline-none transition-colors hover:bg-[color-mix(in_oklab,var(--foreground)_calc(4%*var(--contrast-wash-gain,1)),transparent)] data-[selected]:bg-[color-mix(in_oklab,var(--foreground)_calc(7%*var(--contrast-wash-gain,1)),transparent)] focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-inset dark:hover:bg-[rgb(255_255_255_/_calc(0.05*var(--contrast-wash-gain,1)))] dark:data-[selected]:bg-accent"
>
<OwnerAvatar
owner={row.owner}
diff --git a/studio/frontend/src/features/hub/hub.css b/studio/frontend/src/features/hub/hub.css
index a378bb587e3..87c735e0179 100644
--- a/studio/frontend/src/features/hub/hub.css
+++ b/studio/frontend/src/features/hub/hub.css
@@ -79,8 +79,15 @@
transition: background-color 160ms ease;
}
+ /* [aria-expanded] as well as [data-state]: the option-menu triggers (the
+ picker's format and sort controls, the Hub's filters) are plain buttons
+ that mark themselves open with aria-expanded, so a data-state-only rule
+ left them at rest while their menu was showing. :active covers the press
+ itself on anything that opens nothing. */
.field-soft:hover,
- .field-soft[data-state="open"] {
+ .field-soft:active,
+ .field-soft[data-state="open"],
+ .field-soft[aria-expanded="true"] {
background-color: color-mix(in srgb, var(--foreground) calc(8% * var(--contrast-wash-gain, 1)), transparent) !important;
}
@@ -89,19 +96,28 @@
outline: none;
}
+ /* Rest sits below the hover tone; hover and focus take --accent, the one
+ hover colour the app uses. Focus must never fall back to the panel or
+ the field looks empty while typing.
+
+ Rest is the hover colour held back, not a separate wash: a translucent
+ --accent cannot reach an opaque one over any backdrop, so the two keep
+ their order at every contrast setting. Carrying its own foreground wash,
+ rest was scaled by the wash gain while the hover token only nudged, and
+ the pair met at the top of the slider. Matches the old resting tone. */
.dark .field-soft {
- background-color: color-mix(in srgb, var(--foreground) calc(5% * var(--contrast-wash-gain, 1)), transparent) !important;
+ background-color: color-mix(in srgb, var(--accent) 60%, transparent) !important;
}
.dark .field-soft:hover,
- .dark .field-soft[data-state="open"] {
- background-color: color-mix(in srgb, var(--foreground) calc(9% * var(--contrast-wash-gain, 1)), transparent) !important;
+ .dark .field-soft:active,
+ .dark .field-soft[data-state="open"],
+ .dark .field-soft[aria-expanded="true"] {
+ background-color: var(--accent) !important;
}
.dark .field-soft:focus-visible {
- /* #1c1c1c, written as the wash its resting twin uses so focus keeps its
- distance from rest at any contrast. */
- background-color: color-mix(in srgb, var(--foreground) calc(1.73% * var(--contrast-wash-gain, 1)), var(--background)) !important;
+ background-color: var(--accent) !important;
}
/* The Hub search field is `type="search"` (so the browser won't offer saved
@@ -331,8 +347,8 @@
}
html.dark .hub-page .hub-model-card:hover {
- /* #202020 at the default, on the same curve as the resting fill above. */
- background-color: color-mix(in srgb, var(--foreground) calc(3.46% * var(--contrast-wash-gain, 1)), var(--background));
+ /* #3a3a3a at the default: the one hover colour, as everywhere else. */
+ background-color: var(--accent);
border-color: transparent;
}
@@ -556,7 +572,7 @@
html.dark .hub-page .hub-tag-soft:hover,
html.dark .hub-page .hub-tag-meta:hover {
- background-color: color-mix(in srgb, var(--foreground) calc(4% * var(--contrast-wash-gain, 1)), transparent);
+ background-color: var(--accent);
}
/* List rows share the cards' flat neutral surface: no border, no gradient,
@@ -593,7 +609,7 @@
}
html.dark .hub-page .hub-result-row:hover {
- background-color: color-mix(in srgb, var(--foreground) calc(10% * var(--contrast-wash-gain, 1)), var(--background));
+ background-color: var(--accent);
box-shadow: none;
}
@@ -603,8 +619,13 @@
background-color: color-mix(in srgb, var(--foreground) calc(5% * var(--contrast-wash-gain, 1)), var(--card));
}
+ /* Derived from the hover tone rather than washed over the page, so the
+ selected row cannot sink below the row you are merely pointing at. As a
+ wash it was 11% against a hover that had moved up to the --accent token,
+ which put a clicked row three levels DARKER than a hovered one, and the
+ gap widened as the contrast slider came down. */
html.dark .hub-page .hub-result-row[data-selected="true"] {
- background-color: color-mix(in srgb, var(--foreground) calc(11% * var(--contrast-wash-gain, 1)), var(--background));
+ background-color: color-mix(in srgb, var(--foreground) 6%, var(--accent));
box-shadow: none;
}
@@ -621,7 +642,7 @@
}
html.dark .hub-page .hub-recent-item:hover {
- background-color: color-mix(in srgb, var(--foreground) calc(8% * var(--contrast-wash-gain, 1)), transparent);
+ background-color: var(--accent);
}
.hub-page .hub-recent-clear:hover,
@@ -655,15 +676,22 @@
color: var(--foreground);
}
+ /* --accent, the app's one hover tone, carrying a little --foreground: the
+ menu now rests at the tone --accent alone would sit 8 levels above, which
+ is not enough to pick a row out. Same step the track keeps from the pill. */
html.dark .hub-menu-instant [data-slot="select-item"]:focus,
html.dark .hub-menu-instant [data-slot="select-item"][data-highlighted],
html.dark .hub-menu-instant [role="option"][data-highlighted] {
- background-color: color-mix(in srgb, var(--foreground) calc(8% * var(--contrast-wash-gain, 1)), transparent);
+ background-color: color-mix(in srgb, var(--foreground) 6%, var(--accent));
color: var(--foreground);
}
+ /* The trigger's resting tone, not the panel's, so an open menu reads as the
+ control it came from instead of a hole in the panel. Opaque rather than
+ .field-soft's translucent rest, because a floating menu has no fixed
+ backdrop and would land on a different colour per surface. */
html.dark .hub-menu-instant {
- background-color: color-mix(in oklab, #2e2f31, var(--contrast-target, transparent) var(--contrast-surface-mix, 0%)) !important;
+ background-color: color-mix(in srgb, var(--accent) 60%, var(--popover)) !important;
}
.hub-menu-instant *,
@@ -687,12 +715,27 @@
box-shadow: none;
}
+ /* 6.5%, in line with .hub-chip. At 4.5% the track sat 9 levels off the page
+ and the unselected half of the control had nothing to stand on. */
html.dark .hub-tab-toggle {
- background-color: color-mix(in srgb, var(--foreground) calc(4.5% * var(--contrast-wash-gain, 1)), transparent);
+ background-color: color-mix(in srgb, var(--foreground) calc(6.5% * var(--contrast-wash-gain, 1)), transparent);
border: 0;
box-shadow: none;
}
+ /* The track is a wash on whatever sits behind it, so how far it lands from
+ the selected pill depends on that surface: 21 levels below --accent on the
+ page, but only 7 on an elevated panel, where the two halves of the control
+ stop reading apart. Panels therefore sink the track toward the page
+ instead of lifting it off the panel, stopping under it at #232323. No
+ wash gain here: that guard keeps lit washes from fading out, and this one
+ darkens. */
+ html.dark .menu-soft-surface .hub-tab-toggle,
+ html.dark .menu-soft-surface-up .hub-tab-toggle,
+ html.dark [data-slot="dialog-content"] .hub-tab-toggle {
+ background-color: color-mix(in srgb, var(--background) 27%, transparent);
+ }
+
html:not(.dark) .hub-tab-toggle-pill {
background-color: var(--background);
border: 0;
@@ -704,14 +747,35 @@
background-color: color-mix(in srgb, var(--foreground) calc(5% * var(--contrast-wash-gain, 1)), var(--background));
}
- html.dark .hub-tab-toggle-pill {
- background-color: color-mix(in srgb, var(--foreground) calc(10% * var(--contrast-wash-gain, 1)), transparent);
+ /* A tab is a real button, so unlike the sliding indicator it can hover. In
+ light the pill is already the lightest thing on the panel, so it stays
+ put rather than moving the only direction left, which is down. */
+ html:not(.dark) .hub-tab-toggle-pill[role="tab"]:hover {
+ background-color: var(--background);
+ }
+
+ /* The selected segment takes --accent, the app's one selection colour, so it
+ reads like every other lit row. As its own wash it was scaled by the wash
+ gain, which falls much further than the token does: at the bottom of the
+ contrast range the selected tab sank to barely above its own track. Hover
+ is the same colour, so a selected segment stays put under the pointer. */
+ html.dark .hub-tab-toggle-pill,
+ html.dark .hub-tab-toggle-pill:hover {
+ background-color: var(--accent);
border: 0;
box-shadow: none;
}
- html.dark .hub-tab-toggle-pill:hover {
- background-color: color-mix(in srgb, var(--foreground) calc(18% * var(--contrast-wash-gain, 1)), transparent);
+ /* Standalone buttons borrow the pill look without being a segment, so they
+ want back the hover the rule above pins away. Mixed into --accent rather
+ than washed over the element, which would paint on whatever sits behind
+ the pill and composite below it. Press returns to --accent. */
+ html.dark .hub-tab-toggle-pill.hub-pill-action:hover {
+ background-color: color-mix(in srgb, var(--foreground) 8%, var(--accent));
+ }
+
+ html.dark .hub-tab-toggle-pill.hub-pill-action:active {
+ background-color: var(--accent);
}
html:not(.dark) .hub-page .catalog-row {
@@ -737,11 +801,14 @@
}
html.dark .hub-page .catalog-row:hover {
- background-color: color-mix(in srgb, var(--foreground) calc(3.5% * var(--contrast-wash-gain, 1)), transparent);
+ background-color: var(--accent);
}
+ /* Above the hover tone it is derived from, for the reason the result rows
+ carry: a 7% wash on the page lands below --accent, so selecting a row you
+ were hovering dimmed it. */
html.dark .hub-page .catalog-row[data-selected="true"] {
- background-color: color-mix(in srgb, var(--foreground) calc(7% * var(--contrast-wash-gain, 1)), transparent);
+ background-color: color-mix(in srgb, var(--foreground) 6%, var(--accent));
}
}
@@ -767,8 +834,10 @@
border-radius: 9999px;
}
+ /* 6%, landing on --card. At 3.5% the quant row it holds was 7 levels off the
+ page and read as loose text rather than a control. */
.dark .hub-download-card {
- background-color: color-mix(in srgb, var(--foreground) calc(3.5% * var(--contrast-wash-gain, 1)), transparent);
+ background-color: color-mix(in srgb, var(--foreground) calc(6% * var(--contrast-wash-gain, 1)), transparent);
border: 1px solid color-mix(in srgb, var(--foreground) calc(5.5% * var(--contrast-edge-gain, 1)), transparent);
box-shadow: none;
}
@@ -1120,7 +1189,7 @@
}
.dark .hub-action-btn:hover:not(:disabled) {
- background-color: color-mix(in srgb, var(--foreground) calc(5% * var(--contrast-wash-gain, 1)), transparent);
+ background-color: var(--accent);
}
.hub-action-btn:disabled {
@@ -1268,8 +1337,9 @@
white-space: nowrap;
}
+ /* The toolbar pills read as one family with the chips below them. */
html.dark .hub-page .hub-stat-pill {
- background-color: color-mix(in srgb, var(--foreground) calc(4% * var(--contrast-wash-gain, 1)), transparent);
+ background-color: color-mix(in srgb, var(--foreground) calc(6.5% * var(--contrast-wash-gain, 1)), transparent);
}
.hub-page .hub-stat-pill-value {
@@ -1392,7 +1462,7 @@
}
html.dark .hub-page .hub-hero {
- --hub-hero-fill: #1c1c1c;
+ --hub-hero-fill: var(--card);
--hub-card-border-accent: var(--foreground);
--hub-card-edge-mix: 2.8%;
--hub-card-inner-accent: var(--foreground);
diff --git a/studio/frontend/src/features/model-picker/components/memory-estimate-row.tsx b/studio/frontend/src/features/model-picker/components/memory-estimate-row.tsx
index 75221c79831..c760f65cb98 100644
--- a/studio/frontend/src/features/model-picker/components/memory-estimate-row.tsx
+++ b/studio/frontend/src/features/model-picker/components/memory-estimate-row.tsx
@@ -20,10 +20,10 @@ import {
} from "../model-config/memory-fit";
const MEMORY_VALUE_TONE: Record<MemoryFitVerdict, string> = {
- fits: "text-nav-fg",
+ fits: "text-foreground",
tight: "text-amber-500",
exceeds: "text-red-500",
- unknown: "text-nav-fg",
+ unknown: "text-foreground",
};
/** Match the size and type of the surrounding numeric controls. */
@@ -105,7 +105,7 @@ function MemoryFigure({
ref={buttonRef}
type="button"
aria-label={`${label}: ${value}`}
- className={`relative inline-flex h-8 w-auto min-w-[64px] max-w-full shrink-0 cursor-default! items-center justify-center overflow-hidden rounded-full border-transparent bg-[var(--panel-input-surface)] px-3.5 text-ui-13 font-medium leading-none tabular-nums focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 ${tone ?? "text-nav-fg"}`}
+ className={`relative inline-flex h-8 w-auto min-w-[64px] max-w-full shrink-0 cursor-default! items-center justify-center overflow-hidden rounded-full border-transparent bg-[var(--panel-input-surface)] px-3.5 text-ui-13 font-medium leading-none tabular-nums focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 ${tone ?? "text-foreground"}`}
>
<span aria-hidden="true" className="min-w-0 truncate">
{candidates[displayIndex] ?? value}
@@ -142,7 +142,7 @@ function MemoryBreakdownLine({
<div className="grid grid-cols-[minmax(0,1fr)_auto] items-baseline gap-x-4 gap-y-1">
<span className="min-w-0 text-ui-12 text-muted-foreground">{label}</span>
<span
- className={`whitespace-nowrap pr-2 text-ui-12 tabular-nums ${muted ? "text-muted-foreground" : "text-nav-fg"}`}
+ className={`whitespace-nowrap pr-2 text-ui-12 tabular-nums ${muted ? "text-muted-foreground" : "text-foreground"}`}
>
{value}
</span>
@@ -230,7 +230,7 @@ export function MemoryEstimateRow({
estimate.drafterRuntimeBytes,
);
return (
- <div className="flex flex-col border-b border-border/60 pb-5">
+ <div className="flex flex-col border-b border-border pb-5">
<button
type="button"
onClick={() => onExpandedChange(!expanded)}
@@ -240,16 +240,16 @@ export function MemoryEstimateRow({
className="group flex min-h-8 w-full items-center justify-between gap-3 rounded-md text-left focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60 focus-visible:ring-offset-2 focus-visible:ring-offset-background"
>
<span className="flex min-w-0 items-center gap-2">
- <span className="min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg">
+ <span className="min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-foreground">
Estimated Memory Usage
</span>
- <span className="shrink-0 rounded-md bg-[rgb(0_0_0_/_calc(0.04*var(--contrast-wash-gain,1)))] px-1.5 py-0.5 text-ui-10 font-medium uppercase tracking-wide text-muted-foreground dark:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))]">
+ <span className="shrink-0 rounded-md bg-[rgb(0_0_0_/_calc(0.04*var(--contrast-wash-gain,1)))] px-1.5 py-0.5 text-ui-10 font-medium uppercase tracking-wide text-muted-foreground dark:bg-muted">
Beta
</span>
</span>
<ChevronDown
aria-hidden="true"
- className={`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-hover:text-nav-fg motion-reduce:transition-none ${expanded ? "rotate-0" : "-rotate-90"}`}
+ className={`size-3.5 shrink-0 text-muted-foreground transition-transform duration-200 group-hover:text-foreground motion-reduce:transition-none ${expanded ? "rotate-0" : "-rotate-90"}`}
/>
</button>
<div
diff --git a/studio/frontend/src/features/model-picker/components/model-config-page.tsx b/studio/frontend/src/features/model-picker/components/model-config-page.tsx
index 83516481539..cd6982a7cc7 100644
--- a/studio/frontend/src/features/model-picker/components/model-config-page.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-config-page.tsx
@@ -182,9 +182,9 @@ import {
const ROW_CLASS = "flex min-h-8 items-center justify-between gap-3";
const LABEL_CLASS =
- "min-w-0 truncate text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg";
+ "min-w-0 truncate text-ui-13 font-medium leading-[1.25] tracking-nav text-foreground";
const LABEL_CLASS_WRAP =
- "min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-nav-fg";
+ "min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-foreground";
// Same surface token as the panel's fields and textareas.
const CONTROL_SURFACE =
"rounded-full border-transparent bg-[var(--panel-input-surface)] hover:bg-[var(--panel-input-surface-hover)] dark:bg-[var(--panel-input-surface)] dark:hover:bg-[var(--panel-input-surface-hover)]";
@@ -724,7 +724,7 @@ function VramBudgetRow() {
type="button"
disabled={locked}
onClick={resetBudget}
- className="text-ui-11 text-muted-foreground underline underline-offset-2 hover:text-nav-fg"
+ className="text-ui-11 text-muted-foreground underline underline-offset-2 hover:text-foreground"
>
Reset to the server default
</button>
@@ -919,7 +919,7 @@ function GpuMemorySettings({
key={d.index}
className="flex items-center justify-between gap-3"
>
- <span className="min-w-0 truncate text-ui-12 text-nav-fg/80">
+ <span className="min-w-0 truncate text-ui-12 text-muted-foreground">
GPU {d.index}: {d.name}
{d.memoryTotalGb
? ` · ${Math.round(d.memoryTotalGb)} GiB`
@@ -932,7 +932,7 @@ function GpuMemorySettings({
<div className="flex shrink-0 items-center gap-0.5">
<button
type="button"
- className="rounded px-1 text-ui-12 text-nav-fg/60 hover:text-nav-fg disabled:opacity-30"
+ className="rounded px-1 text-ui-12 text-muted-foreground hover:text-foreground disabled:opacity-30"
aria-label={`Move GPU ${d.index} earlier`}
disabled={position === 0}
onClick={() => moveGpu(d.index, -1)}
@@ -941,7 +941,7 @@ function GpuMemorySettings({
</button>
<button
type="button"
- className="rounded px-1 text-ui-12 text-nav-fg/60 hover:text-nav-fg disabled:opacity-30"
+ className="rounded px-1 text-ui-12 text-muted-foreground hover:text-foreground disabled:opacity-30"
aria-label={`Move GPU ${d.index} later`}
disabled={position >= orderedGpuIds.length - 1}
onClick={() => moveGpu(d.index, 1)}
@@ -976,7 +976,7 @@ function AdvancedSettingsToggle({
}) {
return (
// Ruled off from the context controls above, matching the estimate row's divider.
- <div className={`${ROW_CLASS} border-t border-border/60 pt-5`}>
+ <div className={`${ROW_CLASS} border-t border-border pt-5`}>
<div className="flex min-w-0 items-center gap-1.5">
<span className="min-w-0 text-ui-13 font-medium leading-[1.25] tracking-nav text-muted-foreground">
Advanced settings
@@ -1832,7 +1832,7 @@ function ExtraArgsRow({
placeholder="--rope-scaling yarn --yarn-orig-ctx 32768"
aria-label="Extra llama-server arguments"
aria-describedby={diagnostics.length > 0 ? adviceId : undefined}
- className="block size-full resize-none bg-transparent px-3.5 py-2.5 text-left font-mono text-ui-12 leading-relaxed text-nav-fg outline-none placeholder:text-muted-foreground"
+ className="block size-full resize-none bg-transparent px-3.5 py-2.5 text-left font-mono text-ui-12 leading-relaxed text-foreground outline-none placeholder:text-muted-foreground"
/>
</div>
{(tokenCount > 0 || diagnostics.length > 0) && (
@@ -3121,7 +3121,7 @@ export function ModelConfigPage({
<div className="text-ui-10 font-semibold uppercase leading-none tracking-wider text-muted-foreground">
Run settings
</div>
- <div className="mt-1.5 truncate text-ui-14 font-semibold leading-tight text-nav-fg">
+ <div className="mt-1.5 truncate text-ui-14 font-semibold leading-tight text-foreground">
{target.displayName}
</div>
</div>
@@ -3296,8 +3296,8 @@ export function ModelConfigPage({
<div
className={
variant === "sidebar"
- ? "mt-5 flex flex-col gap-2 border-t border-border/60 pt-5"
- : "mt-5 flex items-center justify-between gap-3 border-t border-border/60 pt-5"
+ ? "mt-5 flex flex-col gap-2 border-t border-border pt-5"
+ : "mt-5 flex items-center justify-between gap-3 border-t border-border pt-5"
}
>
<div className="flex min-w-0 items-center gap-2">
@@ -3313,7 +3313,7 @@ export function ModelConfigPage({
/>
<label
htmlFor={rememberId}
- className="cursor-pointer select-none truncate text-ui-13 text-nav-fg"
+ className="cursor-pointer select-none truncate text-ui-13 text-foreground"
>
Remember for this model
</label>
diff --git a/studio/frontend/src/features/model-picker/components/model-selector.tsx b/studio/frontend/src/features/model-picker/components/model-selector.tsx
index 8197be6c45b..edf4c6d9e02 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector.tsx
@@ -168,11 +168,11 @@ function ModelSelectorTrigger({
"unsloth-model-selector-trigger group/trigger flex min-w-0 items-center gap-2 transition-colors",
// Suppress the pill's hover background while the eject hit area is hovered.
variant === "outline" &&
- "rounded-full border border-border/60 hover:bg-accent has-[[data-eject-hit]:hover]:!bg-transparent",
+ "rounded-full border border-border hover:bg-accent has-[[data-eject-hit]:hover]:!bg-transparent",
variant === "ghost" &&
"rounded-full hover:bg-accent has-[[data-eject-hit]:hover]:!bg-transparent",
variant === "muted" &&
- "rounded-full bg-muted hover:bg-muted/80 has-[[data-eject-hit]:hover]:!bg-muted",
+ "rounded-full bg-muted hover:bg-muted has-[[data-eject-hit]:hover]:!bg-muted",
// More left padding than right; the chevron is pulled close to the label so the trigger reads
// balanced around the text. Height stays pinned to --studio-chat-control-height.
size === "sm" && "h-8 pl-3 pr-1.5 text-xs",
@@ -223,7 +223,7 @@ function ModelSelectorTrigger({
<span className="relative -top-[0.05em] flex min-w-0 flex-1 items-baseline">
<span
className={cn(
- "min-w-0 flex flex-1 items-baseline truncate font-heading text-ui-16 font-medium leading-tight text-black dark:text-white",
+ "min-w-0 flex flex-1 items-baseline truncate font-heading text-ui-16 font-medium leading-tight text-black dark:text-foreground",
triggerLabelClassName,
)}
>
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/connected-model-settings-dialog.tsx b/studio/frontend/src/features/model-picker/components/model-selector/connected-model-settings-dialog.tsx
index 6bdea37e9ef..4207d0dffc3 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/connected-model-settings-dialog.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector/connected-model-settings-dialog.tsx
@@ -189,7 +189,7 @@ export function ConnectedModelSettingsDialog({
</DialogHeader>
{rememberParamsPerModel ? null : (
- <p className="rounded-md border border-border/70 bg-muted/30 px-3 py-2 text-xs leading-relaxed text-muted-foreground">
+ <p className="rounded-md border border-border bg-muted px-3 py-2 text-xs leading-relaxed text-muted-foreground">
"Remember settings per model" is off in Settings → Chat, so the
prompt and output cap below are stored but never restored. Reasoning
effort is kept separately and still applies.
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/folder-browser.tsx b/studio/frontend/src/features/model-picker/components/model-selector/folder-browser.tsx
index 283d04abb21..111fc0a7191 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/folder-browser.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector/folder-browser.tsx
@@ -166,9 +166,9 @@ export function FolderBrowser({
</DialogHeader>
{/* Breadcrumb */}
- <div className="flex flex-wrap items-center gap-0.5 border-t border-border/50 px-6 py-2 font-mono text-ui-11 text-muted-foreground">
+ <div className="flex flex-wrap items-center gap-0.5 border-t border-border px-6 py-2 font-mono text-ui-11 text-muted-foreground">
{crumbs.length === 0 ? (
- <span className="text-muted-foreground/60">(loading…)</span>
+ <span className="text-muted-foreground/80">(loading…)</span>
) : (
crumbs.map((c, i) => (
<span key={c.value} className="flex items-center gap-0.5">
@@ -181,7 +181,7 @@ export function FolderBrowser({
{c.label}
</button>
{i < crumbs.length - 1 && (
- <span className="text-muted-foreground/40">/</span>
+ <span className="text-muted-foreground/80">/</span>
)}
</span>
))
@@ -190,14 +190,14 @@ export function FolderBrowser({
{/* Suggestions (quick-pick chips) */}
{data?.suggestions && data.suggestions.length > 0 && (
- <div className="flex flex-wrap gap-1 border-t border-border/50 px-6 py-2">
+ <div className="flex flex-wrap gap-1 border-t border-border px-6 py-2">
{data.suggestions.map((s) => (
<button
key={s}
type="button"
onClick={() => navigate(s, showHidden)}
disabled={loading}
- className="rounded-full border border-border/50 px-2 py-0.5 font-mono text-ui-10 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40"
+ className="rounded-full border border-border px-2 py-0.5 font-mono text-ui-10 text-muted-foreground transition-colors hover:bg-muted hover:text-foreground disabled:opacity-40"
title={s}
>
{s.length > 36 ? `…${s.slice(-33)}` : s}
@@ -210,7 +210,7 @@ export function FolderBrowser({
toggling Show hidden) and just dim it, so the dialog doesn't collapse and
flash. The full-height spinner only shows on the first load, when there
is no data yet. */}
- <div className="max-h-64 min-h-24 overflow-y-auto border-t border-border/50">
+ <div className="max-h-64 min-h-24 overflow-y-auto border-t border-border">
{error && (
<div className="px-6 py-3 text-xs text-destructive">{error}</div>
)}
@@ -246,21 +246,21 @@ export function FolderBrowser({
{data.entries.length === 0 &&
(!showModelHints ||
!(data.model_files_here && data.model_files_here > 0)) && (
- <div className="px-6 py-3 text-xs text-muted-foreground/60">
+ <div className="px-6 py-3 text-xs text-muted-foreground/80">
(empty directory)
</div>
)}
{showModelHints &&
data.model_files_here !== undefined &&
data.model_files_here > 0 && (
- <div className="border-t border-border/30 px-6 py-1.5 text-ui-10 text-foreground/70">
+ <div className="border-t border-border px-6 py-1.5 text-ui-10 text-muted-foreground">
{data.model_files_here} model file
{data.model_files_here === 1 ? "" : "s"} in this folder.
Click "Use this folder" to scan it.
</div>
)}
{data.truncated === true && (
- <div className="border-t border-border/30 px-6 py-1.5 text-ui-10 text-muted-foreground/70">
+ <div className="border-t border-border px-6 py-1.5 text-ui-10 text-muted-foreground/80">
Showing first {data.entries.length} entries. Narrow the path
to see more.
</div>
@@ -275,7 +275,7 @@ export function FolderBrowser({
}}
className={cn(
"flex w-full items-center gap-2 px-6 py-1.5 text-left text-xs transition-colors hover:bg-muted hover:text-foreground",
- e.hidden && "text-muted-foreground/60",
+ e.hidden && "text-muted-foreground/80",
)}
>
<HugeiconsIcon
@@ -284,12 +284,12 @@ export function FolderBrowser({
"size-3 shrink-0",
e.has_models
? "text-foreground"
- : "text-muted-foreground/50",
+ : "text-muted-foreground/80",
)}
/>
<span className="truncate font-mono">{e.name}</span>
{showModelHints && e.has_models && (
- <span className="ml-auto shrink-0 rounded-full border border-border/50 px-1.5 py-0 text-ui-9 uppercase tracking-wider text-muted-foreground">
+ <span className="ml-auto shrink-0 rounded-full border border-border px-1.5 py-0 text-ui-9 uppercase tracking-wider text-muted-foreground">
models
</span>
)}
@@ -300,7 +300,7 @@ export function FolderBrowser({
</div>
{/* Footer */}
- <DialogFooter className="flex items-center justify-between gap-2 border-t border-border/50 px-6 py-3">
+ <DialogFooter className="flex items-center justify-between gap-2 border-t border-border px-6 py-3">
<label
htmlFor="folder-browser-show-hidden"
className="flex cursor-pointer items-center gap-2 text-xs text-muted-foreground"
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts
index 616694ccf26..f21a4a0c1d4 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts
+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-catalog.ts
@@ -8,7 +8,9 @@
import { normalizeDenseQuantSchemes } from "../../../../lib/dense-quant-schemes.ts";
import {
type GgufFitClass,
+ type GgufVariantSizes,
classifyGgufFit as classifyGgufFitForDevice,
+ ggufVariantFitSizeBytes,
} from "../../../../lib/gguf-fit.ts";
import {
type HostClass,
@@ -1106,6 +1108,53 @@ export function ggufFitRuns(fit: GgufFitClass): boolean {
return fit !== "oom";
}
+/** Whether a verdict loads with room to spare. `fits` clears the VRAM budget and `ram` the RAM
+ * one, both of which already hold a reserve back; `marginal` and `partial` run at the edge. */
+export function ggufFitIsComfortable(fit: GgufFitClass): boolean {
+ return fit === "fits" || fit === "ram";
+}
+
+/** What to recommend on a device whose budget is known: the largest quant that runs with room to
+ * spare, else the largest that runs at all, else the smallest. Quality the machine can actually
+ * hold, rather than whatever size the repo defaults to.
+ *
+ * Null when no variant carries a size, since then there is nothing to weigh against the device
+ * and the caller's repo default is the better guess. */
+export function recommendedQuantForDevice<T extends GgufVariantSizes>(
+ variants: readonly T[],
+ fitOf: (sizeBytes: number) => GgufFitClass,
+): T | null {
+ // Ranked by the weights, since that is the quality on offer and the size the row shows. Judged on
+ // the download footprint, which also covers the companion GGUFs the loader charges for: a vision
+ // projector, or a drafter `auto` promotes to. On `size_bytes` alone this starred quants that go
+ // OOM once the mmproj lands beside them.
+ const fitOfVariant = (variant: T) => fitOf(ggufVariantFitSizeBytes(variant));
+ // A listing with no size metadata reports zero (gguf_variants.py: an OSError stat-ing a local
+ // file, or a manifest an older backend cannot read). Zero prices as the bare context allowance,
+ // so it reads comfortable on any device and would outrank a real quant that only runs at the
+ // edge. Unknown is not comfortable, so it does not compete.
+ const sized = variants.filter((variant) => ggufVariantFitSizeBytes(variant) > 0);
+ if (sized.length === 0) return null;
+ const bySizeDesc = [...sized].sort(
+ (left, right) => right.size_bytes - left.size_bytes,
+ );
+ // Nothing runs, so the pick is whatever is closest to running: the smallest
+ // FOOTPRINT, not the smallest checkpoint. Companions are chosen per
+ // checkpoint (FLUX.2-klein sizes its text encoder that way), so a lighter
+ // quant can drag a heavier dependency along and end up furthest from fitting.
+ // Ties keep the larger checkpoint, since bySizeDesc is ranked by quality.
+ const smallestFootprint = bySizeDesc.reduce((best, variant) =>
+ ggufVariantFitSizeBytes(variant) < ggufVariantFitSizeBytes(best)
+ ? variant
+ : best,
+ );
+ return (
+ bySizeDesc.find((variant) => ggufFitIsComfortable(fitOfVariant(variant))) ??
+ bySizeDesc.find((variant) => fitOfVariant(variant) !== "oom") ??
+ smallestFootprint
+ );
+}
+
export interface QuantVariant {
quant: string;
filename: string;
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-delete-action.tsx b/studio/frontend/src/features/model-picker/components/model-selector/model-delete-action.tsx
index 1931a703d39..e370a6fb418 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/model-delete-action.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-delete-action.tsx
@@ -63,9 +63,9 @@ export function ModelDeleteAction({
disabled={disabled}
className={cn(
// Fixed box, matching the gear and dots menu it sits beside.
- "flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-destructive/10 hover:text-destructive",
+ "flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/80 transition-colors hover:bg-destructive/10 hover:text-destructive",
disabled &&
- "cursor-not-allowed opacity-40 hover:bg-transparent hover:text-muted-foreground/60",
+ "cursor-not-allowed opacity-40 hover:bg-transparent hover:text-muted-foreground/80",
buttonClassName,
)}
>
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-load-settings-action.tsx b/studio/frontend/src/features/model-picker/components/model-selector/model-load-settings-action.tsx
index 0298bf711ce..b4d050baa15 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/model-load-settings-action.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-load-settings-action.tsx
@@ -35,7 +35,7 @@ export function ModelLoadSettingsAction({
className={cn(
// Fixed box, not padding around the glyph, so this and the dots menu hover as one size. Callers
// can still size it up.
- "flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-[rgb(0_0_0_/_calc(0.05*var(--contrast-wash-gain,1)))] hover:text-foreground dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]",
+ "flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/80 transition-colors hover:bg-[rgb(0_0_0_/_calc(0.05*var(--contrast-wash-gain,1)))] hover:text-foreground dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]",
className,
)}
>
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/model-row-menu.tsx b/studio/frontend/src/features/model-picker/components/model-selector/model-row-menu.tsx
index 526c29090ad..f6abaea9b86 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/model-row-menu.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector/model-row-menu.tsx
@@ -195,7 +195,7 @@ export function ModelRowMenu({
aria-label={ariaLabel}
className={cn(
// Fixed box, matching ModelLoadSettingsAction beside it.
- "flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-[rgb(0_0_0_/_calc(0.05*var(--contrast-wash-gain,1)))] hover:text-foreground dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]",
+ "flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/80 transition-colors hover:bg-[rgb(0_0_0_/_calc(0.05*var(--contrast-wash-gain,1)))] hover:text-foreground dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]",
buttonClassName,
)}
>
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx b/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx
index 41cac4c6424..aac380245f8 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector/pickers.tsx
@@ -83,7 +83,11 @@ import {
import { useVramBudgetFraction } from "@/hooks/use-vram-budget-fraction";
import { copyToClipboard } from "@/lib/copy-to-clipboard";
import { diffusionRouteSearch } from "@/lib/diffusion-route-search";
-import { type GgufFitClass, requiredGgufMemoryGb } from "@/lib/gguf-fit";
+import {
+ type GgufFitClass,
+ ggufVariantFitSizeBytes,
+ requiredGgufMemoryGb,
+} from "@/lib/gguf-fit";
import { extractParamLabel } from "@/lib/model-size";
import { toast } from "@/lib/toast";
import { cn, formatCompact } from "@/lib/utils";
@@ -167,6 +171,7 @@ import {
curatedRowLabelFor,
curatedSizeBytesFor,
curatedTotalParamsFor,
+ recommendedQuantForDevice,
groupForRepoId,
} from "./model-catalog";
import { curatedArtifactIsOfferable } from "./host-artifact-policy";
@@ -437,7 +442,7 @@ function ListLabel({
<div
className={cn(
"flex items-center justify-between gap-1 px-2.5 pb-1",
- divider ? "mt-3 border-t border-border/50 pt-3" : "pt-3",
+ divider ? "mt-3 border-t border-border pt-3" : "pt-3",
)}
>
<span className="flex items-center gap-1.5 text-ui-10 font-semibold uppercase tracking-wider text-muted-foreground">
@@ -452,7 +457,7 @@ function ListLabel({
type="button"
onClick={onToggle}
aria-label={collapsed ? "Expand section" : "Collapse section"}
- className="shrink-0 rounded p-1 text-muted-foreground/60 transition-colors hover:text-foreground"
+ className="shrink-0 rounded p-1 text-muted-foreground/80 transition-colors hover:text-foreground"
>
{collapsed ? (
<ChevronRightIcon className="size-3" />
@@ -545,7 +550,7 @@ function CapabilityIcons({ caps }: { caps: ModelCapabilities }) {
key={key}
title={title}
aria-label={title}
- className="flex size-[18px] shrink-0 items-center justify-center rounded-md border border-border/60 text-muted-foreground"
+ className="flex size-[18px] shrink-0 items-center justify-center rounded-md border border-border text-muted-foreground"
>
<Glyph className="size-3" />
</span>
@@ -561,7 +566,7 @@ function VisionBadge() {
<TooltipTrigger asChild={true}>
<span
aria-label="Vision"
- className="flex h-[calc(18px*var(--ui-space-scale,1))] shrink-0 items-center justify-center rounded-md border border-border/60 px-1.5 text-indigo-700 dark:text-indigo-300"
+ className="flex h-[calc(18px*var(--ui-space-scale,1))] shrink-0 items-center justify-center rounded-md border border-border px-1.5 text-indigo-700 dark:text-indigo-300"
>
<HugeiconsIcon icon={ViewIcon} className="size-3" strokeWidth={1.8} />
</span>
@@ -578,7 +583,7 @@ function ParamChip({ label }: { label: string }) {
// h-[calc(18px*var(--ui-space-scale,1))], the height every other chip in the row band pins (quant, vision, the disk mark, the
// Loaded tag). py-px sized this one by its line box instead, the one height here that scales with
// --ui-font-scale, so the row only looked level at the scale where the two happened to cross.
- <span className="inline-flex h-[calc(18px*var(--ui-space-scale,1))] shrink-0 items-center whitespace-nowrap rounded-md border border-border/60 px-1.5 text-ui-10 font-medium text-muted-foreground tabular-nums">
+ <span className="inline-flex h-[calc(18px*var(--ui-space-scale,1))] shrink-0 items-center whitespace-nowrap rounded-md border border-border px-1.5 text-ui-10 font-medium text-muted-foreground tabular-nums">
{label}
</span>
);
@@ -843,13 +848,13 @@ export function GgufDownloadFootprint({
return (
<span
data-model-download-footprint={true}
- className="flex items-center gap-1 whitespace-nowrap text-foreground/80"
+ className="flex items-center gap-1 whitespace-nowrap text-muted-foreground"
>
<SizeText value={totalLabel} />
<span
data-model-download-footprint-help={true}
aria-hidden={true}
- className="flex size-3.5 shrink-0 items-center justify-center text-muted-foreground/70"
+ className="flex size-3.5 shrink-0 items-center justify-center text-muted-foreground/80"
>
<HugeiconsIcon icon={HelpCircleIcon} className="size-3" strokeWidth={1.8} />
</span>
@@ -877,7 +882,7 @@ export function GgufDownloadFootprintExplanation({
function QuantChip({ label }: { label: string }) {
return (
- <span className="inline-flex h-[calc(18px*var(--ui-space-scale,1))] max-w-full items-center overflow-hidden rounded-md bg-[rgb(0_0_0_/_calc(0.06*var(--contrast-wash-gain,1)))] px-1 font-mono text-ui-9 text-muted-foreground dark:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]">
+ <span className="inline-flex h-[calc(18px*var(--ui-space-scale,1))] max-w-full items-center overflow-hidden rounded-md bg-[rgb(0_0_0_/_calc(0.06*var(--contrast-wash-gain,1)))] px-1 font-mono text-ui-9 text-muted-foreground dark:bg-muted">
{label}
</span>
);
@@ -958,7 +963,7 @@ const ROW_ACTIONS_PINNED_CLASS = cn(ROW_ACTIONS_CLASS, "opacity-100");
// Same box and glyph size as ModelLoadSettingsAction, so a heading's buttons sit in the same
// column and hover the same size as the ones on the rows under it.
const HEADING_ACTION_CLASS =
- "flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/60 transition hover:bg-[rgb(0_0_0_/_calc(0.05*var(--contrast-wash-gain,1)))] hover:text-foreground dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]";
+ "flex size-5 shrink-0 items-center justify-center rounded-md text-muted-foreground/80 transition hover:bg-[rgb(0_0_0_/_calc(0.05*var(--contrast-wash-gain,1)))] hover:text-foreground dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]";
/** A Connected group label. Wider than the On Device section labels, since nothing divides these
* groups but the gap, and foldable the same way. */
@@ -1201,9 +1206,9 @@ function ModelRow({
</span>
) : null}
{showOwner ? (
- <span className="inline-flex min-w-0 max-w-[45%] shrink items-baseline text-ui-13 text-muted-foreground/90">
+ <span className="inline-flex min-w-0 max-w-[45%] shrink items-baseline text-ui-13 text-muted-foreground/80">
<span className="truncate">{owner}</span>
- <span className="shrink-0 text-muted-foreground/45">/</span>
+ <span className="shrink-0 text-muted-foreground/80">/</span>
</span>
) : null}
<span className="min-w-0 flex-1 truncate">{name}</span>
@@ -1217,7 +1222,7 @@ function ModelRow({
/>
)}
{alignMeta !== "device" && quantChip ? (
- <span className="ml-2 shrink-0 rounded-md bg-[rgb(0_0_0_/_calc(0.06*var(--contrast-wash-gain,1)))] px-1.5 py-px font-mono text-ui-10 text-muted-foreground dark:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]">
+ <span className="ml-2 shrink-0 rounded-md bg-[rgb(0_0_0_/_calc(0.06*var(--contrast-wash-gain,1)))] px-1.5 py-px font-mono text-ui-10 text-muted-foreground dark:bg-muted">
{quantChip}
</span>
) : null}
@@ -1829,6 +1834,17 @@ function GgufVariantExpander({
],
);
+ // One verdict per variant, so the badge, the ordering and the star cannot
+ // disagree. Judged on the download footprint, which covers the companion
+ // GGUFs the loader charges for: a vision projector, or a drafter `auto`
+ // promotes to. On the bare checkpoint a vision quant could sort and badge as
+ // fitting while the recommendation had already ruled it OOM.
+ const getVariantFit = useCallback(
+ (variant: GgufVariantDetail): GgufFitClass =>
+ getGgufFit(ggufVariantFitSizeBytes(variant)),
+ [getGgufFit],
+ );
+
const variantGroups = useMemo(
() => groupGgufVariantsForPicker(variants ?? []),
[variants],
@@ -1838,8 +1854,9 @@ function GgufVariantExpander({
[variantGroups, defaultVariant],
);
- // Each workflow gets its own recommendation: if its preferred variant is OOM use the largest
- // that can run, and if all are OOM the smallest.
+ // Each workflow gets its own recommendation: the largest quant the device runs with room to
+ // spare, else the largest that runs at all, else the smallest. The repo default only decides it
+ // when nothing has been measured, so a big machine is not held at the default's size.
const effectiveRecommendedByGroup = useMemo(() => {
const recommended = new Map<string, string>();
for (const group of variantGroups) {
@@ -1848,21 +1865,9 @@ function GgufVariantExpander({
if (preferred) recommended.set(group.key, preferred.quant);
continue;
}
- if (preferred && getGgufFit(preferred.size_bytes) !== "oom") {
- recommended.set(group.key, preferred.quant);
- continue;
- }
- const fitting = group.variants
- .filter((variant) => getGgufFit(variant.size_bytes) !== "oom")
- .sort((left, right) => right.size_bytes - left.size_bytes);
- if (fitting[0]) {
- recommended.set(group.key, fitting[0].quant);
- continue;
- }
- const smallest = [...group.variants].sort(
- (left, right) => left.size_bytes - right.size_bytes,
- )[0];
- if (smallest) recommended.set(group.key, smallest.quant);
+ // Null when the group carries no sizes at all, so there is nothing to measure.
+ const pick = recommendedQuantForDevice(group.variants, getGgufFit) ?? preferred;
+ if (pick) recommended.set(group.key, pick.quant);
}
return recommended;
}, [variantGroups, preferredByGroup, anyBudgetGb, budgetKnown, getGgufFit]);
@@ -1883,7 +1888,7 @@ function GgufVariantExpander({
if (!variants) return variants;
// Tier: 0 = downloaded+fits, 1 = downloaded+tight, 2 = fits, 3 = tight, 4 = OOM
const tierOf = (v: GgufVariantDetail) => {
- const f = getGgufFit(v.size_bytes);
+ const f = getVariantFit(v);
if (f === "oom") return 4;
const base = f === "fits" ? 0 : 1;
return v.downloaded ? base : base + 2;
@@ -1907,7 +1912,7 @@ function GgufVariantExpander({
: a.size_bytes - b.size_bytes;
});
});
- }, [variants, variantGroups, effectiveRecommendedByGroup, getGgufFit]);
+ }, [variants, variantGroups, effectiveRecommendedByGroup, getVariantFit]);
// On Device only: with Show all quantizations off, list quants already on disk, torn ones included.
const showAllQuantizations = useChatRuntimeStore(
@@ -2120,7 +2125,7 @@ function GgufVariantExpander({
const isRecommended =
group != null &&
effectiveRecommendedByGroup.get(group.key) === v.quant;
- const fit = getGgufFit(v.size_bytes);
+ const fit = getVariantFit(v);
const oom = fit === "oom";
const expectedBytes = ggufVariantExpectedBytes(v);
// This row's own dependency group, never the listing's: see the footprintVariants comment above.
@@ -2177,7 +2182,7 @@ function GgufVariantExpander({
partial
</span>
) : isRecommended ? (
- <span className="ml-1.5 text-ui-9 font-sans font-medium text-primary/70">
+ <span className="ml-1.5 text-ui-9 font-sans font-medium text-primary">
recommended
</span>
) : null}
@@ -5270,11 +5275,13 @@ export function HubModelPicker({
onClick={() => setFitOnDeviceOnly(!fitOnDeviceOnly)}
className="flex w-full cursor-pointer select-none items-center gap-1.5 rounded-[10px] px-2 py-1.5 text-left text-xs text-muted-foreground transition-colors hover:text-foreground"
>
+ {/* --input is a hairline tuned for the page; on the menu surface this
+ 14px control needs an outline you can actually find. */}
<Checkbox
checked={fitOnDeviceOnly}
tabIndex={-1}
aria-hidden={true}
- className="pointer-events-none size-3.5 rounded-full [&_svg]:!size-2.5"
+ className="pointer-events-none size-3.5 rounded-full border-muted-foreground/70 [&_svg]:!size-2.5"
/>
Only show models that fit
</button>
@@ -5290,7 +5297,7 @@ export function HubModelPicker({
<HugeiconsIcon
icon={ArrowUpDownIcon}
strokeWidth={1.75}
- className="size-3.5 shrink-0 text-muted-foreground"
+ className="size-3.5 shrink-0 text-foreground"
/>
<span className="truncate">{label}</span>
</span>
@@ -6118,7 +6125,7 @@ export function HubModelPicker({
type="button"
onClick={onBrowseHub}
aria-label="Search more models on the Hub"
- className="hub-tab-toggle-pill flex h-(--picker-control-h) w-(--picker-control-w) shrink-0 items-center justify-center gap-[calc(5px*var(--ui-space-scale,1))] rounded-full border-0 text-xs text-foreground transition-colors"
+ className="hub-tab-toggle-pill hub-pill-action flex h-(--picker-control-h) w-(--picker-control-w) shrink-0 items-center justify-center gap-[calc(5px*var(--ui-space-scale,1))] rounded-full border-0 text-xs text-foreground transition-colors"
>
<HugeiconsIcon
icon={DashboardCircleIcon}
@@ -6345,7 +6352,7 @@ export function HubModelPicker({
type="button"
onClick={scrollToOtherModels}
aria-label="Go to other models"
- className="shrink-0 rounded p-1 text-muted-foreground/60 transition-colors hover:text-foreground"
+ className="shrink-0 rounded p-1 text-muted-foreground/80 transition-colors hover:text-foreground"
>
<HugeiconsIcon
icon={Flag01Icon}
@@ -6368,7 +6375,7 @@ export function HubModelPicker({
type="button"
onClick={scrollToFineTuned}
aria-label="Go to fine-tuned models"
- className="shrink-0 rounded p-1 text-muted-foreground/60 transition-colors hover:text-foreground"
+ className="shrink-0 rounded p-1 text-muted-foreground/80 transition-colors hover:text-foreground"
>
<HugeiconsIcon
icon={TrainIcon}
@@ -6390,7 +6397,7 @@ export function HubModelPicker({
type="button"
onClick={scrollToCustomFolders}
aria-label="Go to custom folders"
- className="shrink-0 rounded p-1 text-muted-foreground/60 transition-colors hover:text-foreground"
+ className="shrink-0 rounded p-1 text-muted-foreground/80 transition-colors hover:text-foreground"
>
<HugeiconsIcon
icon={Folder02Icon}
@@ -6452,7 +6459,7 @@ export function HubModelPicker({
<>
<div
ref={fineTunedSectionRef}
- className="mt-3 flex items-center gap-1 border-t border-border/50 px-2.5 pb-1 pt-3"
+ className="mt-3 flex items-center gap-1 border-t border-border px-2.5 pb-1 pt-3"
>
<span className="flex items-center gap-1.5 text-ui-10 font-semibold uppercase tracking-wider text-muted-foreground">
<HugeiconsIcon icon={TrainIcon} className="size-3.5" />
@@ -6468,7 +6475,7 @@ export function HubModelPicker({
}
title={fineTunedCollapsed ? "Expand" : "Collapse"}
onClick={() => setFineTunedCollapsed((v) => !v)}
- className="shrink-0 rounded p-1 text-muted-foreground/60 transition-colors hover:text-foreground"
+ className="shrink-0 rounded p-1 text-muted-foreground/80 transition-colors hover:text-foreground"
>
{fineTunedCollapsed ? (
<ChevronRightIcon className="size-3" />
@@ -6501,7 +6508,7 @@ export function HubModelPicker({
<>
<div
ref={customFolderSectionRef}
- className="mt-3 flex items-center gap-1 border-t border-border/50 px-2.5 pb-1 pt-3"
+ className="mt-3 flex items-center gap-1 border-t border-border px-2.5 pb-1 pt-3"
>
<button
type="button"
@@ -6535,7 +6542,7 @@ export function HubModelPicker({
return !open;
});
}}
- className="shrink-0 rounded p-1 text-muted-foreground/60 transition-colors hover:text-foreground"
+ className="shrink-0 rounded p-1 text-muted-foreground/80 transition-colors hover:text-foreground"
>
<HugeiconsIcon
icon={showFolderInput ? Cancel01Icon : Add01Icon}
@@ -6547,7 +6554,7 @@ export function HubModelPicker({
aria-label="Browse for a folder on the server"
title="Browse folders on the server"
onClick={() => setShowFolderBrowser(true)}
- className="shrink-0 rounded p-0.5 text-muted-foreground/60 transition-colors hover:text-foreground"
+ className="shrink-0 rounded p-0.5 text-muted-foreground/80 transition-colors hover:text-foreground"
>
<HugeiconsIcon
icon={Search01Icon}
@@ -6565,7 +6572,7 @@ export function HubModelPicker({
}
title={customFoldersCollapsed ? "Expand" : "Collapse"}
onClick={() => setCustomFoldersCollapsed((v) => !v)}
- className="shrink-0 rounded p-1 text-muted-foreground/60 transition-colors hover:text-foreground"
+ className="shrink-0 rounded p-1 text-muted-foreground/80 transition-colors hover:text-foreground"
>
{customFoldersCollapsed ? (
<ChevronRightIcon className="size-3" />
@@ -6587,11 +6594,11 @@ export function HubModelPicker({
>
<HugeiconsIcon
icon={Folder02Icon}
- className="size-3 shrink-0 text-muted-foreground/40"
+ className="size-3 shrink-0 text-muted-foreground/80"
/>
<div className="min-w-0 flex-1">
<span
- className="block truncate font-mono text-ui-10 text-muted-foreground/70"
+ className="block truncate font-mono text-ui-10 text-muted-foreground/80"
title={f.path}
>
{f.path}
@@ -6609,7 +6616,7 @@ export function HubModelPicker({
type="button"
onClick={() => handleRemoveFolder(f.id)}
aria-label={`Remove folder ${f.path}`}
- className="shrink-0 rounded p-1 text-foreground/70 transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive"
+ className="shrink-0 rounded p-1 text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:bg-destructive/10 focus-visible:text-destructive"
>
<HugeiconsIcon
icon={Cancel01Icon}
@@ -6639,7 +6646,7 @@ export function HubModelPicker({
onClick={() => void handleAddFolder(p)}
disabled={folderLoading}
title={`Add ${p}`}
- className="rounded-full border border-dashed border-border/50 px-2 py-0.5 font-mono text-ui-10 text-muted-foreground/70 transition-colors hover:border-[color-mix(in_oklab,var(--foreground)_calc(30%*var(--contrast-edge-gain,1)),transparent)] hover:bg-accent hover:text-foreground disabled:opacity-40"
+ className="rounded-full border border-dashed border-border px-2 py-0.5 font-mono text-ui-10 text-muted-foreground/80 transition-colors hover:border-[color-mix(in_oklab,var(--foreground)_calc(30%*var(--contrast-edge-gain,1)),transparent)] hover:bg-accent hover:text-foreground disabled:opacity-40"
>
<span className="text-ui-11 font-semibold">
+
@@ -6657,7 +6664,7 @@ export function HubModelPicker({
<div className="flex items-center gap-1">
<HugeiconsIcon
icon={Folder02Icon}
- className="size-3 shrink-0 text-muted-foreground/40"
+ className="size-3 shrink-0 text-muted-foreground/80"
/>
<input
value={folderInput}
@@ -6679,7 +6686,7 @@ export function HubModelPicker({
}
}}
placeholder="/path/to/models"
- className="h-6 min-w-0 flex-1 rounded border border-border/50 bg-transparent px-1.5 font-mono text-ui-10 text-foreground outline-none placeholder:text-muted-foreground/40 focus:border-[color-mix(in_oklab,var(--foreground)_calc(20%*var(--contrast-edge-gain,1)),transparent)]"
+ className="h-6 min-w-0 flex-1 rounded border border-border bg-transparent px-1.5 font-mono text-ui-10 text-foreground outline-none placeholder:text-muted-foreground/80 focus:border-[color-mix(in_oklab,var(--foreground)_calc(20%*var(--contrast-edge-gain,1)),transparent)]"
disabled={folderLoading}
autoFocus={true}
/>
@@ -6689,7 +6696,7 @@ export function HubModelPicker({
disabled={folderLoading}
aria-label="Browse for folder"
title="Browse folders on the server"
- className="flex h-6 shrink-0 items-center justify-center rounded border border-border/50 px-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40"
+ className="flex h-6 shrink-0 items-center justify-center rounded border border-border px-1.5 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground disabled:opacity-40"
>
<HugeiconsIcon
icon={Search01Icon}
@@ -6702,7 +6709,7 @@ export function HubModelPicker({
void handleAddFolder();
}}
disabled={folderLoading || !folderInput.trim()}
- className="h-6 shrink-0 rounded border border-border/50 px-1.5 text-ui-10 text-muted-foreground transition-colors hover:bg-accent disabled:opacity-40"
+ className="h-6 shrink-0 rounded border border-border px-1.5 text-ui-10 text-muted-foreground transition-colors hover:bg-accent disabled:opacity-40"
>
Add
</button>
diff --git a/studio/frontend/src/features/model-picker/components/model-selector/pill-tabs.tsx b/studio/frontend/src/features/model-picker/components/model-selector/pill-tabs.tsx
index 368f0cf421b..c6fd495c7c4 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector/pill-tabs.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector/pill-tabs.tsx
@@ -99,10 +99,11 @@ export function PillTabs({
value === tab.value
? "text-foreground"
: "text-muted-foreground hover:text-foreground",
- // The active tab carries the pill; pin its hover bg so an already-selected tab shows no hover change.
- fit &&
- value === tab.value &&
- "hub-tab-toggle-pill hover:!bg-[var(--background)] dark:hover:!bg-[color-mix(in_srgb,var(--foreground)_10%,transparent)]",
+ // The active tab carries the pill; its hover lives on the pill
+ // rules in hub.css. The pin that used to sit here was written
+ // without a mode variant, so in dark it painted the page colour
+ // over the pill and pointing at the selected tab blacked it out.
+ fit && value === tab.value && "hub-tab-toggle-pill",
)}
>
{tab.icon}
diff --git a/studio/frontend/src/features/settings/components/appearance-custom-controls.tsx b/studio/frontend/src/features/settings/components/appearance-custom-controls.tsx
index 068d32ac640..b57afa12ef1 100644
--- a/studio/frontend/src/features/settings/components/appearance-custom-controls.tsx
+++ b/studio/frontend/src/features/settings/components/appearance-custom-controls.tsx
@@ -78,15 +78,15 @@ const PALETTE_DEFAULT_COLORS: Record<
> = {
standard: {
light: { accent: "#17b88b", background: "#fefefd", foreground: "#262626" },
- dark: { accent: "#17b88b", background: "#181818", foreground: "#ffffff" },
+ dark: { accent: "#17b88b", background: "#181818", foreground: "#dfdfdf" },
},
classic: {
light: { accent: "#339cff", background: "#ffffff", foreground: "#1a1c1f" },
- dark: { accent: "#4dabff", background: "#181818", foreground: "#ffffff" },
+ dark: { accent: "#4dabff", background: "#181818", foreground: "#dfdfdf" },
},
minimal: {
light: { accent: "#171717", background: "#ffffff", foreground: "#171717" },
- dark: { accent: "#ededed", background: "#181818", foreground: "#ffffff" },
+ dark: { accent: "#ededed", background: "#181818", foreground: "#dfdfdf" },
},
};
diff --git a/studio/frontend/src/features/settings/components/palette-cards.tsx b/studio/frontend/src/features/settings/components/palette-cards.tsx
index d42e041bf08..049ac099bbf 100644
--- a/studio/frontend/src/features/settings/components/palette-cards.tsx
+++ b/studio/frontend/src/features/settings/components/palette-cards.tsx
@@ -32,10 +32,10 @@ const PREVIEWS: Record<Palette, Record<ResolvedTheme, PreviewColors>> = {
},
dark: {
bg: "#181818",
- sidebar: "#262626",
+ sidebar: "#272727",
accent: "#17b88b",
- text: "#b5b5b5",
- border: "#303030",
+ text: "#dfdfdf",
+ border: "#3a3a3a",
},
},
classic: {
@@ -48,10 +48,10 @@ const PREVIEWS: Record<Palette, Record<ResolvedTheme, PreviewColors>> = {
},
dark: {
bg: "#181818",
- sidebar: "#262626",
+ sidebar: "#272727",
accent: "#4dabff",
- text: "#b5b5b5",
- border: "#303030",
+ text: "#dfdfdf",
+ border: "#3a3a3a",
},
},
minimal: {
@@ -64,10 +64,10 @@ const PREVIEWS: Record<Palette, Record<ResolvedTheme, PreviewColors>> = {
},
dark: {
bg: "#181818",
- sidebar: "#262626",
+ sidebar: "#272727",
accent: "#ededed",
- text: "#a8a8a8",
- border: "#303030",
+ text: "#dfdfdf",
+ border: "#3a3a3a",
},
},
};
diff --git a/studio/frontend/src/features/settings/settings-dialog.tsx b/studio/frontend/src/features/settings/settings-dialog.tsx
index 7f29d20bd4d..42e640ac41f 100644
--- a/studio/frontend/src/features/settings/settings-dialog.tsx
+++ b/studio/frontend/src/features/settings/settings-dialog.tsx
@@ -579,7 +579,7 @@ export function SettingsDialog() {
// only unselected items get a keyboard focus ring.
active
? "text-accent-foreground"
- : "text-[#383835] dark:text-[#c7c7c4] hover:bg-accent hover:text-accent-foreground focus-visible:ring-1 focus-visible:ring-ring",
+ : "text-[#383835] dark:text-foreground hover:bg-accent hover:text-accent-foreground focus-visible:ring-1 focus-visible:ring-ring",
)}
>
{active && (
@@ -625,7 +625,7 @@ export function SettingsDialog() {
<button
type="button"
onClick={closeDialog}
- className="absolute top-3 end-3 z-10 flex size-[calc(30px*var(--ui-space-scale,1))] items-center justify-center rounded-[10px] text-[#383835] dark:text-[#c7c7c4] transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
+ className="absolute top-3 end-3 z-10 flex size-[calc(30px*var(--ui-space-scale,1))] items-center justify-center rounded-[10px] text-[#383835] dark:text-foreground transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"
aria-label={t("settings.dialog.closeAriaLabel")}
>
<HugeiconsIcon icon={Cancel01Icon} className="size-4" />
diff --git a/studio/frontend/src/features/settings/stores/appearance-custom-store.ts b/studio/frontend/src/features/settings/stores/appearance-custom-store.ts
index ca5d213b3a4..73f417bb411 100644
--- a/studio/frontend/src/features/settings/stores/appearance-custom-store.ts
+++ b/studio/frontend/src/features/settings/stores/appearance-custom-store.ts
@@ -288,6 +288,8 @@ export const CONTRAST_SURFACE_MIX_VAR = "--contrast-surface-mix";
export const CONTRAST_LINE_MIX_VAR = "--contrast-line-mix";
/** Control outlines and switch tracks, which fade less far than a divider. */
export const CONTRAST_CONTROL_MIX_VAR = "--contrast-control-mix";
+/** Hover and selection fills, which fade less far than the surface under them. */
+export const CONTRAST_STATE_MIX_VAR = "--contrast-state-mix";
export const CONTRAST_TEXT_MIX_VAR = "--contrast-text-mix";
/** Multipliers for the hand-written washes that stand in for those tokens. */
export const CONTRAST_WASH_GAIN_VAR = "--contrast-wash-gain";
@@ -673,7 +675,7 @@ const PALETTE_SURFACES: Record<
{ background: string; elevated: string }
> = {
light: { background: "#ffffff", elevated: "#ffffff" },
- dark: { background: "#181818", elevated: "#212121" },
+ dark: { background: "#181818", elevated: "#272727" },
};
function minimumAccentTextContrast(
@@ -965,6 +967,11 @@ export function applyCustomizationToDocument(
setVar(CONTRAST_SURFACE_MIX_VAR, mix(raising ? 8 : 70));
setVar(CONTRAST_LINE_MIX_VAR, mix(raising ? 45 : 80));
setVar(CONTRAST_CONTROL_MIX_VAR, mix(raising ? 45 : 55));
+ // Hover and selection fills stop well short of the surfaces they sit on.
+ // On the surface curve they collapsed toward the page faster than the
+ // sidebar and cards did, so at the bottom the lit row was darker than its
+ // own background: the pointer stopped telling you where it was.
+ setVar(CONTRAST_STATE_MIX_VAR, mix(raising ? 8 : 30));
// Text sits on a gentler curve at both ends: it has to stay readable.
setVar(CONTRAST_TEXT_MIX_VAR, mix(40));
// Controls that wash the page with translucent white or black instead of
@@ -972,7 +979,12 @@ export function applyCustomizationToDocument(
// step with the tokens above.
const gain = (span: number) =>
(raising ? 1 + distance * span : 1 - distance * span).toFixed(3);
- setVar(CONTRAST_WASH_GAIN_VAR, gain(raising ? 0.7 : 0.75));
+ // Lowering keeps most of a wash rather than a quarter of it. These washes
+ // are the chrome you aim at, not decoration: tab tracks, header pills,
+ // chips, filter triggers. At a quarter strength a 4% fill landed 2 levels
+ // off the page, so the unselected half of a segmented control and the whole
+ // Hub toolbar read as bare background.
+ setVar(CONTRAST_WASH_GAIN_VAR, gain(raising ? 0.7 : 0.4));
setVar(CONTRAST_EDGE_GAIN_VAR, gain(raising ? 0.9 : 0.8));
} else {
el.removeAttribute("data-contrast-adjust");
@@ -980,6 +992,7 @@ export function applyCustomizationToDocument(
setVar(CONTRAST_SURFACE_MIX_VAR, null);
setVar(CONTRAST_LINE_MIX_VAR, null);
setVar(CONTRAST_CONTROL_MIX_VAR, null);
+ setVar(CONTRAST_STATE_MIX_VAR, null);
setVar(CONTRAST_TEXT_MIX_VAR, null);
setVar(CONTRAST_WASH_GAIN_VAR, null);
setVar(CONTRAST_EDGE_GAIN_VAR, null);
diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css
index 2b171ac8d10..2bd16031d64 100644
--- a/studio/frontend/src/index.css
+++ b/studio/frontend/src/index.css
@@ -215,7 +215,7 @@
--radius: 1.1rem;
/* White sidebar against the warm off-white page; the tone difference is
the separator now that the right-edge divider is gone. */
- --sidebar: #ffffff;
+ --sidebar-base: #ffffff;
--sidebar-foreground: oklch(0.1281 0.0179 169.2764);
--sidebar-primary: #17b88b;
--sidebar-primary-foreground: oklch(1 0 0);
@@ -370,49 +370,52 @@
}
.dark {
- /* Dark surfaces shared by ALL palettes: #181818 page, elevated #1f1f1f
- sidebar, #212121 cards. Palette dark blocks override only accent
- tokens so dark mode stays consistent across themes. */
+ /* Dark surfaces shared by ALL palettes: #181818 page, elevated #272727
+ sidebar/cards, #3a3a3a hover, #dfdfdf ink. Palette dark blocks override
+ only accent tokens so dark mode stays consistent across themes. */
--background: #181818;
- --foreground: #ffffff;
- --card-base: #212121;
- --card-foreground: #ffffff;
- --popover-base: #212121;
- --popover-foreground: #ffffff;
+ --foreground: #dfdfdf;
+ --card-base: #272727;
+ --card-foreground: #dfdfdf;
+ --popover-base: #272727;
+ --popover-foreground: #dfdfdf;
--primary: #17b88b;
--primary-foreground: oklch(1 0 0);
- --secondary-base: #242424;
- --secondary-foreground: #ffffff;
- --muted-base: #242424;
- --muted-foreground: #a3a3a3;
- /* One step lighter than --popover so menu item hover reads clearly. */
- --accent-base: #2e2e2e;
- --accent-foreground: #ffffff;
+ --secondary-base: #303030;
+ --secondary-foreground: #dfdfdf;
+ --muted-base: #303030;
+ /* Secondary text: settings descriptions, empty states, captions.
+ Under the ink, still ~7:1 on the dialog surface. */
+ --muted-foreground: #b0b0b0;
+ /* Shared hover tone: one step over --popover. */
+ --accent-base: #3a3a3a;
+ --accent-foreground: #dfdfdf;
--destructive: oklch(0.6368 0.2078 25.3313);
/* Bypass permissions accent: bright, saturated neon yellow on dark. */
--bypass: #ffd60a;
/* --border / --input one step lighter than --muted so outlines and form
borders stay visible on muted surfaces (right config panel, export
- tiles, quant chips) and keep subtle contrast on card. */
- --border-base: #303030;
- --input-base: #303030;
- --ring: #ececec;
+ tiles, quant chips) and keep subtle contrast on card. Matches the
+ hover tone, so outlines and hovered fills share a step. */
+ --border-base: #3a3a3a;
+ --input-base: #3a3a3a;
+ --ring: #dfdfdf;
--chart-1: oklch(0.7511 0.1407 166.2284);
--chart-2: oklch(0.75 0.14 136.5572);
--chart-3: oklch(0.7554 0.1285 197.339);
--chart-4: oklch(0.7503 0.1199 346.7805);
--chart-5: oklch(0.799 0.1196 84.6633);
- /* Elevated a step lighter than --background; the tone difference is
- the separator. */
- --sidebar: #1f1f1f;
- --sidebar-foreground: #ffffff;
+ /* A step over --background; the tone difference is the separator.
+ Matches --card, so every elevated surface reads as one plane. */
+ --sidebar-base: #272727;
+ --sidebar-foreground: #dfdfdf;
--sidebar-primary: #17b88b;
--sidebar-primary-foreground: oklch(1 0 0);
- --sidebar-accent-base: #2a2a2a;
- --sidebar-accent-foreground: #ffffff;
- --tabs-line-indicator-base: #2d2f33;
- --sidebar-border-base: #2a2a2a;
- --sidebar-ring: #ececec;
+ --sidebar-accent-base: #3a3a3a;
+ --sidebar-accent-foreground: #dfdfdf;
+ --tabs-line-indicator-base: #3a3a3a;
+ --sidebar-border-base: #3a3a3a;
+ --sidebar-ring: #dfdfdf;
--destructive-foreground: oklch(1 0 0);
/* Match light's radius so every rounded-* element is the same in both themes. */
--radius: 1.1rem;
@@ -437,12 +440,13 @@
--shadow-xl: 0px 0px 0px 0px hsl(0 0% 0% / 0), 0px 8px 10px 0px hsl(0 0% 0% / 0);
--shadow-2xl: 0px 0px 0px 0px hsl(0 0% 0% / 0);
- --nav-fg: #c9c9c9;
- --nav-fg-muted: #969696;
- --nav-surface-hover-base: #2a2a2a;
- --nav-icon-idle: #5c5c5c;
- --nav-beta-border: #333333;
- --panel-surface-hover-base: #333333;
+ --nav-fg: #dfdfdf;
+ --nav-fg-muted: #b0b0b0;
+ --nav-surface-hover-base: #3a3a3a;
+ /* Lifted with the surfaces: the sidebar is #272727, not #1f1f1f. */
+ --nav-icon-idle: #767676;
+ --nav-beta-border: #3a3a3a;
+ --panel-surface-hover-base: #3a3a3a;
/* Right-side chat-parameters panel: matches the chat content
surface in both themes — distinction from the left sidebar
is handled by the left border alone. Tracks `--background` so
@@ -451,21 +455,18 @@
--panel-surface: var(--background);
--panel-surface-fg: var(--foreground);
/* Translucent white so the same fill reads correctly on the #181818
- page AND on #212121 cards/dialogs. */
+ page AND on #272727 cards/dialogs. */
--panel-input-surface-base: rgba(255, 255, 255, 0.07);
--panel-input-surface-hover-base: rgba(255, 255, 255, 0.11);
- /* Soft neutral gray for muted text and sliders. Pure-ish #ababab
- reads as quiet on the dark panel without going colored. */
- --panel-surface-fg-muted: #ababab;
- /* Dark-mode slider tone matches muted text — user wants the dark
- theme slider unchanged from the previous behavior. */
- --panel-slider-fg-base: #ababab;
- /* Chat-message action icons. A touch lighter than the previous
- #b8b8b8 so the icons read clearly without going near pure white;
- hover restores full --foreground for affordance. */
- --chat-icon-fg: #d8d8d8;
+ /* Muted panel text and sliders: one step under the ink, uncolored. */
+ --panel-surface-fg-muted: #b0b0b0;
+ /* Dark-mode slider tone matches muted text. */
+ --panel-slider-fg-base: #b0b0b0;
+ /* Chat action icons: under the ink so they read as controls, not text.
+ Hover restores full --foreground. */
+ --chat-icon-fg: #c4c4c4;
--chat-icon-fg-hover: var(--foreground);
- --chat-icon-bg-hover-base: #2a2a2a;
+ --chat-icon-bg-hover-base: #3a3a3a;
}
/* ---------------------------------------------------------------------------
@@ -518,7 +519,7 @@
--chart-5: #5b7189;
/* Same as the standard palette; the sidebar surface does not change
with the palette. */
- --sidebar: #ffffff;
+ --sidebar-base: #ffffff;
--sidebar-foreground: #1a1c1f;
--sidebar-primary: #0d0d0d;
--sidebar-primary-foreground: #ffffff;
@@ -587,7 +588,7 @@
--chart-4: #a6a6a6;
--chart-5: #d1d1d1;
/* White sidebar on white content; the border alone is the separator. */
- --sidebar: #ffffff;
+ --sidebar-base: #ffffff;
--sidebar-foreground: #171717;
--sidebar-primary: #171717;
--sidebar-primary-foreground: #ffffff;
@@ -646,6 +647,10 @@
:root {
/* Boxes and buttons: the fill that lifts a surface off the page. */
--card: var(--card-base);
+ /* On the curve with --card, which it matches. Left off it, the sidebar held
+ its authored tone while the rows on it washed past it, so a lowered
+ contrast put the active row DARKER than the sidebar behind it. */
+ --sidebar: var(--sidebar-base);
--popover: var(--popover-base);
--secondary: var(--secondary-base);
--muted: var(--muted-base);
@@ -671,18 +676,25 @@
specificity, so it reaches all three palettes. */
html[data-contrast-adjust] {
--card: color-mix(in oklab, var(--card-base), var(--contrast-target) var(--contrast-surface-mix));
+ /* Same curve as its rows, so the step between them survives the slider. */
+ --sidebar: color-mix(in oklab, var(--sidebar-base), var(--contrast-target) var(--contrast-surface-mix));
--popover: color-mix(in oklab, var(--popover-base), var(--contrast-target) var(--contrast-surface-mix));
--secondary: color-mix(in oklab, var(--secondary-base), var(--contrast-target) var(--contrast-surface-mix));
--muted: color-mix(in oklab, var(--muted-base), var(--contrast-target) var(--contrast-surface-mix));
- --accent: color-mix(in oklab, var(--accent-base), var(--contrast-target) var(--contrast-surface-mix));
- --nav-surface-hover: color-mix(in oklab, var(--nav-surface-hover-base), var(--contrast-target) var(--contrast-surface-mix));
- --panel-surface-hover: color-mix(in oklab, var(--panel-surface-hover-base), var(--contrast-target) var(--contrast-surface-mix));
+ /* Hover and selection fills take --contrast-state-mix, a shorter curve than
+ the surfaces they sit on. Sharing the surface curve, they fell toward the
+ page at the same rate as the sidebar and the cards, so near the bottom a
+ lit row was no lighter than its own background. The fallback keeps a
+ snapshot written before this token on the old behaviour. */
+ --accent: color-mix(in oklab, var(--accent-base), var(--contrast-target) var(--contrast-state-mix, var(--contrast-surface-mix)));
+ --nav-surface-hover: color-mix(in oklab, var(--nav-surface-hover-base), var(--contrast-target) var(--contrast-state-mix, var(--contrast-surface-mix)));
+ --panel-surface-hover: color-mix(in oklab, var(--panel-surface-hover-base), var(--contrast-target) var(--contrast-state-mix, var(--contrast-surface-mix)));
--panel-input-surface: color-mix(in oklab, var(--panel-input-surface-base), var(--contrast-target) var(--contrast-surface-mix));
/* Same curve as its resting twin, or the hover inverts at high contrast. */
--panel-input-surface-hover: color-mix(in oklab, var(--panel-input-surface-hover-base), var(--contrast-target) var(--contrast-surface-mix));
/* Sidebar and model picker rows, and the chat control hovers. */
- --sidebar-accent: color-mix(in oklab, var(--sidebar-accent-base), var(--contrast-target) var(--contrast-surface-mix));
- --chat-icon-bg-hover: color-mix(in oklab, var(--chat-icon-bg-hover-base), var(--contrast-target) var(--contrast-surface-mix));
+ --sidebar-accent: color-mix(in oklab, var(--sidebar-accent-base), var(--contrast-target) var(--contrast-state-mix, var(--contrast-surface-mix)));
+ --chat-icon-bg-hover: color-mix(in oklab, var(--chat-icon-bg-hover-base), var(--contrast-target) var(--contrast-state-mix, var(--contrast-surface-mix)));
--tabs-line-indicator: color-mix(in oklab, var(--tabs-line-indicator-base), var(--contrast-target) var(--contrast-surface-mix));
--border: color-mix(in oklab, var(--border-base), var(--contrast-target) var(--contrast-line-mix));
/* Control outlines and switch tracks stop short of the hairlines: an
@@ -1697,7 +1709,7 @@ html[data-chat-font] .aui-root {
/* --nav-surface-hover is tuned for the page bg; on the lighter menu
surface it is invisible, so use the menu hover token instead. */
background-color: var(--accent);
- color: #fff;
+ color: var(--foreground);
}
.app-user-menu [data-slot="dropdown-menu-item"]:focus *,
.app-user-menu [data-slot="dropdown-menu-sub-trigger"]:focus *,
@@ -1707,7 +1719,7 @@ html[data-chat-font] .aui-root {
.dark .app-user-menu [data-slot="dropdown-menu-item"]:focus *,
.dark .app-user-menu [data-slot="dropdown-menu-sub-trigger"]:focus *,
.dark .app-user-menu [data-slot="dropdown-menu-sub-trigger"][data-state="open"] * {
- color: #fff !important;
+ color: var(--foreground) !important;
}
.menu-flat-destructive {
@@ -1745,10 +1757,10 @@ html[data-chat-font] .aui-root {
box-shadow: none;
}
- /* Lift the dialog off the page bg; halfway to --card keeps the inner
- bg-muted / bg-background fills readable. */
+ /* Lift the dialog off the page bg. On --card, so it matches the sidebar,
+ the chatbox and every menu. */
.dark .settings-surface {
- background-color: color-mix(in srgb, var(--background) 50%, var(--card));
+ background-color: var(--card);
}
/* App-wide: every clickable control shows the hand cursor. Disabled ones
@@ -1825,7 +1837,12 @@ html[data-chat-font] .aui-root {
.dark .menu-soft-surface,
.dark .menu-soft-surface-up {
--menu-soft-edge: rgba(255, 255, 255, 0.07);
- --menu-soft-shadow: rgba(0, 0, 0, 0.28);
+ /* The page colour, so the falloff disappears into the page instead of
+ ringing it. var(--background), not a fixed #181818, so it follows a
+ custom background too. Where a menu overlaps a lighter surface this
+ still parts the two, and --menu-soft-edge carries the boundary
+ elsewhere. Kept in step with the update banners. */
+ --menu-soft-shadow: var(--background);
--menu-soft-offset-y: 8px;
--menu-soft-blur: 28px;
--menu-soft-spread: -6px;
@@ -1856,6 +1873,24 @@ html[data-chat-font] .aui-root {
box-shadow: none;
}
+ /* Model discovery secondary text: section labels, chips, placeholders and
+ trigger icons. Small or uppercase, and much of it sits on control fills
+ rather than the panel, where the app-wide #b0b0b0 drops to 5.2:1. Lift
+ the token once per surface so the picker and the Hub read alike, with
+ --foreground still a step above. Re-derives --muted-foreground from the
+ lifted base on the same curve the contrast slider uses, so the setting
+ still reaches this text; at the default the mix is the identity. */
+ .dark .unsloth-model-selector-menu,
+ .dark .hub-menu-instant,
+ .dark .hub-page {
+ --panel-surface-fg-muted: #c9c9c9;
+ --muted-foreground: color-mix(
+ in oklab,
+ var(--panel-surface-fg-muted),
+ var(--contrast-target, transparent) var(--contrast-text-mix, 0%)
+ );
+ }
+
/* List menus: one radius in both themes, slightly tighter than --radius-lg
and matching the sidebar buttons. !important beats per-menu rounded-*. */
[data-slot="dropdown-menu-content"],
@@ -1880,16 +1915,19 @@ html[data-chat-font] .aui-root {
box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16) !important;
}
/* Dark: keep the chat-box dropdown shadow so menus don't merge into a
- same-color surface (e.g. a menu overlapping the composer). */
+ same-color surface (e.g. a menu overlapping the composer). The page
+ colour rather than black, so over the page there is nothing to see and
+ over the composer it is only the step between the two surfaces. Black
+ ringed every menu several levels below the page. */
.dark [data-slot="dropdown-menu-content"],
.dark [data-slot="dropdown-menu-sub-content"],
.dark [data-slot="select-content"],
.dark [data-slot="combobox-content"],
.dark [data-slot="popover-content"] {
- box-shadow: 0 4px 14px var(--background) !important;
+ box-shadow: 0 8px 28px -6px var(--background) !important;
}
- /* Model selector: shadow in the page-bg color so it lifts off the
+ /* Model selector: tighter than the menus above so it lifts off the
composer it overlaps (chatbox geometry). Account menu stays flat. */
.dark .unsloth-model-selector-menu {
box-shadow: 0 2px 8px -2px var(--background) !important;
@@ -1909,7 +1947,7 @@ html[data-chat-font] .aui-root {
box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16);
}
.dark .app-user-menu.menu-soft-surface-up {
- box-shadow: 0 8px 28px -6px rgba(0, 0, 0, 0.28);
+ box-shadow: 0 8px 28px -6px var(--background);
}
.chat-composer-surface {
@@ -1929,7 +1967,7 @@ html[data-chat-font] .aui-root {
}
.composer-pill-btn {
- @apply flex cursor-pointer items-center gap-1.5 rounded-full py-1.5 pl-2 pr-2.5 text-ui-14 font-medium text-muted-foreground/70 transition-colors hover:bg-primary/10 dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))] disabled:cursor-not-allowed disabled:opacity-40;
+ @apply flex cursor-pointer items-center gap-1.5 rounded-full py-1.5 pl-2 pr-2.5 text-ui-14 font-medium text-muted-foreground/70 dark:text-foreground transition-colors hover:bg-primary/10 dark:hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40;
}
/* Caret pills (RAG, MCP): the chevron carries its own whitespace, so the
@@ -1997,7 +2035,8 @@ html[data-chat-font] .aui-root {
color: color-mix(in oklab, var(--foreground) 60%, transparent);
}
.dark .composer-pill-btn.composer-pill-permissions:not([data-variant="danger"]) {
- color: color-mix(in oklab, var(--foreground) 72%, transparent);
+ /* Full ink, like the rest of the composer's controls. */
+ color: var(--foreground);
}
/* Bypass permissions badge: bright yellow text, no resting fill; the
rounded hover pill picks up the yellow accent like other toggles. */
@@ -2476,7 +2515,7 @@ html[data-chat-font] .aui-root {
/* Right-side Thinking pill (toggle or dropdown). pl-2 matches the left
pills so the hover X is not pushed in too far. */
.unsloth-thinking-pill {
- @apply inline-flex shrink-0 cursor-pointer items-center gap-1 rounded-full py-1.5 pl-2 pr-2.5 text-ui-14 font-medium text-muted-foreground transition-colors hover:bg-primary/10 dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))] disabled:cursor-not-allowed disabled:opacity-40;
+ @apply inline-flex shrink-0 cursor-pointer items-center gap-1 rounded-full py-1.5 pl-2 pr-2.5 text-ui-14 font-medium text-muted-foreground dark:text-foreground transition-colors hover:bg-primary/10 dark:hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40;
/* Reserve a text line so the icon-only (inactive) pill matches the
text pills' height instead of collapsing to the icon. */
min-height: calc(1lh + 0.75rem);
@@ -3223,7 +3262,7 @@ html[data-chat-font] .aui-root {
uses var(--card) in dark); the composer shadow lifts them off the page. */
.dark [data-sonner-toast][data-styled='true'] {
background-color: var(--card) !important;
- box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.16) !important;
+ box-shadow: 0 2px 8px -2px var(--background) !important;
}
/* Selectable toast text; non-selectable toast buttons. */
diff --git a/studio/frontend/tests/appearance-accent-vars.test.ts b/studio/frontend/tests/appearance-accent-vars.test.ts
index 64acf7d1b20..bca90246ecb 100644
--- a/studio/frontend/tests/appearance-accent-vars.test.ts
+++ b/studio/frontend/tests/appearance-accent-vars.test.ts
@@ -244,13 +244,13 @@ test("a narrow valid band between custom and elevated surfaces is not skipped",
...DEFAULT_CUSTOMIZATION,
colors: {
light: { ...DEFAULT_CUSTOMIZATION.colors.light, accent: null },
- dark: { accent: "#44d088", background: "#4bba47", foreground: null },
+ dark: { accent: "#44d088", background: "#4ec24a", foreground: null },
},
};
applyCustomizationToDocument(splitSurfaces, "dark");
const corrected = vars.get("--primary") ?? "";
- assert.ok(ratio(corrected, "#4bba47") >= 2.5);
- assert.ok(ratio(corrected, "#212121") >= 2.5);
+ assert.ok(ratio(corrected, "#4ec24a") >= 2.5);
+ assert.ok(ratio(corrected, "#272727") >= 2.5);
});
test("resize-handle glows follow the primary token", () => {
diff --git a/studio/frontend/tests/connected-model-row-actions.test.ts b/studio/frontend/tests/connected-model-row-actions.test.ts
index 1720dd0f287..8896eec859e 100644
--- a/studio/frontend/tests/connected-model-row-actions.test.ts
+++ b/studio/frontend/tests/connected-model-row-actions.test.ts
@@ -706,7 +706,7 @@ test("a row's name starts where its heading's label does", () => {
pickers,
/<span className="flex min-w-0 items-center gap-1\.5 text-ui-10 font-semibold/,
);
- const listLabel = /className=\{cn\(\s*"flex items-center justify-between gap-1 px-2\.5 pb-1",\s*divider \? "mt-3 border-t border-border\/50 pt-3" : "pt-3",/;
+ const listLabel = /className=\{cn\(\s*"flex items-center justify-between gap-1 px-2\.5 pb-1",\s*divider \? "mt-3 border-t border-border pt-3" : "pt-3",/;
assert.match(pickers, listLabel);
assert.match(
pickers,
diff --git a/studio/frontend/tests/contrast-slider.test.ts b/studio/frontend/tests/contrast-slider.test.ts
index 454a850bf23..737d944d132 100644
--- a/studio/frontend/tests/contrast-slider.test.ts
+++ b/studio/frontend/tests/contrast-slider.test.ts
@@ -14,6 +14,7 @@ import { readSrc, readText } from "./helpers/kit.ts";
// by owning the tokens, so these tests pin the ownership.
const CSS = readSrc("index.css");
+const HUB_CSS = readSrc("features/hub/hub.css");
const STORE = readSrc("features/settings/stores/appearance-custom-store.ts");
const SNAPSHOT = readText("../public/reload-snapshot.js");
/** Every source that can carry a class, so a fixed wash cannot slip in. */
@@ -30,19 +31,27 @@ const SOURCES = (function walk(dir: string): string[] {
/** Fills first, then lines. Every one is authored by the palettes as -base. */
const SURFACE_TOKENS = [
"card",
+ // The sidebar is a surface like the rest. Left off the curve it held its
+ // authored tone while its own rows washed past it, and the lit row came out
+ // darker than the sidebar behind it.
+ "sidebar",
"popover",
"secondary",
"muted",
+ "panel-input-surface",
+ "panel-input-surface-hover",
+ "tabs-line-indicator",
+];
+/** Hover and selection fills, on a shorter curve so the state stays findable. */
+const STATE_TOKENS = [
"accent",
"nav-surface-hover",
"panel-surface-hover",
- "panel-input-surface",
- "panel-input-surface-hover",
"sidebar-accent",
"chat-icon-bg-hover",
- "tabs-line-indicator",
];
const LINE_TOKENS = ["border", "input", "sidebar-border"];
+const FILL_TOKENS = [...SURFACE_TOKENS, ...STATE_TOKENS];
function block(marker: string): string {
const at = CSS.indexOf(marker);
@@ -52,7 +61,7 @@ function block(marker: string): string {
}
test("the palettes author base values, never the token the app reads", () => {
- for (const token of [...SURFACE_TOKENS, ...LINE_TOKENS]) {
+ for (const token of [...FILL_TOKENS, ...LINE_TOKENS]) {
const authored = CSS.match(new RegExp(`^\\t--${token}-base:`, "gm")) ?? [];
assert.ok(
authored.length >= 2,
@@ -72,7 +81,7 @@ test("the palettes author base values, never the token the app reads", () => {
test("at the default the derivation is the identity", () => {
const identity = block("--card: var(--card-base);");
- for (const token of [...SURFACE_TOKENS, ...LINE_TOKENS]) {
+ for (const token of [...FILL_TOKENS, ...LINE_TOKENS]) {
assert.ok(
identity.includes(`--${token}: var(--${token}-base);`),
`--${token} does not fall back to its authored value`,
@@ -90,6 +99,15 @@ test("off the default, fills and lines each take their own curve", () => {
`--${token} is not on the surface curve`,
);
}
+ // A hover nobody can find is the same failure as an outline nobody can find.
+ for (const token of STATE_TOKENS) {
+ assert.ok(
+ adjusted.includes(
+ `--${token}: color-mix(in oklab, var(--${token}-base), var(--contrast-target) var(--contrast-state-mix, var(--contrast-surface-mix)));`,
+ ),
+ `--${token} is not on the state curve`,
+ );
+ }
assert.ok(
adjusted.includes("--border: color-mix(in oklab, var(--border-base), var(--contrast-target) var(--contrast-line-mix));"),
);
@@ -117,6 +135,7 @@ test("lowering flattens further than raising lifts", () => {
"CONTRAST_SURFACE_MIX_VAR",
"CONTRAST_LINE_MIX_VAR",
"CONTRAST_CONTROL_MIX_VAR",
+ "CONTRAST_STATE_MIX_VAR",
]) {
const { raising, lowering } = ceilings(name);
assert.ok(raising < lowering, `${name} is symmetric`);
@@ -124,6 +143,61 @@ test("lowering flattens further than raising lifts", () => {
}
});
+test("a lit row never sinks below the surface it sits on", () => {
+ // Both fall toward the page when contrast drops. While they shared a ceiling
+ // they fell together, and since the fills start closer to the page the lit
+ // row reached it first and went under: at the bottom of the slider the active
+ // sidebar row was darker than the sidebar. A shorter curve keeps the order.
+ const ceiling = (name: string) => {
+ const hit = new RegExp(`${name}, mix\\(raising \\? \\d+ : (\\d+)\\)`).exec(
+ STORE,
+ );
+ assert.ok(hit, `${name} is not set from the two ceilings`);
+ return Number(hit[1]);
+ };
+ assert.ok(
+ ceiling("CONTRAST_STATE_MIX_VAR") < ceiling("CONTRAST_SURFACE_MIX_VAR"),
+ "hover fills flatten as fast as the surfaces under them",
+ );
+});
+
+test("a dark selection fill takes the token, not a wash", () => {
+ // A wash is scaled by --contrast-wash-gain, which still falls further at the
+ // bottom of the range than --contrast-state-mix does. Painted as washes, the
+ // selected tab and the selected quant sank to within a couple of levels of
+ // the surface under them there.
+ assert.match(
+ HUB_CSS,
+ /html\.dark \.hub-tab-toggle-pill,\s*html\.dark \.hub-tab-toggle-pill:hover \{[^}]*background-color: var\(--accent\)/,
+ "the selected segment is not on --accent",
+ );
+ for (const file of [
+ "features/hub/catalog/gguf-download-card.tsx",
+ "features/hub/catalog/models-table.tsx",
+ ]) {
+ const source = readSrc(file);
+ assert.match(
+ source,
+ /dark:(data-\[selected\]:)?bg-accent/,
+ `${file} does not paint its selection with --accent`,
+ );
+ // Scoped to the selection utility itself; resting chips and progress
+ // tracks in these files carry the gain on purpose.
+ assert.doesNotMatch(
+ source,
+ /dark:data-\[selected\]:bg-\[[^\]]*contrast-wash-gain/,
+ `${file} still paints a selection with a wash`,
+ );
+ }
+ // The quant row's hover is --accent held back, so it cannot reach the
+ // selected row: as its own wash it closed to a few levels at high contrast.
+ assert.match(
+ readSrc("features/hub/catalog/gguf-download-card.tsx"),
+ /dark:hover:bg-\[color-mix\(in_srgb,var\(--accent\)_\d+%,transparent\)\]/,
+ "the quant row hover is not derived from --accent",
+ );
+});
+
test("panel sliders move with the slider too", () => {
// .panel-slider repaints the track, fill and thumb with !important, so the
// component's own gain-aware colours never reach them.
diff --git a/studio/frontend/tests/hub-row-selection.test.ts b/studio/frontend/tests/hub-row-selection.test.ts
new file mode 100644
index 00000000000..721bea069e5
--- /dev/null
+++ b/studio/frontend/tests/hub-row-selection.test.ts
@@ -0,0 +1,63 @@
+// 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";
+
+// Selecting a row must not dim it. Dark hover moved onto the --accent token
+// while the selected fills stayed hand-written washes on the page, which put a
+// clicked row below a merely hovered one and widened the gap as the contrast
+// slider came down, since a wash falls further than the token does.
+
+const HUB_CSS = readSrc("features/hub/hub.css");
+const PICKERS = readSrc(
+ "features/model-picker/components/model-selector/pickers.tsx",
+);
+
+const selectedFill = (row: string) => {
+ const rule = HUB_CSS.match(
+ new RegExp(
+ `html\\.dark \\.hub-page \\.${row}\\[data-selected="true"\\] \\{([^}]*)\\}`,
+ ),
+ );
+ assert.ok(rule, `${row} has no dark selected rule`);
+ return rule[1] ?? "";
+};
+
+const hoverFill = (row: string) => {
+ const rule = HUB_CSS.match(
+ new RegExp(`html\\.dark \\.hub-page \\.${row}:hover \\{([^}]*)\\}`),
+ );
+ assert.ok(rule, `${row} has no dark hover rule`);
+ return rule[1] ?? "";
+};
+
+for (const row of ["catalog-row", "hub-result-row"]) {
+ test(`a selected ${row} is derived from the tone it must outrank`, () => {
+ assert.match(hoverFill(row), /background-color: var\(--accent\)/);
+ // Built ON --accent, so the pair keeps its order at every contrast
+ // setting instead of relying on two curves staying in step.
+ assert.match(selectedFill(row), /var\(--foreground\) 6%, var\(--accent\)/);
+ });
+
+ test(`a selected ${row} is not a wash that the slider can flatten`, () => {
+ assert.doesNotMatch(selectedFill(row), /contrast-wash-gain/);
+ });
+}
+
+test("the picker reads one fit per variant, companions included", () => {
+ // tierOf and the rendered badge used the bare checkpoint while the
+ // recommendation already judged the footprint, so a vision quant could sort
+ // and badge as fitting after the star had ruled it OOM.
+ assert.doesNotMatch(PICKERS, /getGgufFit\(v\.size_bytes\)/);
+ const at = PICKERS.indexOf("const getVariantFit = useCallback(");
+ assert.notEqual(at, -1, "getVariantFit is missing");
+ assert.match(
+ PICKERS.slice(at, at + 260),
+ /ggufVariantFitSizeBytes\(variant\)/,
+ );
+ // Ordering and badge both go through it.
+ assert.equal(PICKERS.match(/getVariantFit\(v\)/g)?.length, 2);
+});
diff --git a/studio/frontend/tests/hub-tab-toggle-track.test.ts b/studio/frontend/tests/hub-tab-toggle-track.test.ts
new file mode 100644
index 00000000000..86f95e0773f
--- /dev/null
+++ b/studio/frontend/tests/hub-tab-toggle-track.test.ts
@@ -0,0 +1,120 @@
+// 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";
+
+// The segmented control is a wash on whatever is behind it, so its distance
+// from the selected pill is a property of the surface, not of the control. On
+// the page the wash lands 21 levels below --accent; on an elevated panel the
+// same wash lands 7 below and the two halves stop reading apart. These pin the
+// panel case darkening instead, and the pill's hover on borrowed-pill buttons.
+
+const HUB_CSS = readSrc("features/hub/hub.css");
+const PICKERS = readSrc(
+ "features/model-picker/components/model-selector/pickers.tsx",
+);
+
+const MENU_TRACK =
+ /html\.dark \.menu-soft-surface \.hub-tab-toggle,[\s\S]*?\{([^}]*)\}/;
+
+test("a track on an elevated panel sinks toward the page, not off the panel", () => {
+ const rule = HUB_CSS.match(MENU_TRACK);
+ assert.ok(rule, "menu-scoped .hub-tab-toggle rule is missing");
+ // Mixing --foreground here is what put the track 7 levels off the pill.
+ assert.match(rule[1] ?? "", /var\(--background\)/);
+ assert.doesNotMatch(rule[1] ?? "", /var\(--foreground\)/);
+});
+
+test("the panel track overrides the page one rather than racing it", () => {
+ const base = HUB_CSS.indexOf("html.dark .hub-tab-toggle {");
+ const scoped = HUB_CSS.search(MENU_TRACK);
+ assert.ok(base >= 0 && scoped >= 0);
+ // Higher specificity already wins; source order keeps it obvious.
+ assert.ok(scoped > base, "the scoped rule must follow the page one");
+});
+
+test("the page track is left on its own wash", () => {
+ const base = HUB_CSS.match(/html\.dark \.hub-tab-toggle \{([^}]*)\}/);
+ assert.ok(base);
+ assert.match(base[1] ?? "", /var\(--foreground\)/);
+});
+
+test("the panel track stops just under the panel rather than far below it", () => {
+ const rule = HUB_CSS.match(MENU_TRACK);
+ // 27% of #181818 over #272727 is #232323.
+ assert.match(rule?.[1] ?? "", /var\(--background\) 27%/);
+});
+
+test("a selected segment shows no hover, being the tab you are already on", () => {
+ // Grouped with the resting rule, so the two cannot drift apart.
+ assert.match(
+ HUB_CSS,
+ /html\.dark \.hub-tab-toggle-pill,\s*html\.dark \.hub-tab-toggle-pill:hover \{[^}]*background-color: var\(--accent\)/,
+ );
+});
+
+test("no tab pins its hover to a colour that is only right in one theme", () => {
+ const tabs = readSrc(
+ "features/model-picker/components/model-selector/pill-tabs.tsx",
+ );
+ // hover:!bg-[var(--background)] carries no mode variant, so in dark it
+ // painted the page colour over the pill and blacked the tab out.
+ assert.doesNotMatch(tabs, /hover:!bg-\[var\(--background\)\]/);
+});
+
+test("an option menu rests at its trigger's tone, not the panel's", () => {
+ const menu = HUB_CSS.match(/html\.dark \.hub-menu-instant \{([^}]*)\}/);
+ assert.ok(menu);
+ // The same 60% .field-soft rests at, made opaque for a floating surface.
+ assert.match(menu[1] ?? "", /var\(--accent\) 60%, var\(--popover\)/);
+});
+
+test("a highlighted row still lifts clear of the lighter menu", () => {
+ const row = HUB_CSS.match(
+ /html\.dark \.hub-menu-instant \[data-slot="select-item"\]:focus,[\s\S]*?\{([^}]*)\}/,
+ );
+ assert.ok(row);
+ // Bare --accent would sit 8 levels above the menu, too close to pick out.
+ assert.match(row[1] ?? "", /var\(--foreground\) 6%, var\(--accent\)/);
+});
+
+test("a white pill in light mode stays put, having nowhere lighter to go", () => {
+ const rule = HUB_CSS.match(
+ /html:not\(\.dark\) \.hub-tab-toggle-pill\[role="tab"\]:hover \{([^}]*)\}/,
+ );
+ assert.ok(rule, "the light tab hover is missing");
+ assert.match(rule[1] ?? "", /background-color:\s*var\(--background\)/);
+});
+
+test("a button borrowing the pill look gets the hover the pill pins away", () => {
+ const hover = HUB_CSS.match(
+ /html\.dark \.hub-tab-toggle-pill\.hub-pill-action:hover \{([^}]*)\}/,
+ );
+ assert.ok(hover, "hub-pill-action hover rule is missing");
+ // Lighter than rest: --accent carrying a little --foreground.
+ assert.match(hover[1] ?? "", /var\(--foreground\) 8%, var\(--accent\)/);
+});
+
+test("pressing a borrowed pill returns it to the selection colour", () => {
+ const hover = HUB_CSS.indexOf(
+ "html.dark .hub-tab-toggle-pill.hub-pill-action:hover",
+ );
+ const active = HUB_CSS.indexOf(
+ "html.dark .hub-tab-toggle-pill.hub-pill-action:active",
+ );
+ assert.ok(active > hover, ":active must follow :hover to win the cascade");
+ const rule = HUB_CSS.slice(active).match(/\{([^}]*)\}/);
+ assert.match(rule?.[1] ?? "", /background-color:\s*var\(--accent\)/);
+});
+
+test("Search Hub is a borrowed pill, so it opts into the hover", () => {
+ const button = PICKERS.match(
+ /aria-label="Search more models on the Hub"[\s\S]{0,200}?className="([^"]*)"/,
+ );
+ assert.ok(button, "Search Hub button not found");
+ assert.match(button[1] ?? "", /\bhub-tab-toggle-pill\b/);
+ assert.match(button[1] ?? "", /\bhub-pill-action\b/);
+});
diff --git a/studio/frontend/tests/loaded-models-surface.test.ts b/studio/frontend/tests/loaded-models-surface.test.ts
index b9f5043e37d..44d5349b4e0 100644
--- a/studio/frontend/tests/loaded-models-surface.test.ts
+++ b/studio/frontend/tests/loaded-models-surface.test.ts
@@ -65,14 +65,14 @@ test("the modifier hardcodes neither theme", () => {
// inset is gone the two agree. If the banner is restyled, this fails.
test("the shared vars still match the update banner's shadow", () => {
assert.match(BANNER, /shadow-\[0_2px_8px_-2px_rgba\(0,0,0,0\.16\)\]/);
- assert.match(BANNER, /dark:shadow-\[0_8px_28px_-6px_rgba\(0,0,0,0\.28\)\]/);
+ assert.match(BANNER, /dark:shadow-\[0_8px_28px_-6px_var\(--background\)\]/);
const light = rule(".menu-soft-surface,");
assert.match(light, /--menu-soft-shadow: rgba\(0, 0, 0, 0\.16\)/);
assert.match(light, /--menu-soft-offset-y: 2px/);
assert.match(light, /--menu-soft-blur: 8px/);
assert.match(light, /--menu-soft-spread: -2px/);
const dark = rule(".dark .menu-soft-surface,");
- assert.match(dark, /--menu-soft-shadow: rgba\(0, 0, 0, 0\.28\)/);
+ assert.match(dark, /--menu-soft-shadow: var\(--background\)/);
assert.match(dark, /--menu-soft-offset-y: 8px/);
assert.match(dark, /--menu-soft-blur: 28px/);
assert.match(dark, /--menu-soft-spread: -6px/);
diff --git a/studio/frontend/tests/recommended-quant-for-device.test.ts b/studio/frontend/tests/recommended-quant-for-device.test.ts
new file mode 100644
index 00000000000..1eac7f336bc
--- /dev/null
+++ b/studio/frontend/tests/recommended-quant-for-device.test.ts
@@ -0,0 +1,151 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+// The picker used to recommend whatever quant the repo defaults to, whenever it ran at all. On a
+// machine with room for far more, that pinned the suggestion to the default's size: a 64 GiB box
+// was told to run UD-Q4_K_XL at 18 GiB while UD-Q6_K_XL at 25 GiB fit with the reserve intact.
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { classifyGgufFit } from "../src/lib/gguf-fit.ts";
+import {
+ ggufFitIsComfortable,
+ recommendedQuantForDevice,
+} from "../src/features/model-picker/components/model-selector/model-catalog.ts";
+
+const GB = 1024 ** 3;
+const variant = (quant: string, gb: number) => ({ quant, size_bytes: gb * GB });
+
+/** The quants on the Qwen3.8-27B listing, in the order the picker holds them. */
+const QUANTS = [
+ variant("UD-Q2_K_XL", 9.8),
+ variant("UD-IQ1_S", 6.2),
+ variant("UD-Q4_K_XL", 18),
+ variant("BF16", 55),
+ variant("UD-Q8_K_XL", 31),
+ variant("UD-Q6_K_XL", 25),
+];
+
+const fitOn = (gpuGb: number, systemRamGb: number) => (sizeBytes: number) =>
+ classifyGgufFit(sizeBytes, { gpuGb, systemRamGb });
+
+test("a comfortable verdict is one that keeps its reserve", () => {
+ assert.ok(ggufFitIsComfortable("fits"));
+ assert.ok(ggufFitIsComfortable("ram"));
+ // These load, but at the edge, so they are not what to suggest.
+ assert.ok(!ggufFitIsComfortable("marginal"));
+ assert.ok(!ggufFitIsComfortable("partial"));
+ assert.ok(!ggufFitIsComfortable("oom"));
+});
+
+test("a roomy machine is recommended more than the repo default's size", () => {
+ const pick = recommendedQuantForDevice(QUANTS, fitOn(0, 64));
+ assert.equal(pick?.quant, "UD-Q6_K_XL");
+});
+
+test("the pick never exceeds what the device can hold", () => {
+ for (const ramGb of [8, 16, 32, 64, 128]) {
+ const fit = fitOn(0, ramGb);
+ const pick = recommendedQuantForDevice(QUANTS, fit);
+ assert.ok(pick, `no pick at ${ramGb} GiB`);
+ const runnable = QUANTS.filter((q) => fit(q.size_bytes) !== "oom");
+ if (runnable.length > 0) {
+ assert.notEqual(
+ fit(pick.size_bytes),
+ "oom",
+ `${ramGb} GiB was handed a quant it cannot load`,
+ );
+ }
+ }
+});
+
+test("more memory never recommends a smaller quant", () => {
+ let previous = 0;
+ for (const ramGb of [8, 16, 32, 64, 128, 256]) {
+ const pick = recommendedQuantForDevice(QUANTS, fitOn(0, ramGb));
+ assert.ok(pick);
+ assert.ok(
+ pick.size_bytes >= previous,
+ `${ramGb} GiB went backwards from the tier below it`,
+ );
+ previous = pick.size_bytes;
+ }
+});
+
+// A vision repo fetches an mmproj beside the weights, so download_size_bytes runs ahead of
+// size_bytes. Scoring the checkpoint alone recommended a quant that OOMs once the projector lands.
+test("companion weights count against the budget", () => {
+ const vision = [
+ { quant: "UD-Q4_K_XL", size_bytes: 18 * GB, download_size_bytes: 22 * GB },
+ { quant: "UD-Q6_K_XL", size_bytes: 25 * GB, download_size_bytes: 29 * GB },
+ ];
+ const fit = fitOn(0, 64);
+ // 64 GiB of RAM offloads 32 GiB. The larger quant needs 29.75 GiB on its weights but 34.35 GiB
+ // with the projector, so only the smaller one actually loads.
+ assert.equal(fit(25 * GB), "ram");
+ assert.equal(fit(29 * GB), "oom");
+ assert.equal(recommendedQuantForDevice(vision, fit)?.quant, "UD-Q4_K_XL");
+});
+
+// A listing with no size metadata reports zero, which prices as the bare context allowance and so
+// reads comfortable on any device. Ranked by weights it sorts last, but the comfortable pass would
+// still reach it once every real quant was only marginal or partial.
+test("a variant of unknown size does not outrank one that runs", () => {
+ const listing = [
+ { quant: "UD-Q8_K_XL", size_bytes: 22 * GB },
+ { quant: "UD-Q6_K_XL", size_bytes: 20.5 * GB },
+ { quant: "UD-IQ2_XXS", size_bytes: 0 },
+ ];
+ // A 24 GiB card with 16 GiB of RAM offloads both of these, neither with room to spare: the
+ // comfortable ceiling here is 19.4 GiB. An unpriced zero clears it, so it used to win.
+ const fit = fitOn(24, 16);
+ assert.equal(fit(0), "fits");
+ for (const size of [22, 20.5]) {
+ assert.ok(!ggufFitIsComfortable(fit(size * GB)), `${size} GiB is comfortable`);
+ assert.notEqual(fit(size * GB), "oom", `${size} GiB does not run`);
+ }
+ assert.equal(recommendedQuantForDevice(listing, fit)?.quant, "UD-Q8_K_XL");
+});
+
+test("a group with no sizes at all is left to the caller", () => {
+ const unsized = [
+ { quant: "UD-Q4_K_XL", size_bytes: 0 },
+ { quant: "UD-Q6_K_XL", size_bytes: 0 },
+ ];
+ assert.equal(recommendedQuantForDevice(unsized, fitOn(24, 16)), null);
+});
+
+test("a machine too small for anything still gets the smallest", () => {
+ const pick = recommendedQuantForDevice(QUANTS, () => "oom");
+ assert.equal(pick?.quant, "UD-IQ1_S");
+});
+
+test("nothing to choose from is not a choice", () => {
+ assert.equal(recommendedQuantForDevice([], () => "fits"), null);
+});
+
+// Companions are picked per checkpoint, so download size does not have to rise
+// with weights. When nothing runs, ranking the fallback by weights can hand
+// back the variant furthest from fitting.
+test("when nothing runs, the fallback is the smallest footprint", () => {
+ const perVariantCompanions = [
+ // Heavier weights, light dependency.
+ { quant: "UD-Q6_K_XL", size_bytes: 12 * GB, download_size_bytes: 14 * GB },
+ // Lighter weights, but it drags a much larger text encoder along.
+ { quant: "UD-Q4_K_XL", size_bytes: 10 * GB, download_size_bytes: 40 * GB },
+ ];
+ const pick = recommendedQuantForDevice(perVariantCompanions, () => "oom");
+ assert.equal(pick?.quant, "UD-Q6_K_XL");
+});
+
+test("the footprint fallback keeps the better quant when footprints tie", () => {
+ const tied = [
+ { quant: "UD-Q6_K_XL", size_bytes: 12 * GB, download_size_bytes: 20 * GB },
+ { quant: "UD-Q4_K_XL", size_bytes: 10 * GB, download_size_bytes: 20 * GB },
+ ];
+ assert.equal(
+ recommendedQuantForDevice(tied, () => "oom")?.quant,
+ "UD-Q6_K_XL",
+ );
+});