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: control heights, composer fades, API page layout, settings polish (#15232)
Michael Han61cfbaa93cf8
diff --git a/studio/frontend/scripts/check-bundle-budget.ts b/studio/frontend/scripts/check-bundle-budget.tsindex 1140acebca1..5ec280cc237 100644--- a/studio/frontend/scripts/check-bundle-budget.ts+++ b/studio/frontend/scripts/check-bundle-budget.ts@@ -430,8 +430,11 @@ export const BUDGET = {// Scheduled tasks (#13871) add 15.9 KB raw / 5.0 KB transfer (results poll, unseen dots, strings; page and// dialog lazy): 6,766.5 -> 6,782.4 KB raw, 2,041.5 -> 2,046.5 KB transfer against main 90164297d, one machine// and build, Node 24, 105 chunks. Raised by that growth over main's budget.- transferBytes: 2_096_327,- rawBytes: 6_958_713,+ // The control heights and API page round (#15232) adds 2,639 B raw / 717 B transfer, mostly its token table,+ // regenerate and tooltip strings in the eager locales (6,945,181 -> 6,947,820 B raw, 2,095,616 -> 2,096,333 B+ // transfer against 6eeb690f8d, one machine and build, 105 chunks). Raised by that growth.+ transferBytes: 2_097_044,+ rawBytes: 6_961_352,};// The chunk count is reported but not budgeted. Splitting a page out of the entry raises it while lowering thediff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsxindex 48e4282f4ea..7be861f2011 100644--- a/studio/frontend/src/components/app-sidebar.tsx+++ b/studio/frontend/src/components/app-sidebar.tsx@@ -732,7 +732,7 @@ function NavItem({<HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-icon! shrink-0 translate-x-0.5 group-data-[collapsible=icon]:translate-x-0 group-hover/menu-button:animate-icon-pop" /><span className="text-ui-14p5 leading-ui-19 tracking-nav">{label}</span>{badge && (- <Badge variant="secondary" className="group-data-[collapsible=icon]:hidden">+ <Badge variant="accent" className="group-data-[collapsible=icon]:hidden">{badge}</Badge>)}@@ -1061,7 +1061,7 @@ function MoreMenuItem({><HugeiconsIcon icon={icon} strokeWidth={1.75} /><span className="min-w-0 flex-1 truncate">{label}</span>- {badge && <Badge variant="secondary">{badge}</Badge>}+ {badge && <Badge variant="accent">{badge}</Badge>}{spinner && <Spinner className="size-3.5 shrink-0 text-muted-foreground" />}{newAction && (<button@@ -1136,7 +1136,7 @@ function MediaMoreSubmenu<Id extends string>({><HugeiconsIcon icon={icon} strokeWidth={1.75} /><span className="min-w-0 flex-1 truncate">{label}</span>- {badge && <Badge variant="secondary">{badge}</Badge>}+ {badge && <Badge variant="accent">{badge}</Badge>}{spinner && (<Spinner className="size-3.5 shrink-0 text-muted-foreground" />)}diff --git a/studio/frontend/src/components/assistant-ui/attachment.tsx b/studio/frontend/src/components/assistant-ui/attachment.tsxindex 985c4c6f021..e1724cf27a2 100644--- a/studio/frontend/src/components/assistant-ui/attachment.tsx+++ b/studio/frontend/src/components/assistant-ui/attachment.tsx@@ -409,7 +409,7 @@ const PastedTextAttachmentUI: FC<{variant === "card" ? (<buttonclassName={cn(- "aui-pasted-text-card group flex cursor-pointer overflow-hidden rounded-lg text-left transition-colors",+ "aui-pasted-text-card group flex cursor-pointer overflow-hidden rounded-[14px] text-left transition-colors",CARD_SIZE,CARD_EDGE,CARD_SURFACE,@@ -443,7 +443,7 @@ const PastedTextAttachmentUI: FC<{) : variant === "row" ? (<buttonclassName={cn(- "aui-pasted-text-row flex max-w-full cursor-pointer items-center gap-3 rounded-lg px-4 py-3 text-left transition-colors",+ "aui-pasted-text-row flex max-w-full cursor-pointer items-center gap-3 rounded-[14px] px-4 py-3 text-left transition-colors",SENT_ROW_WIDTH,CARD_EDGE,"hover:bg-[color-mix(in_oklab,var(--foreground)_5%,transparent)]",@@ -503,7 +503,7 @@ const AttachmentCardRemove: FC = () => {variant="ghost"size="icon"aria-label="Remove file"- className="aui-attachment-card-remove absolute top-1.5 right-1.5 size-5 rounded-full bg-foreground p-0 opacity-0 shadow-sm transition-opacity hover:bg-foreground! focus-visible:opacity-100 group-hover/attachment-card:opacity-100 group-focus-within/attachment-card:opacity-100 [@media(pointer:coarse)]:opacity-100 [&_svg]:text-background"+ className="aui-attachment-card-remove absolute top-1.5 right-1.5 size-5 rounded-full bg-white p-0 opacity-0 shadow-sm ring-1 ring-black/15 transition-opacity hover:bg-white! dark:bg-black dark:ring-white/20 dark:hover:bg-black! focus-visible:opacity-100 group-hover/attachment-card:opacity-100 group-focus-within/attachment-card:opacity-100 [@media(pointer:coarse)]:opacity-100 [&_svg]:text-black dark:[&_svg]:text-white"><XIcon className="aui-attachment-remove-icon size-3 stroke-[2.5px]" /></Button>@@ -558,7 +558,7 @@ const ComposerAttachmentCard: FC = () => {<AttachmentPreviewDialog redactFromReload={true}><buttonclassName={cn(- "aui-attachment-card-tile flex cursor-pointer overflow-hidden rounded-lg text-left transition-colors",+ "aui-attachment-card-tile flex cursor-pointer overflow-hidden rounded-[14px] text-left transition-colors",CARD_SIZE,CARD_EDGE,!src && CARD_SURFACE,@@ -588,7 +588,7 @@ const SentImageTile: FC = () => {<AttachmentPreviewDialog redactFromReload={false}><buttonclassName={cn(- "aui-attachment-image-tile block cursor-pointer overflow-hidden rounded-lg transition-opacity hover:opacity-85",+ "aui-attachment-image-tile block cursor-pointer overflow-hidden rounded-[14px] transition-opacity hover:opacity-85",layout === "list" ? SENT_IMAGE_SIZE : SENT_IMAGE_SIZE_COMPACT,CARD_EDGE,)}@@ -658,7 +658,7 @@ const SentFileItem: FC = () => {{layout === "list" ? (<buttonclassName={cn(- "aui-attachment-row flex max-w-full cursor-pointer items-center gap-3 rounded-lg px-4 py-3 text-left transition-colors",+ "aui-attachment-row flex max-w-full cursor-pointer items-center gap-3 rounded-[14px] px-4 py-3 text-left transition-colors",SENT_ROW_WIDTH,CARD_EDGE,"hover:bg-[color-mix(in_oklab,var(--foreground)_5%,transparent)]",diff --git a/studio/frontend/src/components/assistant-ui/chat-dictation-bar.tsx b/studio/frontend/src/components/assistant-ui/chat-dictation-bar.tsxindex 20866fd60ac..c69b1ac8cb7 100644--- a/studio/frontend/src/components/assistant-ui/chat-dictation-bar.tsx+++ b/studio/frontend/src/components/assistant-ui/chat-dictation-bar.tsx@@ -263,7 +263,7 @@ export const ChatDictationBar: FC<{{transcribing === "stop" ? (<Spinner className="size-3.5" />) : (- <SquareIcon className="size-3 fill-current" />+ <SquareIcon className="composer-glyph-snap size-3.5 fill-current" />)}</TooltipIconButton><TooltipIconButtondiff --git a/studio/frontend/src/components/assistant-ui/queue-resume-icon.tsx b/studio/frontend/src/components/assistant-ui/queue-resume-icon.tsxindex e516cfc0cc0..15cef347361 100644--- a/studio/frontend/src/components/assistant-ui/queue-resume-icon.tsx+++ b/studio/frontend/src/components/assistant-ui/queue-resume-icon.tsx@@ -10,10 +10,10 @@ export function QueueResumeIcon({ className = "size-6" }: { className?: string }className={className}aria-hidden="true">- {/* Centres the glyph: its own box sits 0.15 right of the viewBox middle. */}+ {/* Box centred, then 1/12 of its width right: a triangle's weight sits toward its flat side. */}<pathfillRule="evenodd"- transform="translate(-0.15 0)"+ transform="translate(1.15 0)"d="M4.5 5.653c0-1.427 1.529-2.33 2.779-1.643l11.54 6.347c1.295.712 1.295 2.573 0 3.286L7.28 19.99c-1.25.687-2.779-.217-2.779-1.643V5.653Z"clipRule="evenodd"/>diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsxindex a8db7688de7..0011a8f25ab 100644--- a/studio/frontend/src/components/assistant-ui/thread.tsx+++ b/studio/frontend/src/components/assistant-ui/thread.tsx@@ -401,6 +401,7 @@ import {ReadAloudIcon,} from "@/lib/action-bar-icons";import { ForkIcon } from "@/lib/fork-icon";+import { markComposerScrollEdges } from "@/lib/composer-scroll-fade";import { cn } from "@/lib/utils";import {ActionBarMorePrimitive,@@ -2734,8 +2735,7 @@ const ThreadScrollToBottom: FC = () => {variant="outline"onClick={() => scrollToBottom("auto")}className={cn(- // Muted in dark mode: the page background made it disappear.- "aui-thread-scroll-to-bottom pointer-events-auto rounded-full p-0 size-[calc(28px*var(--ui-space-scale,1))] bg-background hover:bg-accent dark:bg-muted dark:hover:bg-accent",+ "aui-thread-scroll-to-bottom pointer-events-auto rounded-full p-0 size-[calc(28px*var(--ui-space-scale,1))] bg-background shadow-[0_0_0_0.5px_rgb(0_0_0/0.15)] hover:bg-accent dark:shadow-[0_0_0_0.5px_rgb(255_255_255/0.2)] dark:bg-muted dark:hover:bg-accent",(isAtBottom || !enabled) && "invisible pointer-events-none",)}>@@ -5908,6 +5908,12 @@ const Composer: FC<{dir="auto"{...inputProps}cancelOnEscape={!(declineMounted && declineOwnsEscape)}+ onScrollCapture={(event) =>+ markComposerScrollEdges(event.currentTarget)+ }+ onInputCapture={(event) =>+ markComposerScrollEdges(event.currentTarget)+ }// Capture, so inputProps keeps the handlers it already owns.onKeyDownCapture={notePlainPasteChord}onKeyUpCapture={endPlainPasteChord}@@ -7772,8 +7778,7 @@ const ComposerRightControls: FC<{className="aui-composer-send ml-1.5 size-9 rounded-full"aria-label="Resume queue">- {/* Solid glyph, so it is smaller than the stroked send arrow. */}- <QueueResumeIcon className="size-4" />+ <QueueResumeIcon className="composer-resume-glyph size-4" /></TooltipIconButton>) : queueEntry?.dispatched && !queueEntry.paused ? (<Button@@ -7784,7 +7789,7 @@ const ComposerRightControls: FC<{aria-label="Stop queued message"onClick={stop}>- <SquareIcon className="size-3 fill-current" />+ <SquareIcon className="composer-glyph-snap size-3.5 fill-current" /></Button>) : (<TooltipIconButton@@ -7816,7 +7821,7 @@ const ComposerRightControls: FC<{{researchStopping ? (<Spinner className="size-3.5" />) : (- <SquareIcon className="size-3 fill-current" />+ <SquareIcon className="composer-glyph-snap size-3.5 fill-current" />)}</Button>) : (@@ -7837,7 +7842,7 @@ const ComposerRightControls: FC<{// dispatches the next queued prompt. stop() ends the run.onClick={stop}>- <SquareIcon className="size-3 fill-current" />+ <SquareIcon className="composer-glyph-snap size-3.5 fill-current" /></Button></ComposerPrimitive.Cancel>) : (@@ -8301,7 +8306,8 @@ const ContinueMessageBarForLastMessage: FC = () => {}}><QueueResumeIcon className="size-3.5" />- Resume+ {/* Not bare text: as the last element the icon lost its margin to the message's reset. */}+ <span>Resume</span></Button>)}</div>diff --git a/studio/frontend/src/components/ui/badge.tsx b/studio/frontend/src/components/ui/badge.tsxindex 471d81c169d..aa1d0c49d79 100644--- a/studio/frontend/src/components/ui/badge.tsx+++ b/studio/frontend/src/components/ui/badge.tsx@@ -17,6 +17,7 @@ export const badgeVariants = cva(default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",secondary:"bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",+ accent: "train-section-chip [--chip-tint:var(--control-accent)]",destructive:"bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",outline:diff --git a/studio/frontend/src/components/ui/dropdown-menu.tsx b/studio/frontend/src/components/ui/dropdown-menu.tsxindex 7c38a6bfcb7..6166a4f3873 100644--- a/studio/frontend/src/components/ui/dropdown-menu.tsx+++ b/studio/frontend/src/components/ui/dropdown-menu.tsx@@ -105,7 +105,7 @@ function DropdownMenuItem({data-inset={inset}data-variant={variant}className={cn(- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2.5 rounded-md px-3 py-2 text-sm [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2.5 rounded-md px-3 min-h-menu-row py-2 text-sm [&_svg:not([class*='size-'])]:size-4 group/dropdown-menu-item relative flex cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",className,)}{...props}@@ -123,7 +123,7 @@ function DropdownMenuCheckboxItem({<DropdownMenuPrimitive.CheckboxItemdata-slot="dropdown-menu-checkbox-item"className={cn(- "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2.5 rounded-md py-2 pr-9 pl-3 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",+ "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2.5 rounded-md min-h-menu-row py-2 pr-9 pl-3 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",className,)}checked={checked}@@ -162,7 +162,7 @@ function DropdownMenuRadioItem({<DropdownMenuPrimitive.RadioItemdata-slot="dropdown-menu-radio-item"className={cn(- "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2.5 rounded-md py-2 pr-9 pl-3 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",+ "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground gap-2.5 rounded-md min-h-menu-row py-2 pr-9 pl-3 text-sm [&_svg:not([class*='size-'])]:size-4 relative flex cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",className,)}{...props}@@ -256,7 +256,7 @@ function DropdownMenuSubTrigger({data-slot="dropdown-menu-sub-trigger"data-inset={inset}className={cn(- "focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-md px-3 py-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",+ "focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground gap-2 rounded-md px-3 min-h-menu-row py-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex cursor-pointer items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",className,)}{...props}diff --git a/studio/frontend/src/components/ui/tooltip.tsx b/studio/frontend/src/components/ui/tooltip.tsxindex a9a73e47a78..9a915d53888 100644--- a/studio/frontend/src/components/ui/tooltip.tsx+++ b/studio/frontend/src/components/ui/tooltip.tsx@@ -7,6 +7,7 @@ import {useCallback,useContext,useEffect,+ useRef,useState,useSyncExternalStore,} from "react";@@ -140,11 +141,14 @@ function Tooltip({// Drop what is open when a modal takes over, so closing the dialog does not// bring the tooltip back on its own. Owners of a controlled tooltip are told,// since their state (a `hovered` flag) never sees the pointerleave either.+ // Latch only a tooltip its owner held open: one already shut never sends another false.+ const controlledOpenRef = useRef(controlledOpen);+ controlledOpenRef.current = controlledOpen;useEffect(() => {if (!blocked) return;setHoverOpen(false);setClickOpen(false);- setDismissedUntilOwnerResets(true);+ if (controlledOpenRef.current) setDismissedUntilOwnerResets(true);controlledOnOpenChange?.(false);}, [blocked, controlledOnOpenChange]);diff --git a/studio/frontend/src/features/api-monitor/api-monitor-page.tsx b/studio/frontend/src/features/api-monitor/api-monitor-page.tsxindex 47ed03ee6f6..d76266012d5 100644--- a/studio/frontend/src/features/api-monitor/api-monitor-page.tsx+++ b/studio/frontend/src/features/api-monitor/api-monitor-page.tsx@@ -17,8 +17,10 @@ import {SelectTrigger,SelectValue,} from "@/components/ui/select";+import { useSidebar } from "@/components/ui/sidebar";import { Skeleton } from "@/components/ui/skeleton";import { fetchDeviceType, usePlatformStore } from "@/config/env";+import { useIsMobileShell } from "@/hooks/use-mobile";import { getInferenceStatus, unloadModel } from "@/features/chat/api/chat-api";import { resolveInferenceCheckpointId } from "@/features/chat/lib/apply-inference-status-to-store";import { useChatRuntimeStore } from "@/features/chat/stores/chat-runtime-store";@@ -42,6 +44,7 @@ import { Tick02Icon } from "@/lib/tick-icon";import { cn } from "@/lib/utils";import {ApiIcon,+ ArrowDataTransferVerticalIcon,Cancel01Icon,CodeIcon,ComputerTerminal01Icon,@@ -58,7 +61,8 @@ import {Settings02Icon,Timer01Icon,} from "@hugeicons/core-free-icons";-import { HugeiconsIcon } from "@hugeicons/react";+import { ReloadIcon } from "@/lib/reload-icon";+import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";import {type CSSProperties,type KeyboardEvent,@@ -85,15 +89,16 @@ import { useSingleLine } from "./use-single-line";import { PAYLOAD_SHOW_ALL_MAX_CHARS, payloadPreview } from "./payload-preview";import { ToolbarTooltip } from "./components/toolbar-tooltip";import { unloadResident } from "./unload-resident";+import { useApiModelReload } from "./use-api-model-reload";+import { ContextUsageBar as ContextUsageChip } from "@/features/chat/components/context-usage-bar";import {residentHasRunSettings,- residentHasSlotsSetting,keptRunSettingsRequest,runSettingsRequest,- slotsSettingsRequest,} from "./slots-settings-request";import {monitorSelection,+ useResidentFileGrant,useResidentRunTarget,} from "./use-resident-run-target";import {@@ -244,15 +249,20 @@ function statusTextClass(status: ApiMonitorEntry["status"]): string {type ServedModel = {name: string;+ /** The id the monitor logs under; the label can carry an MLX folder suffix. */+ id: string;checkpoint: string;active: boolean;quant: string | null;+ isMlx: boolean;};function servedModels(loaded: { id: string; quant?: string | null; checkpoint?: string }[],activeModel: string | null,residentCheckpoint: string | null | undefined,+ // Status says MLX only for the primary model; kept slots carry no backend.+ loadedIsMlx: boolean | null,): ServedModel[] {const activeId = monitorSelection(activeModel).id;// At most one primary row: two local files can share a public name, and marking both ejected the primary.@@ -271,16 +281,20 @@ function servedModels(model.quant && !model.id.includes(":")? `${model.id}:${model.quant}`: model.id,+ id: monitorSelection(model.id).id,checkpoint: model.checkpoint ?? model.id,active: index === activeIndex,quant: model.quant ?? null,+ isMlx: index === activeIndex && loadedIsMlx === true,}));if (activeModel && !rows.some((row) => row.active)) {rows.unshift({name: activeModel,+ id: activeId,checkpoint: activeModel,active: true,quant: monitorSelection(activeModel).ggufVariant,+ isMlx: loadedIsMlx === true,});}return rows.sort((a, b) => Number(b.active) - Number(a.active));@@ -375,19 +389,31 @@ function CopyButton({);}+const FACT_CELL =+ "order-2 min-w-0 @max-3xl/served:pl-3.5 @max-3xl/served:empty:hidden @3xl/served:order-none";+function Fact({label,+ icon,children,className,}: {label: string;+ icon?: IconSvgElement;children: ReactNode;className?: string;}): ReactElement {return (- <div className={cn("flex min-w-0 items-center gap-2", className)}>- <dt className="shrink-0 text-ui-12 text-muted-foreground">{label}</dt>- <dd className="flex min-w-0 items-center gap-1 text-ui-12 text-foreground">+ <div className={cn("flex min-w-0 items-center", className)} title={label}>+ <dt className="sr-only">{label}</dt>+ <dd className="flex min-w-0 items-center gap-1.5 whitespace-nowrap text-ui-12 text-foreground">+ {icon ? (+ <HugeiconsIcon+ icon={icon}+ strokeWidth={1.75}+ className="size-3.5 shrink-0 text-muted-foreground"+ />+ ) : null}{children}</dd></div>@@ -837,12 +863,7 @@ function QuickStart({const choices = useApiExampleChoices(baseUrl, "curl");return (<div className="flex flex-col items-center gap-4 px-6 py-12 text-center">- <span- className={cn(- "flex size-10 items-center justify-center rounded-md text-muted-foreground",- INSET,- )}- >+ <span className="flex size-10 items-center justify-center icon-disc text-muted-foreground"><HugeiconsIconicon={ComputerTerminal01Icon}strokeWidth={1.75}@@ -878,7 +899,11 @@ function QuickStart({onClick={openApiSettings}className="gap-1.5 rounded-full">- <HugeiconsIcon icon={PlusSignIcon} strokeWidth={1.75} className="size-4" />+ <HugeiconsIcon+ icon={PlusSignIcon}+ strokeWidth={1.75}+ className="size-4"+ />Create an API key and see more examples</Button></div>@@ -887,6 +912,8 @@ function QuickStart({export function ApiMonitorPage(): ReactElement {const signalReady = useAppShellReadySignal();+ const isMobileShell = useIsMobileShell();+ const { pinned } = useSidebar();const tour = useGuidedTourController({id: "api-monitor",steps: apiMonitorTourSteps,@@ -920,6 +947,7 @@ export function ApiMonitorPage(): ReactElement {const runtime = useChatModelRuntime();const loadedModels = useChatRuntimeStore((s) => s.loadedModels);const residentCheckpoint = useChatRuntimeStore((s) => s.residentCheckpoint);+ const loadedIsMlx = useChatRuntimeStore((s) => s.loadedIsMlx);const [unloading, setUnloading] = useState(false);const [ejectingKept, setEjectingKept] = useState(false);const [exampleModel, setExampleModel] = useState<ServedModel | null>(null);@@ -933,14 +961,21 @@ export function ApiMonitorPage(): ReactElement {.join(","),[entries],);- const [unloadError, setUnloadError] = useState<string | null>(null);const resident = useResidentRunTarget(data?.active_model);+ const fileGrant = useResidentFileGrant(data?.active_model);+ const reload = useApiModelReload({+ selectModel: runtime.selectModel,+ loadNpuModel: runtime.loadNpuModel,+ readModelLoadEpochs: runtime.readModelLoadEpochs,+ fileGrant,+ onSettled: refresh,+ residencyKey,+ });+ const [unloadError, setUnloadError] = useState<string | null>(null);const [configRequest, setConfigRequest] =useState<ModelConfigHandoffRequest | null>(null);const canEditSettings =!modelLoading && !unloading && residentHasRunSettings(resident);- const canEditSlots =- !modelLoading && !unloading && residentHasSlotsSetting(resident);useEffect(() => {const refreshRemoteBase = () => {@@ -1148,8 +1183,9 @@ export function ApiMonitorPage(): ReactElement {const activeModel = data?.active_model ?? null;const now = useServerNow(data?.server_time, entries.length > 0);const served = useMemo(- () => servedModels(loadedModels, activeModel, residentCheckpoint),- [loadedModels, activeModel, residentCheckpoint],+ () =>+ servedModels(loadedModels, activeModel, residentCheckpoint, loadedIsMlx),+ [loadedModels, activeModel, residentCheckpoint, loadedIsMlx],);const serverStatus =SERVER_STATUS[@@ -1160,15 +1196,6 @@ export function ApiMonitorPage(): ReactElement {// older backends omit the field, so only explicit `false` disables recording.const loggingDisabled = data?.logging_enabled === false;const queued = data?.queue?.queued ?? 0;- const slotsLabel = data?.queue- ? `${data.queue.active}/${data.queue.capacity} busy${- queued > 0 ? ` · ${queued} queued` : ""- }`- : "";- const slotsClassName = cn(- "tabular-nums",- queued > 0 && "text-amber-700 dark:text-amber-500",- );const ejecting = unloading || ejectingKept;const ejectServed = async (model: ServedModel): Promise<void> => {@@ -1214,7 +1241,7 @@ export function ApiMonitorPage(): ReactElement {disabled={ejecting || modelLoading || (model.active && !canEditSettings)}- className="size-7 shrink-0 rounded-full p-0 text-muted-foreground hover:text-foreground"+ className="size-7 shrink-0 rounded-full p-0 text-muted-foreground hover:text-foreground dark:hover:bg-chat-icon-bg-hover"><HugeiconsIconicon={Settings02Icon}@@ -1224,6 +1251,50 @@ export function ApiMonitorPage(): ReactElement {</Button></ToolbarTooltip>);+ const reloadBusy = reload.reloadingKey != null || ejecting || modelLoading;+ const reloadButton = (model: ServedModel): ReactElement => (+ <ToolbarTooltip label={`Reload ${model.name}`}>+ <Button+ type="button"+ variant="ghost"+ size="sm"+ aria-label={`Reload ${model.name}`}+ onClick={() => void reload.reloadServed(model)}+ disabled={reloadBusy || !reload.canReload(model)}+ className="size-7 shrink-0 rounded-full p-0 text-muted-foreground hover:text-foreground dark:hover:bg-chat-icon-bg-hover"+ >+ <HugeiconsIcon+ icon={ReloadIcon}+ strokeWidth={1.75}+ className={cn(+ "size-3.5",+ (reload.reloadingKey === model.checkpoint ||+ reload.reloadingKey === "*") &&+ "animate-spin",+ )}+ />+ </Button>+ </ToolbarTooltip>+ );+ const ejectButton = (model: ServedModel): ReactElement => (+ <ToolbarTooltip label={`Eject ${model.name}`}>+ <Button+ type="button"+ variant="ghost"+ size="sm"+ aria-label={`Eject ${model.name}`}+ onClick={() => void ejectServed(model)}+ disabled={ejecting || modelLoading}+ className="size-7 shrink-0 rounded-full p-0 text-muted-foreground hover:text-foreground dark:hover:bg-chat-icon-bg-hover"+ >+ <HugeiconsIcon+ icon={RemoveCircleIcon}+ strokeWidth={1.75}+ className="size-3.5"+ />+ </Button>+ </ToolbarTooltip>+ );const exampleButton = (model: ServedModel): ReactElement => (<ToolbarTooltip label={`API example for ${model.name}`}><Button@@ -1233,13 +1304,9 @@ export function ApiMonitorPage(): ReactElement {aria-label={`API example for ${model.name}`}aria-haspopup="dialog"onClick={() => setExampleModel(model)}- className="size-7 shrink-0 rounded-full p-0 text-muted-foreground hover:text-foreground"+ className="size-7 shrink-0 rounded-full p-0 text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 group-hover/row:opacity-100 dark:hover:bg-chat-icon-bg-hover [@media(hover:none)]:opacity-100">- <HugeiconsIcon- icon={CodeIcon}- strokeWidth={1.75}- className="size-4"- />+ <HugeiconsIcon icon={CodeIcon} strokeWidth={1.75} className="size-4" /></Button></ToolbarTooltip>);@@ -1249,151 +1316,240 @@ export function ApiMonitorPage(): ReactElement {: served.length === 1? `Eject ${served[0].name} and free its memory`: "No model is loaded";- const contextFact = (- <>- {data?.context_length ? (- <Fact label="Context">- <span className="tabular-nums">- {formatCount(data.context_length)} tokens- </span>- </Fact>- ) : null}- </>- );- const slotsFact = (+ const rowFacts = (model: ServedModel): ReactElement => {+ const { id } = model;+ // Since the latest completed load: an earlier one may have had another window; a failed one changed nothing.+ let loadedAt = 0;+ for (const entry of entries) {+ if (+ isLifecycleEntry(entry) &&+ entry.event === "load" &&+ entry.status === "completed" &&+ modelIdsMatch(monitorSelection(entry.model).id, id)+ ) {+ loadedAt = Math.max(loadedAt, entry.started_at);+ }+ }+ const requests = entries.filter(+ (entry) =>+ !isLifecycleEntry(entry) &&+ entry.started_at >= loadedAt &&+ // Requests may be logged as "<id>:<quant>".+ modelIdsMatch(monitorSelection(entry.model).id, id),+ );+ let last: ApiMonitorEntry | null = null;+ for (const entry of requests) {+ if (+ entry.total_tokens != null &&+ entry.context_length &&+ (last == null || entry.started_at > last.started_at)+ ) {+ last = entry;+ }+ }+ const rowStats = computeStats(requests);+ const used = last?.total_tokens ?? (model.active ? 0 : null);+ const windowSize =+ last?.context_length ?? (model.active ? data?.context_length : null);+ return (+ <>+ <dl className={FACT_CELL}>+ {used != null && windowSize ? (+ <Fact label="Context">+ <ContextUsageChip+ ringFirst={true}+ pinOnClick={true}+ hoverClassName="rounded-full transition-colors group-hover:bg-muted dark:group-hover:bg-chat-icon-bg-hover"+ padX={2}+ className="-my-1 -ml-2 h-6 min-w-(--full) [--icon-size:--spacing(3.5)] [&>button]:rounded-full"+ used={used}+ total={windowSize}+ promptTokens={last?.prompt_tokens ?? undefined}+ completionTokens={last?.completion_tokens ?? undefined}+ />+ </Fact>+ ) : null}+ </dl>+ <dl className={FACT_CELL}>+ {rowStats.tokensPerSecond != null ? (+ <Fact label="Speed" icon={FlashIcon}>+ <span className="tabular-nums">+ {rowStats.tokensPerSecond.toFixed(1)} tok/s+ </span>+ </Fact>+ ) : null}+ </dl>+ <dl className={FACT_CELL}>+ {rowStats.avgDurationMs != null ? (+ <Fact label="Total time, average per request" icon={Timer01Icon}>+ <span className="tabular-nums">+ {formatDuration(rowStats.avgDurationMs)}+ </span>+ </Fact>+ ) : null}+ </dl>+ <dl className={FACT_CELL}>+ <Fact label="Requests" icon={ArrowDataTransferVerticalIcon}>+ <span className="tabular-nums">{formatCount(rowStats.total)}</span>+ {rowStats.errors > 0 ? (+ <span className="tabular-nums text-red-600 dark:text-red-400">+ · {formatCount(rowStats.errors)}{" "}+ {rowStats.errors === 1 ? "error" : "errors"}+ </span>+ ) : null}+ </Fact>+ </dl>+ </>+ );+ };+ return (<>- {data?.queue ? (- <Fact label="Slots">- {canEditSlots ? (- <ToolbarTooltip label="Change parallel slots">- <button- type="button"- onClick={() =>- setConfigRequest(- slotsSettingsRequest(- resident,- createModelConfigHandoffRequestId(),- ),- )- }+ {/* Model picker where Chat keeps it; sticky, so the log scrolls under it. */}+ <div+ className={cn(+ "sticky top-0 z-30 flex min-h-[calc(48px*var(--ui-space-scale,1))] shrink-0 items-start bg-background pt-[var(--studio-chat-header-padding-top,11px)]",+ isMobileShell+ ? "pl-12"+ : pinned+ ? "pl-2"+ : isTauri+ ? "pl-[var(--studio-collapsed-chat-controls-inset,0.75rem)]"+ : "pl-[calc(0.5rem*var(--ui-space-scale,1)+max(0px,var(--studio-mac-traffic-light-inset,0px)-var(--sidebar-width-icon,3rem)))]",+ )}+ >+ <div data-tour="api-toolbar" className="flex min-w-0 max-w-full">+ <ApiModelLoadControls+ runtime={runtime}+ activeModel={data?.active_model}+ residencyKey={residencyKey}+ onSettled={refresh}+ onUnloadActive={unloadActiveModel}+ unloading={ejecting}+ configRequest={configRequest}+ onConfigRequestAdopted={() => setConfigRequest(null)}+ onEjectAll={() => void ejectAll()}+ onLastLoadChanged={reload.refreshLastLoad}+ />+ </div>+ <div+ aria-hidden={true}+ className="pointer-events-none absolute inset-x-0 top-full h-6 bg-gradient-to-b from-background to-transparent"+ />+ </div>+ <main className="@container/page mx-auto flex w-full max-w-6xl 3xl:max-w-[calc(1440px*var(--ui-space-scale,1))] 4xl:max-w-[calc(1760px*var(--ui-space-scale,1))] flex-col gap-5 px-6 pb-10 pt-4 max-sm:px-4 max-sm:pt-2 sm:px-10">+ <GuidedTour {...tour.tourProps} />+ <header className="flex items-start justify-between gap-4 @2xl/page:items-end">+ <div className="flex min-w-0 flex-col gap-1">+ <div className="flex flex-wrap items-center gap-3">+ <h1 className="font-heading text-ui-30 font-semibold leading-[1.04] tracking-[-0.028em] text-foreground sm:text-ui-34">+ API+ </h1>+ <spanclassName={cn(- slotsClassName,- "w-fit cursor-pointer text-left underline decoration-dotted decoration-muted-foreground/60 underline-offset-4 hover:decoration-foreground",+ "inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-ui-12 font-medium text-foreground",+ INSET,)}>- {slotsLabel}- </button>- </ToolbarTooltip>- ) : (- <span className={slotsClassName}>{slotsLabel}</span>- )}- </Fact>- ) : null}- </>- );- const activeFacts = (- <>- {contextFact}- {slotsFact}- </>- );-- return (- <main className="mx-auto flex w-full max-w-6xl 3xl:max-w-[calc(1440px*var(--ui-space-scale,1))] 4xl:max-w-[calc(1760px*var(--ui-space-scale,1))] flex-col gap-5 px-6 pb-10 pt-12 max-sm:px-4 max-sm:pt-8 sm:px-10">- <GuidedTour {...tour.tourProps} />- <header className="flex flex-wrap items-end justify-between gap-4">- <div className="flex min-w-0 flex-col gap-1">- <div className="flex flex-wrap items-center gap-3">- <h1 className="font-heading text-ui-30 font-semibold leading-[1.04] tracking-[-0.028em] text-foreground sm:text-ui-34">- API- </h1>- <span- className={cn(- "inline-flex items-center gap-1.5 rounded-full px-2.5 py-0.5 text-ui-12 font-medium text-foreground",- INSET,- )}- >- <span- className={cn("size-2 rounded-full", serverStatus.dot)}- aria-hidden={true}- />- {serverStatus.label}- {served.length > 1 ? (- <span className="text-muted-foreground">- · {served.length} models- </span>- ) : null}- </span>+ <span+ className={cn("size-2 rounded-full", serverStatus.dot)}+ aria-hidden={true}+ />+ {serverStatus.label}+ {served.length > 1 ? (+ <span className="text-muted-foreground">+ · {served.length} models+ </span>+ ) : null}+ </span>+ </div>+ <p className="text-sm text-muted-foreground">+ Serve your local models to any OpenAI-compatible client and watch+ each request live.+ </p></div>- <p className="text-sm text-muted-foreground">- Serve your local models to any OpenAI-compatible client and watch- each request live.- </p>- </div>- <ToolbarTooltip label="API settings">- <Button- type="button"- variant="ghost"- size="icon"- onClick={openApiSettings}- aria-label="API settings"- className="size-8 rounded-full text-muted-foreground hover:bg-[color-mix(in_oklab,var(--foreground)_calc(10%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground dark:hover:bg-[color-mix(in_oklab,var(--foreground)_calc(14%*var(--contrast-wash-gain,1)),transparent)]"- >- <HugeiconsIcon- icon={Settings02Icon}- strokeWidth={1.75}- className="size-[calc(18px*var(--ui-space-scale,1))]"- />- </Button>- </ToolbarTooltip>- </header>-- {/* Checked first when a client can't reach the API: base URL and what is loaded. */}- <section- data-tour="api-endpoint"- className={cn("flex flex-col", SURFACE)}- >- <div className="flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-5 py-4">- <div className="flex min-w-0 items-center gap-3">- <span- className="train-section-chip inline-flex size-9 shrink-0 items-center justify-center rounded-full"- style={- { "--chip-tint": "var(--control-accent)" } as CSSProperties- }+ <ToolbarTooltip label="API settings">+ <Button+ type="button"+ variant="ghost"+ size="icon"+ onClick={openApiSettings}+ aria-label="API settings"+ className="size-8 rounded-full text-muted-foreground hover:bg-[color-mix(in_oklab,var(--foreground)_calc(10%*var(--contrast-wash-gain,1)),transparent)] hover:text-foreground dark:hover:bg-[color-mix(in_oklab,var(--foreground)_calc(14%*var(--contrast-wash-gain,1)),transparent)]"><HugeiconsIcon- icon={ApiIcon}- strokeWidth={1.5}+ icon={Settings02Icon}+ strokeWidth={1.75}className="size-[calc(18px*var(--ui-space-scale,1))]"/>- </span>- <div className="flex min-w-0 flex-col">- <span className="text-ui-11 text-muted-foreground">Base URL</span>- {/* h-5: at the copy button's 28px the chip sat below the text. */}- <div className="group/copy flex h-5 min-w-0 items-center gap-1">- <span className="truncate font-mono text-ui-13 text-foreground">- {baseUrl}- </span>- <CopyButton- value={baseUrl}- label="Copy API base URL"- revealOnHover={true}+ </Button>+ </ToolbarTooltip>+ </header>++ <section+ data-tour="api-endpoint"+ className={cn("flex flex-col", SURFACE)}+ >+ <div className="flex flex-wrap items-center justify-between gap-x-6 gap-y-3 px-5 py-4">+ <div className="flex min-w-0 items-center gap-3">+ <span+ className="train-section-chip inline-flex size-9 shrink-0 items-center justify-center rounded-full"+ style={+ { "--chip-tint": "var(--control-accent)" } as CSSProperties+ }+ >+ <HugeiconsIcon+ icon={ApiIcon}+ strokeWidth={1.5}+ className="size-[calc(18px*var(--ui-space-scale,1))]"/>+ </span>+ <div className="flex min-w-0 flex-col">+ <span className="text-ui-11 text-muted-foreground">+ Base URL+ </span>+ {/* h-5: at the copy button's 28px the chip sat below the text. */}+ <div className="group/copy flex h-5 min-w-0 items-center gap-1">+ <span className="truncate font-mono text-ui-13 text-foreground">+ {baseUrl}+ </span>+ <CopyButton+ value={baseUrl}+ label="Copy API base URL"+ revealOnHover={true}+ />+ </div></div></div>- </div>- <div data-tour="api-toolbar" className="flex min-w-0 max-w-full">- <ApiModelLoadControls- runtime={runtime}- activeModel={data?.active_model}- residencyKey={residencyKey}- onSettled={refresh}- onUnloadActive={unloadActiveModel}- unloading={ejecting}- configRequest={configRequest}- onConfigRequestAdopted={() => setConfigRequest(null)}- onEjectAll={() => void ejectAll()}- >+ <div className="flex items-center gap-2">+ <ToolbarTooltip label={reload.reloadAllTitle(served)}>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => void reload.reloadAll(served)}+ disabled={+ reloadBusy ||+ (served.length === 0 && reload.lastLoadLabel == null) ||+ (served.length > 0 &&+ !served.some((model) => reload.canReload(model)))+ }+ className="gap-1.5 rounded-full"+ >+ <HugeiconsIcon+ icon={ReloadIcon}+ strokeWidth={1.75}+ className={cn(+ "size-4",+ reload.reloadingKey === "*" && "animate-spin",+ )}+ />+ {reload.reloadingKey === "*"+ ? "Reloading"+ : served.length > 1+ ? "Reload all"+ : "Reload"}+ </Button>+ </ToolbarTooltip><ToolbarTooltip label={ejectLabel}><Buttontype="button"@@ -1419,404 +1575,372 @@ export function ApiMonitorPage(): ReactElement {: "Eject"}</Button></ToolbarTooltip>- </ApiModelLoadControls>+ </div>+ {reload.error ? (+ <span+ role="alert"+ className="basis-full break-words text-ui-12 text-red-600 dark:text-red-400"+ >+ {reload.error}+ </span>+ ) : null}</div>- </div>- <div className={cn("border-t px-5 pt-3.5 pb-5", DIVIDER)}>- {served.length > 1 ? (- <div className="flex flex-col gap-2">+ <div className={cn("border-t px-5 pt-3.5 pb-5", DIVIDER)}>+ {served.length === 0 ? (<p className="text-ui-12 text-muted-foreground">- {served.length} models answering requests+ No models loaded</p>- <div className="grid grid-cols-[minmax(0,max-content)_auto_auto_auto_1fr] items-center gap-x-6 gap-y-1.5">- {served.map((model) => (- <div key={model.checkpoint} className="contents">- <span className="group/copy flex min-w-0 items-center gap-1 text-ui-12">- <span- className="size-1.5 shrink-0 rounded-full bg-emerald-500"- aria-hidden={true}- />- <span className="ml-1 truncate font-mono text-foreground">- {model.name}+ ) : (+ <div className="@container/served flex flex-col gap-2">+ <p className="text-ui-12 text-muted-foreground">+ {served.length === 1+ ? "1 model answering requests"+ : `${served.length} models answering requests`}+ </p>+ <div className="flex flex-col gap-3 @3xl/served:grid @3xl/served:grid-cols-[minmax(0,max-content)_auto_auto_auto_auto_1fr] @3xl/served:items-center @3xl/served:gap-x-6 @3xl/served:gap-y-1.5">+ {served.map((model) => (+ // A subgrid, not `contents`: the row needs a box (gaps included) to hover.+ <div+ key={model.checkpoint}+ className="group/row flex flex-wrap items-center gap-x-3 gap-y-1 @md/served:gap-x-4 @3xl/served:col-span-full @3xl/served:grid @3xl/served:grid-cols-subgrid @3xl/served:gap-x-6"+ >+ <span className="order-1 flex min-w-0 flex-1 items-center gap-1 text-ui-12 @max-3xl/served:basis-full @max-3xl/served:items-start @3xl/served:order-none">+ <span+ className="size-1.5 shrink-0 rounded-full bg-emerald-500 @max-3xl/served:mt-1.5"+ aria-hidden={true}+ />+ <span className="ml-1 min-w-0 truncate font-mono text-foreground @max-3xl/served:whitespace-normal @max-3xl/served:[overflow-wrap:anywhere]">+ {model.name}+ </span>+ {exampleButton(model)}</span>- <CopyButton- value={model.name}- label="Copy model name"- revealOnHover={true}- />- </span>- <span className="flex items-center gap-0.5">- {settingsButton(model)}- {exampleButton(model)}- </span>- <dl className="min-w-0">- {model.active ? contextFact : null}- </dl>- <dl className="min-w-0">- {model.active ? slotsFact : null}- </dl>- <span className="justify-self-end">- <ToolbarTooltip label={`Eject ${model.name}`}>- <Button- type="button"- variant="ghost"- size="sm"- aria-label={`Eject ${model.name}`}- onClick={() => void ejectServed(model)}- disabled={ejecting || modelLoading}- className="size-7 rounded-full p-0 text-muted-foreground hover:text-foreground"- >- <HugeiconsIcon- icon={RemoveCircleIcon}- strokeWidth={1.75}- className="size-3.5"- />- </Button>- </ToolbarTooltip>- </span>- </div>- ))}+ {rowFacts(model)}+ <span className="order-3 ml-auto flex shrink-0 items-center gap-0.5 justify-self-end @3xl/served:order-none @3xl/served:ml-0">+ {settingsButton(model)}+ {reloadButton(model)}+ {ejectButton(model)}+ </span>+ </div>+ ))}+ </div></div>- </div>- ) : (- <dl className="flex flex-wrap items-center gap-x-6 gap-y-2">- <Fact label="Model" className="max-w-full">- {served.length === 1 ? (- <>- {/* Its own reveal group: hovering settings or code must not show Copy. */}- <span className="group/copy flex min-w-0 items-center gap-1">- <span className="truncate font-mono">{served[0].name}</span>- <CopyButton- value={served[0].name}- label="Copy model name"- revealOnHover={true}- />- </span>- {settingsButton(served[0])}- {exampleButton(served[0])}- </>- ) : (- <span className="text-muted-foreground">None loaded</span>- )}- </Fact>- {served[0]?.active ? activeFacts : null}- </dl>- )}- </div>- </section>+ )}+ </div>+ </section>- {error ? <Banner>{error}</Banner> : null}- {unloadError ? (- <Banner onDismiss={() => setUnloadError(null)}>{unloadError}</Banner>- ) : null}+ {error ? <Banner>{error}</Banner> : null}+ {unloadError ? (+ <Banner onDismiss={() => setUnloadError(null)}>{unloadError}</Banner>+ ) : null}- <section- aria-label="Traffic summary"- className="elevated-card grid grid-cols-2 gap-px overflow-hidden bg-border/60 sm:grid-cols-3 lg:grid-cols-6 dark:bg-background"- >- <Stat- label="In flight"- value={formatCount(modelStats.active)}- tone={modelStats.active > 0 ? "active" : "default"}- hint={queued > 0 ? `${formatCount(queued)} queued` : undefined}- />- <Stat- label="Requests"- value={formatCount(modelStats.total)}- hint={loggingDisabled ? "recording off" : "in the recent log"}- />- <Stat- label="Errors"- value={formatCount(modelStats.errors)}- tone={modelStats.errors > 0 ? "error" : "default"}- hint={- modelStats.errorRate != null- ? `${Math.round(modelStats.errorRate * 100)}% of finished`- : undefined- }- />- <Stat- label="Avg latency"- value={formatDuration(modelStats.avgDurationMs)}- hint={- modelStats.maxDurationMs != null- ? `max ${formatDuration(modelStats.maxDurationMs)}`- : undefined- }- />- <Stat- label="Generation speed"- value={- modelStats.tokensPerSecond == null- ? "–"- : `${modelStats.tokensPerSecond.toFixed(1)} tok/s`- }- hint="while decoding"- />- <Stat- label="Tokens"- value={formatCount(modelStats.totalTokens)}- hint={`${formatCount(modelStats.inputTokens)} in · ${formatCount(modelStats.outputTokens)} out`}- />- </section>+ <section+ aria-label="Traffic summary"+ className="elevated-card grid grid-cols-2 gap-px overflow-hidden bg-border/60 @xl/page:grid-cols-3 @5xl/page:grid-cols-6 dark:bg-background"+ >+ <Stat+ label="In flight"+ value={formatCount(modelStats.active)}+ tone={modelStats.active > 0 ? "active" : "default"}+ hint={queued > 0 ? `${formatCount(queued)} queued` : undefined}+ />+ <Stat+ label="Requests"+ value={formatCount(modelStats.total)}+ hint={loggingDisabled ? "recording off" : "in the recent log"}+ />+ <Stat+ label="Errors"+ value={formatCount(modelStats.errors)}+ tone={modelStats.errors > 0 ? "error" : "default"}+ hint={+ modelStats.errorRate != null+ ? `${Math.round(modelStats.errorRate * 100)}% of finished`+ : undefined+ }+ />+ <Stat+ label="Avg latency"+ value={formatDuration(modelStats.avgDurationMs)}+ hint={+ modelStats.maxDurationMs != null+ ? `max ${formatDuration(modelStats.maxDurationMs)}`+ : undefined+ }+ />+ <Stat+ label="Generation speed"+ value={+ modelStats.tokensPerSecond == null+ ? "–"+ : `${modelStats.tokensPerSecond.toFixed(1)} tok/s`+ }+ hint="while decoding"+ />+ <Stat+ label="Tokens"+ value={formatCount(modelStats.totalTokens)}+ hint={`${formatCount(modelStats.inputTokens)} in · ${formatCount(modelStats.outputTokens)} out`}+ />+ </section>- <section className={cn("flex min-h-0 flex-col overflow-hidden", SURFACE)}>- <div- className={cn(- "flex flex-wrap items-center gap-2 border-b px-4 py-3",- DIVIDER,- )}+ <section+ className={cn("flex min-h-0 flex-col overflow-hidden", SURFACE)}>- <div className="relative w-full min-w-0 sm:w-56">- <HugeiconsIcon- icon={Search01Icon}- strokeWidth={1.75}- className="pointer-events-none absolute top-1/2 left-3 size-3.5 -translate-y-1/2 text-muted-foreground"- aria-hidden={true}- />- <Input- value={query}- onChange={(event) => setQuery(event.target.value)}- placeholder="Search requests"- aria-label="Search API requests"- title="Matches the model, endpoint, prompt, reply or error"- className="pl-8"- />- </div>- <nav- aria-label="Filter by status"- className="-my-2 flex max-w-full gap-1 overflow-x-auto px-1 py-2 [scrollbar-width:none]!"+ <div+ className={cn(+ "flex flex-wrap items-center gap-2 border-b px-4 py-3",+ DIVIDER,+ )}>- {STATUS_FILTERS.map((option) => {- const active = statusFilter === option.value;- const count = statusCounts[option.value];- return (- <button- key={option.value}+ <div className="relative w-full min-w-0 sm:w-56">+ <HugeiconsIcon+ icon={Search01Icon}+ strokeWidth={1.75}+ className="pointer-events-none absolute top-1/2 left-3 size-3.5 -translate-y-1/2 text-muted-foreground"+ aria-hidden={true}+ />+ <Input+ value={query}+ onChange={(event) => setQuery(event.target.value)}+ placeholder="Search requests"+ aria-label="Search API requests"+ title="Matches the model, endpoint, prompt, reply or error"+ className="pl-8"+ />+ </div>+ <nav+ aria-label="Filter by status"+ className="-my-2 flex max-w-full gap-1 overflow-x-auto px-1 py-2 [scrollbar-width:none]!"+ >+ {STATUS_FILTERS.map((option) => {+ const active = statusFilter === option.value;+ const count = statusCounts[option.value];+ return (+ <button+ key={option.value}+ type="button"+ aria-current={active ? "page" : undefined}+ onClick={() => setStatusFilter(option.value)}+ className={cn(+ "flex h-9 shrink-0 items-center gap-1.5 rounded-full px-3.5 font-heading text-ui-14 text-foreground/80 transition-colors hover:text-foreground",+ active &&+ "bg-white font-medium text-foreground shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))] dark:shadow-none",+ )}+ >+ {option.label}+ {option.value !== "all" && count > 0 ? (+ <span+ className={cn(+ "tabular-nums text-muted-foreground",+ option.value === "error" &&+ "text-red-600 dark:text-red-400",+ )}+ >+ {formatCount(count)}+ </span>+ ) : null}+ </button>+ );+ })}+ </nav>+ {loggedModels.length > 1 ? (+ <Select+ value={effectiveModelFilter}+ onValueChange={setModelFilter}+ >+ <SelectTrigger+ aria-label="Filter by model"+ className="h-9 max-w-64 rounded-full"+ >+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ <SelectItem value={ALL_MODELS}>All models</SelectItem>+ {loggedModels.map((model) => (+ <SelectItem key={model} value={model}>+ {model}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ ) : null}+ <div className="ml-auto flex shrink-0 items-center gap-1">+ {visible.length !== entries.length ? (+ <span className="mr-1 text-ui-11 tabular-nums text-muted-foreground">+ {formatCount(visible.length)} of {formatCount(entries.length)}+ </span>+ ) : null}+ <ToolbarTooltip+ label={paused ? "Resume the live feed" : "Pause the live feed"}+ >+ <Buttontype="button"- aria-current={active ? "page" : undefined}- onClick={() => setStatusFilter(option.value)}+ variant="ghost"+ size="icon"+ aria-label={+ paused ? "Resume the live feed" : "Pause the live feed"+ }+ aria-pressed={paused}+ onClick={() => setPaused(!paused)}className={cn(- "flex h-9 shrink-0 items-center gap-1.5 rounded-full px-3.5 font-heading text-ui-14 text-foreground/80 transition-colors hover:text-foreground",- active &&- "bg-white font-medium text-foreground shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))] dark:shadow-none",+ "rounded-full",+ paused &&+ "bg-amber-500/10 text-amber-700 hover:bg-amber-500/15 dark:text-amber-500",)}>- {option.label}- {option.value !== "all" && count > 0 ? (- <span- className={cn(- "tabular-nums text-muted-foreground",- option.value === "error" &&- "text-red-600 dark:text-red-400",- )}- >- {formatCount(count)}- </span>- ) : null}- </button>- );- })}- </nav>- {loggedModels.length > 1 ? (- <Select value={effectiveModelFilter} onValueChange={setModelFilter}>- <SelectTrigger- aria-label="Filter by model"- className="h-9 max-w-64 rounded-full"- >- <SelectValue />- </SelectTrigger>- <SelectContent>- <SelectItem value={ALL_MODELS}>All models</SelectItem>- {loggedModels.map((model) => (- <SelectItem key={model} value={model}>- {model}- </SelectItem>- ))}- </SelectContent>- </Select>- ) : null}- <div className="ml-auto flex shrink-0 items-center gap-1">- {visible.length !== entries.length ? (- <span className="mr-1 text-ui-11 tabular-nums text-muted-foreground">- {formatCount(visible.length)} of {formatCount(entries.length)}- </span>- ) : null}- <ToolbarTooltip- label={paused ? "Resume the live feed" : "Pause the live feed"}- >- <Button- type="button"- variant="ghost"- size="icon"- aria-label={- paused ? "Resume the live feed" : "Pause the live feed"- }- aria-pressed={paused}- onClick={() => setPaused(!paused)}- className={cn(- "rounded-full",- paused &&- "bg-amber-500/10 text-amber-700 hover:bg-amber-500/15 dark:text-amber-500",- )}- >- <HugeiconsIcon- icon={paused ? PlayIcon : PauseIcon}- strokeWidth={1.75}- className="size-4"- />- </Button>- </ToolbarTooltip>- <ToolbarTooltip label="Refresh">- <Button- type="button"- variant="ghost"- size="icon"- onClick={refresh}- disabled={refreshing}- aria-label="Refresh"- className="rounded-full"- >- <HugeiconsIcon- icon={Refresh01Icon}- strokeWidth={1.75}- className={cn("size-4", refreshing && "animate-spin")}- />- </Button>- </ToolbarTooltip>- <ToolbarTooltip label="Clear log">- <Button- type="button"- variant="ghost"- size="icon"- disabled={entries.length === 0}- onClick={() => {- setSelectedId(null);- void clear();- }}- aria-label="Clear log"- className="rounded-full text-red-500/80 hover:text-red-500 dark:text-red-400/80 dark:hover:text-red-400"- >- <HugeiconsIcon- icon={Delete02Icon}- strokeWidth={1.75}- className="size-4"- />- </Button>- </ToolbarTooltip>+ <HugeiconsIcon+ icon={paused ? PlayIcon : PauseIcon}+ strokeWidth={1.75}+ className="size-4"+ />+ </Button>+ </ToolbarTooltip>+ <ToolbarTooltip label="Refresh">+ <Button+ type="button"+ variant="ghost"+ size="icon"+ onClick={refresh}+ disabled={refreshing}+ aria-label="Refresh"+ className="rounded-full"+ >+ <HugeiconsIcon+ icon={Refresh01Icon}+ strokeWidth={1.75}+ className={cn("size-4", refreshing && "animate-spin")}+ />+ </Button>+ </ToolbarTooltip>+ <ToolbarTooltip label="Clear log">+ <Button+ type="button"+ variant="ghost"+ size="icon"+ disabled={entries.length === 0}+ onClick={() => {+ setSelectedId(null);+ void clear();+ }}+ aria-label="Clear log"+ className="rounded-full text-red-500/80 hover:text-red-500 dark:text-red-400/80 dark:hover:text-red-400"+ >+ <HugeiconsIcon+ icon={Delete02Icon}+ strokeWidth={1.75}+ className="size-4"+ />+ </Button>+ </ToolbarTooltip>+ </div></div>- </div>- {!loading && entries.length === 0 ? (- <div data-tour="api-log">- {loggingDisabled ? (- <p className="mx-auto max-w-lg px-6 py-14 text-center text-sm text-muted-foreground">- Recording is off: UNSLOTH_STUDIO_DISABLE_API_MONITOR is set.- Requests and model loads still run normally, they are just not- listed here. Unset the variable and restart Unsloth to- re-enable.- </p>- ) : (- <QuickStart- baseUrl={baseUrl}- model={- (served.find((m) => m.active) ?? served[0])?.name ?? null- }- />- )}- </div>- ) : (- <div- data-tour="api-log"- className="grid min-h-0 grid-cols-1 lg:grid-cols-[minmax(0,380px)_minmax(0,1fr)] 4xl:grid-cols-[minmax(0,480px)_minmax(0,1fr)]"- >- <div- ref={listRef}- onKeyDown={onListKeyDown}- className={cn(- PANE_HEIGHT,- DIVIDER,- "flex flex-col gap-0.5 border-b p-1.5 lg:border-b-0 lg:border-r",- )}- >- {loading ? (- <div className="flex flex-col gap-2 p-1.5">- {[0, 1, 2].map((i) => (- <Skeleton key={i} className="h-16 w-full rounded-md" />- ))}- </div>- ) : visible.length === 0 ? (- <div className="flex flex-col items-center gap-3 px-4 py-10 text-center text-sm text-muted-foreground">- No requests match this filter.- <Button- type="button"- variant="outline"- size="sm"- onClick={() => {- setQuery("");- setStatusFilter("all");- setModelFilter(ALL_MODELS);- }}- className="rounded-full"- >- Clear filters- </Button>- </div>+ {!loading && entries.length === 0 ? (+ <div data-tour="api-log">+ {loggingDisabled ? (+ <p className="mx-auto max-w-lg px-6 py-14 text-center text-sm text-muted-foreground">+ Recording is off: UNSLOTH_STUDIO_DISABLE_API_MONITOR is set.+ Requests and model loads still run normally, they are just not+ listed here. Unset the variable and restart Unsloth to+ re-enable.+ </p>) : (- visible.map((entry) => (- <RequestRow- key={entry.id}- entry={entry}- selected={entry.id === selectedId}- onSelect={setSelectedId}- now={now}- />- ))+ <QuickStart+ baseUrl={baseUrl}+ model={+ (served.find((m) => m.active) ?? served[0])?.name ?? null+ }+ />)}</div>-- <div className={PANE_HEIGHT}>- {selected ? (- <RequestDetail- entry={selected}- detail={details[selected.id]}- loading={loadingDetails.has(selected.id)}- />- ) : (- <div className="flex h-full flex-col items-center justify-center gap-3 px-6 py-10 text-center">- <span- className={cn(- "flex size-10 items-center justify-center rounded-md text-muted-foreground",- INSET,- )}- >- <HugeiconsIcon- icon={FileSearchIcon}- strokeWidth={1.75}- className="size-5"+ ) : (+ <div+ data-tour="api-log"+ className="grid min-h-0 grid-cols-1 lg:grid-cols-[minmax(0,380px)_minmax(0,1fr)] 4xl:grid-cols-[minmax(0,480px)_minmax(0,1fr)]"+ >+ <div+ ref={listRef}+ onKeyDown={onListKeyDown}+ className={cn(+ PANE_HEIGHT,+ DIVIDER,+ "flex flex-col gap-0.5 border-b p-1.5 lg:border-b-0 lg:border-r",+ )}+ >+ {loading ? (+ <div className="flex flex-col gap-2 p-1.5">+ {[0, 1, 2].map((i) => (+ <Skeleton key={i} className="h-16 w-full rounded-md" />+ ))}+ </div>+ ) : visible.length === 0 ? (+ <div className="flex flex-col items-center gap-3 px-4 py-10 text-center text-sm text-muted-foreground">+ No requests match this filter.+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => {+ setQuery("");+ setStatusFilter("all");+ setModelFilter(ALL_MODELS);+ }}+ className="rounded-full"+ >+ Clear filters+ </Button>+ </div>+ ) : (+ visible.map((entry) => (+ <RequestRow+ key={entry.id}+ entry={entry}+ selected={entry.id === selectedId}+ onSelect={setSelectedId}+ now={now}/>- </span>- <p className="max-w-xs text-sm text-muted-foreground">- Select a request to see its details. Arrow keys move- through the list.- </p>- </div>- )}+ ))+ )}+ </div>++ <div className={PANE_HEIGHT}>+ {selected ? (+ <RequestDetail+ entry={selected}+ detail={details[selected.id]}+ loading={loadingDetails.has(selected.id)}+ />+ ) : (+ <div className="flex h-full flex-col items-center justify-center gap-3 px-6 py-10 text-center">+ <span className="flex size-10 items-center justify-center icon-disc text-muted-foreground">+ <HugeiconsIcon+ icon={FileSearchIcon}+ strokeWidth={1.75}+ className="size-5"+ />+ </span>+ <p className="max-w-xs text-sm text-muted-foreground">+ Select a request to see its details. Arrow keys move+ through the list.+ </p>+ </div>+ )}+ </div></div>- </div>- )}- </section>+ )}+ </section>- <SavedModelSettingsPanel />- <ApiExampleDialog- open={exampleModel != null}- onOpenChange={(open) => {- if (!open) setExampleModel(null);- }}- baseUrl={baseUrl}- model={exampleModel?.name ?? ""}- samplingModelId={exampleModel?.checkpoint ?? ""}- />- </main>+ <SavedModelSettingsPanel />+ <ApiExampleDialog+ open={exampleModel != null}+ onOpenChange={(open) => {+ if (!open) setExampleModel(null);+ }}+ baseUrl={baseUrl}+ model={exampleModel?.name ?? ""}+ samplingModelId={exampleModel?.checkpoint ?? ""}+ />+ </main>+ </>);}diff --git a/studio/frontend/src/features/api-monitor/components/api-model-load-controls.tsx b/studio/frontend/src/features/api-monitor/components/api-model-load-controls.tsxindex 9ec2de9b95d..b092edbae95 100644--- a/studio/frontend/src/features/api-monitor/components/api-model-load-controls.tsx+++ b/studio/frontend/src/features/api-monitor/components/api-model-load-controls.tsx@@ -1,14 +1,6 @@-// SPDX-License-Identifier: AGPL-3.0-only-// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0--// Loads through the Chat runtime's selectModel, so the API board gets the same context, quant,-// GPU placement, trust and running-chat guards as Chat.--import { Button } from "@/components/ui/button";import {chatLocalModelOptions,isExternalModelId,- readLastLocalModelLoad,type useChatModelRuntime,useChatRuntimeStore,wantsDownloadManagerStaging,@@ -31,25 +23,16 @@ import {useActiveModelConfig,} from "@/features/model-picker";import { isNpuModelId } from "@/features/npu";-import { cn } from "@/lib/utils";-import { ReloadIcon } from "@hugeicons/core-free-icons";-import { HugeiconsIcon } from "@hugeicons/react";import {type Dispatch,type ReactElement,- type ReactNode,type SetStateAction,useCallback,useEffect,useMemo,useState,} from "react";-import {- RELOAD_MISSING_HISTORY_MESSAGE,- reloadLastModel,-} from "../reload-last-model";import { monitorSelection } from "../use-resident-run-target";-import { ToolbarTooltip } from "./toolbar-tooltip";// A pick superseded by a newer one rejects too; the newer pick owns the outcome.function loadErrorMessage(err: unknown, fallback: string): string | null {@@ -176,21 +159,6 @@ function useLoadAfterDownload(}, [pending, setPending, onStartError]);}-function reloadTitle(- lastLoadLabel: string | null | undefined,- loaded: boolean,-): string {- if (lastLoadLabel === undefined) {- return "Checking previously loaded model...";- }- if (!lastLoadLabel) {- return RELOAD_MISSING_HISTORY_MESSAGE;- }- return loaded- ? `Reload ${lastLoadLabel}`- : `Reload ${lastLoadLabel} (no model loaded)`;-}-function toModelOptions(models: {id: string;@@ -217,7 +185,7 @@ export function ApiModelLoadControls({configRequest = null,onConfigRequestAdopted,onEjectAll,- children,+ onLastLoadChanged,}: {runtime: ReturnType<typeof useChatModelRuntime>;activeModel: string | null | undefined;@@ -230,7 +198,7 @@ export function ApiModelLoadControls({configRequest?: ModelConfigHandoffRequest | null;onConfigRequestAdopted?: (requestId: string) => void;onEjectAll?: () => void;- children?: ReactNode;+ onLastLoadChanged?: () => void;}): ReactElement {const { selectModel, loadNpuModel, refresh, ejectModel } = runtime;const loadedModels = useChatRuntimeStore((s) => s.loadedModels);@@ -249,33 +217,14 @@ export function ApiModelLoadControls({const refreshLocalModels = localModelInventory.refresh;const [selectorOpen, setSelectorOpen] = useState(false);- const [reloading, setReloading] = useState(false);const [actionError, setActionError] = useState<string | null>(null);const [pendingDownload, setPendingDownload] =useState<PendingDownload | null>(null);- const [lastLoadLabel, setLastLoadLabel] = useState<string | null | undefined>(- undefined,- );-- const refreshLastLoadLabel = useCallback(() => {- readLastLocalModelLoad()- .then((last) => {- setLastLoadLabel(- last- ? last.kind === "gguf" && last.ggufVariant- ? `${last.id} · ${last.ggufVariant}`- : last.id- : null,- );- })- .catch(() => setLastLoadLabel(null));- }, []);-useEffect(() => {refresh();refreshLocalModels();- refreshLastLoadLabel();- }, [refresh, refreshLocalModels, refreshLastLoadLabel]);+ onLastLoadChanged?.();+ }, [refresh, refreshLocalModels, onLastLoadChanged]);// Opened during render, as the picker adopts the request, so the same pass mounts its page.const [openedRequestId, setOpenedRequestId] = useState<string | null>(null);@@ -291,11 +240,11 @@ export function ApiModelLoadControls({if (activeModel === undefined) {return;}- refreshLastLoadLabel();+ onLastLoadChanged?.();if (!useChatRuntimeStore.getState().modelLoading) {refresh({ includeLoras: false });}- }, [activeModel, residencyKey, refresh, refreshLastLoadLabel]);+ }, [activeModel, residencyKey, refresh, onLastLoadChanged]);const models = useMemo(() => toModelOptions(modelsFromStore),@@ -345,13 +294,13 @@ export function ApiModelLoadControls({forceReload: meta?.forceReload,config: meta?.config,});- refreshLastLoadLabel();+ onLastLoadChanged?.();onSettled();return;}try {await selectModel(localSelection(value, meta));- refreshLastLoadLabel();+ onLastLoadChanged?.();onSettled();} catch (err: unknown) {setActionError(loadErrorMessage(err, "Failed to load model"));@@ -361,7 +310,7 @@ export function ApiModelLoadControls({selectModel,loadNpuModel,onSettled,- refreshLastLoadLabel,+ onLastLoadChanged,activeModel,unloading,],@@ -377,42 +326,6 @@ export function ApiModelLoadControls({setActionError,);- const handleReload = useCallback(async () => {- setPendingDownload(null);- setReloading(true);- setActionError(null);- try {- await reloadLastModel({- readLastLoad: () => readLastLocalModelLoad(),- resolveConfig: (id, variant) => {- const resolved = resolveResidentInitialConfig(id, variant);- return resolved.remembered ? { config: resolved.config } : null;- },- loadTarget: async (target) => {- await selectModel({- id: target.id,- isGguf: target.kind === "gguf",- ggufVariant: target.ggufVariant ?? undefined,- config: target.config ?? undefined,- keepSpeculative: target.config != null,- forceReload: true,- isDownloaded: true,- previousConfig: currentRuntimePerModelConfig({- includeMaxSeqLength: true,- }),- throwOnError: true,- });- },- });- refreshLastLoadLabel();- onSettled();- } catch (err: unknown) {- setActionError(loadErrorMessage(err, "Failed to reload model"));- } finally {- setReloading(false);- }- }, [selectModel, onSettled, refreshLastLoadLabel]);-const handleEject = useCallback((modelId?: string) => {setPendingDownload(null);@@ -426,7 +339,6 @@ export function ApiModelLoadControls({);const busy = modelLoading || unloading;- const reloadDisabled = reloading || busy || lastLoadLabel == null;const { id: effectiveModel, ggufVariant: activeGgufVariant } =monitorSelection(activeModel);@@ -439,7 +351,7 @@ export function ApiModelLoadControls({publicModelId(runtimeCheckpoint) === effectiveModel;return (- <div className="flex min-w-0 max-w-full flex-wrap items-center gap-2">+ <div className="flex min-w-0 max-w-full flex-wrap items-center gap-1"><ModelSelectormodels={models}loraModels={loraModels}@@ -468,39 +380,13 @@ export function ApiModelLoadControls({refreshLocalModels();}}deleteDisabled={modelLoading}- variant="outline"- size="sm"- placeholder="Load model"+ variant="ghost"+ placeholder="Load models"open={selectorOpen && !unloading}onOpenChange={setSelectorOpen}- className="h-9 max-w-full rounded-full bg-background px-3.5 sm:max-w-[calc(28rem*var(--ui-space-scale,1))] dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))] dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))] [&>span:last-child]:ml-1"- // Not leading-none: the truncated label would crop descenders.- triggerLabelClassName={cn(- "text-sm leading-5",- !activeModel && "font-sans",- )}+ className="ml-1.5 max-w-[62vw] !pl-2.5 !pr-1.5 md:max-w-none !h-[var(--studio-chat-control-height,34px)]"contentClassName="max-sm:max-w-[calc(100vw-3rem)]"/>- <ToolbarTooltip label={reloadTitle(lastLoadLabel, Boolean(activeModel))}>- <Button- type="button"- variant="outline"- size="icon"- aria-label={reloading ? "Reloading" : "Reload"}- onClick={() => {- handleReload();- }}- disabled={reloadDisabled}- className="rounded-full"- >- <HugeiconsIcon- icon={ReloadIcon}- strokeWidth={1.75}- className={cn("size-4", reloading && "animate-spin")}- />- </Button>- </ToolbarTooltip>- {children}{actionError ? (<spanrole="alert"diff --git a/studio/frontend/src/features/api-monitor/components/saved-model-settings.tsx b/studio/frontend/src/features/api-monitor/components/saved-model-settings.tsxindex 73cf1a8260b..d7799647d68 100644--- a/studio/frontend/src/features/api-monitor/components/saved-model-settings.tsx+++ b/studio/frontend/src/features/api-monitor/components/saved-model-settings.tsx@@ -14,7 +14,8 @@ import {putModelOverride,} from "@/features/model-picker/api/model-overrides";import { deletePerModelConfigsForOverrideKeys } from "@/features/model-picker/model-config/per-model-config";-import { Trash2 } from "lucide-react";+import { Delete02Icon } from "@hugeicons/core-free-icons";+import { HugeiconsIcon } from "@hugeicons/react";import {type ReactElement,useCallback,@@ -254,7 +255,7 @@ export function SavedModelSettingsPanel(): ReactElement {<Buttonvariant="ghost"size="icon-sm"- className="shrink-0 text-muted-foreground hover:text-destructive"+ className="shrink-0 text-destructive hover:text-destructive"aria-label={`Forget settings for ${modelId}`}title="Forget these settings"disabled={forgetting.has(modelId)}@@ -263,7 +264,7 @@ export function SavedModelSettingsPanel(): ReactElement {{forgetting.has(modelId) ? (<Spinner label="Forgetting" />) : (- <Trash2 />+ <HugeiconsIcon icon={Delete02Icon} strokeWidth={1.75} />)}</Button></li>diff --git a/studio/frontend/src/features/api-monitor/use-api-model-reload.ts b/studio/frontend/src/features/api-monitor/use-api-model-reload.tsnew file mode 100644index 00000000000..bce2a444cfe--- /dev/null+++ b/studio/frontend/src/features/api-monitor/use-api-model-reload.ts@@ -0,0 +1,256 @@+// 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 {+ readLastLocalModelLoad,+ type useChatModelRuntime,+ useChatRuntimeStore,+} from "@/features/chat";+import { isPrecisionFolderName } from "@/features/hub/lib/dataset-size";+import {+ isNativeFileLabel,+ isStandaloneGgufPath,+} from "@/features/hub/lib/model-identity";+import { isNpuModelId } from "@/features/npu";+import {+ currentRuntimePerModelConfig,+ resolveResidentInitialConfig,+} from "@/features/model-picker";+import { useCallback, useEffect, useState } from "react";+import {+ type LastLoadRecord,+ RELOAD_MISSING_HISTORY_MESSAGE,+ reloadLastModel,+} from "./reload-last-model";+import {+ type ResidentRunTarget,+ residentHasRunSettings,+} from "./slots-settings-request";+import { monitorSelection } from "./use-resident-run-target";++type Runtime = ReturnType<typeof useChatModelRuntime>;++export type ReloadableModel = {+ name: string;+ checkpoint: string;+ quant: string | null;+ active: boolean;+ isMlx?: boolean;+};++function errorMessage(err: unknown, fallback: string): string | null {+ const runtime = useChatRuntimeStore.getState();+ // A load that another pick replaced is not a failure to report.+ if (runtime.modelLoading || runtime.loadingModelPick) {+ return null;+ }+ return err instanceof Error ? err.message : fallback;+}++type ReloadSelection = LastLoadRecord & {+ loadId?: string;+ nativePathToken?: string;+ nativePathExpiresAtMs?: number | null;+};++/** A file-picked GGUF is served under a display label; only the resident's file grant can load it. */+function grantedTarget(resident: ResidentRunTarget): ReloadSelection {+ return {+ id: resident.checkpoint,+ kind: resident.isGguf ? "gguf" : "model",+ ggufVariant: resident.ggufVariant,+ loadId: resident.loadId ?? undefined,+ nativePathToken: resident.nativePathToken ?? undefined,+ nativePathExpiresAtMs: resident.nativePathExpiresAtMs,+ };+}++function servedTarget(model: ReloadableModel): LastLoadRecord {+ if (isStandaloneGgufPath(model.checkpoint)) {+ return { id: model.checkpoint, kind: "gguf", ggufVariant: null };+ }+ // The checkpoint, not a kept slot's public alias; only the synthetic primary row's is its label.+ const { id, ggufVariant } = monitorSelection(model.name);+ const variant = model.quant ?? ggufVariant;+ const target = model.checkpoint === model.name ? id : model.checkpoint;+ // MLX reports its precision folder as the quant but loads as a model. Status says MLX only for the+ // primary; a kept row's folder is told by name, and names both formats use (bf16) by a GGUF repo.+ const mlxFolder =+ model.isMlx ||+ (variant != null && isPrecisionFolderName(variant) && !/gguf/i.test(target));+ return {+ id: target,+ kind: variant != null && !mlxFolder ? "gguf" : "model",+ ggufVariant: variant,+ };+}++export function useApiModelReload({+ selectModel,+ loadNpuModel,+ readModelLoadEpochs,+ fileGrant,+ onSettled,+ residencyKey,+}: {+ selectModel: Runtime["selectModel"];+ loadNpuModel: Runtime["loadNpuModel"];+ readModelLoadEpochs: Runtime["readModelLoadEpochs"];+ fileGrant: ResidentRunTarget | null;+ onSettled: () => void;+ residencyKey: string;+}) {+ // undefined while the record is read; null when there is none.+ const [lastLoadLabel, setLastLoadLabel] = useState<string | null | undefined>(+ undefined,+ );+ const [reloadingKey, setReloadingKey] = useState<string | null>(null);+ const [error, setError] = useState<string | null>(null);++ const refreshLastLoad = useCallback(() => {+ readLastLocalModelLoad()+ .then((last) =>+ setLastLoadLabel(+ last+ ? last.kind === "gguf" && last.ggufVariant+ ? `${last.id} · ${last.ggufVariant}`+ : last.id+ : null,+ ),+ )+ .catch(() => setLastLoadLabel(null));+ }, []);++ // biome-ignore lint/correctness/useExhaustiveDependencies: residencyKey is the trigger, not an input+ useEffect(() => {+ refreshLastLoad();+ }, [refreshLastLoad, residencyKey]);++ const load = useCallback(+ async (target: ReloadSelection) => {+ const resolved = resolveResidentInitialConfig(+ target.id,+ target.ggufVariant,+ );+ const config = resolved.remembered ? resolved.config : null;+ // As the picker does: /validate cannot resolve an NPU id, so these skip selectModel.+ if (isNpuModelId(target.id)) {+ await loadNpuModel(target.id, {+ forceReload: true,+ config: config ?? undefined,+ });+ return;+ }+ await selectModel({+ id: target.id,+ isGguf: target.kind === "gguf",+ ggufVariant: target.ggufVariant ?? undefined,+ loadId: target.loadId,+ nativePathToken: target.nativePathToken,+ nativePathExpiresAtMs: target.nativePathExpiresAtMs,+ config: config ?? undefined,+ keepSpeculative: config != null,+ forceReload: true,+ isDownloaded: true,+ previousConfig: currentRuntimePerModelConfig({+ includeMaxSeqLength: true,+ }),+ throwOnError: true,+ });+ },+ [selectModel, loadNpuModel],+ );++ const run = useCallback(+ async (key: string, work: () => Promise<void>) => {+ setReloadingKey(key);+ setError(null);+ try {+ await work();+ refreshLastLoad();+ onSettled();+ } catch (err: unknown) {+ setError(errorMessage(err, "Failed to reload model"));+ } finally {+ setReloadingKey(null);+ }+ },+ [onSettled, refreshLastLoad],+ );++ const rowTarget = useCallback(+ (model: ReloadableModel): ReloadSelection =>+ model.active && fileGrant+ ? grantedTarget(fileGrant)+ : servedTarget(model),+ [fileGrant],+ );++ // A file-picked GGUF is listed by its bare file name; without a live grant nothing here can load it.+ const canReload = useCallback(+ (model: ReloadableModel): boolean =>+ model.active && fileGrant+ ? residentHasRunSettings(fileGrant)+ : !isNativeFileLabel(model.checkpoint),+ [fileGrant],+ );++ const reloadServed = useCallback(+ (model: ReloadableModel) =>+ run(model.checkpoint, () => load(rowTarget(model))),+ [run, load, rowTarget],+ );++ // Kept models first and the primary last, so the primary is still the most recent load.+ const reloadAll = useCallback(+ (models: ReloadableModel[]) =>+ run("*", async () => {+ if (models.length === 0) {+ await reloadLastModel({+ readLastLoad: () => readLastLocalModelLoad(),+ resolveConfig: (id, variant) => {+ const resolved = resolveResidentInitialConfig(id, variant);+ return resolved.remembered ? { config: resolved.config } : null;+ },+ loadTarget: load,+ });+ return;+ }+ for (const model of models+ .filter(canReload)+ .sort((a, b) => Number(a.active) - Number(b.active))) {+ const before = readModelLoadEpochs();+ await load(rowTarget(model));+ // selectModel returns quietly on a Stop, a declined prompt or a newer pick; each load takes one intent.+ const after = readModelLoadEpochs();+ if (+ after.cancels !== before.cancels ||+ after.intent > before.intent + 1+ ) {+ return;+ }+ }+ }),+ [run, load, readModelLoadEpochs, rowTarget, canReload],+ );++ const reloadAllTitle = (served: ReloadableModel[]): string => {+ if (served.length > 1) return `Reload all ${served.length} models`;+ if (served.length === 1) return `Reload ${served[0].name}`;+ if (lastLoadLabel === undefined)+ return "Checking previously loaded model...";+ if (!lastLoadLabel) return RELOAD_MISSING_HISTORY_MESSAGE;+ return `Reload ${lastLoadLabel} (no model loaded)`;+ };++ return {+ lastLoadLabel,+ refreshLastLoad,+ reloadingKey,+ error,+ reloadServed,+ reloadAll,+ canReload,+ reloadAllTitle,+ };+}diff --git a/studio/frontend/src/features/api-monitor/use-resident-run-target.ts b/studio/frontend/src/features/api-monitor/use-resident-run-target.tsindex d7c2cd60a35..90fd2a0dd7a 100644--- a/studio/frontend/src/features/api-monitor/use-resident-run-target.ts+++ b/studio/frontend/src/features/api-monitor/use-resident-run-target.ts@@ -29,6 +29,50 @@ export function monitorSelection(activeModel: string | null | undefined): {: { id: activeModel, ggufVariant: null };}+/** The resident's file-picker grant, expired or not, while it is the model the monitor reports. */+export function useResidentFileGrant(+ activeModel: string | null | undefined,+): ResidentRunTarget | null {+ const { checkpoint, isGguf } = useActiveModelConfig();+ const ggufVariant = useChatRuntimeStore((s) => s.activeGgufVariant);+ const isDiffusion = useChatRuntimeStore((s) => s.loadedIsDiffusion);+ const loadId = useChatRuntimeStore((s) => s.activeLoadId);+ const nativePathToken = useChatRuntimeStore((s) => s.activeNativePathToken);+ const nativePathExpiresAtMs = useChatRuntimeStore(+ (s) => s.activeNativePathExpiresAtMs,+ );+ return useMemo(() => {+ const { id } = monitorSelection(activeModel);+ if (+ !nativePathToken ||+ !id ||+ checkpoint == null ||+ publicModelId(checkpoint) !== id+ ) {+ return null;+ }+ return {+ checkpoint,+ ggufVariant,+ isGguf,+ isLora: false,+ isDiffusion,+ loadId,+ nativePathToken,+ nativePathExpiresAtMs,+ };+ }, [+ activeModel,+ checkpoint,+ isGguf,+ ggufVariant,+ isDiffusion,+ loadId,+ nativePathToken,+ nativePathExpiresAtMs,+ ]);+}+/** The resident as Chat's runtime holds it, or null when that is not the model the monitor reports. */export function useResidentRunTarget(activeModel: string | null | undefined,diff --git a/studio/frontend/src/features/audio/components/audio-source-input.tsx b/studio/frontend/src/features/audio/components/audio-source-input.tsxindex 0ee50d91a0f..ec0f47fb352 100644--- a/studio/frontend/src/features/audio/components/audio-source-input.tsx+++ b/studio/frontend/src/features/audio/components/audio-source-input.tsx@@ -13,11 +13,11 @@ import { cn } from "@/lib/utils";import {Alert02Icon,Cancel01Icon,- Mic01Icon,PlusSignIcon,StopIcon,} from "@hugeicons/core-free-icons";import { AiSpeechIcon } from "@/lib/hugeicons-derived";+import { MicIcon } from "@/lib/mic-icon";import { HugeiconsIcon } from "@hugeicons/react";import {type ReactNode,@@ -455,10 +455,11 @@ export function AudioSourceInput({: void source.startRecording()}>- <HugeiconsIcon- icon={recording ? StopIcon : Mic01Icon}- className="size-4"- />+ {recording ? (+ <HugeiconsIcon icon={StopIcon} className="size-4" />+ ) : (+ <MicIcon className="size-4" />+ )}{recording ? "Stop" : "Record"}</Button><outputdiff --git a/studio/frontend/src/features/browser/browser-panel.tsx b/studio/frontend/src/features/browser/browser-panel.tsxindex 567eb21198e..91045b9f9d8 100644--- a/studio/frontend/src/features/browser/browser-panel.tsx+++ b/studio/frontend/src/features/browser/browser-panel.tsx@@ -92,11 +92,11 @@ import {ViewIcon,VolumeMute02Icon,} from "@hugeicons/core-free-icons";+import { ReloadIcon } from "@/lib/reload-icon";import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";import {ArrowLeft,ArrowRight,- RotateCw,ShieldCheck,XIcon,} from "lucide-react";@@ -1487,7 +1487,7 @@ function WebToolbar({ tab, visible }: { tab: BrowserTab | undefined; visible: bo}}className={NAV_BUTTON}>- <RotateCw strokeWidth={NAV_STROKE} className={cn(NAV_ICON, "scale-[0.94]")} />+ <HugeiconsIcon icon={ReloadIcon} strokeWidth={NAV_STROKE} className={NAV_ICON} /></IconButton></div><AddressBar@@ -1602,7 +1602,7 @@ function BrowserFileToolbar({onClick={runAgain}className={NAV_BUTTON}>- <RotateCw strokeWidth={NAV_STROKE} className={cn(NAV_ICON, "scale-[0.94]")} />+ <HugeiconsIcon icon={ReloadIcon} strokeWidth={NAV_STROKE} className={NAV_ICON} /></IconButton></div><AddressBardiff --git a/studio/frontend/src/features/browser/tab-menu.tsx b/studio/frontend/src/features/browser/tab-menu.tsxindex ad18fb7fdba..4011a3373cd 100644--- a/studio/frontend/src/features/browser/tab-menu.tsx+++ b/studio/frontend/src/features/browser/tab-menu.tsx@@ -37,10 +37,10 @@ import {PencilEdit02Icon,PinIcon,PinOffIcon,- Refresh01Icon,VolumeHighIcon,VolumeMute02Icon,} from "@hugeicons/core-free-icons";+import { ReloadIcon } from "@/lib/reload-icon";import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";import { useNavigate } from "@tanstack/react-router";import { type ComponentType, Fragment, type ReactNode } from "react";@@ -223,7 +223,7 @@ export function TabMenuItems({</Row>) : null,tab && kind !== "newtab" ? (- <Row key="reload" P={P} icon={Refresh01Icon} onSelect={() => reloadTab(tab)}>+ <Row key="reload" P={P} icon={ReloadIcon} onSelect={() => reloadTab(tab)}>{t("browser.reload")}</Row>) : null,diff --git a/studio/frontend/src/features/chat/components/context-usage-bar.tsx b/studio/frontend/src/features/chat/components/context-usage-bar.tsxindex 7ff28a72224..59c8ba03e7a 100644--- a/studio/frontend/src/features/chat/components/context-usage-bar.tsx+++ b/studio/frontend/src/features/chat/components/context-usage-bar.tsx@@ -6,7 +6,7 @@ import {TooltipTrigger,} from "@/components/ui/tooltip";import { cn } from "@/lib/utils";-import type { CSSProperties, FC } from "react";+import { type CSSProperties, type FC, useEffect, useRef, useState } from "react";import {type ContextUsageBarInput,deriveContextUsageBar,@@ -100,9 +100,54 @@ const Face: FC<{ face: string }> = ({ face }) => {);};+// A mouse click pins it open (the shared Tooltip pins only on touch) until an outside press or Escape.+function useClickPin(enabled: boolean) {+ const [hovered, setHovered] = useState(false);+ const [pinned, setPinned] = useState(false);+ const triggerRef = useRef<HTMLButtonElement>(null);+ useEffect(() => {+ if (!pinned) return;+ const release = (event: Event) => {+ const target = event.target as Element | null;+ if (triggerRef.current?.contains(target) || target?.closest?.('[data-slot="tooltip-content"]')) {+ return;+ }+ setPinned(false);+ };+ const releaseOnEscape = (event: KeyboardEvent) => {+ if (event.key === "Escape") setPinned(false);+ };+ document.addEventListener("pointerdown", release, true);+ document.addEventListener("keydown", releaseOnEscape, true);+ return () => {+ document.removeEventListener("pointerdown", release, true);+ document.removeEventListener("keydown", releaseOnEscape, true);+ };+ }, [pinned]);+ if (!enabled) return null;+ return {+ root: { open: hovered || pinned, onOpenChange: setHovered },+ trigger: {+ ref: triggerRef,+ onClick: () => setPinned((was) => !was),+ "aria-expanded": pinned,+ },+ };+}+export const ContextUsageBar: FC<- ContextUsageBarInput & { className?: string; compactUnknownAsIcon?: boolean }-> = ({ className, compactUnknownAsIcon = false, ...input }) => {+ ContextUsageBarInput & {+ className?: string;+ compactUnknownAsIcon?: boolean;+ pinOnClick?: boolean;+ /** Replaces the hover surface's shape and colour (the API page's pill). */+ hoverClassName?: string;+ /** Side padding of the face, in --spacing units; the widths below count it. */+ padX?: number;+ ringFirst?: boolean;+ }+> = ({ className, compactUnknownAsIcon = false, pinOnClick = false, hoverClassName, padX = 2.5, ringFirst = false, ...input }) => {+ const pin = useClickPin(pinOnClick);const state = deriveContextUsageBar(input);if (!state) return null;@@ -118,14 +163,15 @@ export const ContextUsageBar: FC<const showRing = state.compactFace === null;// Mono text, so widths are exact in ch. Full: padding, face, and the gap and ring. Compact: an icon button.const fullWidth = showRing- ? `calc(${faceWidthCh(face)}ch + var(--icon-size) + 7 * var(--spacing))`- : `calc(${faceWidthCh(face)}ch + 5 * var(--spacing))`;+ ? `calc(${faceWidthCh(face)}ch + var(--icon-size) + ${2 * padX + 2} * var(--spacing))`+ : `calc(${faceWidthCh(face)}ch + ${2 * padX} * var(--spacing))`;const compactWidth =- compactFace === null ? "calc(30px * var(--ui-space-scale, 1))" : `calc(${faceWidthCh(compactFace)}ch + 5 * var(--spacing))`;- const hover = "rounded-[10px] transition-colors group-hover:bg-chat-icon-bg-hover";+ compactFace === null ? "calc(30px * var(--ui-space-scale, 1))" : `calc(${faceWidthCh(compactFace)}ch + ${2 * padX} * var(--spacing))`;+ const padStyle = { paddingInline: `calc(${padX} * var(--spacing))` };+ const hover = hoverClassName ?? "rounded-[10px] transition-colors group-hover:bg-chat-icon-bg-hover";return (- <Tooltip>+ <Tooltip {...pin?.root}>{/* The header squeezes this wrapper; the button inside takes only the face it shows. */}<divstyle={@@ -141,6 +187,7 @@ export const ContextUsageBar: FC<<TooltipTrigger asChild><buttontype="button"+ {...pin?.trigger}aria-label={state.label}// The full face where it fits, else the compact one, right-aligned against the icons.style={{@@ -163,16 +210,17 @@ export const ContextUsageBar: FC<<UsageRing percent={percent} stroke={severity.stroke} /></span>) : (- <span className={cn("flex h-full shrink-0 items-center px-2.5", hover)}><Face face={compactFace} /></span>+ <span className={cn("flex h-full shrink-0 items-center", hover)} style={padStyle}><Face face={compactFace} /></span>)}</span><spanclassName="col-start-1 row-start-1 h-full overflow-hidden"style={{ width: "clamp(0px, (100% - var(--full) + 1px) * 999, var(--full))" }}>- <span className={cn("flex h-full w-(--full) items-center gap-2 px-2.5", hover)}>+ <span className={cn("flex h-full w-(--full) items-center gap-2", hover)} style={padStyle}>+ {showRing && ringFirst ? <UsageRing percent={percent} stroke={severity.stroke} /> : null}<Face face={face} />- {showRing ? <UsageRing percent={percent} stroke={severity.stroke} /> : null}+ {showRing && !ringFirst ? <UsageRing percent={percent} stroke={severity.stroke} /> : null}</span></span></button>@@ -181,10 +229,10 @@ export const ContextUsageBar: FC<<TooltipContentside="bottom"sideOffset={8}- variant="rich"- className="[&_span>svg]:hidden!"+ variant="none"+ className="dropdown-surface rounded-lg bg-popover px-4 py-3 font-sans text-popover-foreground shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] [&_span>svg]:hidden!">- <div className="grid min-w-44 gap-1.5 text-xs">+ <div className="grid min-w-48 gap-2 text-sm">{percent !== null ? (<div className="flex items-center justify-between gap-4"><span className="text-muted-foreground">diff --git a/studio/frontend/src/features/chat/components/openai-code-exec-section.tsx b/studio/frontend/src/features/chat/components/openai-code-exec-section.tsxindex a9ec697a2fd..b131e78edfc 100644--- a/studio/frontend/src/features/chat/components/openai-code-exec-section.tsx+++ b/studio/frontend/src/features/chat/components/openai-code-exec-section.tsx@@ -24,7 +24,9 @@ import {} from "@/components/ui/alert-dialog";import { Button } from "@/components/ui/button";import { Input } from "@/components/ui/input";-import { TrashIcon, PlusIcon } from "lucide-react";+import { Delete02Icon } from "@hugeicons/core-free-icons";+import { HugeiconsIcon } from "@hugeicons/react";+import { PlusIcon } from "lucide-react";import {createOpenAIContainer,deleteOpenAIContainer,@@ -536,7 +538,7 @@ export function OpenAICodeExecSection({}}aria-label={`Delete container ${c.name ?? c.id}`}>- <TrashIcon className="size-3.5" />+ <HugeiconsIcon icon={Delete02Icon} strokeWidth={1.75} className="size-3.5" /></Button></li>);diff --git a/studio/frontend/src/features/chat/components/research-activity-panel.tsx b/studio/frontend/src/features/chat/components/research-activity-panel.tsxindex 158ddc9c177..ef8bc526277 100644--- a/studio/frontend/src/features/chat/components/research-activity-panel.tsx+++ b/studio/frontend/src/features/chat/components/research-activity-panel.tsx@@ -33,6 +33,7 @@ import { RefreshGlyph } from "@/lib/refresh-icon";import { FileGlyph } from "@/lib/file-icon";import {DashedLineCircleIcon as CircleDashedIcon,+ Delete02Icon,Telescope02Icon,} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";@@ -43,7 +44,6 @@ import {ExternalLink,Pencil,Plus,- Trash2,X,} from "lucide-react";import {@@ -676,7 +676,7 @@ function PlanReview({ runId }: { runId: string }): ReactElement | null {}}aria-label={`Remove step ${index + 1}`}>- <Trash2 />+ <HugeiconsIcon icon={Delete02Icon} strokeWidth={1.75} /></Button></div><Textareadiff --git a/studio/frontend/src/features/chat/hooks/use-chat-model-runtime.ts b/studio/frontend/src/features/chat/hooks/use-chat-model-runtime.tsindex 454aacedb8b..c4fe1f5564c 100644--- a/studio/frontend/src/features/chat/hooks/use-chat-model-runtime.ts+++ b/studio/frontend/src/features/chat/hooks/use-chat-model-runtime.ts@@ -253,6 +253,8 @@ type ActiveModelLoadRun = {/** The selection the user last asked for, so an await can tell it was superseded. */let modelSelectionIntentEpoch = 0;+/** Bumped when a load ends without loading; selectModel itself resolves quietly then. */+let modelLoadCancelEpoch = 0;let pendingExternalReplacement:| { intentId: number; config?: PerModelConfig }| null = null;@@ -1099,6 +1101,7 @@ export function useChatModelRuntime() {if (run.cancelPromise) return run.cancelPromise;const model = loadingModelRef.current;+ modelLoadCancelEpoch += 1;run.abortController.abort();loadAbortRef.current = null;loadingModelRef.current = null;@@ -1302,6 +1305,11 @@ export function useChatModelRuntime() {[],);+ const readModelLoadEpochs = useCallback(+ () => ({ intent: modelSelectionIntentEpoch, cancels: modelLoadCancelEpoch }),+ [],+ );+const selectModel = useCallback(async (selection: string | SelectedModelInput) => {const modelId = typeof selection === "string" ? selection : selection.id;@@ -1398,6 +1406,7 @@ export function useChatModelRuntime() {if (mayReachHub) {const preparedToken = await prepareHfTokenForUse(hfToken);if (!preparedToken.proceed) {+ modelLoadCancelEpoch += 1;if (modelSelectionIntentEpoch === loadIntentId) {toast.error("Model load cancelled.");// This pick invalidated the previous run before opening credentials. If that run@@ -1904,9 +1913,10 @@ export function useChatModelRuntime() {let keepsOthers =keepModelsLoaded && !forceReload && (paramsNow.engine ?? "auto") === "auto";let switchingNote = keepsOthers ? "Keeping the loaded models." : "Switching models.";- // Reloading one of several touches only its own slot, so only its chats stop.+ // Reloading one of several touches only its own slot, so only its chats stop. The target, not+ // the selected model: the API page reloads any served row.const touchesOnlySelected =- forceReload && !isExternalModelId(paramsNow.checkpoint) && loadedNow.length > 1;+ forceReload && !isExternalModelId(modelId) && loadedNow.length > 1;try {stopDecision = keepsOthers? {@@ -1918,13 +1928,14 @@ export function useChatModelRuntime() {: await confirmStopRunningChatsIfNeeded(forceReload ? "Applying these settings" : "Loading a different model","reload",- touchesOnlySelected ? (paramsNow.checkpoint ?? undefined) : undefined,+ touchesOnlySelected ? modelId : undefined,);} catch (error) {releasePreflightLifecycleLease();throw error;}if (!stopDecision.proceed) {+ modelLoadCancelEpoch += 1;releasePreflightLifecycleLease();// The inherited target, not this pick's own previousConfig: when this pick superseded a// load that had already pre-applied its settings, that field holds the superseded target's@@ -2591,6 +2602,7 @@ export function useChatModelRuntime() {);if (abortCtrl.signal.aborted) throw new Error("Cancelled");if (!stopDecision.proceed) {+ modelLoadCancelEpoch += 1;// Declined before anything was unloaded: exit as a cancellation, not a failed load.if (modelSelectionIntentEpoch === loadIntentId &&@@ -4198,6 +4210,7 @@ export function useChatModelRuntime() {discardExternalReplacement,restoreConfigForExternalReplacement,isModelSelectionIntentCurrent,+ readModelLoadEpochs,loadingModel,loadProgress,loadToastDismissed,diff --git a/studio/frontend/src/features/chat/projects-page.tsx b/studio/frontend/src/features/chat/projects-page.tsxindex 9e85b517dc9..bacae4643b1 100644--- a/studio/frontend/src/features/chat/projects-page.tsx+++ b/studio/frontend/src/features/chat/projects-page.tsx@@ -615,7 +615,7 @@ export function ProjectsPage() {}}}placeholder="Search projects"- className="h-9 w-full rounded-full border-none bg-muted pl-10 pr-4 shadow-none dark:bg-card"+ className="h-control w-full rounded-full border-none bg-muted pl-10 pr-4 shadow-none dark:bg-card"aria-label="Search projects"/></div>@@ -626,7 +626,7 @@ export function ProjectsPage() {size="icon"data-tour="projects-io"title="Import / Export projects"- className="rounded-full border-none bg-muted shadow-none dark:bg-card"+ className="size-control rounded-full border-none bg-muted shadow-none dark:bg-card"><HugeiconsIcon icon={Download01Icon} strokeWidth={1.75} className="size-icon" /></Button>diff --git a/studio/frontend/src/features/chat/prompt-storage/prompt-storage-dialog.tsx b/studio/frontend/src/features/chat/prompt-storage/prompt-storage-dialog.tsxindex e0d3fc2e4ba..885b35ae8f1 100644--- a/studio/frontend/src/features/chat/prompt-storage/prompt-storage-dialog.tsx+++ b/studio/frontend/src/features/chat/prompt-storage/prompt-storage-dialog.tsx@@ -23,7 +23,11 @@ import {import { downloadFile, isDownloadCancelled } from "@/lib/native-files";import { cn } from "@/lib/utils";-import { Download01Icon, Search01Icon } from "@hugeicons/core-free-icons";+import {+ Delete02Icon,+ Download01Icon,+ Search01Icon,+} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import {BookmarkIcon,@@ -33,7 +37,6 @@ import {PlayIcon,PlusIcon,RotateCcwIcon,- Trash2Icon,UploadIcon,XIcon,} from "lucide-react";@@ -1759,7 +1762,7 @@ function PromptDetail({className="flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-muted-foreground"title="Delete">- <Trash2Icon className="size-4" />+ <HugeiconsIcon icon={Delete02Icon} strokeWidth={1.75} className="size-4" /></button><div className="flex-1" />{dirty && (@@ -2103,7 +2106,7 @@ function PromptListDetail({className="flex h-8 w-8 items-center justify-center rounded-full text-muted-foreground hover:bg-destructive/10 hover:text-destructive transition-colors disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-transparent disabled:hover:text-muted-foreground"title="Delete">- <Trash2Icon className="size-4" />+ <HugeiconsIcon icon={Delete02Icon} strokeWidth={1.75} className="size-4" /></button><div className="flex-1" />{dirty && (diff --git a/studio/frontend/src/features/chat/shared-composer.tsx b/studio/frontend/src/features/chat/shared-composer.tsxindex 2c409a75aff..56b4b1f3666 100644--- a/studio/frontend/src/features/chat/shared-composer.tsx+++ b/studio/frontend/src/features/chat/shared-composer.tsx@@ -37,6 +37,7 @@ import { InternetGlyph } from "@/lib/internet-icon";import { MicIcon } from "@/lib/mic-icon";import { MenuTickIcon, Tick02Icon } from "@/lib/tick-icon";import { BrowserAgentMenuItem, BrowserAgentPill } from "@/features/browser/agent/lazy-composer-toggle";+import { markComposerScrollEdges } from "@/lib/composer-scroll-fade";import { cn } from "@/lib/utils";import {DropdownMenu,@@ -3230,6 +3231,12 @@ export function SharedComposer({event.currentTarget.value.length,);}}+ onScroll={(event) =>+ markComposerScrollEdges(event.currentTarget)+ }+ onInputCapture={(event) =>+ markComposerScrollEdges(event.currentTarget)+ }onCompositionStart={() => {imeSessionOpenRef.current = true;setCompositionState(true);@@ -3538,7 +3545,7 @@ export function SharedComposer({: "Stop dictation"}>- <SquareIcon className="size-3 animate-pulse fill-current" />+ <SquareIcon className="composer-glyph-snap size-3.5 animate-pulse fill-current" /></TooltipIconButton>)}</>@@ -3570,7 +3577,7 @@ export function SharedComposer({aria-label="Stop generating"onClick={stop}>- <SquareIcon className="size-3 fill-current" />+ <SquareIcon className="composer-glyph-snap size-3.5 fill-current" /></Button>) : (<TooltipIconButtondiff --git a/studio/frontend/src/features/generation-presets/media-generation-preset-control.tsx b/studio/frontend/src/features/generation-presets/media-generation-preset-control.tsxindex b52ade8abc7..82d7a61957c 100644--- a/studio/frontend/src/features/generation-presets/media-generation-preset-control.tsx+++ b/studio/frontend/src/features/generation-presets/media-generation-preset-control.tsx@@ -10,13 +10,13 @@ import {} from "@/components/ui/popover";import { ChevronDownStandardIcon } from "@/lib/chevron-icons";import { cn } from "@/lib/utils";+import { Delete02Icon } from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";import {Bookmark,Check,ClipboardPaste,ImageUp,- Trash2,} from "lucide-react";import { Fragment, useState } from "react";import { DEFAULT_PRESET_NAME } from "./preset-policy";@@ -262,7 +262,7 @@ export function MediaGenerationPresetControl({onClick={() => remove().catch(() => undefined)}className="mt-3 flex h-8 w-full items-center justify-center gap-1.5 rounded-full text-xs text-muted-foreground transition-colors hover:bg-destructive/10 hover:text-destructive focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50">- <Trash2 className="size-3.5" />+ <HugeiconsIcon icon={Delete02Icon} strokeWidth={1.75} className="size-3.5" />Delete preset</button>) : null}diff --git a/studio/frontend/src/features/hub/catalog/on-device-folders-dialog.tsx b/studio/frontend/src/features/hub/catalog/on-device-folders-dialog.tsxindex a5df9c486da..3372039691b 100644--- a/studio/frontend/src/features/hub/catalog/on-device-folders-dialog.tsx+++ b/studio/frontend/src/features/hub/catalog/on-device-folders-dialog.tsx@@ -333,7 +333,7 @@ export function OnDeviceFoldersDialog({(downloadCacheLoaded ? "Unavailable" : "Loading...")}title={downloadCache?.cacheHome}- className="field-soft h-9 min-w-0 flex-1 rounded-full px-3 font-mono text-ui-12"+ className="field-soft h-control min-w-0 flex-1 rounded-full px-3 font-mono text-ui-12"/><div className="flex shrink-0 items-center gap-2"><Button@@ -342,7 +342,6 @@ export function OnDeviceFoldersDialog({size="sm"onClick={() => void changeDownloadLocation()}disabled={!downloadCache?.editable || downloadSaving}- className="h-9 rounded-full px-3 text-ui-12p5">{downloadSaving ? (<Spinner className="size-3.5" />@@ -493,7 +492,7 @@ export function OnDeviceFoldersDialog({placeholder="Paste a folder path"spellCheck={false}autoComplete="off"- className="field-soft h-9 min-w-0 flex-1 rounded-full px-3 font-mono text-ui-12 placeholder:font-sans"+ className="field-soft h-control min-w-0 flex-1 rounded-full px-3 font-mono text-ui-12 placeholder:font-sans"/><div className="flex shrink-0 items-center gap-2"><Button@@ -502,7 +501,6 @@ export function OnDeviceFoldersDialog({size="sm"onClick={() => void browseLocations()}disabled={pending !== null}- className="h-9 rounded-full px-3 text-ui-12p5"><HugeiconsIconicon={FolderSearchIcon}@@ -516,7 +514,6 @@ export function OnDeviceFoldersDialog({type="submit"size="sm"disabled={!path.trim() || pending !== null}- className="h-9 rounded-full px-3 text-ui-12p5">{pending === "add" ? (<Spinner className="size-3.5" />diff --git a/studio/frontend/src/features/hub/hub.css b/studio/frontend/src/features/hub/hub.cssindex b68329eb67a..51ebe7492a6 100644--- a/studio/frontend/src/features/hub/hub.css+++ b/studio/frontend/src/features/hub/hub.css@@ -1308,16 +1308,17 @@white-space: nowrap;border-radius: 9999px;background-color: var(--status-success);- padding: calc(0.5rem * var(--ui-space-scale, 1)) calc(0.75rem * var(--ui-space-scale, 1));+ /* The play glyph's empty right side reads as padding on the left, so the right gets more. */+ padding: calc(0.5rem * var(--ui-space-scale, 1)) calc(0.9375rem * var(--ui-space-scale, 1))+ calc(0.5rem * var(--ui-space-scale, 1)) calc(0.75rem * var(--ui-space-scale, 1));font-size: calc(0.8125rem * var(--ui-font-scale, 1));font-weight: 600;line-height: calc(1.125rem * var(--ui-font-scale, 1));letter-spacing: -0.025em;- color: var(--status-success-foreground);+ color: #fff;transition: background-color 150ms, transform 150ms;box-shadow:- inset 0 1px 0- color-mix(in srgb, var(--status-success-foreground) 18%, transparent),+ inset 0 1px 0 rgb(255 255 255 / 0.18),0 1px 2px color-mix(in srgb, var(--status-success) 22%, transparent);}diff --git a/studio/frontend/src/features/hub/lib/dataset-size.ts b/studio/frontend/src/features/hub/lib/dataset-size.tsindex 76bdbff7e36..8469e91c9f4 100644--- a/studio/frontend/src/features/hub/lib/dataset-size.ts+++ b/studio/frontend/src/features/hub/lib/dataset-size.ts@@ -332,6 +332,10 @@ const PRECISION_FOLDER_SOURCE ="(?:mlx[-_]?)?(?:[0-9]{1,2}[-_]?bits?(?:[-_][a-z0-9]+)*|bf16|fp16|f16|fp32|f32|fp8|mxfp4|nvfp4)";const PRECISION_FOLDER_RE = new RegExp(`^(?:${PRECISION_FOLDER_SOURCE})$`, "i");+export function isPrecisionFolderName(name: string): boolean {+ return PRECISION_FOLDER_RE.test(name);+}+function precisionVariantFolders(names: string[]): Set<string> {const files = new Map<string, string[]>();for (const name of names) {diff --git a/studio/frontend/src/features/images/images-page.tsx b/studio/frontend/src/features/images/images-page.tsxindex 1511d546906..e07ac1a609f 100644--- a/studio/frontend/src/features/images/images-page.tsx+++ b/studio/frontend/src/features/images/images-page.tsx@@ -35,6 +35,7 @@ import {Refresh01Icon,SparklesIcon,} from "@hugeicons/core-free-icons";+import { ReloadIcon } from "@/lib/reload-icon";import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";import { History as HistoryIcon, Shuffle } from "lucide-react";import { MessageCircleIcon, TestTubeOutlineIcon } from "@/lib/hugeicons-derived";@@ -7367,7 +7368,7 @@ export function ImagesPage({disabled={busy !== null}onClick={handleReapply}>- <HugeiconsIcon icon={Refresh01Icon} className="mr-2 size-4" />+ <HugeiconsIcon icon={ReloadIcon} className="mr-2 size-4" />Reapply</Button></TooltipTrigger>diff --git a/studio/frontend/src/features/rag/components/thread-documents-bar.tsx b/studio/frontend/src/features/rag/components/thread-documents-bar.tsxindex ae93304699c..7b9d35db485 100644--- a/studio/frontend/src/features/rag/components/thread-documents-bar.tsx+++ b/studio/frontend/src/features/rag/components/thread-documents-bar.tsx@@ -330,7 +330,7 @@ function LinkedFolderCard({<ProjectBadge /><divtitle={title}- className={cn("flex overflow-hidden rounded-lg", CARD_SIZE, CARD_EDGE)}+ className={cn("flex overflow-hidden rounded-[14px]", CARD_SIZE, CARD_EDGE)}><FileCardBodyname={label}@@ -540,7 +540,7 @@ function DocumentCard({onClick={onRemove}aria-label={`Remove ${doc.filename}`}className={cn(- "absolute flex size-5 items-center justify-center rounded-full bg-foreground text-background opacity-0 shadow-sm transition-opacity focus-visible:opacity-100 group-hover/attachment-card:opacity-100 group-focus-within/attachment-card:opacity-100 [@media(pointer:coarse)]:opacity-100",+ "absolute flex size-5 items-center justify-center rounded-full bg-white text-black opacity-0 shadow-sm ring-1 ring-black/15 dark:bg-black dark:text-white dark:ring-white/20 transition-opacity focus-visible:opacity-100 group-hover/attachment-card:opacity-100 group-focus-within/attachment-card:opacity-100 [@media(pointer:coarse)]:opacity-100",compact ? "top-1/2 right-1.5 -translate-y-1/2" : "top-1.5 right-1.5",)}>@@ -619,7 +619,7 @@ function DocumentCard({<button{...buttonProps}className={cn(- "flex overflow-hidden rounded-lg text-left transition-colors disabled:cursor-default",+ "flex overflow-hidden rounded-[14px] text-left transition-colors disabled:cursor-default",CARD_SIZE,CARD_EDGE,canOpen && CARD_SURFACE,@@ -678,7 +678,7 @@ function AddFilesCard({disabled={disabled}onClick={onClick}className={cn(- "unsloth-files-add-card flex flex-col items-center justify-center gap-1.5 rounded-lg border border-dashed border-[color-mix(in_oklab,var(--foreground)_calc(20%*var(--contrast-edge-gain,1)),transparent)] text-ui-12 text-muted-foreground transition-colors hover:border-[color-mix(in_oklab,var(--foreground)_calc(35%*var(--contrast-edge-gain,1)),transparent)] hover:text-foreground",+ "unsloth-files-add-card flex flex-col items-center justify-center gap-1.5 rounded-[14px] border border-dashed border-[color-mix(in_oklab,var(--foreground)_calc(20%*var(--contrast-edge-gain,1)),transparent)] text-ui-12 text-muted-foreground transition-colors hover:border-[color-mix(in_oklab,var(--foreground)_calc(35%*var(--contrast-edge-gain,1)),transparent)] hover:text-foreground",CARD_SIZE,)}>diff --git a/studio/frontend/src/features/scheduled-tasks/tasks-page.tsx b/studio/frontend/src/features/scheduled-tasks/tasks-page.tsxindex e3ab536049b..c08338af4f2 100644--- a/studio/frontend/src/features/scheduled-tasks/tasks-page.tsx+++ b/studio/frontend/src/features/scheduled-tasks/tasks-page.tsx@@ -433,7 +433,7 @@ export function TasksPage() {onChange={(event) => setQuery(event.target.value)}placeholder={t("scheduledTasks.search")}aria-label={t("scheduledTasks.search")}- className="h-9 w-full rounded-full border-none bg-muted pl-10 pr-4 shadow-none dark:bg-card"+ className="h-control w-full rounded-full border-none bg-muted pl-10 pr-4 shadow-none dark:bg-card"/></div><Button onClick={() => setEditing(null)}>diff --git a/studio/frontend/src/features/settings/components/api-key-row.tsx b/studio/frontend/src/features/settings/components/api-key-row.tsxindex e87e547a653..bc8218f9c44 100644--- a/studio/frontend/src/features/settings/components/api-key-row.tsx+++ b/studio/frontend/src/features/settings/components/api-key-row.tsx@@ -15,6 +15,7 @@ import { cn } from "@/lib/utils";import {Copy01Icon,Delete02Icon,+ Refresh01Icon,MoreHorizontalIcon,} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";@@ -65,12 +66,42 @@ export function expiresText(return formatRelativeTime(locale, Math.ceil(diff / 86400000), "day");}+export const TOKEN_TABLE =+ "grid grid-cols-[minmax(0,1fr)_auto_auto_auto_auto_auto] gap-x-6 max-sm:grid-cols-[minmax(0,1fr)_auto_auto_auto] max-sm:gap-x-4";+const TOKEN_ROW = "col-span-full grid grid-cols-subgrid items-center px-3";+const TOKEN_CELL =+ "whitespace-nowrap text-ui-12 text-muted-foreground first-letter:uppercase";++export function ApiKeyTableHeader() {+ const t = useT();+ return (+ <div+ className={cn(+ TOKEN_ROW,+ "pt-3 pb-1.5 text-ui-11 font-medium text-muted-foreground",+ )}+ aria-hidden="true"+ >+ <span className="pl-4.5">{t("settings.apiKeys.columnName")}</span>+ <span className="max-sm:hidden">{t("settings.apiKeys.columnToken")}</span>+ <span className="max-sm:hidden">+ {t("settings.apiKeys.columnCreated")}+ </span>+ <span>{t("settings.apiKeys.columnLastUsed")}</span>+ <span>{t("settings.apiKeys.columnExpires")}</span>+ <span className="w-7 max-sm:w-9" />+ </div>+ );+}+export function ApiKeyRow({apiKey,onRevoke,+ onRegenerate,}: {apiKey: ApiKey;onRevoke: (key: ApiKey) => void;+ onRegenerate: (key: ApiKey) => void;}) {const t = useT();const locale = useLocale();@@ -78,48 +109,41 @@ export function ApiKeyRow({const prefix = `sk-unsloth-${apiKey.key_prefix}`;const expired = isExpired(apiKey.expires_at);return (- <div className="group flex items-center gap-3 border-b border-border/60 px-1 py-3 last:border-b-0 transition-colors hover:bg-accent/40">- <span- className={cn(- "size-1.5 shrink-0 rounded-full",- expired ? "bg-muted-foreground/40" : "bg-emerald-500",- )}- aria-hidden="true"- />- <div className="flex min-w-0 flex-1 flex-col gap-0.5">- <div className="flex min-w-0 items-center justify-between gap-3">- <span- className="truncate text-sm font-medium text-foreground"- title={apiKey.name}- >- {apiKey.name}- </span>- <code className="shrink-0 font-mono text-ui-11 text-muted-foreground">- {prefix}…- </code>- </div>- <div className="flex flex-wrap gap-x-1.5 text-ui-11 text-muted-foreground">- <span>- {t("settings.apiKeys.created", {- value: relative(apiKey.created_at, t, locale),- })}- </span>- <span>·</span>- <span>- {t("settings.apiKeys.used", {- value: relative(apiKey.last_used_at, t, locale),- })}- </span>- <span>·</span>- <span>- {expired- ? t("settings.apiKeys.expiredStatus")- : t("settings.apiKeys.expires", {- value: expiresText(apiKey.expires_at, t, locale),- })}- </span>- </div>+ <div+ className={cn(+ TOKEN_ROW,+ "group rounded-lg py-2.5 transition-colors hover:bg-muted dark:hover:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))]",+ )}+ >+ <div className="flex min-w-0 items-center gap-3">+ <span+ className={cn(+ "size-1.5 shrink-0 rounded-full",+ expired ? "bg-muted-foreground/40" : "bg-emerald-500",+ )}+ aria-hidden="true"+ />+ <span+ className="truncate text-sm font-medium text-foreground"+ title={apiKey.name}+ >+ {apiKey.name}+ </span></div>+ <code className="font-mono text-ui-11 text-muted-foreground max-sm:hidden">+ {prefix}…+ </code>+ <span className={cn(TOKEN_CELL, "max-sm:hidden")}>+ {relative(apiKey.created_at, t, locale)}+ </span>+ <span className={TOKEN_CELL}>+ {relative(apiKey.last_used_at, t, locale)}+ </span>+ <span className={cn(TOKEN_CELL, expired && "text-destructive")}>+ {expired+ ? t("settings.apiKeys.expiredStatus")+ : expiresText(apiKey.expires_at, t, locale)}+ </span><DropdownMenu><DropdownMenuTrigger asChild={true}><Button@@ -144,6 +168,10 @@ export function ApiKeyRow({<HugeiconsIcon icon={Copy01Icon} className="size-3.5 mr-2" />{t("settings.apiKeys.copyPrefix")}</DropdownMenuItem>+ <DropdownMenuItem onClick={() => onRegenerate(apiKey)}>+ <HugeiconsIcon icon={Refresh01Icon} className="size-3.5 mr-2" />+ {t("settings.apiKeys.regenerateToken")}+ </DropdownMenuItem><DropdownMenuItemonClick={() => onRevoke(apiKey)}className="text-destructive focus:text-destructive"diff --git a/studio/frontend/src/features/settings/components/color-theme-select.tsx b/studio/frontend/src/features/settings/components/color-theme-select.tsxindex c0f828c0824..94a6f5e88fc 100644--- a/studio/frontend/src/features/settings/components/color-theme-select.tsx+++ b/studio/frontend/src/features/settings/components/color-theme-select.tsx@@ -83,7 +83,7 @@ export function ColorThemeSelect() {<buttontype="button"aria-label={t("settings.appearance.palette.label")}- className="flex h-9 w-52 cursor-pointer items-center gap-2 rounded-full border border-border bg-background pl-1.5 pr-3 text-sm outline-none transition-colors hover:bg-accent/50 focus-visible:border-ring data-[state=open]:bg-accent/50 dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))] dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))] dark:focus-visible:border-transparent dark:focus-visible:bg-[rgb(255_255_255_/_calc(0.12*var(--contrast-wash-gain,1)))] dark:data-[state=open]:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]"+ className="flex h-control w-52 cursor-pointer items-center gap-2 rounded-full border border-border bg-background pl-1.5 pr-3 text-sm outline-none transition-colors hover:bg-accent/50 focus-visible:border-ring data-[state=open]:bg-accent/50 dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))] dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))] dark:focus-visible:border-transparent dark:focus-visible:bg-[rgb(255_255_255_/_calc(0.12*var(--contrast-wash-gain,1)))] dark:data-[state=open]:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))]"><ThemeChip colors={COLOR_THEMES[palette][resolved]} /><span className="min-w-0 flex-1 truncate text-left">diff --git a/studio/frontend/src/features/settings/components/create-key-form.tsx b/studio/frontend/src/features/settings/components/create-key-form.tsxindex 3757283f86b..16b7ee55250 100644--- a/studio/frontend/src/features/settings/components/create-key-form.tsx+++ b/studio/frontend/src/features/settings/components/create-key-form.tsx@@ -4,6 +4,11 @@import { SegmentedPill } from "@/components/segmented-control";import { Button } from "@/components/ui/button";import { Input } from "@/components/ui/input";+import {+ Tooltip,+ TooltipContent,+ TooltipTrigger,+} from "@/components/ui/tooltip";import { useT } from "@/i18n";import { cn } from "@/lib/utils";import { PlusSignIcon } from "@hugeicons/core-free-icons";@@ -19,27 +24,51 @@ const EXPIRY_PRESETS = [{ label: "90d", value: 90 },];+export function nextDefaultTokenNumber(+ names: readonly string[],+ pattern: RegExp,+): number {+ let highest = 0;+ for (const existing of names) {+ const match = pattern.exec(existing.trim());+ if (match) highest = Math.max(highest, Number(match[1]));+ }+ return highest + 1;+}+export function CreateKeyForm({onCreated,onError,+ existingNames,}: {onCreated: (rawKey: string) => void;/** null clears an earlier failure */onError: (message: string | null) => void;+ existingNames: readonly string[];}) {const t = useT();const pillId = useId();const [name, setName] = useState("");const [expiry, setExpiry] = useState<number | null>(null);const [loading, setLoading] = useState(false);+ const [prefix, suffix] = t("settings.apiKeys.defaultTokenName").split("{n}");+ const escape = (text = "") => text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");+ const defaultName = t("settings.apiKeys.defaultTokenName", {+ n: String(+ nextDefaultTokenNumber(+ existingNames,+ new RegExp(`^${escape(prefix)}(\\d+)${escape(suffix)}$`),+ ),+ ),+ });const handleSubmit = async (e: React.FormEvent) => {e.preventDefault();- if (!name.trim() || loading) return;+ if (loading) return;setLoading(true);onError(null);try {- const result = await createApiKey(name.trim(), expiry);+ const result = await createApiKey(name.trim() || defaultName, expiry);onCreated(result.key);setName("");} catch (cause) {@@ -56,37 +85,58 @@ export function CreateKeyForm({value={name}onChange={(e) => setName(e.target.value)}placeholder={t("settings.apiKeys.tokenNamePlaceholder")}- className="h-9 min-w-[calc(200px*var(--ui-space-scale,1))] flex-1 text-sm"+ className="h-control min-w-[calc(200px*var(--ui-space-scale,1))] flex-1 text-sm"aria-label={t("settings.apiKeys.newAccessTokenName")}/>- <div className="hub-tab-toggle inline-flex h-8 items-center rounded-full">+ <div className="hub-tab-toggle inline-flex h-control items-center rounded-full">{EXPIRY_PRESETS.map((p) => {const active = expiry === p.value;return (- <button- key={p.label}- type="button"- onClick={() => setExpiry(p.value)}- aria-pressed={active}- className={cn(- "relative inline-flex h-8 items-center rounded-full px-3.5 text-ui-12 font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",- active- ? "text-foreground"- : "text-muted-foreground hover:text-foreground",- )}- >- {active && <SegmentedPill group={`${pillId}-expiry`} />}- {p.value === null ? t("settings.apiKeys.never") : p.label}- </button>+ <Tooltip key={p.label}>+ <TooltipTrigger asChild={true}>+ <button+ type="button"+ onClick={() => setExpiry(p.value)}+ aria-pressed={active}+ className={cn(+ "relative inline-flex h-control items-center rounded-full px-3.5 text-ui-12 font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",+ active+ ? "text-foreground"+ : "text-muted-foreground hover:text-foreground",+ )}+ >+ {active && <SegmentedPill group={`${pillId}-expiry`} />}+ {p.value === null ? t("settings.apiKeys.never") : p.label}+ </button>+ </TooltipTrigger>+ <TooltipContent side="bottom" sideOffset={6}>+ {p.value === null+ ? t("settings.apiKeys.neverExpiresHint")+ : t("settings.apiKeys.expiresInDaysHint", {+ n: String(p.value),+ })}+ </TooltipContent>+ </Tooltip>);})}</div>- <Button variant="secondary" type="submit" size="sm" disabled={loading || !name.trim()}>- {!loading && <HugeiconsIcon icon={PlusSignIcon} data-icon="inline-start" />}- {loading- ? t("settings.apiKeys.creating")- : t("settings.apiKeys.createToken")}- </Button>+ <Tooltip>+ <TooltipTrigger asChild={true}>+ <Button type="submit" variant="dark" size="sm" disabled={loading}>+ {!loading && (+ <HugeiconsIcon icon={PlusSignIcon} data-icon="inline-start" />+ )}+ {loading+ ? t("settings.apiKeys.creating")+ : t("settings.apiKeys.createToken")}+ </Button>+ </TooltipTrigger>+ <TooltipContent side="bottom" sideOffset={6}>+ {t("settings.apiKeys.createTokenHint", {+ name: name.trim() || defaultName,+ })}+ </TooltipContent>+ </Tooltip></div></form>);diff --git a/studio/frontend/src/features/settings/components/decision-api-section.tsx b/studio/frontend/src/features/settings/components/decision-api-section.tsxindex cdc39c7c984..c7afff9accb 100644--- a/studio/frontend/src/features/settings/components/decision-api-section.tsx+++ b/studio/frontend/src/features/settings/components/decision-api-section.tsx@@ -349,7 +349,7 @@ export function DecisionApiSection(): ReactElement | null {const header = (<><div className="flex items-start gap-3 bg-muted/30 p-4">- <div className="flex size-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/40">+ <div className="flex size-8 shrink-0 items-center justify-center icon-disc"><HugeiconsIconicon={TaskDone01Icon}className="size-4 text-foreground"diff --git a/studio/frontend/src/features/settings/components/desktop-repair-control.tsx b/studio/frontend/src/features/settings/components/desktop-repair-control.tsxindex b6812ee3918..755d1c1e66e 100644--- a/studio/frontend/src/features/settings/components/desktop-repair-control.tsx+++ b/studio/frontend/src/features/settings/components/desktop-repair-control.tsx@@ -45,7 +45,6 @@ export function DesktopRepairControl(): ReactElement | null {return (<><SettingsRow- destructive={true}label={t("settings.general.repairInstall.label")}description={t("settings.general.repairInstall.description")}>diff --git a/studio/frontend/src/features/settings/components/embedding-model-picker.tsx b/studio/frontend/src/features/settings/components/embedding-model-picker.tsxindex b3287a70ee6..604ef16cb11 100644--- a/studio/frontend/src/features/settings/components/embedding-model-picker.tsx+++ b/studio/frontend/src/features/settings/components/embedding-model-picker.tsx@@ -171,7 +171,7 @@ export function EmbeddingModelPicker({data-testid="embedding-model-trigger"aria-label={t("settings.general.rag.embeddingModel")}disabled={disabled || busy}- className={`group/trigger border-border bg-background hover:bg-accent/50 dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))] dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))] focus-visible:border-ring flex h-8 w-full cursor-pointer items-center justify-between gap-1.5 rounded-full border pr-3.5 font-mono text-ui-11 outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${onEject ? "pl-2.5" : "pl-3.5"} ${className ?? ""}`}+ className={`group/trigger border-border bg-background hover:bg-accent/50 dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))] dark:hover:bg-[rgb(255_255_255_/_calc(0.1*var(--contrast-wash-gain,1)))] focus-visible:border-ring flex h-control w-full cursor-pointer items-center justify-between gap-1.5 rounded-full border pr-3.5 font-mono text-ui-11 outline-none transition-colors disabled:cursor-not-allowed disabled:opacity-60 ${onEject ? "pl-2.5" : "pl-3.5"} ${className ?? ""}`}>{onEject ? (// As on the chat model picker: tick at rest, eject on hover. Keyboard and screen readerdiff --git a/studio/frontend/src/features/settings/components/first-token-timeout-row.tsx b/studio/frontend/src/features/settings/components/first-token-timeout-row.tsxindex 3d264dac98f..f2e37e2a60e 100644--- a/studio/frontend/src/features/settings/components/first-token-timeout-row.tsx+++ b/studio/frontend/src/features/settings/components/first-token-timeout-row.tsx@@ -98,7 +98,7 @@ export function FirstTokenTimeoutRow() {><SelectTriggeraria-label={t("settings.chat.firstTokenLabel")}- className="w-40"+ className="w-40 data-[size=default]:h-control"><SelectValue /></SelectTrigger>diff --git a/studio/frontend/src/features/settings/components/hub-settings-section.tsx b/studio/frontend/src/features/settings/components/hub-settings-section.tsxindex e7c2b79bdaa..39f697483bb 100644--- a/studio/frontend/src/features/settings/components/hub-settings-section.tsx+++ b/studio/frontend/src/features/settings/components/hub-settings-section.tsx@@ -191,7 +191,7 @@ export function HubSettingsSection() {saveEndpoint();}}}- className="h-8 w-60"+ className="h-control w-60"/><Buttonvariant="outline"diff --git a/studio/frontend/src/features/settings/components/key-reveal-card.tsx b/studio/frontend/src/features/settings/components/key-reveal-card.tsxindex 20461b54f55..c630d5553a4 100644--- a/studio/frontend/src/features/settings/components/key-reveal-card.tsx+++ b/studio/frontend/src/features/settings/components/key-reveal-card.tsx@@ -44,23 +44,17 @@ export function KeyRevealCard({};return (- <div className="flex flex-col gap-2 rounded-lg border border-emerald-500/30 bg-emerald-500/5 p-3">+ <div className="flex min-w-0 flex-col gap-3 rounded-xl border border-border/60 bg-muted/20 p-4 dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))]"><div className="flex items-center gap-1.5"><HugeiconsIconicon={Tick02Icon}className="size-3.5 text-emerald-600 dark:text-emerald-500"/>- <span className="text-xs font-medium text-emerald-700 dark:text-emerald-500">+ <span className="text-sm font-medium text-foreground">{t("settings.apiKeys.newTokenCreated")}</span></div>- <div- className={cn(- "flex w-full items-center gap-3 rounded-full border border-border bg-muted/40 px-3 py-2.5 font-mono text-sm transition-colors",- "has-[input:focus-visible]:ring-1 has-[input:focus-visible]:ring-ring",- copied && "border-emerald-500/40 bg-emerald-500/10",- )}- >+ <div className="flex h-control w-full items-center gap-3 rounded-full border border-border bg-background pr-2 pl-4 font-mono text-sm dark:border-transparent dark:bg-[rgb(255_255_255_/_calc(0.06*var(--contrast-wash-gain,1)))]"><inputref={inputRef}type="text"@@ -77,8 +71,9 @@ export function KeyRevealCard({size="icon-xs"onClick={handleCopy}className={cn(- "-my-1 shrink-0",- copied && "text-emerald-600 hover:text-emerald-600",+ "shrink-0",+ copied &&+ "text-emerald-600 hover:text-emerald-600 dark:text-emerald-500",)}aria-label={copied@@ -92,12 +87,13 @@ export function KeyRevealCard({/></Button></div>- <div className="flex items-center justify-between gap-3 pt-0.5">+ <div className="flex items-center justify-between gap-3"><p className="text-ui-11 text-muted-foreground">{t("settings.apiKeys.copyNow")}</p><Buttontype="button"+ variant="dark"size="sm"onClick={onDone}className="focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"diff --git a/studio/frontend/src/features/settings/components/keyless-api-access-section.tsx b/studio/frontend/src/features/settings/components/keyless-api-access-section.tsxindex c93628ceea4..416c7b43329 100644--- a/studio/frontend/src/features/settings/components/keyless-api-access-section.tsx+++ b/studio/frontend/src/features/settings/components/keyless-api-access-section.tsx@@ -189,7 +189,7 @@ export function KeylessApiAccessSection({><div className="flex items-center justify-between gap-4 bg-muted/30 p-4"><div className="flex min-w-0 items-start gap-3">- <div className="flex size-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/40">+ <div className="flex size-8 shrink-0 items-center justify-center icon-disc"><HugeiconsIconicon={LaptopIcon}className="size-4 text-foreground"diff --git a/studio/frontend/src/features/settings/components/lan-access-section.tsx b/studio/frontend/src/features/settings/components/lan-access-section.tsxindex 31b4f6c04df..0f3835220cc 100644--- a/studio/frontend/src/features/settings/components/lan-access-section.tsx+++ b/studio/frontend/src/features/settings/components/lan-access-section.tsx@@ -406,7 +406,7 @@ export function LanAccessSection() {><div className="flex items-center justify-between gap-4 bg-muted/30 p-4"><div className="flex min-w-0 items-start gap-3">- <div className="flex size-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/40">+ <div className="flex size-8 shrink-0 items-center justify-center icon-disc"><HugeiconsIconicon={Wifi01Icon}className="size-4 text-foreground"@@ -475,8 +475,7 @@ export function LanAccessSection() {}}><SelectTrigger- size="sm"- className="w-32"+ className="w-32 data-[size=default]:h-control"aria-label="LAN port mode"><SelectValue />@@ -496,7 +495,7 @@ export function LanAccessSection() {aria-label="Custom LAN port"aria-invalid={portInvalid}aria-describedby={portErrorVisible ? portErrorId : undefined}- className="h-8 w-24"+ className="h-control w-24"onChange={(event) => {setPortDraft(event.target.value);setPortError(null);@@ -553,8 +552,7 @@ export function LanAccessSection() {}}><SelectTrigger- size="sm"- className="w-32"+ className="w-32 data-[size=default]:h-control"aria-label="LAN address mode"><SelectValue />diff --git a/studio/frontend/src/features/settings/components/llama-backend-section.tsx b/studio/frontend/src/features/settings/components/llama-backend-section.tsxindex e7feb36e71c..bfb4c0c1ff9 100644--- a/studio/frontend/src/features/settings/components/llama-backend-section.tsx+++ b/studio/frontend/src/features/settings/components/llama-backend-section.tsx@@ -161,7 +161,7 @@ function LlamaCppPathRow({ onChanged }: { onChanged: () => void }) {}}}title={settings?.resolvedBinary ?? settings?.path ?? undefined}- className="h-8 min-w-0 font-mono text-xs"+ className="h-control min-w-0 font-mono text-xs"data-testid="llama-cpp-path-input"/><Button@@ -281,8 +281,7 @@ export function LlamaBackendSection() {><SelectTriggeraria-label={t("settings.resources.llamaBackend.label")}- className="w-52"- size="sm"+ className="w-52 data-[size=default]:h-control"data-testid="llama-backend-select"><SelectValue />diff --git a/studio/frontend/src/features/settings/components/mcp-access-section.tsx b/studio/frontend/src/features/settings/components/mcp-access-section.tsxindex 6d12a926c88..566c86eca70 100644--- a/studio/frontend/src/features/settings/components/mcp-access-section.tsx+++ b/studio/frontend/src/features/settings/components/mcp-access-section.tsx@@ -148,7 +148,7 @@ export function McpAccessSection({className="overflow-hidden rounded-xl border border-border/70"><div className="flex items-start gap-3 bg-muted/30 p-4">- <div className="flex size-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/40">+ <div className="flex size-8 shrink-0 items-center justify-center icon-disc"><HugeiconsIconicon={McpServerIcon}className="size-4 text-foreground"diff --git a/studio/frontend/src/features/settings/components/model-auto-switch-section.tsx b/studio/frontend/src/features/settings/components/model-auto-switch-section.tsxindex 26eafba8fa3..deb9ce04548 100644--- a/studio/frontend/src/features/settings/components/model-auto-switch-section.tsx+++ b/studio/frontend/src/features/settings/components/model-auto-switch-section.tsx@@ -84,7 +84,7 @@ export function MediaIdleUnloadRow({)}disabled={disabled}onChange={(event) => onDraftChange(event.target.value)}- className="h-8 w-24"+ className="h-control w-24"/><span className="text-xs font-medium text-muted-foreground">s</span></div>@@ -346,7 +346,7 @@ export function ModelAutoSwitchSection() {)}disabled={!settings?.enabled || isSaving}onChange={(event) => setDraftIdleSeconds(event.target.value)}- className="h-8 w-24"+ className="h-control w-24"/><span className="text-xs font-medium text-muted-foreground">s</span></div>diff --git a/studio/frontend/src/features/settings/components/model-memory-section.tsx b/studio/frontend/src/features/settings/components/model-memory-section.tsxindex d15b17dd0fa..ed5dbe65601 100644--- a/studio/frontend/src/features/settings/components/model-memory-section.tsx+++ b/studio/frontend/src/features/settings/components/model-memory-section.tsx@@ -8,12 +8,15 @@ import {SelectTrigger,SelectValue,} from "@/components/ui/select";+import { Button } from "@/components/ui/button";import { Switch } from "@/components/ui/switch";import {resyncInferenceStatusAfterKeptModelsUnload,useChatRuntimeStore,} from "@/features/chat";import { formatBytes } from "@/features/hub/lib/format";+import { ChevronRightStandardIcon } from "@/lib/chevron-icons";+import { HugeiconsIcon } from "@hugeicons/react";import { usePersistedToggle } from "@/hooks/use-persisted-toggle";import { useT } from "@/i18n";import { ALLOW_OVERSIZED_LOAD_STORAGE_KEY } from "@/lib/unified-memory-load-refusal";@@ -31,6 +34,7 @@ import {loadMultiModelMode,updateMultiModelMode,} from "../api/multi-model";+import { useSettingsDialogStore } from "../stores/settings-dialog-store";import { MediaIdleUnloadSetting } from "./model-auto-switch-section";import { SettingsRow } from "./settings-row";import { SettingsSection } from "./settings-section";@@ -81,7 +85,12 @@ const MULTI_MODEL_DESCRIPTION = {always: "settings.resources.modelMemory.multiModelDescriptionAlways",} as const;-export function ModelMemorySection({ ref }: { ref?: Ref<HTMLElement> }) {+// `api`: the API tab's copy, only the rows that decide which models a server can answer for.+export function ModelMemorySection({+ ref,+ variant = "full",+}: { ref?: Ref<HTMLElement>; variant?: "full" | "api" }) {+ const full = variant === "full";const t = useT();const [settings, setSettings] = useState<ModelMemorySettings | null>(null);const [error, setError] = useState<string | null>(null);@@ -207,7 +216,27 @@ export function ModelMemorySection({ ref }: { ref?: Ref<HTMLElement> }) {: null;return (- <SettingsSection title={t("settings.resources.modelMemory.title")} ref={ref}>+ <SettingsSection+ title={t("settings.resources.modelMemory.title")}+ ref={ref}+ action={+ full ? undefined : (+ <Button+ size="sm"+ variant="ghost"+ className="text-muted-foreground"+ onClick={() =>+ useSettingsDialogStore+ .getState()+ .openDialog("resources", { scrollTarget: "resources-model-memory" })+ }+ >+ {t("settings.resources.modelMemory.openSystemSettings")}+ <HugeiconsIcon icon={ChevronRightStandardIcon} className="size-3.5" />+ </Button>+ )+ }+ ><SettingsRowlabel={t("settings.resources.modelMemory.keepResident")}description={t(@@ -222,20 +251,22 @@ export function ModelMemorySection({ ref }: { ref?: Ref<HTMLElement> }) {onCheckedChange={(keepResident) => void persist({ keepResident })}/></SettingsRow>- <SettingsRow- label={t("settings.resources.modelMemory.noRamReserve")}- description={t(- "settings.resources.modelMemory.noRamReserveDescription",- )}- hint={t("settings.resources.modelMemory.noRamReserveHint")}- >- <Switch- aria-label={t("settings.resources.modelMemory.noRamReserve")}- checked={settings?.noRamReserve ?? false}- disabled={!settings || isSaving}- onCheckedChange={(noRamReserve) => void persist({ noRamReserve })}- />- </SettingsRow>+ {full ? (+ <SettingsRow+ label={t("settings.resources.modelMemory.noRamReserve")}+ description={t(+ "settings.resources.modelMemory.noRamReserveDescription",+ )}+ hint={t("settings.resources.modelMemory.noRamReserveHint")}+ >+ <Switch+ aria-label={t("settings.resources.modelMemory.noRamReserve")}+ checked={settings?.noRamReserve ?? false}+ disabled={!settings || isSaving}+ onCheckedChange={(noRamReserve) => void persist({ noRamReserve })}+ />+ </SettingsRow>+ ) : null}<SettingsRowlabel={t("settings.resources.modelMemory.multiModel")}description={t(MULTI_MODEL_DESCRIPTION[mode])}@@ -271,20 +302,22 @@ export function ModelMemorySection({ ref }: { ref?: Ref<HTMLElement> }) {</SelectContent></Select></SettingsRow>- <SettingsRow- label={t("settings.resources.modelMemory.allowOversizedLoad")}- description={t(- "settings.resources.modelMemory.allowOversizedLoadDescription",- )}- hint={t("settings.resources.modelMemory.allowOversizedLoadHint")}- >- <Switch- aria-label={t("settings.resources.modelMemory.allowOversizedLoad")}- checked={allowOversizedLoad}- onCheckedChange={setAllowOversizedLoad}- data-testid="allow-oversized-load-switch"- />- </SettingsRow>+ {full ? (+ <SettingsRow+ label={t("settings.resources.modelMemory.allowOversizedLoad")}+ description={t(+ "settings.resources.modelMemory.allowOversizedLoadDescription",+ )}+ hint={t("settings.resources.modelMemory.allowOversizedLoadHint")}+ >+ <Switch+ aria-label={t("settings.resources.modelMemory.allowOversizedLoad")}+ checked={allowOversizedLoad}+ onCheckedChange={setAllowOversizedLoad}+ data-testid="allow-oversized-load-switch"+ />+ </SettingsRow>+ ) : null}{error ? (<p className="pb-3 text-xs text-destructive">{error}</p>) : (@@ -309,7 +342,9 @@ export function ModelMemorySection({ ref }: { ref?: Ref<HTMLElement> }) {) : null}</>)}- <MediaIdleUnloadSetting residencyKey={settings?.keepResident} />+ {full ? (+ <MediaIdleUnloadSetting residencyKey={settings?.keepResident} />+ ) : null}</SettingsSection>);}diff --git a/studio/frontend/src/features/settings/components/monitor-link.tsx b/studio/frontend/src/features/settings/components/monitor-link.tsxindex 78446fd80ba..d9a4890a318 100644--- a/studio/frontend/src/features/settings/components/monitor-link.tsx+++ b/studio/frontend/src/features/settings/components/monitor-link.tsx@@ -55,7 +55,7 @@ export function MonitorLink(): ReactElement {}}className="flex w-full min-w-0 items-center gap-3 rounded-lg border border-border/70 bg-background px-4 py-3 text-left transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring">- <span className="relative flex size-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/40">+ <span className="relative flex size-8 shrink-0 items-center justify-center icon-disc"><HugeiconsIconicon={ActivityIcon}strokeWidth={1.75}diff --git a/studio/frontend/src/features/settings/components/recent-dictations-view.tsx b/studio/frontend/src/features/settings/components/recent-dictations-view.tsxindex aa612c4d0e2..3b4e1ce7460 100644--- a/studio/frontend/src/features/settings/components/recent-dictations-view.tsx+++ b/studio/frontend/src/features/settings/components/recent-dictations-view.tsx@@ -280,7 +280,7 @@ export function RecentDictationsView({) : (<div className="flex flex-col gap-3"><div className="flex items-center gap-2">- <InputGroup className="h-8 flex-1">+ <InputGroup className="h-control flex-1"><InputGroupAddon align="inline-start"><HugeiconsIconicon={Search01Icon}@@ -301,8 +301,7 @@ export function RecentDictationsView({onValueChange={(value) => setSortOrder(value as SortOrder)}><SelectTrigger- size="sm"- className="w-36 shrink-0"+ className="w-36 shrink-0 data-[size=default]:h-control"aria-label={t("settings.voice.recents.sortLabel")}><SelectValue />diff --git a/studio/frontend/src/features/settings/components/remote-access-section.tsx b/studio/frontend/src/features/settings/components/remote-access-section.tsxindex 1f8315d694f..9c98d0ad7f0 100644--- a/studio/frontend/src/features/settings/components/remote-access-section.tsx+++ b/studio/frontend/src/features/settings/components/remote-access-section.tsx@@ -329,7 +329,7 @@ export function RemoteAccessSection() {><div className="flex items-center justify-between gap-4 bg-muted/30 p-4"><div className="flex min-w-0 items-start gap-3">- <div className="flex size-8 shrink-0 items-center justify-center rounded-md border border-border/70 bg-muted/40">+ <div className="flex size-8 shrink-0 items-center justify-center icon-disc"><HugeiconsIconicon={HomeWifiIcon}className="size-4 text-foreground"diff --git a/studio/frontend/src/features/settings/components/settings-section.tsx b/studio/frontend/src/features/settings/components/settings-section.tsxindex 55ba20cef82..0e69393f00f 100644--- a/studio/frontend/src/features/settings/components/settings-section.tsx+++ b/studio/frontend/src/features/settings/components/settings-section.tsx@@ -3,6 +3,8 @@import type { ReactNode, Ref } from "react";+import { cn } from "@/lib/utils";+export function SettingsSection({title,description,@@ -10,11 +12,14 @@ export function SettingsSection({ref,hideHeading = false,action,+ danger = false,}: {title: string;/** Control shown beside the heading, e.g. Refresh. */action?: ReactNode;hideHeading?: boolean;+ /** Danger zone: a divider above the heading sets it apart from the sections before it. */+ danger?: boolean;description?: ReactNode;children: ReactNode;/** For deep links that scroll a section into view. Optional, so every@@ -22,7 +27,14 @@ export function SettingsSection({ref?: Ref<HTMLElement>;}) {return (- <section ref={ref} data-settings-label={title} className="flex flex-col">+ <section+ ref={ref}+ data-settings-label={title}+ className={cn(+ "flex flex-col",+ danger && "border-t border-border/60 pt-6",+ )}+ >{hideHeading ? null : (<div className="mb-1 flex flex-col gap-0.5">{action ? (diff --git a/studio/frontend/src/features/settings/tabs/about-tab.tsx b/studio/frontend/src/features/settings/tabs/about-tab.tsxindex 21379937235..9c15aff8265 100644--- a/studio/frontend/src/features/settings/tabs/about-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/about-tab.tsx@@ -295,9 +295,8 @@ export function AboutTab() {</SettingsSection>{!isTauri && (- <SettingsSection title={t("settings.about.dangerZone")}>+ <SettingsSection danger={true} title={t("settings.about.dangerZone")}><SettingsRow- destructive={true}label={t("settings.about.shutDownStudio")}description={t("settings.about.shutDownStudioDescription")}>diff --git a/studio/frontend/src/features/settings/tabs/accounts-tab.tsx b/studio/frontend/src/features/settings/tabs/accounts-tab.tsxindex c82c76f83ce..f6a301be166 100644--- a/studio/frontend/src/features/settings/tabs/accounts-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/accounts-tab.tsx@@ -203,7 +203,7 @@ function OwnerAccountsTab() {onChange={(event) => setQuery(event.target.value)}placeholder={t("settings.accounts.search")}aria-label={t("settings.accounts.search")}- className="pl-9"+ className="h-control pl-9"/></div><Buttondiff --git a/studio/frontend/src/features/settings/tabs/api-keys-tab.tsx b/studio/frontend/src/features/settings/tabs/api-keys-tab.tsxindex 7610b956c4d..611469d90e7 100644--- a/studio/frontend/src/features/settings/tabs/api-keys-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/api-keys-tab.tsx@@ -11,16 +11,26 @@ import {DialogTitle,} from "@/components/ui/dialog";import { useIsAccountOwner } from "@/features/auth";+import { cn } from "@/lib/utils";import { translate, useT } from "@/i18n";import { AnimatePresence, motion, useReducedMotion } from "motion/react";import { useCallback, useEffect, useState } from "react";-import { type ApiKey, fetchApiKeys, revokeApiKey } from "../api/api-keys";+import {+ type ApiKey,+ createApiKey,+ fetchApiKeys,+ revokeApiKey,+} from "../api/api-keys";import type {KeylessApiAccessExposure,KeylessApiAccessScope,} from "../api/keyless-api-access";import { apiKeyActionMessage } from "../components/api-key-action-message";-import { ApiKeyRow } from "../components/api-key-row";+import {+ ApiKeyRow,+ ApiKeyTableHeader,+ TOKEN_TABLE,+} from "../components/api-key-row";import { AudioApiExamples } from "../components/audio-api-examples";import { MediaApiExamples } from "../components/media-api-examples";import { CreateKeyForm } from "../components/create-key-form";@@ -30,10 +40,18 @@ import { KeylessApiAccessSection } from "../components/keyless-api-access-sectioimport { McpAccessSection } from "../components/mcp-access-section";import { ModelAliasesSection } from "../components/model-aliases-section";import { ModelAutoSwitchSection } from "../components/model-auto-switch-section";+import { ModelMemorySection } from "../components/model-memory-section";import { MonitorLink } from "../components/monitor-link";import { UsageExamples, useApiTunnelPref } from "../components/usage-examples";import { usePublishAccessUrls } from "../hooks/use-publish-access-urls";+function expiryDays(key: ApiKey): number | null {+ if (!key.expires_at) return null;+ const ms =+ new Date(key.expires_at).getTime() - new Date(key.created_at).getTime();+ return Math.max(1, Math.round(ms / 86400000));+}+export function ApiKeysTab() {const t = useT();const isOwner = useIsAccountOwner();@@ -43,6 +61,7 @@ export function ApiKeysTab() {const [actionError, setActionError] = useState<string | null>(null);const [revokeTarget, setRevokeTarget] = useState<ApiKey | null>(null);const [revoking, setRevoking] = useState(false);+ const [regenerate, setRegenerate] = useState(false);const [revealed, setRevealed] = useState<string | null>(null);const [useTunnel, setUseTunnel] = useApiTunnelPref();// Owner-only routes, as the Remote & LAN tab is.@@ -99,13 +118,29 @@ export function ApiKeysTab() {setRevoking(true);setActionError(null);try {+ if (regenerate) {+ // Created before the old one is revoked, so a failed create loses nothing.+ const created = await createApiKey(+ revokeTarget.name,+ expiryDays(revokeTarget),+ );+ setRevealed(created.key);+ }await revokeApiKey(revokeTarget.id);await load();setRevokeTarget(null);} catch (cause) {setActionError(- apiKeyActionMessage(translate("settings.apiKeys.revokeError"), cause),+ apiKeyActionMessage(+ translate(+ regenerate+ ? "settings.apiKeys.regenerateError"+ : "settings.apiKeys.revokeError",+ ),+ cause,+ ),);+ void load();setRevokeTarget(null);} finally {setRevoking(false);@@ -157,6 +192,7 @@ export function ApiKeysTab() {void load();}}onError={setActionError}+ existingNames={keys.map((k) => k.name)}/></motion.div>)}@@ -190,9 +226,21 @@ export function ApiKeysTab() {</p>) : (<div className="hover-scrollbar flex max-h-72 min-w-0 flex-col overflow-y-auto pr-1 [scrollbar-gutter:stable]">- <div className="overlay-scrollbar-gutter">+ <div className={cn("overlay-scrollbar-gutter", TOKEN_TABLE)}>+ <ApiKeyTableHeader />{keys.map((k) => (- <ApiKeyRow key={k.id} apiKey={k} onRevoke={setRevokeTarget} />+ <ApiKeyRow+ key={k.id}+ apiKey={k}+ onRevoke={(key) => {+ setRegenerate(false);+ setRevokeTarget(key);+ }}+ onRegenerate={(key) => {+ setRegenerate(true);+ setRevokeTarget(key);+ }}+ />))}</div></div>@@ -208,13 +256,21 @@ export function ApiKeysTab() {keylessExposure={keyless.exposure}/>- <MonitorLink />-{/* Installation-wide controls: owner-only routes. */}{isOwner ? (<><KeylessApiAccessSection onSettingsChange={setKeyless} />+ <McpAccessSection apiKey={revealed} />+ </>+ ) : null}++ <MonitorLink />++ {isOwner ? (+ <>+ <ModelMemorySection variant="api" />+<ModelAutoSwitchSection /><ModelAliasesSection />@@ -237,8 +293,6 @@ export function ApiKeysTab() {{isOwner ? <DecisionApiSection /> : null}- {isOwner ? <McpAccessSection apiKey={revealed} /> : null}-<Dialogopen={revokeTarget !== null}onOpenChange={(o) => !o && setRevokeTarget(null)}@@ -246,12 +300,19 @@ export function ApiKeysTab() {<DialogContent className="max-w-md"><DialogHeader><DialogTitle>- {t("settings.apiKeys.revokeTitle", {- name: revokeTarget?.name ?? "",- })}+ {t(+ regenerate+ ? "settings.apiKeys.regenerateTitle"+ : "settings.apiKeys.revokeTitle",+ { name: revokeTarget?.name ?? "" },+ )}</DialogTitle><DialogDescription>- {t("settings.apiKeys.revokeDescription")}+ {t(+ regenerate+ ? "settings.apiKeys.regenerateDescription"+ : "settings.apiKeys.revokeDescription",+ )}</DialogDescription></DialogHeader><DialogFooter>@@ -261,13 +322,19 @@ export function ApiKeysTab() {<ButtononClick={confirmRevoke}disabled={revoking}- variant="destructive"+ variant={regenerate ? "dark" : "destructive"}>- {revoking- ? t("settings.apiKeys.revoking")- : t("settings.apiKeys.revokeAction", {- name: revokeTarget?.name ?? "",- })}+ {regenerate+ ? t(+ revoking+ ? "settings.apiKeys.regenerating"+ : "settings.apiKeys.regenerateAction",+ )+ : revoking+ ? t("settings.apiKeys.revoking")+ : t("settings.apiKeys.revokeAction", {+ name: revokeTarget?.name ?? "",+ })}</Button></DialogFooter></DialogContent>diff --git a/studio/frontend/src/features/settings/tabs/general-tab.tsx b/studio/frontend/src/features/settings/tabs/general-tab.tsxindex e59ac3914da..db4dcd1bc17 100644--- a/studio/frontend/src/features/settings/tabs/general-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/general-tab.tsx@@ -573,7 +573,7 @@ export function GeneralTab() {}}onBlur={commitToken}className={cn(- "h-8 w-full font-mono text-xs",+ "h-control w-full font-mono text-xs",tokenValidated ? "pr-14" : "pr-8",)}/>@@ -761,7 +761,7 @@ export function GeneralTab() {value={draftUploadLimit}aria-label={t("settings.general.uploads.maxUploadSize")}onChange={(event) => setDraftUploadLimit(event.target.value)}- className="h-8 w-24"+ className="h-control w-24"/><span className="text-xs font-medium text-muted-foreground">MB@@ -882,10 +882,10 @@ export function GeneralTab() {) : null}<SettingsSection+ danger={true}title={t("settings.general.resetPreferences.sectionTitle")}><SettingsRow- destructive={true}label={t("settings.general.resetPreferences.label")}description={t("settings.general.resetPreferences.description")}>diff --git a/studio/frontend/src/features/settings/tabs/resources-tab.tsx b/studio/frontend/src/features/settings/tabs/resources-tab.tsxindex b6599056dc5..0d2906d883d 100644--- a/studio/frontend/src/features/settings/tabs/resources-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/resources-tab.tsx@@ -1134,14 +1134,12 @@ export function ResourcesTab() {)}</SettingsSection>- {/* Below the GPU section it describes, above the memory settings that- apply to whichever backend is selected. */}+ <ModelMemorySection ref={modelMemoryRef} />+<LlamaBackendSection /><EngineVersionsSection /><InferenceEnginesSection />- <ModelMemorySection ref={modelMemoryRef} />-<SettingsSectionref={storageSectionRef}title={t("settings.resources.storage.title")}diff --git a/studio/frontend/src/features/settings/tabs/sandbox-tab.tsx b/studio/frontend/src/features/settings/tabs/sandbox-tab.tsxindex 5541713587f..85e25cc67b7 100644--- a/studio/frontend/src/features/settings/tabs/sandbox-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/sandbox-tab.tsx@@ -191,7 +191,7 @@ function MemoryLimitRow({onKeyDown={(event) => {if (event.key === "Enter") submit();}}- className="h-8 w-24"+ className="h-control w-24"/><span className="text-xs font-medium text-muted-foreground">GBdiff --git a/studio/frontend/src/features/video/video-page.tsx b/studio/frontend/src/features/video/video-page.tsxindex 81d6fc3ff83..19794b5cf26 100644--- a/studio/frontend/src/features/video/video-page.tsx+++ b/studio/frontend/src/features/video/video-page.tsx@@ -8,7 +8,6 @@ import {ArrowExpand01Icon,ArrowLeftRightIcon,ArrowUpDownIcon,- Refresh01Icon,Cancel01Icon,Delete02Icon,Download01Icon,@@ -16,6 +15,7 @@ import {ImageCropIcon,InformationCircleIcon,} from "@hugeicons/core-free-icons";+import { ReloadIcon } from "@/lib/reload-icon";import { Volume02Icon } from "@/lib/volume-icons";import { HugeiconsIcon } from "@hugeicons/react";@@ -4635,7 +4635,7 @@ function VideoGenerator({disabled={busy !== null}onClick={handleReapply}>- <HugeiconsIcon icon={Refresh01Icon} className="mr-2 size-4" />+ <HugeiconsIcon icon={ReloadIcon} className="mr-2 size-4" />Reapply</Button></TooltipTrigger>diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.tsindex ed82abb6a57..fbb26f89f41 100644--- a/studio/frontend/src/i18n/locales/ar.ts+++ b/studio/frontend/src/i18n/locales/ar.ts@@ -2435,6 +2435,7 @@ export const ar = {noRamReserveDescription: "يقلل ذاكرة النظام المحجوزة لأوزان النموذج.",noRamReserveHint: "يتخطى التحميل المعتمد على تعيين الذاكرة في إصدارات ويندوز المدعومة عندما يكون النموذج محمّلاً بالكامل على كرت الرسوميات، فلا تبقى صفحاته مقيمة. وإلا يُبقي التحميل المعتمد على تعيين الذاكرة. قد تستهلك مخازن المعالج المطلوبة ذاكرة النظام. ويحذف --no-mmap و--mlock.",multiModel: "إبقاء عدة نماذج محمّلة",+ openSystemSettings: "إعدادات النظام",multiModelOff: "إيقاف",multiModelFit: "عندما تتسع",multiModelAlways: "دائمًا",@@ -3142,13 +3143,22 @@ export const ar = {readDocs: "قراءة وثائق API",noAccess: "لا يوجد وصول إلى API بعد.",accessTokens: "توكنات الوصول",+ columnName: "الاسم",+ columnToken: "التوكن",+ columnCreated: "تاريخ الإنشاء",+ columnLastUsed: "آخر استخدام",+ columnExpires: "ينتهي",loadError: "تعذّر تحميل وصول API.",createError: "تعذّر إنشاء توكن الوصول.",revokeError: "تعذّر إلغاء توكن الوصول.",never: "دون انتهاء",- tokenNamePlaceholder: "اسم التوكن (مثل production)",+ tokenNamePlaceholder: "اسم التوكن",newAccessTokenName: "اسم توكن الوصول الجديد",createToken: "إنشاء توكن",+ neverExpiresHint: "لا ينتهي أبدًا",+ expiresInDaysHint: "ينتهي خلال {n} يومًا",+ createTokenHint: "إنشاء توكن باسم \"{name}\"",+ defaultTokenName: "توكن جديد {n}",creating: "جارٍ الإنشاء...",newTokenCreated: "تم إنشاء توكن وصول جديد",accessTokenCopied: "تم نسخ توكن الوصول",@@ -3182,13 +3192,16 @@ export const ar = {expired: "منتهي الصلاحية",expiredStatus: "منتهي الصلاحية",today: "اليوم",- created: "أُنشئ {value}",- used: "آخر استخدام: {value}",- expires: "الانتهاء: {value}",actionsFor: "إجراءات {name}",copyPrefix: "نسخ البادئة",copyFailed: "تعذّر النسخ",revokeToken: "إلغاء التوكن",+ regenerateToken: "إعادة إنشاء التوكن",+ regenerateTitle: "إعادة إنشاء توكن الوصول \"{name}\"؟",+ regenerateDescription: "سيحل محله توكن جديد بالاسم نفسه ومدة الصلاحية نفسها. تفقد التطبيقات التي تستخدم التوكن الحالي الوصول فورًا.",+ regenerateAction: "إعادة الإنشاء",+ regenerating: "جارٍ إعادة الإنشاء...",+ regenerateError: "تعذّرت إعادة إنشاء توكن الوصول.",revokeTitle: 'إلغاء توكن الوصول "{name}"؟',revokeDescription:"ستفقد التطبيقات التي تستخدم هذا التوكن الوصول فورًا. لا يمكن التراجع عن هذا الإجراء.",diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.tsindex c639da92bac..13d7205e199 100644--- a/studio/frontend/src/i18n/locales/de.ts+++ b/studio/frontend/src/i18n/locales/de.ts@@ -2467,6 +2467,7 @@ export const de = {noRamReserveDescription: "Weniger RAM für die Modellgewichte belegen.",noRamReserveHint: "Überspringt auf unterstützten Windows-Builds das speicherabgebildete Laden, wenn das Modell vollständig auf die GPU ausgelagert ist, sodass dessen Seiten nicht im Speicher gehalten werden. Andernfalls bleibt das speicherabgebildete Laden erhalten. Erforderliche CPU-Puffer können weiterhin RAM belegen. Entfernt --no-mmap und --mlock.",multiModel: "Mehrere Modelle geladen lassen",+ openSystemSettings: "Systemeinstellungen",multiModelOff: "Aus",multiModelFit: "Wenn sie passen",multiModelAlways: "Immer",@@ -3188,13 +3189,22 @@ export const de = {readDocs: "API-Dokumentation lesen",noAccess: "Noch kein API-Zugriff.",accessTokens: "Zugriffstoken",+ columnName: "Name",+ columnToken: "Token",+ columnCreated: "Erstellt",+ columnLastUsed: "Zuletzt verwendet",+ columnExpires: "Läuft ab",loadError: "API-Zugriff konnte nicht geladen werden.",createError: "Zugriffstoken konnte nicht erstellt werden.",revokeError: "Zugriffstoken konnte nicht widerrufen werden.",never: "Nie",- tokenNamePlaceholder: "Token-Name (z. B. production)",+ tokenNamePlaceholder: "Token-Name",newAccessTokenName: "Name des neuen Zugriffstokens",createToken: "Token erstellen",+ neverExpiresHint: "Läuft nie ab",+ expiresInDaysHint: "Läuft in {n} Tagen ab",+ createTokenHint: "Token „{name}“ erstellen",+ defaultTokenName: "Neues Token {n}",creating: "Wird erstellt...",newTokenCreated: "Neues Zugriffstoken erstellt",accessTokenCopied: "Zugriffstoken kopiert",@@ -3229,13 +3239,16 @@ export const de = {expired: "abgelaufen",expiredStatus: "Abgelaufen",today: "heute",- created: "Erstellt {value}",- used: "Verwendet {value}",- expires: "Läuft {value} ab",actionsFor: "Aktionen für {name}",copyPrefix: "Präfix kopieren",copyFailed: "Kopieren fehlgeschlagen",revokeToken: "Token widerrufen",+ regenerateToken: "Token neu erzeugen",+ regenerateTitle: "Zugriffstoken „{name}“ neu erzeugen?",+ regenerateDescription: "Ein neuer Token mit demselben Namen und derselben Laufzeit ersetzt diesen. Apps mit dem aktuellen Token verlieren sofort den Zugriff.",+ regenerateAction: "Neu erzeugen",+ regenerating: "Wird neu erzeugt...",+ regenerateError: "Zugriffstoken konnte nicht neu erzeugt werden.",revokeTitle: "Zugriffstoken „{name}“ widerrufen?",revokeDescription:"Apps, die dieses Token verwenden, verlieren sofort den Zugriff. Dies kann nicht rückgängig gemacht werden.",diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.tsindex cb1edef8966..a4caf868793 100644--- a/studio/frontend/src/i18n/locales/en.ts+++ b/studio/frontend/src/i18n/locales/en.ts@@ -2498,6 +2498,7 @@ export const en = {noRamReserveDescription: "Reduce host RAM held for model weights.",noRamReserveHint: "Skips memory-mapped loading on supported Windows builds when the model is fully offloaded to the GPU, so its pages are not held resident. Otherwise keeps memory-mapped loading. Required CPU buffers can still use RAM. Drops --no-mmap and --mlock.",multiModel: "Keep multiple models loaded",+ openSystemSettings: "System settings",multiModelOff: "Off",multiModelFit: "When they fit",multiModelAlways: "Always",@@ -3198,13 +3199,22 @@ export const en = {readDocs: "Read the API docs",noAccess: "No API access yet.",accessTokens: "Access tokens",+ columnName: "Name",+ columnToken: "Token",+ columnCreated: "Created",+ columnLastUsed: "Last used",+ columnExpires: "Expires",loadError: "Couldn't load API access.",createError: "Couldn't create access token.",revokeError: "Couldn't revoke access token.",never: "Never",- tokenNamePlaceholder: "Token name (e.g. production)",+ tokenNamePlaceholder: "Token name",newAccessTokenName: "New access token name",createToken: "Create token",+ neverExpiresHint: "Never expires",+ expiresInDaysHint: "Expires in {n} days",+ createTokenHint: 'Create a token named "{name}"',+ defaultTokenName: "New Token {n}",creating: "Creating...",newTokenCreated: "New access token created",accessTokenCopied: "Access token copied",@@ -3240,13 +3250,16 @@ export const en = {expired: "expired",expiredStatus: "Expired",today: "today",- created: "Created {value}",- used: "Used {value}",- expires: "Expires {value}",actionsFor: "Actions for {name}",copyPrefix: "Copy prefix",copyFailed: "Could not copy",revokeToken: "Revoke token",+ regenerateToken: "Regenerate token",+ regenerateTitle: 'Regenerate access token "{name}"?',+ regenerateDescription: "A new token with the same name and expiry period replaces this one. Apps using the current token lose access immediately.",+ regenerateAction: "Regenerate",+ regenerating: "Regenerating...",+ regenerateError: "Couldn't regenerate access token.",revokeTitle: 'Revoke access token "{name}"?',revokeDescription:"Apps using this token immediately lose access. This cannot be undone.",diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.tsindex fccc5df76e4..87b4f2d78fe 100644--- a/studio/frontend/src/i18n/locales/es.ts+++ b/studio/frontend/src/i18n/locales/es.ts@@ -2462,6 +2462,7 @@ export const es = {noRamReserveDescription: "Reduce la RAM ocupada por los pesos del modelo.",noRamReserveHint: "Omite la carga mapeada en memoria en las compilaciones de Windows compatibles cuando el modelo está totalmente descargado en la GPU, de modo que sus páginas no quedan residentes. En caso contrario conserva la carga mapeada en memoria. Los búferes de CPU necesarios pueden seguir usando RAM. Elimina --no-mmap y --mlock.",multiModel: "Mantener varios modelos cargados",+ openSystemSettings: "Ajustes del sistema",multiModelOff: "Desactivado",multiModelFit: "Cuando quepan",multiModelAlways: "Siempre",@@ -3181,13 +3182,22 @@ export const es = {readDocs: "Leer la documentación de la API",noAccess: "Aún no hay acceso a la API.",accessTokens: "Tokens de acceso",+ columnName: "Nombre",+ columnToken: "Token",+ columnCreated: "Creado",+ columnLastUsed: "Último uso",+ columnExpires: "Caduca",loadError: "No se pudo cargar el acceso a la API.",createError: "No se pudo crear el token de acceso.",revokeError: "No se pudo revocar el token de acceso.",never: "Nunca",- tokenNamePlaceholder: "Nombre del token (p. ej. producción)",+ tokenNamePlaceholder: "Nombre del token",newAccessTokenName: "Nombre del nuevo token de acceso",createToken: "Crear token",+ neverExpiresHint: "No caduca nunca",+ expiresInDaysHint: "Caduca en {n} días",+ createTokenHint: 'Crear un token llamado "{name}"',+ defaultTokenName: "Token nuevo {n}",creating: "Creando...",newTokenCreated: "Nuevo token de acceso creado",accessTokenCopied: "Token de acceso copiado",@@ -3222,13 +3232,16 @@ export const es = {expired: "caducado",expiredStatus: "Caducado",today: "hoy",- created: "Creado {value}",- used: "Usado {value}",- expires: "Caduca {value}",actionsFor: "Acciones para {name}",copyPrefix: "Copiar prefijo",copyFailed: "No se pudo copiar",revokeToken: "Revocar token",+ regenerateToken: "Regenerar token",+ regenerateTitle: '¿Regenerar el token de acceso "{name}"?',+ regenerateDescription: "Un token nuevo con el mismo nombre y periodo de caducidad sustituye a este. Las apps que usan el token actual pierden el acceso de inmediato.",+ regenerateAction: "Regenerar",+ regenerating: "Regenerando...",+ regenerateError: "No se pudo regenerar el token de acceso.",revokeTitle: '¿Revocar el token de acceso "{name}"?',revokeDescription:"Las apps que usan este token pierden el acceso de inmediato. Esto no se puede deshacer.",diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.tsindex 7b6a2cc9887..92824c8f2c5 100644--- a/studio/frontend/src/i18n/locales/fr.ts+++ b/studio/frontend/src/i18n/locales/fr.ts@@ -2466,6 +2466,7 @@ export const fr = {noRamReserveDescription: "Réduit la RAM occupée par les poids du modèle.",noRamReserveHint: "Ignore le chargement mappé en mémoire sur les versions Windows compatibles lorsque le modèle est entièrement déchargé sur le GPU, afin que ses pages ne restent pas résidentes. Sinon, conserve le chargement mappé en mémoire. Les tampons CPU nécessaires peuvent toujours occuper de la RAM. Supprime --no-mmap et --mlock.",multiModel: "Garder plusieurs modèles chargés",+ openSystemSettings: "Réglages système",multiModelOff: "Désactivé",multiModelFit: "S'ils tiennent",multiModelAlways: "Toujours",@@ -3189,13 +3190,22 @@ export const fr = {readDocs: "Lire la documentation de l'API",noAccess: "Aucun accès API pour le moment.",accessTokens: "Jetons d’accès",+ columnName: "Nom",+ columnToken: "Jeton",+ columnCreated: "Créé",+ columnLastUsed: "Dernière utilisation",+ columnExpires: "Expire",loadError: "Impossible de charger l'accès API.",createError: "Impossible de créer le jeton d’accès.",revokeError: "Impossible de révoquer le jeton d’accès.",never: "Jamais",- tokenNamePlaceholder: "Nom du jeton (par ex. production)",+ tokenNamePlaceholder: "Nom du jeton",newAccessTokenName: "Nom du nouveau jeton d’accès",createToken: "Créer un jeton",+ neverExpiresHint: "N'expire jamais",+ expiresInDaysHint: "Expire dans {n} jours",+ createTokenHint: "Créer un jeton nommé « {name} »",+ defaultTokenName: "Nouveau jeton {n}",creating: "Création...",newTokenCreated: "Nouveau jeton d’accès créé",accessTokenCopied: "Jeton d’accès copié",@@ -3230,13 +3240,16 @@ export const fr = {expired: "expiré",expiredStatus: "Expiré",today: "aujourd'hui",- created: "Créé {value}",- used: "Utilisé {value}",- expires: "Expire {value}",actionsFor: "Actions pour {name}",copyPrefix: "Copier le préfixe",copyFailed: "Impossible de copier",revokeToken: "Révoquer le jeton",+ regenerateToken: "Régénérer le jeton",+ regenerateTitle: "Régénérer le jeton d'accès « {name} » ?",+ regenerateDescription: "Un nouveau jeton avec le même nom et la même durée remplace celui-ci. Les apps qui utilisent le jeton actuel perdent l'accès immédiatement.",+ regenerateAction: "Régénérer",+ regenerating: "Régénération...",+ regenerateError: "Impossible de régénérer le jeton d'accès.",revokeTitle: "Révoquer le jeton d’accès « {name} » ?",revokeDescription:"Les applications utilisant ce jeton perdent immédiatement l’accès. Cette action est irréversible.",diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.tsindex 562a05b1eb3..4f35a29aa4b 100644--- a/studio/frontend/src/i18n/locales/he.ts+++ b/studio/frontend/src/i18n/locales/he.ts@@ -2541,6 +2541,7 @@ export const he = {noRamReserveHint:"מדלג על טעינה ממופת זיכרון (Memory-mapped) בגרסאות Windows נתמכות כאשר המודל נפרק במלואו ל-GPU, כך שדפי הזיכרון שלו אינם נשמרים כתושבים. במקרים אחרים שומר על טעינה ממופת זיכרון. חוצצי CPU נדרשים עדיין יכולים להשתמש ב-RAM. מבטל את --no-mmap ו---mlock.",multiModel: "השאר מספר מודלים טעונים",+ openSystemSettings: "הגדרות מערכת",multiModelOff: "כבוי",multiModelFit: "כשהם נכנסים",multiModelAlways: "תמיד",@@ -3260,13 +3261,22 @@ export const he = {readDocs: "קרא את תיעוד ה-API",noAccess: "אין עדיין גישת API.",accessTokens: "טוקני גישה",+ columnName: "שם",+ columnToken: "טוקן",+ columnCreated: "נוצר",+ columnLastUsed: "שימוש אחרון",+ columnExpires: "תפוגה",loadError: "לא ניתן לטעון פרטי גישת API.",createError: "לא ניתן ליצור טוקן גישה.",revokeError: "לא ניתן לבטל טוקן גישה.",never: "אף פעם",- tokenNamePlaceholder: "שם הטוקן (למשל production)",+ tokenNamePlaceholder: "שם הטוקן",newAccessTokenName: "שם טוקן גישה חדש",createToken: "צור טוקן",+ neverExpiresHint: "ללא תפוגה",+ expiresInDaysHint: "פג תוקף בעוד {n} ימים",+ createTokenHint: "יצירת טוקן בשם \"{name}\"",+ defaultTokenName: "טוקן חדש {n}",creating: "יוצר...",newTokenCreated: "טוקן גישה חדש נוצר",accessTokenCopied: "טוקן הגישה הועתק",@@ -3302,13 +3312,16 @@ export const he = {expired: "פג תוקף",expiredStatus: "פג תוקף",today: "היום",- created: "נוצר {value}",- used: "שימוש אחרון {value}",- expires: "יפוג {value}",actionsFor: "פעולות עבור {name}",copyPrefix: "העתק קידומת",copyFailed: "ההעתקה נכשלה",revokeToken: "בטל טוקן",+ regenerateToken: "יצירת טוקן מחדש",+ regenerateTitle: "ליצור מחדש את טוקן הגישה \"{name}\"?",+ regenerateDescription: "טוקן חדש עם אותו שם ואותה תקופת תוקף יחליף את הנוכחי. אפליקציות שמשתמשות בטוקן הנוכחי יאבדו גישה מיד.",+ regenerateAction: "יצירה מחדש",+ regenerating: "יוצר מחדש...",+ regenerateError: "לא ניתן ליצור מחדש את טוקן הגישה.",revokeTitle: 'לבטל את טוקן הגישה "{name}"?',revokeDescription:"יישומים המשתמשים בטוקן זה יאבדו גישה באופן מיידי. לא ניתן לבטל פעולה זו.",diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.tsindex 7ebaf1c63d4..2f8be66b70c 100644--- a/studio/frontend/src/i18n/locales/hi.ts+++ b/studio/frontend/src/i18n/locales/hi.ts@@ -2441,6 +2441,7 @@ export const hi = {noRamReserveDescription: "मॉडल वेट्स के लिए रखी गई RAM घटाता है।",noRamReserveHint: "जब मॉडल पूरी तरह GPU पर ऑफ़लोड हो, तो समर्थित Windows बिल्ड पर मेमोरी-मैप्ड लोडिंग छोड़ देता है, ताकि उसके पेज रेज़िडेंट न रहें। अन्यथा मेमोरी-मैप्ड लोडिंग बनाए रखता है। आवश्यक CPU बफ़र अब भी RAM ले सकते हैं। --no-mmap तथा --mlock हटा देता है।",multiModel: "कई मॉडल लोड रखें",+ openSystemSettings: "सिस्टम सेटिंग्स",multiModelOff: "बंद",multiModelFit: "जब जगह हो",multiModelAlways: "हमेशा",@@ -3151,13 +3152,22 @@ export const hi = {readDocs: "API दस्तावेज़ पढ़ें",noAccess: "अभी तक कोई API एक्सेस नहीं।",accessTokens: "एक्सेस टोकन",+ columnName: "नाम",+ columnToken: "टोकन",+ columnCreated: "बनाया गया",+ columnLastUsed: "अंतिम उपयोग",+ columnExpires: "समाप्ति",loadError: "API एक्सेस लोड नहीं किया जा सका।",createError: "एक्सेस टोकन नहीं बनाया जा सका।",revokeError: "एक्सेस टोकन रद्द नहीं किया जा सका।",never: "कभी नहीं",- tokenNamePlaceholder: "टोकन का नाम (जैसे, production)",+ tokenNamePlaceholder: "टोकन का नाम",newAccessTokenName: "नए एक्सेस टोकन का नाम",createToken: "टोकन बनाएँ",+ neverExpiresHint: "कभी समाप्त नहीं होता",+ expiresInDaysHint: "{n} दिनों में समाप्त",+ createTokenHint: "\"{name}\" नाम का टोकन बनाएं",+ defaultTokenName: "नया टोकन {n}",creating: "बनाया जा रहा है...",newTokenCreated: "नया एक्सेस टोकन बनाया गया",accessTokenCopied: "एक्सेस टोकन कॉपी किया गया",@@ -3191,13 +3201,16 @@ export const hi = {expired: "समाप्त",expiredStatus: "समाप्त",today: "आज",- created: "बनाया गया: {value}",- used: "उपयोग किया गया: {value}",- expires: "समाप्त होता है {value}",actionsFor: "{name} के लिए कार्रवाइयां",copyPrefix: "प्रीफ़िक्स कॉपी करें",copyFailed: "कॉपी नहीं हो सका",revokeToken: "टोकन रद्द करें",+ regenerateToken: "टोकन फिर से बनाएं",+ regenerateTitle: "एक्सेस टोकन \"{name}\" फिर से बनाएं?",+ regenerateDescription: "इसी नाम और समाप्ति अवधि वाला नया टोकन इसकी जगह लेगा। मौजूदा टोकन इस्तेमाल करने वाले ऐप्स की पहुंच तुरंत खत्म हो जाएगी।",+ regenerateAction: "फिर से बनाएं",+ regenerating: "फिर से बनाया जा रहा है...",+ regenerateError: "एक्सेस टोकन फिर से नहीं बनाया जा सका।",revokeTitle: "क्या “{name}” एक्सेस टोकन रद्द करें?",revokeDescription:"इस टोकन का उपयोग करने वाले ऐप तुरंत एक्सेस खो देंगे। इसे पूर्ववत नहीं किया जा सकता।",diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.tsindex 2912b37cd66..09a1208556d 100644--- a/studio/frontend/src/i18n/locales/it.ts+++ b/studio/frontend/src/i18n/locales/it.ts@@ -2371,6 +2371,7 @@ export const it = {noRamReserveDescription: "Riduce la RAM occupata dai pesi del modello.",noRamReserveHint: "Salta il caricamento mappato in memoria sulle build Windows supportate quando il modello è interamente scaricato sulla GPU, così le sue pagine non restano residenti. Altrimenti mantiene il caricamento mappato in memoria. I buffer CPU necessari possono comunque occupare RAM. Rimuove --no-mmap e --mlock.",multiModel: "Mantieni più modelli caricati",+ openSystemSettings: "Impostazioni di sistema",multiModelOff: "Disattivato",multiModelFit: "Se c'è spazio",multiModelAlways: "Sempre",@@ -3090,13 +3091,22 @@ export const it = {readDocs: "Leggi la documentazione delle API",noAccess: "Nessun accesso API configurato.",accessTokens: "Token di accesso",+ columnName: "Nome",+ columnToken: "Token",+ columnCreated: "Creato",+ columnLastUsed: "Ultimo utilizzo",+ columnExpires: "Scade",loadError: "Impossibile caricare gli accessi API.",createError: "Impossibile creare il token di accesso.",revokeError: "Impossibile revocare il token di accesso.",never: "Mai",- tokenNamePlaceholder: "Nome del token (es. produzione)",+ tokenNamePlaceholder: "Nome del token",newAccessTokenName: "Nome del nuovo token di accesso",createToken: "Crea token",+ neverExpiresHint: "Non scade mai",+ expiresInDaysHint: "Scade tra {n} giorni",+ createTokenHint: 'Crea un token chiamato "{name}"',+ defaultTokenName: "Nuovo token {n}",creating: "Creazione...",newTokenCreated: "Nuovo token di accesso creato",accessTokenCopied: "Token di accesso copiato",@@ -3133,13 +3143,16 @@ export const it = {expired: "scaduta",expiredStatus: "Scaduta",today: "oggi",- created: "Creato {value}",- used: "Ultimo utilizzo: {value}",- expires: "Scadenza: {value}",actionsFor: "Azioni per {name}",copyPrefix: "Copia il prefisso",copyFailed: "Impossibile copiare",revokeToken: "Revoca il token",+ regenerateToken: "Rigenera token",+ regenerateTitle: 'Rigenerare il token di accesso "{name}"?',+ regenerateDescription: "Un nuovo token con lo stesso nome e la stessa durata sostituisce questo. Le app che usano il token attuale perdono subito l'accesso.",+ regenerateAction: "Rigenera",+ regenerating: "Rigenerazione...",+ regenerateError: "Impossibile rigenerare il token di accesso.",revokeTitle: "Revocare il token di accesso «{name}»?",revokeDescription:"Le app che usano questo token perdono immediatamente l'accesso. L'operazione è irreversibile.",diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.tsindex f73ee1a3202..94e543a79cb 100644--- a/studio/frontend/src/i18n/locales/ja.ts+++ b/studio/frontend/src/i18n/locales/ja.ts@@ -2417,6 +2417,7 @@ export const ja = {noRamReserveDescription: "モデルの重みが占有する RAM を減らします。",noRamReserveHint: "モデルが GPU に完全にオフロードされている場合、対応する Windows ビルドではメモリマップ読み込みを行わず、ファイルのページが常駐しないようにします。それ以外ではメモリマップ読み込みを維持します。必要な CPU バッファは RAM を使用することがあります。--no-mmap と --mlock を除去します。",multiModel: "複数のモデルを読み込んだままにする",+ openSystemSettings: "システム設定",multiModelOff: "オフ",multiModelFit: "収まる場合",multiModelAlways: "常に",@@ -3117,13 +3118,22 @@ export const ja = {readDocs: "API ドキュメントを読む",noAccess: "アクセストークンはまだありません。",accessTokens: "アクセストークン",+ columnName: "名前",+ columnToken: "トークン",+ columnCreated: "作成",+ columnLastUsed: "最終使用",+ columnExpires: "有効期限",loadError: "アクセストークンを読み込めませんでした。",createError: "アクセストークンを作成できませんでした。",revokeError: "アクセストークンを失効させることができませんでした。",never: "なし",- tokenNamePlaceholder: "トークン名 (例: production)",+ tokenNamePlaceholder: "トークン名",newAccessTokenName: "新規アクセストークン名",createToken: "トークンを作成",+ neverExpiresHint: "期限なし",+ expiresInDaysHint: "{n} 日後に期限切れ",+ createTokenHint: "「{name}」という名前のトークンを作成",+ defaultTokenName: "新しいトークン {n}",creating: "作成中...",newTokenCreated: "新規アクセストークンが作成されました",accessTokenCopied: "アクセストークンをコピーしました",@@ -3155,13 +3165,16 @@ export const ja = {expired: "期限切れ",expiredStatus: "期限切れ",today: "今日",- created: "作成日時 {value}",- used: "使用日時 {value}",- expires: "有効期限 {value}",actionsFor: "{name} のアクション",copyPrefix: "プレフィックスをコピー",copyFailed: "コピーできませんでした",revokeToken: "トークンを失効",+ regenerateToken: "トークンを再生成",+ regenerateTitle: "アクセストークン「{name}」を再生成しますか?",+ regenerateDescription: "同じ名前と有効期間の新しいトークンに置き換えます。現在のトークンを使うアプリはすぐにアクセスできなくなります。",+ regenerateAction: "再生成",+ regenerating: "再生成中...",+ regenerateError: "アクセストークンを再生成できませんでした。",revokeTitle: 'アクセストークン "{name}" を失効させますか?',revokeDescription: "このトークンを使用しているアプリはすぐにアクセスできなくなります。この操作は取り消せません。",revokeAction: '"{name}" を失効',diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.tsindex 9d2c8a5e9fa..1611ca27727 100644--- a/studio/frontend/src/i18n/locales/ko.ts+++ b/studio/frontend/src/i18n/locales/ko.ts@@ -2429,6 +2429,7 @@ export const ko = {noRamReserveDescription: "모델 가중치가 차지하는 RAM을 줄입니다.",noRamReserveHint: "모델이 GPU에 완전히 오프로드된 경우 지원되는 Windows 빌드에서 메모리 매핑 로딩을 건너뛰어 파일 페이지가 상주하지 않도록 합니다. 그렇지 않으면 메모리 매핑 로딩을 유지합니다. 필요한 CPU 버퍼는 여전히 RAM을 사용할 수 있습니다. --no-mmap과 --mlock을 제거합니다.",multiModel: "여러 모델을 로드된 상태로 유지",+ openSystemSettings: "시스템 설정",multiModelOff: "끄기",multiModelFit: "공간이 있을 때",multiModelAlways: "항상",@@ -3130,13 +3131,22 @@ export const ko = {readDocs: "API 문서 읽기",noAccess: "아직 액세스 토큰이 없습니다.",accessTokens: "액세스 토큰",+ columnName: "이름",+ columnToken: "토큰",+ columnCreated: "생성",+ columnLastUsed: "마지막 사용",+ columnExpires: "만료",loadError: "API 접근 권한을 불러오지 못했습니다.",createError: "액세스 토큰을 생성하지 못했습니다.",revokeError: "액세스 토큰을 폐기하지 못했습니다.",never: "만료 없음",- tokenNamePlaceholder: "토큰 이름(예: production)",+ tokenNamePlaceholder: "토큰 이름",newAccessTokenName: "새 액세스 토큰 이름",createToken: "토큰 생성",+ neverExpiresHint: "만료되지 않음",+ expiresInDaysHint: "{n}일 후 만료",+ createTokenHint: "\"{name}\" 토큰 만들기",+ defaultTokenName: "새 토큰 {n}",creating: "생성 중...",newTokenCreated: "새 액세스 토큰이 생성되었습니다",accessTokenCopied: "액세스 토큰이 복사되었습니다",@@ -3170,13 +3180,16 @@ export const ko = {expired: "만료됨",expiredStatus: "만료됨",today: "오늘",- created: "생성: {value}",- used: "마지막 사용: {value}",- expires: "만료: {value}",actionsFor: "{name} 작업",copyPrefix: "접두사 복사",copyFailed: "복사할 수 없습니다",revokeToken: "토큰 폐기",+ regenerateToken: "토큰 재생성",+ regenerateTitle: "액세스 토큰 \"{name}\"을(를) 재생성할까요?",+ regenerateDescription: "이름과 만료 기간이 같은 새 토큰으로 바뀝니다. 현재 토큰을 쓰는 앱은 즉시 접근 권한을 잃습니다.",+ regenerateAction: "재생성",+ regenerating: "재생성 중...",+ regenerateError: "액세스 토큰을 재생성하지 못했습니다.",revokeTitle: '액세스 토큰 "{name}"을 폐기하시겠습니까?',revokeDescription:"이 토큰을 사용하는 앱은 즉시 접근 권한을 잃습니다. 이 작업은 되돌릴 수 없습니다.",diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.tsindex 638cb60bb61..af8852b6e9f 100644--- a/studio/frontend/src/i18n/locales/pt-br.ts+++ b/studio/frontend/src/i18n/locales/pt-br.ts@@ -2450,6 +2450,7 @@ export const ptBR = {noRamReserveDescription: "Reduz a RAM ocupada pelos pesos do modelo.",noRamReserveHint: "Ignora o carregamento mapeado em memória nas versões compatíveis do Windows quando o modelo está totalmente descarregado na GPU, para que suas páginas não fiquem residentes. Caso contrário, mantém o carregamento mapeado em memória. Buffers de CPU necessários ainda podem usar RAM. Remove --no-mmap e --mlock.",multiModel: "Manter vários modelos carregados",+ openSystemSettings: "Configurações do sistema",multiModelOff: "Desativado",multiModelFit: "Quando couberem",multiModelAlways: "Sempre",@@ -3161,13 +3162,22 @@ export const ptBR = {readDocs: "Leia a documentação da API",noAccess: "Nenhum acesso à API ainda.",accessTokens: "Tokens de acesso",+ columnName: "Nome",+ columnToken: "Token",+ columnCreated: "Criado",+ columnLastUsed: "Último uso",+ columnExpires: "Expira",loadError: "Não foi possível carregar o acesso à API.",createError: "Não foi possível criar o token de acesso.",revokeError: "Não foi possível revogar o token de acesso.",never: "Nunca",- tokenNamePlaceholder: "Nome do token (ex.: produção)",+ tokenNamePlaceholder: "Nome do token",newAccessTokenName: "Nome do novo token de acesso",createToken: "Criar token",+ neverExpiresHint: "Nunca expira",+ expiresInDaysHint: "Expira em {n} dias",+ createTokenHint: 'Criar um token chamado "{name}"',+ defaultTokenName: "Novo token {n}",creating: "Criando...",newTokenCreated: "Novo token de acesso criado",accessTokenCopied: "Token de acesso copiado",@@ -3201,13 +3211,16 @@ export const ptBR = {expired: "expirado",expiredStatus: "Expirado",today: "hoje",- created: "Criado {value}",- used: "Usado {value}",- expires: "Expira {value}",actionsFor: "Ações para {name}",copyPrefix: "Copiar prefixo",copyFailed: "Não foi possível copiar",revokeToken: "Revogar token",+ regenerateToken: "Gerar novo token",+ regenerateTitle: 'Gerar novamente o token de acesso "{name}"?',+ regenerateDescription: "Um novo token com o mesmo nome e período de validade substitui este. Apps que usam o token atual perdem o acesso imediatamente.",+ regenerateAction: "Gerar novamente",+ regenerating: "Gerando...",+ regenerateError: "Não foi possível gerar novamente o token de acesso.",revokeTitle: 'Revogar token de acesso "{name}"?',revokeDescription:"Aplicativos que usam este token perderão o acesso imediatamente. Esta ação não pode ser desfeita.",diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.tsindex ac2e3b0387a..053f2905535 100644--- a/studio/frontend/src/i18n/locales/ru.ts+++ b/studio/frontend/src/i18n/locales/ru.ts@@ -2447,6 +2447,7 @@ export const ru = {noRamReserveDescription: "Уменьшает объём ОЗУ, занятый весами модели.",noRamReserveHint: "Пропускает загрузку через отображение файла в память в поддерживаемых сборках Windows, когда модель полностью выгружена на видеокарту, чтобы её страницы не оставались в памяти. В остальных случаях сохраняет загрузку через отображение файла в память. Необходимые буферы ЦП всё равно могут занимать ОЗУ. Убирает --no-mmap и --mlock.",multiModel: "Держать несколько моделей загруженными",+ openSystemSettings: "Настройки системы",multiModelOff: "Выкл.",multiModelFit: "Если помещаются",multiModelAlways: "Всегда",@@ -3158,13 +3159,22 @@ export const ru = {readDocs: "Читать документацию API",noAccess: "Доступа к API пока нет.",accessTokens: "Токены доступа",+ columnName: "Имя",+ columnToken: "Токен",+ columnCreated: "Создан",+ columnLastUsed: "Последнее использование",+ columnExpires: "Истекает",loadError: "Не удалось загрузить доступ к API.",createError: "Не удалось создать токен доступа.",revokeError: "Не удалось отозвать токен доступа.",never: "Никогда",- tokenNamePlaceholder: "Имя токена (например, production)",+ tokenNamePlaceholder: "Имя токена",newAccessTokenName: "Имя нового токена доступа",createToken: "Создать токен",+ neverExpiresHint: "Бессрочный",+ expiresInDaysHint: "Истекает через {n} дн.",+ createTokenHint: "Создать токен «{name}»",+ defaultTokenName: "Новый токен {n}",creating: "Создание...",newTokenCreated: "Новый токен доступа создан",accessTokenCopied: "Токен доступа скопирован",@@ -3198,13 +3208,16 @@ export const ru = {expired: "истёк",expiredStatus: "Истёк",today: "сегодня",- created: "Создан {value}",- used: "Использование: {value}",- expires: "Срок действия: {value}",actionsFor: "Действия для {name}",copyPrefix: "Копировать префикс",copyFailed: "Не удалось скопировать",revokeToken: "Отозвать токен",+ regenerateToken: "Перевыпустить токен",+ regenerateTitle: "Перевыпустить токен доступа «{name}»?",+ regenerateDescription: "Новый токен с тем же именем и сроком действия заменит этот. Приложения с текущим токеном сразу потеряют доступ.",+ regenerateAction: "Перевыпустить",+ regenerating: "Перевыпуск...",+ regenerateError: "Не удалось перевыпустить токен доступа.",revokeTitle: 'Отозвать токен доступа «{name}»?',revokeDescription:"Приложения, использующие этот токен, немедленно потеряют доступ. Это действие нельзя отменить.",diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.tsindex 257f8380d02..6980e40e6e5 100644--- a/studio/frontend/src/i18n/locales/sv.ts+++ b/studio/frontend/src/i18n/locales/sv.ts@@ -2616,6 +2616,7 @@ export const sv = {noRamReserveHint:"Hoppar över minnesmappad inläsning i Windows-versioner som stöds när modellen är helt avlastad till GPU:n, så att dess sidor inte hålls kvar i minnet. Annars behålls minnesmappad inläsning. Nödvändiga CPU-buffertar kan fortfarande använda RAM. Tar bort --no-mmap och --mlock.",multiModel: "Behåll flera modeller inlästa",+ openSystemSettings: "Systeminställningar",multiModelOff: "Av",multiModelFit: "När de får plats",multiModelAlways: "Alltid",@@ -3359,13 +3360,22 @@ export const sv = {readDocs: "Läs API-dokumentationen",noAccess: "Ingen API-åtkomst ännu.",accessTokens: "Åtkomsttoken",+ columnName: "Namn",+ columnToken: "Token",+ columnCreated: "Skapad",+ columnLastUsed: "Senast använd",+ columnExpires: "Upphör",loadError: "Det gick inte att läsa in API-åtkomst.",createError: "Det gick inte att skapa åtkomsttoken.",revokeError: "Det gick inte att återkalla åtkomsttoken.",never: "Aldrig",- tokenNamePlaceholder: "Tokennamn (t.ex. produktion)",+ tokenNamePlaceholder: "Tokennamn",newAccessTokenName: "Namn på ny åtkomsttoken",createToken: "Skapa token",+ neverExpiresHint: "Upphör aldrig",+ expiresInDaysHint: "Upphör om {n} dagar",+ createTokenHint: "Skapa en token med namnet \"{name}\"",+ defaultTokenName: "Ny token {n}",creating: "Skapar ...",newTokenCreated: "Ny åtkomsttoken har skapats",accessTokenCopied: "Åtkomsttoken har kopierats",@@ -3402,13 +3412,16 @@ export const sv = {expired: "har löpt ut",expiredStatus: "Har löpt ut",today: "i dag",- created: "Skapad {value}",- used: "Senast använd {value}",- expires: "Löper ut {value}",actionsFor: "Åtgärder för {name}",copyPrefix: "Kopiera prefix",copyFailed: "Det gick inte att kopiera",revokeToken: "Återkalla token",+ regenerateToken: "Generera om token",+ regenerateTitle: "Generera om åtkomsttoken \"{name}\"?",+ regenerateDescription: "En ny token med samma namn och giltighetstid ersätter den här. Appar som använder den nuvarande token förlorar åtkomst direkt.",+ regenerateAction: "Generera om",+ regenerating: "Genererar om...",+ regenerateError: "Det gick inte att generera om åtkomsttoken.",revokeTitle: "Återkalla åtkomsttoken ”{name}”?",revokeDescription:"Appar som använder denna token förlorar åtkomsten omedelbart. Det går inte att ångra.",diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.tsindex cc0e80ff8d0..77f6383c8ed 100644--- a/studio/frontend/src/i18n/locales/zh-CN.ts+++ b/studio/frontend/src/i18n/locales/zh-CN.ts@@ -2405,6 +2405,7 @@ export const zhCN = {noRamReserveDescription: "减少模型权重占用的内存。",noRamReserveHint: "当模型完全卸载到 GPU 时,在受支持的 Windows 版本上跳过内存映射加载,使其页面不再常驻;否则保持内存映射加载。必要的 CPU 缓冲区仍可能占用内存。移除 --no-mmap 和 --mlock。",multiModel: "保持多个模型加载",+ openSystemSettings: "系统设置",multiModelOff: "关闭",multiModelFit: "能容纳时",multiModelAlways: "总是",@@ -3088,13 +3089,22 @@ export const zhCN = {readDocs: "阅读 API 文档",noAccess: "还没有 API 访问权限。",accessTokens: "访问 token",+ columnName: "名称",+ columnToken: "Token",+ columnCreated: "创建时间",+ columnLastUsed: "上次使用",+ columnExpires: "过期时间",loadError: "无法加载 API 访问权限。",createError: "无法创建访问 token。",revokeError: "无法撤销访问 token。",never: "永不过期",- tokenNamePlaceholder: "Token 名称(例如 production)",+ tokenNamePlaceholder: "Token 名称",newAccessTokenName: "新的访问 token 名称",createToken: "创建 token",+ neverExpiresHint: "永不过期",+ expiresInDaysHint: "{n} 天后过期",+ createTokenHint: "创建名为“{name}”的 Token",+ defaultTokenName: "新 token {n}",creating: "创建中...",newTokenCreated: "新的访问 token 已创建",accessTokenCopied: "访问 token 已复制",@@ -3128,13 +3138,16 @@ export const zhCN = {expired: "已过期",expiredStatus: "已过期",today: "今天",- created: "创建于 {value}",- used: "上次使用:{value}",- expires: "过期时间:{value}",actionsFor: "{name} 的操作",copyPrefix: "复制前缀",copyFailed: "无法复制",revokeToken: "撤销 token",+ regenerateToken: "重新生成 Token",+ regenerateTitle: "重新生成访问 Token“{name}”?",+ regenerateDescription: "将用名称和有效期相同的新 Token 替换此 Token。使用当前 Token 的应用会立即失去访问权限。",+ regenerateAction: "重新生成",+ regenerating: "正在重新生成...",+ regenerateError: "无法重新生成访问 Token。",revokeTitle: "撤销访问 token“{name}”?",revokeDescription:"使用此 token 的应用会立即失去访问权限。此操作无法撤销。",diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.cssindex 54ce8e254dd..fe02056aea5 100644--- a/studio/frontend/src/index.css+++ b/studio/frontend/src/index.css@@ -30,6 +30,30 @@}}+/* A Settings card's leading icon: a borderless disc a step darker (light) or lighter (dark) than the card. */+@utility icon-disc {+ border-radius: 9999px;+ background-color: color-mix(in srgb, var(--foreground) calc(7% * var(--contrast-wash-gain, 1)), transparent);+ &:where(.dark *) {+ background-color: color-mix(in srgb, var(--foreground) calc(11% * var(--contrast-wash-gain, 1)), transparent);+ }+}++/* A filled Button's height (text-sm line, 7px padding, 1px border), for controls beside one. */+@utility h-control {+ height: calc(1.25rem * var(--ui-font-scale, 1) + 14px * var(--ui-space-scale, 1) + 2px);+}++/* A one-line menu row (py-2) rounded up to a whole pixel: a fractional one blurred the last pill. */+@utility min-h-menu-row {+ min-height: round(up, 1lh + 16px * var(--ui-space-scale, 1), 1px);+}++@utility size-control {+ width: calc(1.25rem * var(--ui-font-scale, 1) + 14px * var(--ui-space-scale, 1) + 2px);+ height: calc(1.25rem * var(--ui-font-scale, 1) + 14px * var(--ui-space-scale, 1) + 2px);+}+@layer components {/* The custom Windows/Linux titlebar stays above modal backdrops so nativewindow actions remain usable. Repeat the standard backdrop over the surface@@ -3113,6 +3137,13 @@ html[data-chat-font] .aui-root {margin-block: 2px;}+ /* Whole-pixel label, inside it, not a margin: the next row's 2px margin collapses with one. */+ [data-slot="dropdown-menu-label"]::after {+ content: "";+ display: block;+ height: calc(round(up, 1lh, 1px) - 1lh);+ }+/* A menu's corner is its 12px row radius plus its gutter, so the hover nests in the corner:16px around the standard 4px gutter. !important beats per-menu rounded-*. */[data-slot="dropdown-menu-content"],@@ -3134,6 +3165,15 @@ html[data-chat-font] .aui-root {background-color: rgb(255 255 255 / calc(0.1 * var(--contrast-wash-gain, 1)));}+ /* Settings only: every option picker (select or picker variant) one size; action menus keep theirs. */+ [data-settings-dialog] :is([data-slot="select-trigger"], [data-variant="picker"]) {+ height: calc(1.25rem * var(--ui-font-scale, 1) + 14px * var(--ui-space-scale, 1) + 2px) !important;+ padding-inline: calc(14px * var(--ui-space-scale, 1)) !important;+ border-radius: 9999px !important;+ font-size: var(--text-sm) !important;+ font-weight: 400 !important;+ }+/* Every dropdown/menu/select/popover: borderless, chatbox shadow in light,none in dark. !important so it also overrides the bespoke menu shadows. */[data-slot="dropdown-menu-content"],@@ -3168,6 +3208,16 @@ html[data-chat-font] .aui-root {.dark .sidebar-more-menu[data-slot] {background-color: var(--sidebar) !important;}+ /* More menu: pill rows, corner of half a row plus the p-1 gutter so the pill nests. */+ .sidebar-more-menu[data-slot] {+ border-radius: calc(+ (1.25rem * var(--ui-font-scale, 1) + 14px * var(--ui-space-scale, 1) + 2px) / 2 + 4px *+ var(--ui-space-scale, 1)+ ) !important;+ }+ .sidebar-more-menu :is([data-slot="dropdown-menu-item"], [data-slot="dropdown-menu-sub-trigger"]) {+ border-radius: 9999px;+ }/* On <html> so --accent can be reassigned without a cycle. */.dark {@@ -3510,7 +3560,36 @@ html[data-chat-font] .aui-root {min-height: 100%;max-height: 100% !important;/* Reserved before typing, or the toggle appearing would reflow the text. */- padding-right: calc(2.25rem * var(--ui-space-scale, 1));+ padding-right: calc(2.625rem * var(--ui-space-scale, 1));+ }++ /* 6px wider (and as much more padding) so the scrollbar sits near the composer's edge. */+ .unsloth-composer-line .unsloth-composer-editor .unsloth-composer-input {+ width: calc(100% + 0.375rem * var(--ui-space-scale, 1));+ }++ /* Edge fades: faint on the last line, clearer past a scrolled edge (markComposerScrollEdges). */+ .unsloth-composer-input:not(:placeholder-shown) {+ mask-image:+ linear-gradient(+ to bottom,+ transparent,+ #000 var(--composer-fade-top, 0px),+ #000 calc(100% - var(--composer-fade-bottom, calc(0.375rem * var(--ui-space-scale, 1)))),+ transparent+ ),+ linear-gradient(#000, #000);+ mask-size: calc(100% - 12px) 100%, 12px 100%;+ mask-position: left top, right top;+ mask-repeat: no-repeat;+ }++ .unsloth-composer-input[data-fade-top] {+ --composer-fade-top: calc(1.5rem * var(--ui-space-scale, 1));+ }++ .unsloth-composer-input[data-fade-bottom] {+ --composer-fade-bottom: calc(1rem * var(--ui-space-scale, 1));}/* max(): at 480px tall the clamp is 192px, under the twelve-row compact@@ -3532,6 +3611,14 @@ html[data-chat-font] .aui-root {padding-top: calc(1rem * var(--ui-space-scale, 1));}+ /* Welcome: grows by the pt-[27.5dvh] given up, so the bottom edge stays put and it expands upward. */+ .aui-thread-welcome-center:not(:has(.unsloth-files-panel)) [data-writing-expanded="true"] .unsloth-composer-editor {+ height: calc(+ var(--composer-editor-height, calc(40px * var(--ui-space-scale, 1))) + 27.5dvh - 1rem *+ var(--ui-space-scale, 1)+ );+ }+.unsloth-composer-plus {@apply relative flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full text-foreground transition-colors hover:bg-muted-foreground/15 disabled:cursor-not-allowed disabled:opacity-40;}@@ -4307,13 +4394,26 @@ html[data-chat-font] .aui-root {margin-block: calc(0.5rem * var(--ui-space-scale, 1));}+ /* In em, growing with font and digits: a fixed 1.25rem let "10." hang past the composer's edge. */[data-streamdown="ordered-list"] {list-style-type: decimal;list-style-position: outside;- padding-left: calc(1.25rem * var(--ui-space-scale, 1));+ padding-left: 1.6em;margin-block: calc(0.5rem * var(--ui-space-scale, 1));}+ /* A list that continues past 9 (start="10") is two digits from its first item. */+ [data-streamdown="ordered-list"]:is(+ :has(> li:nth-child(10)),+ [start]:not([start="1"], [start="2"], [start="3"], [start="4"], [start="5"], [start="6"], [start="7"], [start="8"], [start="9"])+ ) {+ padding-left: 2.2em;+ }++ [data-streamdown="ordered-list"]:has(> li:nth-child(100)) {+ padding-left: 2.8em;+ }+[data-streamdown="list-item"] {display: list-item;}@@ -5981,6 +6081,19 @@ html.force-reduced-motion .sidebar-section-drop-line {& svg.size-3\.5 { width: calc(0.875rem * var(--ui-font-scale, 1)); height: calc(0.875rem * var(--ui-font-scale, 1)); }& svg.size-4 { width: var(--ui-icon-size); height: var(--ui-icon-size); }& svg.size-4\.5 { width: var(--ui-icon-size); height: var(--ui-icon-size); }+ /* Round-button glyphs at even pixel sizes, so (circle - glyph) / 2 is a whole pixel: an svg at a+ fractional offset rasterises snapped up and left. Browsers without round() keep the size above. */+ & svg.composer-glyph-snap.size-3\.5 {+ width: round(up, calc(0.875rem * var(--ui-font-scale, 1)), 2px);+ height: round(up, calc(0.875rem * var(--ui-font-scale, 1)), 2px);+ }+ /* Queue Resume's solid play: about a third of the circle's height, like the Stop square. */+ & svg.composer-resume-glyph {+ width: calc(var(--ui-icon-size) * 1.125);+ height: calc(var(--ui-icon-size) * 1.125);+ width: round(up, calc(var(--ui-icon-size) * 1.125), 2px);+ height: round(up, calc(var(--ui-icon-size) * 1.125), 2px);+ }& svg.size-5 { width: var(--ui-icon-size); height: var(--ui-icon-size); }& svg.size-6 { width: calc(1.5rem * var(--ui-font-scale, 1)); height: calc(1.5rem * var(--ui-font-scale, 1)); }& svg:is(.size-\[5px\], [class~='size-[calc(5px*var(--ui-space-scale,1))]']) { width: calc(5px * var(--ui-font-scale, 1)); height: calc(5px * var(--ui-font-scale, 1)); }@@ -6010,6 +6123,8 @@ html.force-reduced-motion .sidebar-section-drop-line {& svg.unsloth-send-icon {width: calc(var(--ui-icon-size) * 1.3);height: calc(var(--ui-icon-size) * 1.3);+ width: round(up, calc(var(--ui-icon-size) * 1.3), 2px);+ height: round(up, calc(var(--ui-icon-size) * 1.3), 2px);}/* Composer plus keeps its pre-#7400 22px base (1.375x the token is the samecurve a 22px glyph would follow), so only its scaling changed. */@@ -6549,3 +6664,4 @@ html[data-find-bar-open] [data-sonner-toaster][data-y-position="top"] {border-color: color-mix(in oklab, var(--border), var(--foreground) 15%);}}+diff --git a/studio/frontend/src/lib/composer-scroll-fade.ts b/studio/frontend/src/lib/composer-scroll-fade.tsnew file mode 100644index 00000000000..3fa9c0de3a0--- /dev/null+++ b/studio/frontend/src/lib/composer-scroll-fade.ts@@ -0,0 +1,18 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++/** Flags the composer edges with text scrolled past, for index.css's fades. Next frame, after autosize;+ bottom needs over half a line past the padding, which typing alone leaves hidden. */+export function markComposerScrollEdges(el: HTMLTextAreaElement): void {+ requestAnimationFrame(() => {+ const style = getComputedStyle(el);+ const slack =+ (Number.parseFloat(style.paddingBottom) || 0) ++ (Number.parseFloat(style.lineHeight) || 24) / 2;+ el.toggleAttribute("data-fade-top", el.scrollTop > 0);+ el.toggleAttribute(+ "data-fade-bottom",+ el.scrollHeight - (el.scrollTop + el.clientHeight) > slack,+ );+ });+}diff --git a/studio/frontend/src/lib/mic-icon.tsx b/studio/frontend/src/lib/mic-icon.tsxindex e19fbecc85e..453f5f0a2f3 100644--- a/studio/frontend/src/lib/mic-icon.tsx+++ b/studio/frontend/src/lib/mic-icon.tsx@@ -3,7 +3,7 @@import type { FC } from "react";-/** Microphone icon used by the chat composer and the Voice settings tab. */+/** Microphone icon used by the chat composer, the Voice settings tab and Audio's Record button. */export const MicIcon: FC<{ className?: string }> = ({ className }) => (<svgclassName={className}diff --git a/studio/frontend/src/lib/reload-icon.ts b/studio/frontend/src/lib/reload-icon.tsnew file mode 100644index 00000000000..9418ddb0b0f--- /dev/null+++ b/studio/frontend/src/lib/reload-icon.ts@@ -0,0 +1,5 @@+// SPDX-License-Identifier: AGPL-3.0-only+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0++// Reload controls (refresh keeps Refresh01Icon): Hugeicons' current "reload", not the package's older ReloadIcon.+export { Refresh04Icon as ReloadIcon } from "@hugeicons/core-free-icons";diff --git a/studio/frontend/src/lib/utils.ts b/studio/frontend/src/lib/utils.tsindex 7408fc4fe95..59db48c6dff 100644--- a/studio/frontend/src/lib/utils.ts+++ b/studio/frontend/src/lib/utils.ts@@ -14,6 +14,10 @@ const twMerge = extendTailwindMerge({classGroups: {"font-size": [{ text: [isUiToken] }],leading: [{ leading: [isUiToken] }],+ // index.css `h-control`, `size-control`, `min-h-menu-row`: so a caller's h-8, size-8 or min-h-0 replaces it instead of both applying.+ h: [{ h: ["control"] }],+ size: [{ size: ["control"] }],+ "min-h": [{ "min-h": ["menu-row"] }],},},});diff --git a/studio/frontend/tests/api-model-reload-target.test.ts b/studio/frontend/tests/api-model-reload-target.test.tsnew file mode 100644index 00000000000..f03dba2800e--- /dev/null+++ b/studio/frontend/tests/api-model-reload-target.test.ts@@ -0,0 +1,83 @@+// 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";++const hook = readSrc("features/api-monitor/use-api-model-reload.ts");+const page = readSrc("features/api-monitor/api-monitor-page.tsx");++test("a served row reloads its checkpoint, not the public alias a kept slot is listed under", () => {+ assert.match(hook, /const target = model\.checkpoint === model\.name \? id : model\.checkpoint;[\s\S]*?id: target,/);+ assert.doesNotMatch(hook, /id: standalone \? model\.checkpoint : id,/);+ assert.match(page, /checkpoint: model\.checkpoint \?\? model\.id,/);+});++test("the Context fact finds requests logged as <id>:<quant>, and shows chat's pinnable chip", () => {+ assert.match(page, /modelIdsMatch\(monitorSelection\(entry\.model\)\.id, id\),/);+ assert.match(page, /entry\.event === "load" &&\s*entry\.status === "completed" &&/);+ assert.doesNotMatch(page, /modelIdsMatch\(entry\.model, id\)/);+ assert.match(page, /<ContextUsageChip\s+ringFirst=\{true\}\s+pinOnClick=\{true\}/);+});++test("an MLX precision folder reloads as a model with its folder, not as a GGUF quant", () => {+ assert.match(hook, /const variant = model\.quant \?\? ggufVariant;/);+ assert.match(hook, /kind: variant != null && !mlxFolder \? "gguf" : "model",/);+ // A kept row has no backend flag: a precision folder name on a non-GGUF repo is MLX too.+ assert.match(hook, /model\.isMlx \|\|\s*\(variant != null && isPrecisionFolderName\(variant\) && !\/gguf\/i\.test\(target\)\)/);+ assert.match(page, /const loadedIsMlx = useChatRuntimeStore\(\(s\) => s\.loadedIsMlx\);/);+ assert.match(page, /isMlx: index === activeIndex && loadedIsMlx === true,/);+});++test("a served NPU model reloads through the NPU loader, as the picker routes it", () => {+ assert.match(hook, /if \(isNpuModelId\(target\.id\)\) \{\s*await loadNpuModel\(target\.id, \{\s*forceReload: true,/);+ assert.match(page, /loadNpuModel: runtime\.loadNpuModel,/);+});++test("a row reload asks to stop only the reloaded model's chats, not the selected model's", () => {+ const runtime = readSrc("features/chat/hooks/use-chat-model-runtime.ts");+ assert.match(runtime, /const touchesOnlySelected =\s*forceReload && !isExternalModelId\(modelId\) && loadedNow\.length > 1;/);+ assert.match(runtime, /touchesOnlySelected \? modelId : undefined,/);+ assert.doesNotMatch(runtime, /touchesOnlySelected \? \(paramsNow\.checkpoint/);+});++test("a file-picked primary reloads through its file grant, and not once the grant expired", () => {+ assert.match(hook, /model\.active && fileGrant\s*\?\s*grantedTarget\(fileGrant\)\s*:\s*servedTarget\(model\)/);+ assert.match(hook, /nativePathToken: resident\.nativePathToken \?\? undefined,/);+ assert.match(hook, /loadId: target\.loadId,\s*nativePathToken: target\.nativePathToken,\s*nativePathExpiresAtMs: target\.nativePathExpiresAtMs,/);+ // A primary with no grant (a reloaded tab) is judged by its label like a kept row.+ assert.match(hook, /model\.active && fileGrant\s*\?\s*residentHasRunSettings\(fileGrant\)\s*:\s*!isNativeFileLabel\(model\.checkpoint\)/);+ const residentHook = readSrc("features/api-monitor/use-resident-run-target.ts");+ const grantHook = residentHook.slice(residentHook.indexOf("export function useResidentFileGrant("), residentHook.indexOf("export function useResidentRunTarget("));+ assert.doesNotMatch(grantHook, /residentMatchesMonitor|residentHasRunSettings/);+ assert.match(page, /const fileGrant = useResidentFileGrant\(data\?\.active_model\);/);+ assert.match(page, /disabled=\{reloadBusy \|\| !reload\.canReload\(model\)\}/);+ assert.match(page, /served\.length > 0 &&\s*!served\.some\(\(model\) => reload\.canReload\(model\)\)/);+ assert.doesNotMatch(hook, /load\(servedTarget\(model\)\)/);+});++test("a kept file-picked row has no grant, so it cannot reload and Reload all skips it", () => {+ // /status lists a lease-backed load by its bare file name only.+ assert.match(hook, /:\s*!isNativeFileLabel\(model\.checkpoint\)/);+ assert.match(hook, /for \(const model of models\s*\.filter\(canReload\)/);+});++test("Reload all stops when a load is cancelled or a newer pick supersedes it", () => {+ const runtime = readSrc("features/chat/hooks/use-chat-model-runtime.ts");+ assert.equal(runtime.match(/if \(!stopDecision\.proceed\) \{\s*modelLoadCancelEpoch \+= 1;/g)?.length, 2);+ assert.match(runtime, /modelLoadCancelEpoch \+= 1;\s*run\.abortController\.abort\(\);/);+ // A declined Hugging Face token prompt also resolves quietly, so it counts as a cancel too.+ assert.match(runtime, /if \(!preparedToken\.proceed\) \{\s*modelLoadCancelEpoch \+= 1;/);+ assert.match(hook, /const before = readModelLoadEpochs\(\);\s*await load\(rowTarget\(model\)\);/);+ assert.match(hook, /after\.cancels !== before\.cancels \|\|\s*after\.intent > before\.intent \+ 1/);+ assert.match(page, /readModelLoadEpochs: runtime\.readModelLoadEpochs,/);+});++test("row statistics match the served id, so an MLX folder row still finds its requests", () => {+ assert.match(page, /id: monitorSelection\(model\.id\)\.id,/);+ assert.match(page, /name: activeModel,\s*id: activeId,/);+ assert.match(page, /const \{ id \} = model;/);+ assert.doesNotMatch(page, /const id = monitorSelection\(model\.name\)\.id;/);+});diff --git a/studio/frontend/tests/api-token-default-name.test.ts b/studio/frontend/tests/api-token-default-name.test.tsnew file mode 100644index 00000000000..fb49c536227--- /dev/null+++ b/studio/frontend/tests/api-token-default-name.test.ts@@ -0,0 +1,39 @@+// 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";++const form = readSrc("features/settings/components/create-key-form.tsx");++// The helper as written in the form, run here without pulling React into the test.+const helperSource = form.slice(+ form.indexOf("export function nextDefaultTokenNumber("),+ form.indexOf("\nexport function CreateKeyForm("),+);+const nextDefaultTokenNumber = new Function(+ `${helperSource+ .replace("export function", "function")+ .replace(/\(\s*names: readonly string\[\],\s*pattern: RegExp,?\s*\): number/, "(names, pattern)")}+ return nextDefaultTokenNumber;`,+)() as (names: readonly string[], pattern: RegExp) => number;++const NEW_TOKEN = /^New Token (\d+)$/;++test("an unnamed token takes the number after every New Token N in use", () => {+ assert.equal(nextDefaultTokenNumber([], NEW_TOKEN), 1);+ assert.equal(nextDefaultTokenNumber(["production", "ci"], NEW_TOKEN), 1);+ assert.equal(nextDefaultTokenNumber(["New Token 1", "New Token 2"], NEW_TOKEN), 3);+ // A gap is not refilled: a revoked "New Token 2" never comes back as a new token's name.+ assert.equal(nextDefaultTokenNumber(["New Token 1", "New Token 3"], NEW_TOKEN), 4);+ assert.equal(nextDefaultTokenNumber(["New Token 12x", "my New Token 9"], NEW_TOKEN), 1);+});++test("an empty name submits the default, and the button is never disabled for it", () => {+ assert.match(form, /createApiKey\(name\.trim\(\) \|\| defaultName, expiry\)/);+ assert.match(form, /placeholder=\{t\("settings.apiKeys.tokenNamePlaceholder"\)\}/);+ assert.match(form, /disabled=\{loading\}/);+ assert.match(form, /variant="dark"/);+});diff --git a/studio/frontend/tests/audio-sidebar-workflows.test.ts b/studio/frontend/tests/audio-sidebar-workflows.test.tsindex 240fda19395..9c79f2acb79 100644--- a/studio/frontend/tests/audio-sidebar-workflows.test.ts+++ b/studio/frontend/tests/audio-sidebar-workflows.test.ts@@ -191,7 +191,7 @@ test("a nav row's New pill sits beside its label, clear of the trailing disclosu// no ml-auto: a trailing pill would sit under the overlay's chevron.assert.match(item,- /<Badge\s+variant="secondary"\s+className="group-data-\[collapsible=icon\]:hidden"\s*>\s*\{badge\}/,+ /<Badge\s+variant="accent"\s+className="group-data-\[collapsible=icon\]:hidden"\s*>\s*\{badge\}/,);assert.match(item, /\{overlay\}/);const more = block(diff --git a/studio/frontend/tests/chat-continuation.test.ts b/studio/frontend/tests/chat-continuation.test.tsindex 54d0c376399..c2a8b9c744b 100644--- a/studio/frontend/tests/chat-continuation.test.ts+++ b/studio/frontend/tests/chat-continuation.test.ts@@ -422,7 +422,7 @@ test("the bar offers the way out in place of a Continue that cannot help", () =>);assert.match(thread,- /\{remedy \? null : \([\s\S]{0,400}Resume\n\s*<\/Button>/,+ /\{remedy \? null : \([\s\S]{0,700}<span>Resume<\/span>\n\s*<\/Button>/,"the resume button is offered again for a cut it cannot help",);});diff --git a/studio/frontend/tests/chat-model-load-replacement.test.ts b/studio/frontend/tests/chat-model-load-replacement.test.tsindex a6f4fe6079b..6e74b0a8b94 100644--- a/studio/frontend/tests/chat-model-load-replacement.test.ts+++ b/studio/frontend/tests/chat-model-load-replacement.test.ts@@ -265,6 +265,7 @@ test("declining B before A unloads X lets C inherit X's newly edited settings",const decline = section(runtime, "if (!stopDecision.proceed) {", "// Re-check the tracked picker for a load");const chooseC = section(runtime, "if (pendingReplacementRollback?.config) {", "// The cancelled run's own rollback target");const declineB = new Function("state", `let pendingReplacementRollback = state.pending;+ let modelLoadCancelEpoch = 0;const modelSelectionIntentEpoch = state.epoch, loadIntentId = 2, stopDecision = { proceed: false };const releasePreflightLifecycleLease = () => { state.released = true; };const restorePreviousConfig = () => { state.restored = true; };diff --git a/studio/frontend/tests/composer-icon-alignment.test.ts b/studio/frontend/tests/composer-icon-alignment.test.tsindex 59c3d501c46..4f54b4afb3d 100644--- a/studio/frontend/tests/composer-icon-alignment.test.ts+++ b/studio/frontend/tests/composer-icon-alignment.test.ts@@ -33,10 +33,10 @@ test("every composer send arrow uses the shared sizing class", () => {for (const arrow of arrows) assert.match(arrow, /unsloth-send-icon/);});-test("every isolated composer stop square keeps its size-3 glyph", () => {+test("every isolated composer stop square draws at size-3.5, about a third of its circle", () => {const stops = componentSources.flatMap((source) => tags(source, "SquareIcon"))- .filter((tag) => /\bsize-3\b/.test(tag));+ .filter((tag) => /\bsize-3\.5(?![\w.-])/.test(tag));assert.equal(stops.length, 6);});diff --git a/studio/frontend/tests/context-usage-compact.test.ts b/studio/frontend/tests/context-usage-compact.test.tsindex 9348006a012..fbcddaf5bbf 100644--- a/studio/frontend/tests/context-usage-compact.test.ts+++ b/studio/frontend/tests/context-usage-compact.test.ts@@ -16,7 +16,10 @@ test("the compact face is the ring, unless there is no window to fill", () => {test("the bar hands every input to the state, batching flags included", () => {const bar = readSrc("features/chat/components/context-usage-bar.tsx");- assert.match(bar, /\(\{ className, compactUnknownAsIcon = false, \.\.\.input \}\) => \{\s*const state = deriveContextUsageBar\(input\);/);+ assert.match(+ bar,+ /\(\{ className, compactUnknownAsIcon = false, pinOnClick = false, hoverClassName, padX = 2\.5, ringFirst = false, \.\.\.input \}\) => \{\s*const pin = useClickPin\(pinOnClick\);\s*const state = deriveContextUsageBar\(input\);/,+ );});test("the header shrinks the context bar before the model name", () => {@@ -30,6 +33,6 @@ test("both faces draw the ring, not the line", () => {assert.match(bar, /\{compactFace === null \? \(\s*<span[^>]*>\s*<UsageRing /);// The full face retains the state's ring policy; only the compact fallback can opt into an icon.assert.match(bar, /const showRing = state\.compactFace === null;/);- assert.match(bar, /\{showRing \? <UsageRing percent=\{percent\} stroke=\{severity\.stroke\} \/> : null\}/);+ assert.match(bar, /\{showRing && ringFirst \? <UsageRing percent=\{percent\} stroke=\{severity\.stroke\} \/> : null\}\s*<Face face=\{face\} \/>\s*\{showRing && !ringFirst \? <UsageRing /);assert.doesNotMatch(bar, /style=\{\{ width: `\$\{percent\}%` \}\}/);});diff --git a/studio/frontend/tests/mcp-access-section.test.ts b/studio/frontend/tests/mcp-access-section.test.tsindex 3b033a459b8..f8a3eb6b2e8 100644--- a/studio/frontend/tests/mcp-access-section.test.ts+++ b/studio/frontend/tests/mcp-access-section.test.ts@@ -30,10 +30,10 @@ const TUNNEL_PREF = readSrc(const LOCALES = { ar, de, en, es, fr, he, hi, it, ja, ko, ptBR, ru, sv, zhCN };-test("only the owner sees it, after the Decision API section, and settings search finds it", () => {+test("only the owner sees it, beside keyless access, and settings search finds it", () => {assert.match(API_TAB,- /\{isOwner \? <DecisionApiSection \/> : null\}\s*\{isOwner \? <McpAccessSection apiKey=\{revealed\} \/> : null\}/,+ /\{isOwner \? \(\s*<>\s*<KeylessApiAccessSection onSettingsChange=\{setKeyless\} \/>\s*<McpAccessSection apiKey=\{revealed\} \/>\s*<\/>\s*\) : null\}/,);assert.doesNotMatch(SECTION, /useIsAccountOwner/);assert.match(diff --git a/studio/frontend/tests/model-memory-multi-model-mode.test.ts b/studio/frontend/tests/model-memory-multi-model-mode.test.tsindex e8ff0e9749e..4a1b9fa4911 100644--- a/studio/frontend/tests/model-memory-multi-model-mode.test.ts+++ b/studio/frontend/tests/model-memory-multi-model-mode.test.ts@@ -133,7 +133,19 @@ test("the row is a three-item Select and the idle row closes the section", () =>const last = (section.parent as ts.JsxElement).children.filter((c) => !(ts.isJsxText(c) && c.containsOnlyTriviaWhiteSpaces)).at(-1);- const lastTag = last ? openingTag(last) : null;+ // The API tab's copy leaves the idle row out: `{full ? <MediaIdleUnloadSetting /> : null}`.+ const lastTags: ts.JsxOpeningLikeElement[] = [];+ const collect = (node: ts.Node): void => {+ const tag = openingTag(node);+ if (tag) {+ lastTags.push(tag);+ }+ ts.forEachChild(node, collect);+ };+ if (last) {+ collect(last);+ }+ const lastTag = lastTags[0] ?? null;assert.equal(lastTag?.tagName.getText(), "MediaIdleUnloadSetting");assert.match(lastTag ? (attr(lastTag, "residencyKey") ?? "") : "",diff --git a/studio/frontend/tests/overlay-scrollbar-gutter.test.ts b/studio/frontend/tests/overlay-scrollbar-gutter.test.tsindex 24e1f8da8ed..1f0ad81d62c 100644--- a/studio/frontend/tests/overlay-scrollbar-gutter.test.ts+++ b/studio/frontend/tests/overlay-scrollbar-gutter.test.ts@@ -274,7 +274,7 @@ test("right-edge action lists reserve the gutter they publish", async () => {);assert.match(apiKeysTab,- /"hover-scrollbar[^"]*overflow-y-auto[^"]*\bpr-1\b[^"]*"[\s\S]{0,200}<div className="overlay-scrollbar-gutter">[\s\S]{0,300}<ApiKeyRow/,+ /"hover-scrollbar[^"]*overflow-y-auto[^"]*\bpr-1\b[^"]*"[\s\S]{0,200}<div className=\{cn\("overlay-scrollbar-gutter", TOKEN_TABLE\)\}>[\s\S]{0,300}<ApiKeyRow/,);const projectSourceDropzone = await readSrcAsync(diff --git a/studio/frontend/tests/projects-page-rows.test.ts b/studio/frontend/tests/projects-page-rows.test.tsindex b203594070d..e257af73055 100644--- a/studio/frontend/tests/projects-page-rows.test.ts+++ b/studio/frontend/tests/projects-page-rows.test.ts@@ -121,7 +121,7 @@ test("the Updated column names the list's order and turns it around", () => {assert.ok(!PAGE.includes("Sort by"), "the sort control is still in the header");assert.ok(!PAGE.includes("sortMode"), "the sort mode outlived its control");assert.match(PAGE, /<div className="relative min-w-0 flex-1 sm:max-w-md">/);- assert.match(PAGE, /className="h-9 w-full rounded-full border-none bg-muted pl-10/);+ assert.match(PAGE, /className="h-control w-full rounded-full border-none bg-muted pl-10/);assert.match(PAGE,/<div className="flex w-full min-w-0 items-center justify-end gap-3 sm:w-auto sm:flex-1">/,diff --git a/studio/frontend/tests/resident-config-match.test.ts b/studio/frontend/tests/resident-config-match.test.tsindex a7c6352e517..c8f066dd6a9 100644--- a/studio/frontend/tests/resident-config-match.test.ts+++ b/studio/frontend/tests/resident-config-match.test.ts@@ -1732,9 +1732,9 @@ test("a pick asks the status about its own model and keeps or replaces the otherassert.equal(USE_CHAT_MODEL_RUNTIME.match(/await readPickStatus\(\)/g)?.length, 2);assert.match(USE_CHAT_MODEL_RUNTIME,- /let keepsOthers =\s*keepModelsLoaded && !forceReload && \(paramsNow\.engine \?\? "auto"\) === "auto";[\s\S]*?const touchesOnlySelected =\s*forceReload && !isExternalModelId\(paramsNow\.checkpoint\) && loadedNow\.length > 1;/,+ /let keepsOthers =\s*keepModelsLoaded && !forceReload && \(paramsNow\.engine \?\? "auto"\) === "auto";[\s\S]*?const touchesOnlySelected =\s*forceReload && !isExternalModelId\(modelId\) && loadedNow\.length > 1;/,);- assert.match(USE_CHAT_MODEL_RUNTIME, /touchesOnlySelected \? \(paramsNow\.checkpoint \?\? undefined\) : undefined,/);+ assert.match(USE_CHAT_MODEL_RUNTIME, /touchesOnlySelected \? modelId : undefined,/);assert.match(USE_CHAT_MODEL_RUNTIME, /stopQueuedRuns\(stopDecision, keepsOthers \|\| touchesOnlySelected\);/);assert.match(USE_CHAT_MODEL_RUNTIME, /if \(!keepsOthers && !touchesOnlySelected\) \{\s*requestLocalPromptQueueStop\(\);/);assert.match(USE_CHAT_MODEL_RUNTIME, /if \(currentCheckpoint && !keepsOthers\)/);diff --git a/studio/frontend/tests/tooltip-open-state.test.ts b/studio/frontend/tests/tooltip-open-state.test.tsindex f5f9fce3a51..a69ca69610a 100644--- a/studio/frontend/tests/tooltip-open-state.test.ts+++ b/studio/frontend/tests/tooltip-open-state.test.ts@@ -57,3 +57,11 @@ test("an uncontrolled tooltip is not held by that latch", () => {true,);});++test("the latch is set only for a controlled tooltip its owner held open", async () => {+ // Already shut when the modal came, its owner never sends another false, so the latch never cleared.+ const { readFileSync } = await import("node:fs");+ const tooltip = readFileSync(new URL("../src/components/ui/tooltip.tsx", import.meta.url), "utf8");+ assert.match(tooltip, /if \(controlledOpenRef\.current\) setDismissedUntilOwnerResets\(true\);/);+ assert.doesNotMatch(tooltip, /^\s*setDismissedUntilOwnerResets\(true\);/m);+});diff --git a/studio/frontend/tests/ui-font-size-scales-spacing.test.ts b/studio/frontend/tests/ui-font-size-scales-spacing.test.tsindex b67771f16e3..c5329cc0c26 100644--- a/studio/frontend/tests/ui-font-size-scales-spacing.test.ts+++ b/studio/frontend/tests/ui-font-size-scales-spacing.test.ts@@ -161,9 +161,9 @@ test("the titlebar reserves room for its controls, which stay in the band", () =});test("the composer's one-row clamp is one row at any size", () => {- // The editor box wins over the input's min-height, so all three clamps and the JS floor move together.+ // The editor box wins over the input's min-height, so all four clamps (the welcome expansion included) and the JS floor move together.const clamps = CSS.match(/calc\(40px \* var\(--ui-space-scale, 1\)\)/g) ?? [];- assert.equal(clamps.length, 3, "a 40px composer clamp is still fixed");+ assert.equal(clamps.length, 4, "a 40px composer clamp is still fixed");const thread = readSrc("components/assistant-ui/thread.tsx");assert.match(thread, /const oneRowHeight = Math\.round\(40 \* uiSpaceScale\);/);assert.doesNotMatch(thread, /Math\.max\(40, editorHeight\)/);diff --git a/tests/studio/playwright_queue_localization.py b/tests/studio/playwright_queue_localization.pyindex 0748368eaea..2c572e3eb34 100644--- a/tests/studio/playwright_queue_localization.py+++ b/tests/studio/playwright_queue_localization.py@@ -204,21 +204,21 @@ GLYPH_GEOMETRY = """() => {return {dx: centre.x - (view.x + view.width / 2),dy: centre.y - (view.y + view.height / 2),+ width: bbox.width,};}"""def check_resume_icon_centred(page, base):- # The play glyph is off-centre in its own viewBox; the icon shifts it back.+ # Optically centred: 1/12 of the glyph's width right of centre (queue-resume-icon.tsx).seed(page, base)page.get_by_role("button", name = "Simulate paused queue", exact = True).click()page.get_by_role("button", name = "More options for queued prompt 1", exact = True).click()page.get_by_role("menuitem", name = "Resume queue", exact = True).wait_for()offset = page.evaluate(GLYPH_GEOMETRY)- # The raw glyph is 0.15 units off centre.- assert abs(offset["dx"]) < 0.05, offset+ assert abs(offset["dx"] - offset["width"] / 12) < 0.1, offsetassert abs(offset["dy"]) < 0.05, offset- print("PASS: the resume glyph is centred in its icon box", flush = True)+ print("PASS: the resume glyph is optically centred in its icon box", flush = True)def check_queue_frame_clips_scrollbar(page, base):