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
Studio: darker unselected model picker toggle, collapse icon for Compact conversation (#14183)
Michael Hanaacd821049f5
diff --git a/studio/frontend/src/features/chat/components/chat-header-menu.tsx b/studio/frontend/src/features/chat/components/chat-header-menu.tsxindex 3f3f8020ba6..e22f753d7b1 100644--- a/studio/frontend/src/features/chat/components/chat-header-menu.tsx+++ b/studio/frontend/src/features/chat/components/chat-header-menu.tsx@@ -31,6 +31,7 @@ import {Archive03Icon,BubbleChatTemporaryIcon,Cancel01Icon,+ CollapseIcon,Copy01Icon,Delete02Icon,Download01Icon,@@ -64,8 +65,6 @@ import {hasPreStreamRunReservation,subscribePreStreamRunReservations,} from "../utils/pre-stream-run-reservation";-import { deriveContextUsageBar } from "../lib/context-usage-bar-state";-import { UsageRing } from "./context-usage-bar";import {type ConversationExportFormat,chatExportOptions,@@ -178,16 +177,6 @@ function ChatMenuItems({ menu }: { menu: ActiveChatMenu }) {const busy = useChatRuntimeStore((state) =>state.modelLoading || Boolean(state.runningByThreadId[menu.item.id]),) || preStreamRunActive || liveRunActive;- const usedPercent = useChatRuntimeStore((state) => {- const usage =- state.activeThreadId === menu.item.id- ? state.contextUsage- : state.contextUsageByThreadId[menu.item.id];- return deriveContextUsageBar({- used: usage?.contextTokens ?? usage?.totalTokens ?? null,- total: state.loadedContextLength,- })?.percent ?? null;- });const compact = () => {const runtime = useChatRuntimeStore.getState();if (@@ -286,11 +275,7 @@ function ChatMenuItems({ menu }: { menu: ActiveChatMenu }) {</Item><DropdownMenuSeparator className="mx-3" /><Item- glyph={- <span className="flex [--track:color-mix(in_srgb,currentColor_30%,transparent)]">- <UsageRing percent={usedPercent} stroke="stroke-current" />- </span>- }+ icon={CollapseIcon}onSelect={compact}disabled={menu.item.type !== "single" || busy}>diff --git a/studio/frontend/src/features/hub/hub.css b/studio/frontend/src/features/hub/hub.cssindex eca027c973a..b3b979c05b7 100644--- a/studio/frontend/src/features/hub/hub.css+++ b/studio/frontend/src/features/hub/hub.css@@ -837,6 +837,9 @@/* The picker's panel is --sidebar, a step from --accent: its controls lift toward white to stand off it. */html.dark .unsloth-model-selector-menu {--picker-control-lit: color-mix(in srgb, var(--accent), white 7.5%);+ /* Sunk further than the panel default's 27%: with the selected pill lifted, the unselected+ half needs to sit below the panel to read as off. */+ --hub-tab-track: color-mix(in srgb, var(--background) 55%, transparent);}html.dark .unsloth-model-selector-menu .hub-tab-toggle-pill,html.dark .unsloth-model-selector-menu .hub-tab-toggle-pill:hover,diff --git a/studio/frontend/tests/manual-compaction.test.ts b/studio/frontend/tests/manual-compaction.test.tsindex 7ca9986e56d..7bdc593a438 100644--- a/studio/frontend/tests/manual-compaction.test.ts+++ b/studio/frontend/tests/manual-compaction.test.ts@@ -10,7 +10,6 @@ import {registerLiveThreadView,subscribeLiveThreadViews,} from "../src/features/chat/utils/live-thread-head.ts";-import { deriveContextUsageBar } from "../src/features/chat/lib/context-usage-bar-state.ts";import {hasPreStreamRunReservation,releasePreStreamRunReservation,@@ -509,32 +508,7 @@ test("the compact button waits for a directly issued assistant run", async () =>}});-test("the compact menu ring follows the selected chat's current context usage", () => {- const select = menuCallback("usedPercent", {- menu: { item: { id: "ring-chat" } },- deriveContextUsageBar,- }) as (state: object) => number | null;- const state = {- activeThreadId: "ring-chat",- contextUsage: { contextTokens: 780, totalTokens: 900 },- contextUsageByThreadId: { "ring-chat": { totalTokens: 200 } },- loadedContextLength: 1000 as number | null,- };- assert.equal(select(state), 78);- state.contextUsage.contextTokens = 180;- assert.equal(select(state), 18);- state.contextUsage.contextTokens = 980;- assert.equal(select(state), 98);- state.activeThreadId = "another-chat";- assert.equal(select(state), 20);- state.contextUsageByThreadId = {} as typeof state.contextUsageByThreadId;- assert.equal(select(state), null);- state.contextUsageByThreadId = { "ring-chat": { totalTokens: 200 } };- state.loadedContextLength = null;- assert.equal(select(state), null);-});--test("the compact menu item binds its action, live ring and busy state", () => {+test("the compact menu item binds its action, icon and busy state", () => {const source = ts.createSourceFile("menu.tsx",readSrc("features/chat/components/chat-header-menu.tsx"),@@ -543,7 +517,6 @@ test("the compact menu item binds its action, live ring and busy state", () => {ts.ScriptKind.TSX,);const items: ts.JsxElement[] = [];- const rings: ts.JsxSelfClosingElement[] = [];function visit(node: ts.Node) {if (ts.isJsxElement(node) && node.openingElement.tagName.getText(source) === "Item" &&node.getText(source).includes('t("chatMenu.compact")')) items.push(node);@@ -565,11 +538,5 @@ test("the compact menu item binds its action, live ring and busy state", () => {assert.equal(disabled({ item: { type: "single" } }, false), false);assert.equal(disabled({ item: { type: "single" } }, true), true);assert.equal(disabled({ item: { type: "compare" } }, false), true);- function findRing(node: ts.Node) {- if (ts.isJsxSelfClosingElement(node) && node.tagName.getText(source) === "UsageRing") rings.push(node);- ts.forEachChild(node, findRing);- }- findRing(item);- assert.equal(rings.length, 1);- assert.equal(expression(rings[0], "percent"), "usedPercent");+ assert.equal(expression(item.openingElement, "icon"), "CollapseIcon");});