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: reorder the chat + menu, with Deep research and Browser use (#13679)
Michael Han34b84f751ddf
diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsxindex f3474927842..acd19d7fa9c 100644--- a/studio/frontend/src/components/assistant-ui/thread.tsx+++ b/studio/frontend/src/components/assistant-ui/thread.tsx@@ -276,7 +276,7 @@ import {import { useExternalProvidersStore } from "@/features/chat/stores/external-providers-store";import { saveMarkdownAsProjectSource } from "@/features/rag";import {- PLUS_MENU_ORDER,+ splitPlusMenuItems,CONVERSATION_MARKDOWN_LABEL,addQueuedChatRunSettingsThreadIds,adoptPreStreamRunReservation,@@ -6924,6 +6924,7 @@ const ComposerToolsMenu: FC<{const menuIsDictating = useAuiState((s) => s.composer.dictation != null);const plusPins = usePlusMenuPrefsStore((s) => s.pins);+ const plusOrder = usePlusMenuPrefsStore((s) => s.order);const [recentPrompts, setRecentPrompts] = useState<PromptEntry[]>([]);const [recentLists, setRecentLists] = useState<PromptListEntry[]>([]);@@ -6996,6 +6997,28 @@ const ComposerToolsMenu: FC<{// (photos, web search, code) and "More" itself are always shown and live// outside this map.const plusMenuNodes: Record<PlusMenuItemId, ReactNode> = {+ deepResearch: researchAvailable ? (+ <DropdownMenuItem+ disabled={researchDisabled && !deepResearchEnabled}+ className={+ deepResearchEnabled && !researchDisabled+ ? "text-primary font-medium"+ : undefined+ }+ onSelect={() => setDeepResearchEnabled(!deepResearchEnabled)}+ >+ <HugeiconsIcon icon={Telescope02Icon} strokeWidth={2} />+ Deep research+ {deepResearchEnabled && !researchDisabled ? (+ <HugeiconsIcon+ icon={Tick02Icon}+ strokeWidth={2}+ className="ml-auto"+ />+ ) : null}+ </DropdownMenuItem>+ ) : null,+ browserUse: <BrowserAgentMenuItem />,chatWithFiles: (<DropdownMenuItemdisabled={ragDisabled}@@ -7173,8 +7196,8 @@ const ComposerToolsMenu: FC<{</DropdownMenuSub>),};- const pinnedPlusItems = PLUS_MENU_ORDER.filter((id) => plusPins[id]);- const overflowPlusItems = PLUS_MENU_ORDER.filter((id) => !plusPins[id]);+ const { pinned: pinnedPlusItems, overflow: overflowPlusItems } =+ splitPlusMenuItems(plusOrder, plusPins);return (<>@@ -7268,27 +7291,6 @@ const ComposerToolsMenu: FC<{/>) : null}</DropdownMenuItem>- {researchAvailable ? (- <DropdownMenuItem- disabled={researchDisabled && !deepResearchEnabled}- className={- deepResearchEnabled && !researchDisabled- ? "text-primary font-medium"- : undefined- }- onSelect={() => setDeepResearchEnabled(!deepResearchEnabled)}- >- <HugeiconsIcon icon={Telescope02Icon} strokeWidth={2} />- Deep research- {deepResearchEnabled && !researchDisabled ? (- <HugeiconsIcon- icon={Tick02Icon}- strokeWidth={2}- className="ml-auto"- />- ) : null}- </DropdownMenuItem>- ) : null}{supportsBuiltinImageGeneration && (<DropdownMenuItemdisabled={imageDisabled}@@ -7312,13 +7314,8 @@ const ComposerToolsMenu: FC<{)}<DropdownMenuSeparator />{isDictating ? <BypassPermissionsMenuItem /> : null}- {/* Browser use sits right under Chat with files, or leads this section without it. */}- {pinnedPlusItems.includes("chatWithFiles") ? null : <BrowserAgentMenuItem />}{pinnedPlusItems.map((id) => (- <Fragment key={id}>- {plusMenuNodes[id]}- {id === "chatWithFiles" ? <BrowserAgentMenuItem /> : null}- </Fragment>+ <Fragment key={id}>{plusMenuNodes[id]}</Fragment>))}<DropdownMenuSub><DropdownMenuSubTrigger>diff --git a/studio/frontend/src/features/chat/index.ts b/studio/frontend/src/features/chat/index.tsindex e19e72f7a47..7c52fd6693c 100644--- a/studio/frontend/src/features/chat/index.ts+++ b/studio/frontend/src/features/chat/index.ts@@ -314,6 +314,8 @@ export {} from "./utils/queued-chat-run-settings";export {PLUS_MENU_ORDER,+ normalizePlusMenuOrder,+ splitPlusMenuItems,usePlusMenuPrefsStore,type PlusMenuItemId,} from "./stores/plus-menu-prefs-store";diff --git a/studio/frontend/src/features/chat/shared-composer.tsx b/studio/frontend/src/features/chat/shared-composer.tsxindex a747a107493..9ceca481876 100644--- a/studio/frontend/src/features/chat/shared-composer.tsx+++ b/studio/frontend/src/features/chat/shared-composer.tsx@@ -204,7 +204,7 @@ import { useUiSpaceScale } from "@/hooks/use-ui-space-scale";import { useIsMobile } from "@/hooks/use-mobile";import { useT } from "@/i18n";import {- PLUS_MENU_ORDER,+ splitPlusMenuItems,type PlusMenuItemId,usePlusMenuPrefsStore,} from "./stores/plus-menu-prefs-store";@@ -709,6 +709,7 @@ export function SharedComposer({}}, []);const plusPins = usePlusMenuPrefsStore((s) => s.pins);+ const plusOrder = usePlusMenuPrefsStore((s) => s.order);const [isQueueRunning, setIsQueueRunning] = useState(false);const [queueProgress, setQueueProgress] = useState({ current: 0, total: 0 });const queueRef = useRef<string[]>([]);@@ -2549,6 +2550,9 @@ export function SharedComposer({// Adjustable "+" menu items, keyed by id. Pinned ones render at the top level; the rest fall into// the "More" overflow submenu. Core items and "More" itself live outside this map.const plusMenuNodes: Record<PlusMenuItemId, ReactNode> = {+ // Compare runs no research, so the item has nothing to offer here.+ deepResearch: null,+ browserUse: <BrowserAgentMenuItem />,chatWithFiles: (<DropdownMenuItemdisabled={ragDisabled}@@ -2710,8 +2714,8 @@ export function SharedComposer({</DropdownMenuSub>),};- const pinnedPlusItems = PLUS_MENU_ORDER.filter((id) => plusPins[id]);- const overflowPlusItems = PLUS_MENU_ORDER.filter((id) => !plusPins[id]);+ const { pinned: pinnedPlusItems, overflow: overflowPlusItems } =+ splitPlusMenuItems(plusOrder, plusPins);return (<div@@ -2949,12 +2953,8 @@ export function SharedComposer({)}<DropdownMenuSeparator />{/* Browser use sits right under Chat with files, or leads this section without it. */}- {pinnedPlusItems.includes("chatWithFiles") ? null : <BrowserAgentMenuItem />}{pinnedPlusItems.map((id) => (- <Fragment key={id}>- {plusMenuNodes[id]}- {id === "chatWithFiles" ? <BrowserAgentMenuItem /> : null}- </Fragment>+ <Fragment key={id}>{plusMenuNodes[id]}</Fragment>))}<DropdownMenuSub><DropdownMenuSubTrigger>diff --git a/studio/frontend/src/features/chat/stores/plus-menu-prefs-store.ts b/studio/frontend/src/features/chat/stores/plus-menu-prefs-store.tsindex 2a5ca7f124a..be5cb33b45e 100644--- a/studio/frontend/src/features/chat/stores/plus-menu-prefs-store.ts+++ b/studio/frontend/src/features/chat/stores/plus-menu-prefs-store.ts@@ -7,7 +7,9 @@ import { persist } from "zustand/middleware";// Adjustable items in the composer "+" menu. The core items and the "More" overflow itself are// always shown and are intentionally NOT represented here.export type PlusMenuItemId =+ | "deepResearch"| "chatWithFiles"+ | "browserUse"| "mcp"| "skills"| "savedPrompts"@@ -15,10 +17,11 @@ export type PlusMenuItemId =| "exportChat"| "projects";-// Canonical order used both for the pinned items at the top level and for the items that fall-// into the "More" overflow submenu.+// Default order; Settings > Chat lets the user reorder it.export const PLUS_MENU_ORDER: PlusMenuItemId[] = [+ "deepResearch","chatWithFiles",+ "browserUse","mcp","skills","savedPrompts",@@ -30,7 +33,9 @@ export const PLUS_MENU_ORDER: PlusMenuItemId[] = [// Chat with files and Skills sit at the top level; everything else, MCP included, lives under// "More". Projects is a workspace the user opts into, not a per-message attachment.const DEFAULT_PINS: Record<PlusMenuItemId, boolean> = {+ deepResearch: true,chatWithFiles: true,+ browserUse: true,mcp: false,skills: true,projects: false,@@ -41,10 +46,44 @@ const DEFAULT_PINS: Record<PlusMenuItemId, boolean> = {export const PLUS_MENU_PINS_STORAGE_KEY = "unsloth_plus_menu_pins";+/** A saved order with unknown ids dropped and missing ones (added in a later release) placed+ * after their default predecessor, so an older order still names every item once. */+export function normalizePlusMenuOrder(saved: unknown): PlusMenuItemId[] {+ const known = new Set<string>(PLUS_MENU_ORDER);+ const order: PlusMenuItemId[] = [];+ if (Array.isArray(saved)) {+ for (const id of saved) {+ if (typeof id === "string" && known.has(id) && !order.includes(id as PlusMenuItemId)) {+ order.push(id as PlusMenuItemId);+ }+ }+ }+ PLUS_MENU_ORDER.forEach((id, index) => {+ if (order.includes(id)) return;+ const before = PLUS_MENU_ORDER.slice(0, index).reverse().find((prev) => order.includes(prev));+ order.splice(before ? order.indexOf(before) + 1 : 0, 0, id);+ });+ return order;+}++export function splitPlusMenuItems(+ order: readonly PlusMenuItemId[],+ pins: Record<PlusMenuItemId, boolean>,+): { pinned: PlusMenuItemId[]; overflow: PlusMenuItemId[] } {+ return {+ pinned: order.filter((id) => pins[id]),+ overflow: order.filter((id) => !pins[id]),+ };+}+export interface PlusMenuPrefsState {pins: Record<PlusMenuItemId, boolean>;setPin: (id: PlusMenuItemId, value: boolean) => void;togglePin: (id: PlusMenuItemId) => void;+ order: PlusMenuItemId[];+ setOrder: (order: PlusMenuItemId[]) => void;+ /** Default order and pins; saved prompt and list pins are kept. */+ resetMenu: () => void;// Ids of saved prompts the user pinned into the "Saved prompts" submenu. Kept client-side like// the menu pins above, since prompts are addressed by their stable server id.pinnedPromptIds: string[];@@ -61,6 +100,9 @@ export const usePlusMenuPrefsStore = create<PlusMenuPrefsState>()(set((state) => ({ pins: { ...state.pins, [id]: value } })),togglePin: (id) =>set((state) => ({ pins: { ...state.pins, [id]: !state.pins[id] } })),+ order: [...PLUS_MENU_ORDER],+ setOrder: (order) => set({ order: normalizePlusMenuOrder(order) }),+ resetMenu: () => set({ pins: { ...DEFAULT_PINS }, order: [...PLUS_MENU_ORDER] }),pinnedPromptIds: [],togglePinnedPrompt: (id) =>set((state) => ({@@ -94,6 +136,7 @@ export const usePlusMenuPrefsStore = create<PlusMenuPrefsState>()(return {...current,pins: { ...DEFAULT_PINS, ...(saved?.pins ?? {}) },+ order: normalizePlusMenuOrder(saved?.order),pinnedPromptIds: saved?.pinnedPromptIds ?? [],pinnedListIds: saved?.pinnedListIds ?? [],};diff --git a/studio/frontend/src/features/settings/components/chat-menu-order-list.tsx b/studio/frontend/src/features/settings/components/chat-menu-order-list.tsxnew file mode 100644index 00000000000..c1772596f20--- /dev/null+++ b/studio/frontend/src/features/settings/components/chat-menu-order-list.tsx@@ -0,0 +1,170 @@+// 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 { Switch } from "@/components/ui/switch";+import { type PlusMenuItemId, usePlusMenuPrefsStore } from "@/features/chat";+import { useT } from "@/i18n";+import {+ AttachmentIcon,+ CodeIcon,+ DragDropVerticalIcon,+ InternetIcon,+ MoreHorizontalIcon,+} from "@hugeicons/core-free-icons";+import { HugeiconsIcon, type IconSvgElement } from "@hugeicons/react";+import { Reorder, useDragControls } from "motion/react";+import { type ReactNode, type RefObject, useRef, useState } from "react";++type ItemMeta = { label: string; icon: ReactNode };++// Same row as the Profile menu customizer (sidebar-menu-customizer.tsx).+function FixedRow({ icon, label }: { icon: IconSvgElement; label: string }) {+ return (+ <div className="flex h-9 items-center gap-2.5 rounded-lg px-2 text-muted-foreground/70">+ <span className="size-4" aria-hidden="true" />+ <HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-4" />+ <span className="text-ui-13">{label}</span>+ </div>+ );+}++function MovableRow({+ id,+ meta,+ index,+ order,+ bounds,+ onDrop,+}: {+ id: PlusMenuItemId;+ meta: ItemMeta;+ index: number;+ order: PlusMenuItemId[];+ bounds: RefObject<HTMLUListElement | null>;+ onDrop: () => void;+}) {+ const t = useT();+ const controls = useDragControls();+ const pinned = usePlusMenuPrefsStore((s) => s.pins[id]);+ const togglePin = usePlusMenuPrefsStore((s) => s.togglePin);+ const setOrder = usePlusMenuPrefsStore((s) => s.setOrder);+ return (+ <Reorder.Item+ value={id}+ data-menu-item={id}+ dragListener={false}+ dragControls={controls}+ layout="position"+ // The row stays inside the list instead of following the pointer over the rest of the tab.+ dragConstraints={bounds}+ dragElastic={0}+ onDragEnd={onDrop}+ whileDrag={{+ backgroundColor: "var(--popover)",+ boxShadow: "0 4px 16px rgb(0 0 0 / 0.18)",+ zIndex: 10,+ }}+ className="relative flex h-9 items-center gap-2.5 rounded-lg px-2"+ >+ <button+ type="button"+ aria-label={t("settings.appearance.sidebarMenu.dragToReorder")}+ onPointerDown={(e) => {+ e.preventDefault();+ controls.start(e);+ }}+ // Arrow keys move the row too, since a pointer drag has no keyboard path.+ onKeyDown={(e) => {+ const to =+ index + (e.key === "ArrowUp" ? -1 : e.key === "ArrowDown" ? 1 : 0);+ if (to === index || to < 0 || to >= order.length) {+ return;+ }+ e.preventDefault();+ const next = [...order];+ next.splice(to, 0, ...next.splice(index, 1));+ setOrder(next);+ }}+ className="flex size-4 shrink-0 cursor-grab touch-none items-center justify-center text-muted-foreground active:cursor-grabbing"+ >+ <HugeiconsIcon+ icon={DragDropVerticalIcon}+ strokeWidth={1.75}+ className="size-4"+ />+ </button>+ <span className="flex size-4 items-center justify-center text-foreground/80 [&_svg]:size-4">+ {meta.icon}+ </span>+ <span className="text-ui-13 text-foreground">{meta.label}</span>+ <Switch+ className="ml-auto"+ aria-label={meta.label}+ checked={pinned}+ onCheckedChange={() => togglePin(id)}+ />+ </Reorder.Item>+ );+}++/** The "+" menu's movable items between its fixed ones, laid out as the menu shows them. */+export function ChatMenuOrderList({+ items,+}: { items: Record<PlusMenuItemId, ItemMeta> }) {+ const t = useT();+ const order = usePlusMenuPrefsStore((s) => s.order);+ const setOrder = usePlusMenuPrefsStore((s) => s.setOrder);+ const listRef = useRef<HTMLUListElement>(null);+ // Swaps stay local while dragging; the store (persisted, read by both + menus) takes the drop.+ const [draft, setDraftState] = useState<PlusMenuItemId[] | null>(null);+ // Read on drop: the last swap and the release can land before a re-render.+ const draftRef = useRef<PlusMenuItemId[] | null>(null);+ const setDraft = (ids: PlusMenuItemId[] | null) => {+ draftRef.current = ids;+ setDraftState(ids);+ };+ const shown = draft ?? order;+ const drop = () => {+ if (draftRef.current) {+ setOrder(draftRef.current);+ }+ setDraft(null);+ };+ return (+ <div+ data-testid="chat-menu-order"+ className="flex flex-col rounded-xl border border-border/70 p-1.5"+ >+ <FixedRow+ icon={AttachmentIcon}+ label={t("settings.chat.menu.addFiles")}+ />+ <FixedRow icon={InternetIcon} label={t("settings.chat.menu.webSearch")} />+ <FixedRow icon={CodeIcon} label={t("settings.chat.menu.tools")} />+ <div className="mx-2 my-1 border-t border-border/70" />+ <Reorder.Group+ ref={listRef}+ axis="y"+ values={shown}+ onReorder={(ids: PlusMenuItemId[]) => setDraft(ids)}+ className="flex flex-col"+ >+ {shown.map((id, index) => (+ <MovableRow+ key={id}+ id={id}+ meta={items[id]}+ index={index}+ order={shown}+ bounds={listRef}+ onDrop={drop}+ />+ ))}+ </Reorder.Group>+ <FixedRow+ icon={MoreHorizontalIcon}+ label={t("settings.chat.menu.more")}+ />+ </div>+ );+}diff --git a/studio/frontend/src/features/settings/tabs/chat-tab.tsx b/studio/frontend/src/features/settings/tabs/chat-tab.tsxindex 9fab7499a88..7f1161f4bbf 100644--- a/studio/frontend/src/features/settings/tabs/chat-tab.tsx+++ b/studio/frontend/src/features/settings/tabs/chat-tab.tsx@@ -38,8 +38,10 @@ import {LibrariesIcon,McpServerIcon,Scroll01Icon,+ Telescope02Icon,} from "@hugeicons/core-free-icons";import { HugeiconsIcon } from "@hugeicons/react";+import { CursorInWindowIcon } from "@/lib/browser-use-icon";import { useNavigate } from "@tanstack/react-router";import { Columns2Icon } from "lucide-react";import { useEffect, useState } from "react";@@ -55,13 +57,14 @@ import {toolResultLimitChoices,updateToolResultLimit,} from "../api/tool-result-limit";+import { ChatMenuOrderList } from "../components/chat-menu-order-list";import { FirstTokenTimeoutRow } from "../components/first-token-timeout-row";import { SettingsRow } from "../components/settings-row";import { ComposerSettings } from "../components/composer-settings";import { SettingsSection } from "../components/settings-section";import { useSettingsDialogStore } from "../stores/settings-dialog-store";-// Adjustable "+" menu items shown in settings, in display order. Icons mirror+// Adjustable "+" menu items shown in settings; the list shows them in the user's order. Icons mirror// the ones used in the composer + menu itself.const PLUS_MENU_ICON_CLASS = "size-[calc(18px*var(--ui-space-scale,1))]";const PLUS_MENU_SETTINGS: {@@ -69,6 +72,28 @@ const PLUS_MENU_SETTINGS: {labelKey: TranslationKey;icon: ReactNode;}[] = [+ {+ id: "deepResearch",+ labelKey: "settings.chat.menu.deepResearch",+ icon: (+ <HugeiconsIcon+ icon={Telescope02Icon}+ strokeWidth={2}+ className={PLUS_MENU_ICON_CLASS}+ />+ ),+ },+ {+ id: "browserUse",+ labelKey: "settings.chat.menu.browserUse",+ icon: (+ <HugeiconsIcon+ icon={CursorInWindowIcon}+ strokeWidth={2}+ className={PLUS_MENU_ICON_CLASS}+ />+ ),+ },{id: "chatWithFiles",labelKey: "settings.chat.menu.chatWithFiles",@@ -257,8 +282,7 @@ export function ChatTab() {const isOwner = useIsAccountOwner();const t = useT();const navigate = useNavigate();- const plusPins = usePlusMenuPrefsStore((state) => state.pins);- const togglePlusPin = usePlusMenuPrefsStore((state) => state.togglePin);+ const resetPlusMenu = usePlusMenuPrefsStore((state) => state.resetMenu);const autoTitle = useChatRuntimeStore((state) => state.autoTitle);const setAutoTitle = useChatRuntimeStore((state) => state.setAutoTitle);const projectAttachmentTarget = useChatRuntimeStore(@@ -787,15 +811,25 @@ export function ChatTab() {</SettingsSection>- <SettingsSection title={t("settings.chat.groups.menu.title")}>- {PLUS_MENU_SETTINGS.map((item) => (- <SettingsRow key={item.id} label={t(item.labelKey)} icon={item.icon}>- <Switch- checked={plusPins[item.id]}- onCheckedChange={() => togglePlusPin(item.id)}- />- </SettingsRow>- ))}+ <SettingsSection+ title={t("settings.chat.groups.menu.title")}+ description={t("settings.chat.menu.description")}+ >+ <div className="pt-3">+ <ChatMenuOrderList+ items={Object.fromEntries(+ PLUS_MENU_SETTINGS.map((item) => [+ item.id,+ { label: t(item.labelKey), icon: item.icon },+ ]),+ ) as Record<PlusMenuItemId, { label: string; icon: ReactNode }>}+ />+ </div>+ <div className="flex justify-end pt-1">+ <Button variant="ghost" size="sm" onClick={resetPlusMenu}>+ {t("settings.chat.menu.reset")}+ </Button>+ </div></SettingsSection></div>);diff --git a/studio/frontend/src/i18n/locales/ar.ts b/studio/frontend/src/i18n/locales/ar.tsindex eba8bd160d3..ae8b269b250 100644--- a/studio/frontend/src/i18n/locales/ar.ts+++ b/studio/frontend/src/i18n/locales/ar.ts@@ -2571,14 +2571,20 @@ export const ar = {},menu: {title: "قائمة المحادثة",- description:- "ثبّت العناصر في القائمة الجانبية لعلامة + في المحادثة. تنتقل العناصر الأخرى إلى «المزيد».",+ description: "ثبّت العناصر في قائمة + للدردشة واسحبها لإعادة ترتيبها. تنتقل العناصر الأخرى إلى «المزيد».",+ deepResearch: "بحث معمّق",+ browserUse: "استخدام المتصفح",chatWithFiles: "المحادثة مع الملفات (RAG)",mcp: "MCP",skills: "المهارات",savedPrompts: "الموجّهات المحفوظة",compareChat: "مقارنة المحادثات",exportChat: "تصدير المحادثة",+ reset: "إعادة التعيين إلى الافتراضي",+ addFiles: "إضافة صور وملفات",+ webSearch: "بحث الويب",+ tools: "الأدوات",+ more: "المزيد",},pastedTextThreshold: "ضغط النصوص الملصقة الطويلة",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/de.ts b/studio/frontend/src/i18n/locales/de.tsindex b05d5e0a442..853341b5547 100644--- a/studio/frontend/src/i18n/locales/de.ts+++ b/studio/frontend/src/i18n/locales/de.ts@@ -2610,14 +2610,20 @@ export const de = {},menu: {title: "Chatmenü",- description:- "Elemente im seitlichen Plus-Menü des Chats anheften. Die übrigen werden unter „Mehr“ angezeigt.",+ description: "Hefte Einträge an das +-Menü des Chats und ziehe sie, um die Reihenfolge zu ändern. Andere landen unter „Mehr“.",+ deepResearch: "Tiefenrecherche",+ browserUse: "Browsersteuerung",chatWithFiles: "Chat mit Dateien (RAG)",mcp: "MCP",skills: "Fähigkeiten",savedPrompts: "Gespeicherte Prompts",compareChat: "Chats vergleichen",exportChat: "Chat exportieren",+ reset: "Auf Standard zurücksetzen",+ addFiles: "Fotos & Dateien hinzufügen",+ webSearch: "Websuche",+ tools: "Werkzeuge",+ more: "Mehr",},pastedTextThreshold: "Lange Einfügungen verdichten",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/en.ts b/studio/frontend/src/i18n/locales/en.tsindex 88dff86bc18..4fec7084394 100644--- a/studio/frontend/src/i18n/locales/en.ts+++ b/studio/frontend/src/i18n/locales/en.ts@@ -2619,14 +2619,20 @@ export const en = {},menu: {title: "Chat menu",- description:- "Pin items to chat's + side menu. Others move into “More”.",+ description: "Pin items to chat's + menu and drag them to reorder. Others move into “More”.",+ deepResearch: "Deep research",+ browserUse: "Browser use",chatWithFiles: "Chat with files (RAG)",mcp: "MCP",skills: "Skills",savedPrompts: "Saved prompts",compareChat: "Compare chat",exportChat: "Export chat",+ reset: "Reset to default",+ addFiles: "Add photos & files",+ webSearch: "Web search",+ tools: "Tools",+ more: "More",},pastedTextThreshold: "Condense long pastes",pastedTextThresholdDescription: "Press {shortcut} to paste directly into the message box.",diff --git a/studio/frontend/src/i18n/locales/es.ts b/studio/frontend/src/i18n/locales/es.tsindex 58d60abecd5..2f6b90e8069 100644--- a/studio/frontend/src/i18n/locales/es.ts+++ b/studio/frontend/src/i18n/locales/es.ts@@ -2601,14 +2601,20 @@ export const es = {},menu: {title: "Menú del chat",- description:- "Fija elementos en el menú lateral «+» del chat. Los demás pasarán a «Más».",+ description: "Fija elementos en el menú + del chat y arrástralos para reordenarlos. Los demás pasan a “Más”.",+ deepResearch: "Investigación profunda",+ browserUse: "Uso del navegador",chatWithFiles: "Chat con archivos (RAG)",mcp: "MCP",skills: "Habilidades",savedPrompts: "Prompts guardados",compareChat: "Comparar chats",exportChat: "Exportar chat",+ reset: "Restablecer valores predeterminados",+ addFiles: "Añadir fotos y archivos",+ webSearch: "Búsqueda web",+ tools: "Herramientas",+ more: "Más",},pastedTextThreshold: "Condensar pegados largos",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/fr.ts b/studio/frontend/src/i18n/locales/fr.tsindex 6468f31cf3c..9a6ea36b481 100644--- a/studio/frontend/src/i18n/locales/fr.ts+++ b/studio/frontend/src/i18n/locales/fr.ts@@ -2607,14 +2607,20 @@ export const fr = {},menu: {title: "Menu du chat",- description:- "Épinglez des éléments dans le menu latéral + du chat. Les autres seront placés dans « Plus ».",+ description: "Épinglez des éléments au menu + du chat et faites-les glisser pour les réordonner. Les autres passent dans « Plus ».",+ deepResearch: "Recherche approfondie",+ browserUse: "Utilisation du navigateur",chatWithFiles: "Discuter avec des fichiers (RAG)",mcp: "MCP",skills: "Compétences",savedPrompts: "Invites enregistrées",compareChat: "Comparer le chat",exportChat: "Exporter le chat",+ reset: "Rétablir par défaut",+ addFiles: "Ajouter photos et fichiers",+ webSearch: "Recherche web",+ tools: "Outils",+ more: "Plus",},pastedTextThreshold: "Condenser les collages longs",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/he.ts b/studio/frontend/src/i18n/locales/he.tsindex ae7bd63c7c4..f7a4dd405f7 100644--- a/studio/frontend/src/i18n/locales/he.ts+++ b/studio/frontend/src/i18n/locales/he.ts@@ -2685,14 +2685,20 @@ export const he = {},menu: {title: "תפריט צ'אט",- description:- "הצמד פריטים לתפריט ה-+ של הצ'אט. פריטים אחרים יעברו אל 'עוד'.",+ description: "הצמידו פריטים לתפריט + של הצ'אט וגררו אותם כדי לשנות את הסדר. השאר עוברים אל \"עוד\".",+ deepResearch: "מחקר מעמיק",+ browserUse: "שימוש בדפדפן",chatWithFiles: "צ'אט עם קבצים (RAG)",mcp: "MCP",skills: "מיומנויות",savedPrompts: "פרומפטים שמורים",compareChat: "השוואת צ'אט",exportChat: "ייצוא צ'אט",+ reset: "איפוס לברירת המחדל",+ addFiles: "הוספת תמונות וקבצים",+ webSearch: "חיפוש באינטרנט",+ tools: "כלים",+ more: "עוד",},pastedTextThreshold: "כווץ טקסט מודבק ארוך",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/hi.ts b/studio/frontend/src/i18n/locales/hi.tsindex d12b9882aa8..efb23503846 100644--- a/studio/frontend/src/i18n/locales/hi.ts+++ b/studio/frontend/src/i18n/locales/hi.ts@@ -2578,14 +2578,20 @@ export const hi = {},menu: {title: "चैट मेन्यू",- description:- "आइटम को चैट के + साइड मेन्यू में पिन करें। बाकी आइटम “More” में चले जाएँगे।",+ description: "चैट के + मेन्यू में आइटम पिन करें और क्रम बदलने के लिए उन्हें खींचें। बाकी “More” में चले जाते हैं।",+ deepResearch: "डीप रिसर्च",+ browserUse: "ब्राउज़र उपयोग",chatWithFiles: "फ़ाइलों के साथ चैट (RAG)",mcp: "MCP",skills: "कौशल",savedPrompts: "सहेजे गए प्रॉम्प्ट",compareChat: "चैट की तुलना करें",exportChat: "चैट एक्सपोर्ट करें",+ reset: "डिफ़ॉल्ट पर रीसेट करें",+ addFiles: "फ़ोटो और फ़ाइलें जोड़ें",+ webSearch: "वेब सर्च",+ tools: "टूल्स",+ more: "और",},pastedTextThreshold: "लंबे पेस्ट को संक्षिप्त करें",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/it.ts b/studio/frontend/src/i18n/locales/it.tsindex 8c2ec044e07..8c09703f5c8 100644--- a/studio/frontend/src/i18n/locales/it.ts+++ b/studio/frontend/src/i18n/locales/it.ts@@ -2519,14 +2519,20 @@ export const it = {},menu: {title: "Menu della chat",- description:- "Fissa le voci nel menu laterale «+» della chat. Le altre verranno spostate in «Altro».",+ description: "Fissa gli elementi nel menu + della chat e trascinali per riordinarli. Gli altri finiscono in “Altro”.",+ deepResearch: "Ricerca approfondita",+ browserUse: "Uso del browser",chatWithFiles: "Chat con file (RAG)",mcp: "MCP",skills: "Competenze",savedPrompts: "Prompt salvati",compareChat: "Confronta chat",exportChat: "Esporta chat",+ reset: "Ripristina predefiniti",+ addFiles: "Aggiungi foto e file",+ webSearch: "Ricerca web",+ tools: "Strumenti",+ more: "Altro",},pastedTextThreshold: "Condensa incolla lunghi",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/ja.ts b/studio/frontend/src/i18n/locales/ja.tsindex b913af1ff48..1503fe8ab3e 100644--- a/studio/frontend/src/i18n/locales/ja.ts+++ b/studio/frontend/src/i18n/locales/ja.ts@@ -2555,14 +2555,20 @@ export const ja = {},menu: {title: "チャットメニュー",- description:- "項目をチャットの「+」サイドメニューに固定します。その他の項目は「More」に移動します。",+ description: "チャットの+メニューに項目を固定し、ドラッグして並べ替えます。その他は「その他」に入ります。",+ deepResearch: "ディープリサーチ",+ browserUse: "ブラウザ操作",chatWithFiles: "ファイルとチャット (RAG)",mcp: "MCP",skills: "スキル",savedPrompts: "保存済みプロンプト",compareChat: "チャットを比較",exportChat: "チャットをエクスポート",+ reset: "デフォルトに戻す",+ addFiles: "写真とファイルを追加",+ webSearch: "ウェブ検索",+ tools: "ツール",+ more: "その他",},pastedTextThreshold: "長い貼り付けを圧縮",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/ko.ts b/studio/frontend/src/i18n/locales/ko.tsindex d21afa585dd..bbd320e1c5e 100644--- a/studio/frontend/src/i18n/locales/ko.ts+++ b/studio/frontend/src/i18n/locales/ko.ts@@ -2564,14 +2564,20 @@ export const ko = {},menu: {title: "채팅 메뉴",- description:- "채팅의 + 사이드 메뉴에 항목을 고정합니다. 나머지 항목은 ‘더 보기’로 이동합니다.",+ description: "채팅의 + 메뉴에 항목을 고정하고 드래그해 순서를 바꾸세요. 나머지는 ‘더보기’로 이동합니다.",+ deepResearch: "심층 리서치",+ browserUse: "브라우저 사용",chatWithFiles: "파일과 채팅(RAG)",mcp: "MCP",skills: "스킬",savedPrompts: "저장된 프롬프트",compareChat: "채팅 비교",exportChat: "채팅 내보내기",+ reset: "기본값으로 재설정",+ addFiles: "사진 및 파일 추가",+ webSearch: "웹 검색",+ tools: "도구",+ more: "더보기",},pastedTextThreshold: "긴 붙여넣기 압축",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/pt-br.ts b/studio/frontend/src/i18n/locales/pt-br.tsindex cfbc33833cc..c0f8746d204 100644--- a/studio/frontend/src/i18n/locales/pt-br.ts+++ b/studio/frontend/src/i18n/locales/pt-br.ts@@ -2588,14 +2588,20 @@ export const ptBR = {},menu: {title: "Menu do chat",- description:- "Fixe itens no menu lateral do botão + do chat. Os demais ficam em “Mais”.",+ description: "Fixe itens no menu + do chat e arraste-os para reordenar. Os demais vão para “Mais”.",+ deepResearch: "Pesquisa aprofundada",+ browserUse: "Uso do navegador",chatWithFiles: "Chat com arquivos (RAG)",mcp: "MCP",skills: "Habilidades",savedPrompts: "Prompts salvos",compareChat: "Comparar chats",exportChat: "Exportar chat",+ reset: "Restaurar padrão",+ addFiles: "Adicionar fotos e arquivos",+ webSearch: "Pesquisa na web",+ tools: "Ferramentas",+ more: "Mais",},pastedTextThreshold: "Condensar colagens longas",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/ru.ts b/studio/frontend/src/i18n/locales/ru.tsindex 54099017617..bbd958d5c22 100644--- a/studio/frontend/src/i18n/locales/ru.ts+++ b/studio/frontend/src/i18n/locales/ru.ts@@ -2584,14 +2584,20 @@ export const ru = {},menu: {title: "Меню чата",- description:- "Закрепляйте пункты в боковом меню «+» чата. Остальные будут доступны в разделе «Ещё».",+ description: "Закрепляйте пункты в меню + чата и перетаскивайте их, чтобы изменить порядок. Остальные попадут в «Ещё».",+ deepResearch: "Глубокое исследование",+ browserUse: "Управление браузером",chatWithFiles: "Чат с файлами (RAG)",mcp: "MCP",skills: "Навыки",savedPrompts: "Сохранённые промпты",compareChat: "Сравнить чаты",exportChat: "Экспортировать чат",+ reset: "Сбросить по умолчанию",+ addFiles: "Добавить фото и файлы",+ webSearch: "Веб-поиск",+ tools: "Инструменты",+ more: "Ещё",},pastedTextThreshold: "Сворачивать длинные вставки",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/sv.ts b/studio/frontend/src/i18n/locales/sv.tsindex be077ffa498..e6680164814 100644--- a/studio/frontend/src/i18n/locales/sv.ts+++ b/studio/frontend/src/i18n/locales/sv.ts@@ -2767,14 +2767,20 @@ export const sv = {},menu: {title: "Chattmeny",- description:- "Fäst objekt i chattens +-sidomeny. Övriga flyttas till ”Mer”.",+ description: "Fäst objekt i chattens +-meny och dra dem för att ändra ordning. Övriga hamnar under ”Mer”.",+ deepResearch: "Djupsökning",+ browserUse: "Webbläsarstyrning",chatWithFiles: "Chatta med filer (RAG)",mcp: "MCP",skills: "Färdigheter",savedPrompts: "Sparade uppmaningar",compareChat: "Jämför chatt",exportChat: "Exportera chatt",+ reset: "Återställ standard",+ addFiles: "Lägg till foton och filer",+ webSearch: "Webbsökning",+ tools: "Verktyg",+ more: "Mer",},pastedTextThreshold: "Kondensera långa inklistringar",pastedTextThresholdDescription:diff --git a/studio/frontend/src/i18n/locales/zh-CN.ts b/studio/frontend/src/i18n/locales/zh-CN.tsindex d932c2c0c34..b506f5e0eda 100644--- a/studio/frontend/src/i18n/locales/zh-CN.ts+++ b/studio/frontend/src/i18n/locales/zh-CN.ts@@ -2532,14 +2532,20 @@ export const zhCN = {},menu: {title: "聊天菜单",- description:- "将条目固定到聊天中的“+”侧边菜单,其他条目会移到“更多”中。",+ description: "将项目固定到聊天的 + 菜单,并拖动以调整顺序。其余项目会移到“更多”中。",+ deepResearch: "深度研究",+ browserUse: "浏览器操作",chatWithFiles: "与文件聊天(RAG)",mcp: "MCP",skills: "技能",savedPrompts: "已保存的提示词",compareChat: "对比聊天",exportChat: "导出聊天",+ reset: "恢复默认",+ addFiles: "添加照片和文件",+ webSearch: "网页搜索",+ tools: "工具",+ more: "更多",},pastedTextThreshold: "压缩长粘贴内容",pastedTextThresholdDescription:diff --git a/studio/frontend/tests/chat-menu-order.test.ts b/studio/frontend/tests/chat-menu-order.test.tsnew file mode 100644index 00000000000..7b51fe95815--- /dev/null+++ b/studio/frontend/tests/chat-menu-order.test.ts@@ -0,0 +1,92 @@+// 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 { installLocalStorageFake, readSrc, registerBundlerResolver } from "./helpers/kit.ts";++registerBundlerResolver();+const { store } = installLocalStorageFake();+const {+ PLUS_MENU_ORDER,+ PLUS_MENU_PINS_STORAGE_KEY,+ normalizePlusMenuOrder,+ splitPlusMenuItems,+ usePlusMenuPrefsStore,+} = await import("../src/features/chat/stores/plus-menu-prefs-store.ts");++test("deep research and browser use are menu items, shown by default", () => {+ assert.ok(PLUS_MENU_ORDER.includes("deepResearch"));+ assert.ok(PLUS_MENU_ORDER.includes("browserUse"));+ const { pins } = usePlusMenuPrefsStore.getInitialState();+ assert.equal(pins.deepResearch, true);+ assert.equal(pins.browserUse, true);+});++test("a saved order drops unknown ids and slots new ones after their default neighbour", () => {+ // Saved before this release: no deep research or browser use, one retired id.+ const saved = ["skills", "chatWithFiles", "retired", "mcp", "skills"];+ const order = normalizePlusMenuOrder(saved);+ assert.equal(order.length, PLUS_MENU_ORDER.length);+ assert.equal(new Set(order).size, order.length);+ assert.ok(!order.includes("retired" as never));+ // The user's own items keep their relative order.+ const mine = order.filter((id) => ["skills", "chatWithFiles", "mcp"].includes(id));+ assert.deepEqual(mine, ["skills", "chatWithFiles", "mcp"]);+ // Browser use follows chat with files, as it does by default.+ assert.equal(order[order.indexOf("chatWithFiles") + 1], "browserUse");+ assert.deepEqual(normalizePlusMenuOrder(undefined), PLUS_MENU_ORDER);+});++test("the menu shows pinned items in the saved order and the rest under More in that order", () => {+ const pins = Object.fromEntries(PLUS_MENU_ORDER.map((id) => [id, false])) as Record<+ (typeof PLUS_MENU_ORDER)[number],+ boolean+ >;+ pins.skills = true;+ pins.deepResearch = true;+ const order = normalizePlusMenuOrder(["skills", "mcp", "deepResearch"]);+ const { pinned, overflow } = splitPlusMenuItems(order, pins);+ assert.deepEqual(pinned, ["skills", "deepResearch"]);+ // More keeps the saved order too: mcp was placed before chat with files.+ assert.ok(overflow.indexOf("mcp") < overflow.indexOf("chatWithFiles"));+ assert.equal(pinned.length + overflow.length, PLUS_MENU_ORDER.length);+});++test("an install that saved pins before ordering existed gets the default order and new pins", async () => {+ store.set(+ PLUS_MENU_PINS_STORAGE_KEY,+ JSON.stringify({ state: { pins: { chatWithFiles: false, skills: true } }, version: 1 }),+ );+ await usePlusMenuPrefsStore.persist.rehydrate();+ const state = usePlusMenuPrefsStore.getState();+ assert.deepEqual(state.order, PLUS_MENU_ORDER);+ assert.equal(state.pins.chatWithFiles, false);+ assert.equal(state.pins.browserUse, true);+ state.setOrder(["projects", ...PLUS_MENU_ORDER]);+ assert.equal(usePlusMenuPrefsStore.getState().order[0], "projects");+ usePlusMenuPrefsStore.getState().resetMenu();+ assert.deepEqual(usePlusMenuPrefsStore.getState().order, PLUS_MENU_ORDER);+});++test("both + menus render from the saved order, with no hard-coded browser use slot", () => {+ for (const path of ["components/assistant-ui/thread.tsx", "features/chat/shared-composer.tsx"]) {+ const src = readSrc(path);+ assert.match(src, /splitPlusMenuItems\(plusOrder, plusPins\)/, path);+ assert.match(src, /browserUse: <BrowserAgentMenuItem \/>/, path);+ assert.ok(!src.includes('pinnedPlusItems.includes("chatWithFiles")'), path);+ }+});++test("dragging a chat menu row stays inside the list and saves the order once, on drop", () => {+ const src = readSrc("features/settings/components/chat-menu-order-list.tsx");+ // A hard stop at the list: the row no longer slides over the fixed rows or the heading.+ assert.match(src, /dragConstraints=\{bounds\}\s*dragElastic=\{0\}/);+ // Swaps go to a local draft; the persisted store (read by both + menus) only takes the drop.+ assert.match(src, /onReorder=\{\(ids: PlusMenuItemId\[\]\) => setDraft\(ids\)\}/);+ assert.match(src, /onDragEnd=\{onDrop\}/);+ assert.match(src, /if \(draftRef\.current\) \{\s*setOrder\(draftRef\.current\);/);+ // layoutScroll on the settings pane would double-count its scroll against the constraints.+ assert.ok(!readSrc("features/settings/settings-dialog.tsx").includes("layoutScroll"));+});