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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Stop the model selector's format and quant suffix clipping descenders (#12427)
Daniel Han1a96706ef0ba
diff --git a/studio/frontend/src/features/model-picker/components/model-selector.tsx b/studio/frontend/src/features/model-picker/components/model-selector.tsxindex 9011932e2d5..029795bf5f7 100644--- a/studio/frontend/src/features/model-picker/components/model-selector.tsx+++ b/studio/frontend/src/features/model-picker/components/model-selector.tsx@@ -264,7 +264,7 @@ function ModelSelectorTrigger({{currentModel?.descriptionSuffix && (<spanclassName={cn(- "min-w-0 shrink-[1000000] truncate whitespace-nowrap text-xs leading-none text-muted-foreground",+ "min-w-0 shrink-[1000000] truncate whitespace-nowrap text-xs leading-tight text-muted-foreground",!currentModel.description && !showCloudIndicator && GAP_BEFORE,)}>diff --git a/studio/frontend/tests/model-selector-name-priority.test.ts b/studio/frontend/tests/model-selector-name-priority.test.tsindex afd0a655a04..a41a3fadb81 100644--- a/studio/frontend/tests/model-selector-name-priority.test.ts+++ b/studio/frontend/tests/model-selector-name-priority.test.ts@@ -11,12 +11,24 @@ 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-\[1000000\] truncate whitespace-nowrap text-xs leading-tight 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 itassert.match(selector, /"flex max-w-full shrink-0 items-baseline whitespace-nowrap font-heading/);});+test("no truncating span pairs truncate with leading-none, which clips descenders", () => {+ // At text-xs a 12px line box ends 1.5px above the bottom of g, j, p, q and y, and truncate+ // hides the overflow, so the suffix showed its format and quant with flat descenders.+ for (const literal of selector.match(/"[^"\n]*"/g) ?? []) {+ const tokens = literal.slice(1, -1).split(/\s+/);+ assert.ok(+ !(tokens.includes("truncate") && tokens.includes("leading-none")),+ `truncate with leading-none clips descenders: ${literal}`,+ );+ }+});+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"/);