Skip to content

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

Studio: keep the model name ahead of its format and quant when the header is tight (#12396)

Michael Hanffd71a91c9e4
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 2e4c4357c75..907a4a1450f 100644
--- a/studio/frontend/src/features/model-picker/components/model-selector.tsx
+++ b/studio/frontend/src/features/model-picker/components/model-selector.tsx
@@ -142,6 +142,9 @@ interface ModelSelectorProps {
placeholder?: string;
}
+// Space before the description or suffix, drawn inside its box so it truncates away with the text.
+const GAP_BEFORE = "before:inline-block before:w-2 before:content-['']";
+
function ModelSelectorTrigger({
currentModel,
isLoaded,
@@ -227,8 +230,8 @@ function ModelSelectorTrigger({
) : null}
{/* No vertical offset, so the caps line up with the project switcher. */}
<span className="flex min-w-0 flex-1 items-baseline">
- {/* Name and quant stay whole; only the description truncates. The suffix sits outside this
- group, so even an over-long name leaves room for it. */}
+ {/* The name gives way last: the suffix (format and quant), then the description, shrink
+ away first. Their far larger shrink factor makes that order effectively strict. */}
<span className="flex min-w-0 items-baseline">
<span
className={cn(
@@ -248,8 +251,8 @@ function ModelSelectorTrigger({
{currentModel?.description && (
<span
className={cn(
- "min-w-0 truncate text-xs leading-tight text-muted-foreground",
- showCloudIndicator ? "" : "ml-2",
+ "min-w-0 shrink-[1000] truncate text-xs leading-tight text-muted-foreground",
+ !showCloudIndicator && GAP_BEFORE,
)}
>
{currentModel.description}
@@ -259,8 +262,8 @@ function ModelSelectorTrigger({
{currentModel?.descriptionSuffix && (
<span
className={cn(
- "shrink-0 whitespace-nowrap text-xs leading-none text-muted-foreground",
- !currentModel.description && !showCloudIndicator && "ml-2",
+ "min-w-0 shrink-[1000000] truncate whitespace-nowrap text-xs leading-none text-muted-foreground",
+ !currentModel.description && !showCloudIndicator && GAP_BEFORE,
)}
>
{currentModel.description ? " - " : ""}
diff --git a/studio/frontend/tests/model-selector-name-priority.test.ts b/studio/frontend/tests/model-selector-name-priority.test.ts
new file mode 100644
index 00000000000..afd0a655a04
--- /dev/null
+++ b/studio/frontend/tests/model-selector-name-priority.test.ts
@@ -0,0 +1,23 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+// When the model selector is squeezed, the format and quant give way before the model name.
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrc } from "./helpers/kit.ts";
+
+const selector = readSrc("features/model-picker/components/model-selector.tsx");
+
+test("the suffix shrinks first, then the description, and the name last", () => {
+ assert.match(selector, /"min-w-0 shrink-\[1000000\] truncate whitespace-nowrap text-xs leading-none text-muted-foreground"/);
+ assert.match(selector, /"min-w-0 shrink-\[1000\] truncate text-xs leading-tight text-muted-foreground"/);
+ // the name only truncates once its group is narrower than it
+ assert.match(selector, /"flex max-w-full shrink-0 items-baseline whitespace-nowrap font-heading/);
+});
+
+test("the gap before the description or suffix truncates away with it", () => {
+ assert.match(selector, /const GAP_BEFORE = "before:inline-block before:w-2 before:content-\[''\]";/);
+ assert.doesNotMatch(selector, /"ml-2"/);
+});