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: capability tags in the model picker match the vision pill and get their own colours (#12192)

Daniel Handa8578236715
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 d03e945c090..1d111e4d0f2 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
@@ -516,11 +516,15 @@ function formatBytes(bytes: number): string {
const CAPABILITY_BADGES: {
key: keyof ModelCapabilities;
title: string;
+ /** Glyph colour, one per capability like the vision badge's indigo, so the kinds tell apart at a glance. */
+ tone: string;
Glyph: (props: { className: string }) => ReactNode;
}[] = [
{
key: "videoGen",
title: "Generates video",
+ // Warm, at the vision indigo's lightness and chroma: amber-300 outshone every other tag.
+ tone: "text-[oklch(0.5_0.1_55)] dark:text-[oklch(0.78_0.09_60)]",
Glyph: (props) => (
<HugeiconsIcon icon={FlimSlateIcon} strokeWidth={1.8} {...props} />
),
@@ -528,6 +532,8 @@ const CAPABILITY_BADGES: {
{
key: "imageGen",
title: "Generates images",
+ // Pink, as the Hub tags diffusion models.
+ tone: "text-pink-700 dark:text-pink-300",
Glyph: (props) => (
<HugeiconsIcon icon={Image03Icon} strokeWidth={1.8} {...props} />
),
@@ -537,6 +543,9 @@ const CAPABILITY_BADGES: {
// Direction-neutral, unlike the two above: `audio` covers ASR and classification as well as
// synthesis, so a Whisper row would claim to generate what it consumes.
title: "Audio",
+ // Teal, not the Hub's rose, which is too close to the image pink at this size; held to the
+ // vision indigo's lightness and chroma, as sky-300 read brighter than the tags beside it.
+ tone: "text-[oklch(0.5_0.08_190)] dark:text-[oklch(0.78_0.08_190)]",
Glyph: (props) => (
<HugeiconsIcon icon={AudioWave01Icon} strokeWidth={1.8} {...props} />
),
@@ -567,12 +576,16 @@ function CapabilityIcons({ caps }: { caps: ModelCapabilities }) {
const scope = useContext(CapabilityScope);
return (
<>
- {visibleCapabilityBadges(caps, scope).map(({ key, title, Glyph }) => (
+ {visibleCapabilityBadges(caps, scope).map(({ key, title, tone, Glyph }) => (
+ // The vision badge's pill (same height and px-1.5), so every glyph tag in the row is one width.
<span
key={key}
title={title}
aria-label={title}
- className="flex size-[calc(18px*var(--ui-space-scale,1))] shrink-0 items-center justify-center rounded-md border border-border text-muted-foreground"
+ className={cn(
+ "flex h-[calc(18px*var(--ui-space-scale,1))] shrink-0 items-center justify-center rounded-md border border-border px-1.5",
+ tone,
+ )}
>
<Glyph className="size-3" />
</span>
@@ -953,17 +966,17 @@ const META_COLUMN = {
// Fits "UD-Q4_K_XL"; a hard cap, so longer quants clip.
quant: "min-[560px]:w-[7.2em]",
// Each width below is the widest set its scope can draw: anything wider makes min-w-min expand the
- // slot and shift every column after it. This slot holds capability glyphs (18px), the vision badge
- // (24px) and the "on disk" mark (14px), gap-1 between them; scope draws no glyph.
- badge: "min-w-min min-[560px]:w-[calc(24px*var(--ui-space-scale,1))]",
- // One glyph plus the disk mark (18 + 4 + 14).
- badgeMid: "min-w-min min-[560px]:w-[calc(36px*var(--ui-space-scale,1))]",
+ // slot and shift every column after it. This slot holds capability glyphs and the vision badge
+ // (both 26px pills) and the "on disk" mark (14px), gap-1 between them; scope draws no glyph.
+ badge: "min-w-min min-[560px]:w-[calc(26px*var(--ui-space-scale,1))]",
+ // One glyph plus the disk mark (26 + 4 + 14).
+ badgeMid: "min-w-min min-[560px]:w-[calc(44px*var(--ui-space-scale,1))]",
// On Device draws the vision badge (26px) and, since partials are listed, the partial mark
// (14px) beside it. 44px is that pair with its gap: reserving only the badge let a row drawing
// both grow past the slot and carry its quant chip 18px left of every other row.
badgeDevice: "min-w-min min-[560px]:w-[calc(44px*var(--ui-space-scale,1))]",
- // Hub draws the disk mark and no vision badge (18+4+14). A second glyph grows it via min-w-min.
- badgeWide: "min-w-min min-[560px]:w-[calc(36px*var(--ui-space-scale,1))]",
+ // Hub draws the disk mark and no vision badge (26+4+14). A second glyph grows it via min-w-min.
+ badgeWide: "min-w-min min-[560px]:w-[calc(44px*var(--ui-space-scale,1))]",
// The fit mark (Hub rows), one 18px glyph.
vram: "min-w-min min-[560px]:w-[calc(18px*var(--ui-space-scale,1))]",
// Device rows reserve the slot rather than hug the chip. This is the last variable column, so
diff --git a/studio/frontend/tests/on-device-dot-and-header-alignment.test.ts b/studio/frontend/tests/on-device-dot-and-header-alignment.test.ts
index 9f657e62ca2..d6176057d93 100644
--- a/studio/frontend/tests/on-device-dot-and-header-alignment.test.ts
+++ b/studio/frontend/tests/on-device-dot-and-header-alignment.test.ts
@@ -53,10 +53,10 @@ test("the download glyph is gone from the picker entirely", () => {
});
test("the scoped badge column reserves the wider on-device marker", () => {
- // Video can show one 18px capability, a 4px gap and the 14px marker. If the
- // fixed width remains 34px, min-w-min expands only those rows and shifts all
+ // Video can show one 26px capability pill, a 4px gap and the 14px marker. If the
+ // fixed width is any narrower, min-w-min expands only those rows and shifts all
// metadata columns after the badge slot.
- assert.ok(PICKERS.includes('badgeMid: "min-w-min min-[560px]:w-[36px]"'));
+ assert.ok(PICKERS.includes('badgeMid: "min-w-min min-[560px]:w-[44px]"'));
});
test("the unscoped badge column is sized per list, not to the union of both", () => {
@@ -65,7 +65,8 @@ test("the unscoped badge column is sized per list, not to the union of both", ()
// half-downloaded at once, and at 26px that row alone grew and carried its quant chip 18px left
// of every other row -- the exact drift the fixed columns exist to stop.
assert.ok(PICKERS.includes('badgeDevice: "min-w-min min-[560px]:w-[44px]"'));
- assert.ok(PICKERS.includes('badgeWide: "min-w-min min-[560px]:w-[36px]"'));
+ // Hub: one 26px capability pill, a gap-1 and the disk mark.
+ assert.ok(PICKERS.includes('badgeWide: "min-w-min min-[560px]:w-[44px]"'));
// Both marks really can land on one On Device row, which is what makes 44 the right number.
const gguf = PICKERS.slice(PICKERS.indexOf("const renderDownloadedGgufRow"));
const row = gguf.slice(0, gguf.indexOf("\n };"));
@@ -161,7 +162,7 @@ test("every chip in the row band pins the same height", () => {
// ParamChip sized itself from its line box, the one height here that scales with
// --ui-font-scale: at 1.0 it stood 1px prouder than the quant and vision chips beside it and at
// 0.8125 it sat 1.8px shorter, so the row was only level at the scale where the two crossed.
- for (const chip of ["QuantChip", "VisionBadge", "ParamChip"]) {
+ for (const chip of ["QuantChip", "VisionBadge", "CapabilityIcons", "ParamChip"]) {
const start = PICKERS.indexOf(`function ${chip}(`);
assert.ok(start > 0, `${chip} exists`);
const body = PICKERS.slice(start, PICKERS.indexOf("\n}", start));
@@ -651,3 +652,21 @@ test("every list header takes the same alignment", () => {
assert.equal(shared, 4, "Pinned, custom sections, Projects and Recents");
assert.ok(!SIDEBAR.includes("translate-x-[2px]"));
});
+
+test("capability glyph tags are the vision badge's pill, each in its own colour", () => {
+ const body = (name: string) => {
+ const start = PICKERS.indexOf(`function ${name}(`);
+ return PICKERS.slice(start, PICKERS.indexOf("\n}", start));
+ };
+ // Same height and padding around the same 12px glyph, so image, video and audio tags are as
+ // wide as the vision one instead of 18px squares beside a 26px pill.
+ for (const name of ["VisionBadge", "CapabilityIcons"]) {
+ assert.match(body(name), /h-\[18px\] shrink-0 items-center justify-center rounded-md border border-border px-1\.5/);
+ }
+ assert.ok(!body("CapabilityIcons").includes("text-muted-foreground"), "no grey glyphs left");
+ const list = PICKERS.slice(PICKERS.indexOf("const CAPABILITY_BADGES"), PICKERS.indexOf("const CapabilityScope"));
+ const tones = [...list.matchAll(/tone: "([^"]+)"/g)].map((m) => m[1]);
+ assert.equal(tones.length, 3, "every capability names a tone");
+ assert.equal(new Set(tones).size, 3, "no two tags share a colour");
+ assert.ok(tones.every((t) => !t.includes("indigo")), "none reuses the vision indigo");
+});