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: Skills pill in the composer for quick toggling (#12631)
Michael Hanb93b8e0599ab
diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsxindex cba3c72a73f..09b47416d45 100644--- a/studio/frontend/src/components/assistant-ui/thread.tsx+++ b/studio/frontend/src/components/assistant-ui/thread.tsx@@ -189,6 +189,7 @@ import {watchAutoContinueRun,} from "@/features/chat/utils/auto-continue-run-keeper";import { McpComposerButton } from "@/features/chat/mcp-composer-button";+import { SkillsComposerButton } from "@/features/chat/skills-composer-button";import { pickerAcceptForTextBasenames } from "@/features/chat/text-attachment-accept";import {COMPOSER_INPUT_SELECTOR,@@ -5377,6 +5378,7 @@ const Composer: FC<{{mcpEnabledForChat ? (<McpComposerButton side={effectiveMenuSide} />) : null}+ <SkillsComposerButton side={effectiveMenuSide} /></>) : null}</div>diff --git a/studio/frontend/src/features/chat/shared-composer.tsx b/studio/frontend/src/features/chat/shared-composer.tsxindex 25bf2c0b2a8..9a916cc0ad3 100644--- a/studio/frontend/src/features/chat/shared-composer.tsx+++ b/studio/frontend/src/features/chat/shared-composer.tsx@@ -134,6 +134,7 @@ import {} from "./api/prompts-api";import { PromptCountBadge } from "./prompt-storage/prompt-count-badge";import { McpComposerButton } from "./mcp-composer-button";+import { SkillsComposerButton } from "./skills-composer-button";import { PermissionModeComposerPill } from "./permission-mode-select";import { reasoningCapsFromLoad } from "./lib/apply-inference-status-to-store";import { resyncInferenceStatusAfterServerModelChange } from "./hooks/use-chat-model-runtime";@@ -3054,6 +3055,7 @@ export function SharedComposer({</button>) : null}{mcpEnabledForChat ? <McpComposerButton side="top" /> : null}+ <SkillsComposerButton side="top" /></div>{/* mr-0.5 matches the send button inset from the edge in normal chat; gap-1.5 matches its control spacing. */}<div className="ml-auto mr-0.5 flex items-center gap-1.5">diff --git a/studio/frontend/src/features/chat/skills-composer-button.tsx b/studio/frontend/src/features/chat/skills-composer-button.tsxnew file mode 100644index 00000000000..fff8883e8b3--- /dev/null+++ b/studio/frontend/src/features/chat/skills-composer-button.tsx@@ -0,0 +1,140 @@+// 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 { Scroll01Icon } from "@hugeicons/core-free-icons";+import { HugeiconsIcon } from "@hugeicons/react";+import { ChevronDownIcon } from "lucide-react";+import { useState } from "react";+import { toast } from "sonner";++import {+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuLabel,+ DropdownMenuSeparator,+ DropdownMenuTrigger,+} from "@/components/ui/dropdown-menu";+import { useT } from "@/i18n";+import { MenuTickIcon } from "@/lib/tick-icon";++import {+ refreshSkillsCatalog,+ setSkillEnabled,+ useSkillsCatalog,+} from "./api/skills-api";+import { ChatSkillsDialog } from "./components/chat-skills-dialog";++/** Composer pill for the enabled skills, shown once any is on. Toggles them in place. */+export function SkillsComposerButton({+ side = "bottom",+}: {+ side?: "top" | "bottom";+} = {}) {+ const t = useT();+ const { skills } = useSkillsCatalog();+ const [menuOpen, setMenuOpen] = useState(false);+ const [dialogOpen, setDialogOpen] = useState(false);+ const [pending, setPending] = useState<ReadonlySet<string>>(() => new Set());++ // Runnable skills only: shadowed or invalid ones stay in Manage skills.+ const usable = skills.filter((skill) => skill.valid && !skill.shadowed);+ const enabledCount = usable.filter((skill) => skill.enabled).length;++ async function toggle(name: string, enabled: boolean) {+ if (pending.has(name)) return;+ setPending((current) => new Set(current).add(name));+ try {+ await setSkillEnabled(name, enabled);+ } catch (cause) {+ toast.error(t("skills.updateError"), {+ description: cause instanceof Error ? cause.message : String(cause),+ });+ } finally {+ setPending((current) => {+ const next = new Set(current);+ next.delete(name);+ return next;+ });+ }+ }++ return (+ <>+ {/* Stays while open, so turning off the last skill does not close it. */}+ {enabledCount > 0 || menuOpen ? (+ <DropdownMenu+ open={menuOpen}+ onOpenChange={(open) => {+ setMenuOpen(open);+ if (open) refreshSkillsCatalog();+ }}+ >+ <DropdownMenuTrigger asChild={true}>+ <button+ type="button"+ className="composer-pill-btn"+ data-pill-label={t("skills.title")}+ data-active={enabledCount > 0 ? "true" : "false"}+ aria-label={t("skills.title")}+ >+ <span className="composer-pill-glyph">+ <HugeiconsIcon+ icon={Scroll01Icon}+ className="size-[calc(15px*var(--ui-space-scale,1))]"+ strokeWidth={2}+ />+ </span>+ <span>{t("skills.title")}</span>+ <ChevronDownIcon+ strokeWidth={1.5}+ className="composer-pill-caret size-[calc(15px*var(--ui-space-scale,1))]"+ />+ </button>+ </DropdownMenuTrigger>+ <DropdownMenuContent+ side={side}+ align="start"+ sideOffset={0}+ avoidCollisions={true}+ className="unsloth-plus-menu mcp-menu w-[calc(232px*var(--ui-space-scale,1))]"+ >+ <DropdownMenuLabel>{t("skills.title")}</DropdownMenuLabel>+ <div className="max-h-[calc(280px*var(--ui-space-scale,1))] overflow-y-auto">+ {usable.map((skill) => (+ <DropdownMenuItem+ key={`${skill.source}:${skill.name}`}+ disabled={pending.has(skill.name)}+ // Stays open to toggle several.+ onSelect={(event) => {+ event.preventDefault();+ void toggle(skill.name, !skill.enabled);+ }}+ aria-label={t(skill.enabled ? "skills.disable" : "skills.enable", {+ name: skill.name,+ })}+ className={skill.enabled ? "text-primary font-medium" : undefined}+ >+ <span className="truncate">{skill.name}</span>+ {skill.enabled ? (+ <HugeiconsIcon icon={MenuTickIcon} strokeWidth={2} className="ml-auto" />+ ) : null}+ </DropdownMenuItem>+ ))}+ </div>+ <DropdownMenuSeparator />+ <DropdownMenuItem+ onSelect={() => {+ setMenuOpen(false);+ setDialogOpen(true);+ }}+ >+ {t("skills.manage")}+ </DropdownMenuItem>+ </DropdownMenuContent>+ </DropdownMenu>+ ) : null}+ <ChatSkillsDialog open={dialogOpen} onOpenChange={setDialogOpen} />+ </>+ );+}diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.tsindex d963228bc1b..eb91cd9b44a 100644--- a/studio/frontend/src/i18n/locales/ar.ts+++ b/studio/frontend/src/i18n/locales/ar.ts@@ -3151,6 +3151,7 @@ export const ar = {discardDescription: "ستُفقد التعديلات غير المحفوظة على {name}.",discard: "تجاهل",mentions: "المهارات",+ manage: "إدارة المهارات",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.tsindex 317896ca2f4..2c01edb1379 100644--- a/studio/frontend/src/i18n/locales/de.ts+++ b/studio/frontend/src/i18n/locales/de.ts@@ -3220,6 +3220,7 @@ export const de = {discardDescription: "Nicht gespeicherte Änderungen an {name} gehen verloren.",discard: "Verwerfen",mentions: "Fähigkeiten",+ manage: "Fähigkeiten verwalten",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.tsindex 2c70d051e58..c2f9922bb08 100644--- a/studio/frontend/src/i18n/locales/en.ts+++ b/studio/frontend/src/i18n/locales/en.ts@@ -3175,6 +3175,7 @@ export const en = {discardDescription: "Edits to {name} that are not saved will be lost.",discard: "Discard",mentions: "Skills",+ manage: "Manage skills",},// The Library page, its file viewer, and the menus and toasts that act on its files.library: {diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.tsindex 4df84a2bfa8..f495e541a1f 100644--- a/studio/frontend/src/i18n/locales/es.ts+++ b/studio/frontend/src/i18n/locales/es.ts@@ -3217,6 +3217,7 @@ export const es = {discardDescription: "Los cambios en {name} que no se hayan guardado se perderán.",discard: "Descartar",mentions: "Habilidades",+ manage: "Gestionar habilidades",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.tsindex 2318c64fcfe..6bfd3e91f0e 100644--- a/studio/frontend/src/i18n/locales/fr.ts+++ b/studio/frontend/src/i18n/locales/fr.ts@@ -3231,6 +3231,7 @@ export const fr = {discardDescription: "Les modifications non enregistrées de {name} seront perdues.",discard: "Abandonner",mentions: "Compétences",+ manage: "Gérer les compétences",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.tsindex 942dfe2c064..c196bb64902 100644--- a/studio/frontend/src/i18n/locales/hi.ts+++ b/studio/frontend/src/i18n/locales/hi.ts@@ -3158,6 +3158,7 @@ export const hi = {discardDescription: "{name} में असहेजे बदलाव खो जाएँगे।",discard: "छोड़ें",mentions: "कौशल",+ manage: "कौशल प्रबंधित करें",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.tsindex eb2cdc2ac04..b8b6068edfa 100644--- a/studio/frontend/src/i18n/locales/it.ts+++ b/studio/frontend/src/i18n/locales/it.ts@@ -3220,6 +3220,7 @@ export const it = {discardDescription: "Le modifiche non salvate a {name} andranno perse.",discard: "Scarta",mentions: "Competenze",+ manage: "Gestisci competenze",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.tsindex b77f9bb3a8b..6b01ae47325 100644--- a/studio/frontend/src/i18n/locales/ja.ts+++ b/studio/frontend/src/i18n/locales/ja.ts@@ -3099,6 +3099,7 @@ export const ja = {discardDescription: "{name} の保存されていない変更は失われます。",discard: "破棄",mentions: "スキル",+ manage: "スキルを管理",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.tsindex bcaee828917..b2775dc673e 100644--- a/studio/frontend/src/i18n/locales/ko.ts+++ b/studio/frontend/src/i18n/locales/ko.ts@@ -3145,6 +3145,7 @@ export const ko = {discardDescription: "{name}의 저장되지 않은 변경 사항이 사라집니다.",discard: "버리기",mentions: "스킬",+ manage: "스킬 관리",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.tsindex 7cfef1ce41c..8f117635011 100644--- a/studio/frontend/src/i18n/locales/pt-br.ts+++ b/studio/frontend/src/i18n/locales/pt-br.ts@@ -3179,6 +3179,7 @@ export const ptBR = {discardDescription: "As alterações não salvas em {name} serão perdidas.",discard: "Descartar",mentions: "Habilidades",+ manage: "Gerenciar habilidades",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.tsindex d7319311a07..1cbfcc31e4c 100644--- a/studio/frontend/src/i18n/locales/ru.ts+++ b/studio/frontend/src/i18n/locales/ru.ts@@ -3178,6 +3178,7 @@ export const ru = {discardDescription: "Несохранённые изменения в {name} будут потеряны.",discard: "Отменить",mentions: "Навыки",+ manage: "Управлять навыками",},library: {tabs: {diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.tsindex 6d2d075ae54..32fcaf1869d 100644--- a/studio/frontend/src/i18n/locales/zh-CN.ts+++ b/studio/frontend/src/i18n/locales/zh-CN.ts@@ -3059,6 +3059,7 @@ export const zhCN = {discardDescription: "对 {name} 未保存的修改将会丢失。",discard: "放弃",mentions: "技能",+ manage: "管理技能",},library: {tabs: {diff --git a/studio/frontend/tests/skills-composer-pill.test.ts b/studio/frontend/tests/skills-composer-pill.test.tsnew file mode 100644index 00000000000..468cfabfa43--- /dev/null+++ b/studio/frontend/tests/skills-composer-pill.test.ts@@ -0,0 +1,31 @@+// 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 { readFile } from "node:fs/promises";+import test from "node:test";++const read = (path: string) => readFile(new URL(path, import.meta.url), "utf8");+const PILL = await read("../src/features/chat/skills-composer-button.tsx");+const THREAD = await read("../src/components/assistant-ui/thread.tsx");+const SHARED = await read("../src/features/chat/shared-composer.tsx");++test("the Skills pill shows once a usable skill is on, in both composers", () => {+ assert.match(PILL, /skills\.filter\(\(skill\) => skill\.valid && !skill\.shadowed\)/);+ assert.match(PILL, /\{enabledCount > 0 \|\| menuOpen \? \(/);+ assert.match(THREAD, /<SkillsComposerButton side=\{effectiveMenuSide\} \/>/);+ assert.match(SHARED, /<SkillsComposerButton side="top" \/>/);+});++test("one list of every runnable skill under the Skills title, then Manage skills", () => {+ assert.match(PILL, /<DropdownMenuLabel>\{t\("skills\.title"\)\}<\/DropdownMenuLabel>/);+ assert.doesNotMatch(PILL, /source !== "bundled"|Settings02Icon/);+ assert.match(PILL, /<DropdownMenuSeparator \/>\s*<DropdownMenuItem/);+});++test("the Skills pill toggles in place and links to the full dialog", () => {+ assert.match(PILL, /event\.preventDefault\(\);\s*void toggle\(skill\.name, !skill\.enabled\);/);+ assert.match(PILL, /await setSkillEnabled\(name, enabled\);/);+ assert.match(PILL, /t\("skills\.manage"\)/);+ assert.match(PILL, /<ChatSkillsDialog open=\{dialogOpen\} onOpenChange=\{setDialogOpen\} \/>/);+});