Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Studio: More menu hover pill and row height, grouped chat options menu (#15519)

Michael Hanb69c634c7aa8
diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx
index 9490fd8718b..122d1c0c9a2 100644
--- a/studio/frontend/src/components/app-sidebar.tsx
+++ b/studio/frontend/src/components/app-sidebar.tsx
@@ -1025,7 +1025,8 @@ function MoreMenuItem({
>
<HugeiconsIcon icon={icon} strokeWidth={1.75} />
<span className="min-w-0 flex-1 truncate">{label}</span>
- {badge && <Badge variant="accent">{badge}</Badge>}
+ {/* -my-0.5: a 20px badge would make the row 36px. */}
+ {badge && <Badge variant="accent" className="-my-0.5">{badge}</Badge>}
{spinner && <Spinner className="size-3.5 shrink-0 text-muted-foreground" />}
{newAction && (
<button
@@ -1100,7 +1101,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="accent">{badge}</Badge>}
+ {badge && <Badge variant="accent" className="-my-0.5">{badge}</Badge>}
{spinner && (
<Spinner className="size-3.5 shrink-0 text-muted-foreground" />
)}
diff --git a/studio/frontend/src/features/chat/components/chat-header-menu.tsx b/studio/frontend/src/features/chat/components/chat-header-menu.tsx
index a3518df1f19..cda19673a23 100644
--- a/studio/frontend/src/features/chat/components/chat-header-menu.tsx
+++ b/studio/frontend/src/features/chat/components/chat-header-menu.tsx
@@ -72,7 +72,11 @@ import {
getSidebarItemThreadIds,
regenerateChatTitleWithToast,
} from "./chat-row-menu";
-import { OpenChatFolderItem, UploadToChatFolderItem } from "./open-chat-folder-item";
+import {
+ chatFolderSessionId,
+ OpenChatFolderItem,
+ UploadToChatFolderItem,
+} from "./open-chat-folder-item";
const MENU = "library-actions-menu";
const ICON = "size-icon";
@@ -233,6 +237,7 @@ function ChatMenuItems({ menu }: { menu: ActiveChatMenu }) {
>
{t("library.menu.regenerateTitle")}
</Item>
+ <DropdownMenuSeparator className="mx-3" />
<Item
icon={menu.pinned ? PinOffIcon : PinIcon}
onSelect={menu.togglePin}
@@ -289,6 +294,7 @@ function ChatMenuItems({ menu }: { menu: ActiveChatMenu }) {
>
{t("library.chats.menu.fork")}
</Item>
+ <DropdownMenuSeparator className="mx-3" />
<DropdownMenuSub>
<DropdownMenuSubTrigger className="gap-2.5">
<HugeiconsIcon
@@ -397,6 +403,8 @@ function ChatMenuItems({ menu }: { menu: ActiveChatMenu }) {
))}
</DropdownMenuSubContent>
</DropdownMenuSub>
+ {/* Only with the folder items, or it doubles the next separator. */}
+ {chatFolderSessionId(menu.item) ? <DropdownMenuSeparator className="mx-3" /> : null}
<OpenChatFolderItem item={menu.item} />
<UploadToChatFolderItem item={menu.item} />
<DropdownMenuSeparator className="mx-3" />
diff --git a/studio/frontend/src/features/chat/components/open-chat-folder-item.tsx b/studio/frontend/src/features/chat/components/open-chat-folder-item.tsx
index 2fe17be9773..472726fc46a 100644
--- a/studio/frontend/src/features/chat/components/open-chat-folder-item.tsx
+++ b/studio/frontend/src/features/chat/components/open-chat-folder-item.tsx
@@ -41,6 +41,13 @@ function reportRevealError(
}
/** "Open chat folder" (desktop only). Compare chats outside a project get no item. */
+/** None for a compare chat outside a project. */
+export function chatFolderSessionId(item: SidebarItem): string | undefined {
+ return item.type === "single" || item.projectId
+ ? sandboxSessionIdFor(getSidebarItemThreadIds(item)[0] ?? item.id, item.projectId)
+ : undefined;
+}
+
export function OpenChatFolderItem({
item,
Item = DropdownMenuItem,
@@ -50,10 +57,7 @@ export function OpenChatFolderItem({
}) {
const t = useT();
const threadIds = getSidebarItemThreadIds(item);
- const sandboxSessionId =
- item.type === "single" || item.projectId
- ? sandboxSessionIdFor(threadIds[0] ?? item.id, item.projectId)
- : undefined;
+ const sandboxSessionId = chatFolderSessionId(item);
if (!sandboxSessionId) return null;
if (!isTauri) return <OpenChatFolderUnavailableItem Item={Item} />;
return (
@@ -96,10 +100,7 @@ export function UploadToChatFolderItem({
Item?: ComponentType<ComponentProps<typeof DropdownMenuItem>>;
}) {
const t = useT();
- const sandboxSessionId =
- item.type === "single" || item.projectId
- ? sandboxSessionIdFor(getSidebarItemThreadIds(item)[0] ?? item.id, item.projectId)
- : undefined;
+ const sandboxSessionId = chatFolderSessionId(item);
if (!sandboxSessionId) return null;
return (
<Item
diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css
index 14e9b637c30..c42f91af44a 100644
--- a/studio/frontend/src/index.css
+++ b/studio/frontend/src/index.css
@@ -2948,6 +2948,13 @@ html[data-chat-font] .aui-root {
.sidebar-more-menu :is([data-slot="dropdown-menu-item"], [data-slot="dropdown-menu-sub-trigger"]) {
border-radius: 9999px;
}
+ /* Gutter inside the viewport: snapping the w-max width shaved the pill's round end. */
+ .sidebar-more-menu[data-slot] {
+ padding-inline: 0 !important;
+ }
+ .sidebar-more-menu > [data-slot="dropdown-menu-viewport"] {
+ padding-inline: var(--spacing);
+ }
/* On <html> so --accent can be reassigned without a cycle. */
.dark {
diff --git a/studio/frontend/tests/chat-header-menu-groups.test.ts b/studio/frontend/tests/chat-header-menu-groups.test.ts
new file mode 100644
index 00000000000..49b7338e456
--- /dev/null
+++ b/studio/frontend/tests/chat-header-menu-groups.test.ts
@@ -0,0 +1,59 @@
+// 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 MENU = readSrc("features/chat/components/chat-header-menu.tsx");
+
+test("the chat menu splits into naming, marking, copying the chat, moving it out, its folder, and removal", () => {
+ const body = MENU.slice(
+ MENU.indexOf(" return (\n <>\n <Item icon={Edit03Icon}"),
+ );
+ const outer =
+ body.slice(0, body.indexOf('{t("shell.sections.moveTo")}')) +
+ body.slice(body.indexOf('{t("chatMenu.copy")}'));
+ const marks = [
+ 'regenerateTitle")}',
+ 'DropdownMenuSeparator className="mx-3"',
+ "togglePin",
+ "toggleUnread",
+ 'DropdownMenuSeparator className="mx-3"',
+ "chatMenu.compact",
+ "library.chats.menu.fork",
+ 'DropdownMenuSeparator className="mx-3"',
+ "chatMenu.copy",
+ "common.export",
+ 'chatFolderSessionId(menu.item) ? <DropdownMenuSeparator className="mx-3" /> : null',
+ "<OpenChatFolderItem",
+ "<UploadToChatFolderItem",
+ 'DropdownMenuSeparator className="mx-3"',
+ "settings.data.library.archive",
+ "common.delete",
+ ];
+ let at = 0;
+ for (const mark of marks) {
+ const next = outer.indexOf(mark, at);
+ assert.ok(next >= 0, `${mark} out of order`);
+ at = next + mark.length;
+ }
+ assert.equal(
+ outer.match(/<DropdownMenuSeparator className="mx-3" \/>/g)?.length,
+ 5,
+ );
+});
+
+test("the folder items and their separator share one condition", () => {
+ const folder = readSrc("features/chat/components/open-chat-folder-item.tsx");
+ assert.equal(
+ folder.match(/const sandboxSessionId = chatFolderSessionId\(item\);/g)
+ ?.length,
+ 2,
+ );
+ assert.match(
+ folder,
+ /export function chatFolderSessionId\(item: SidebarItem\): string \| undefined \{/,
+ );
+});
diff --git a/studio/frontend/tests/sidebar-more-menu-rows.test.ts b/studio/frontend/tests/sidebar-more-menu-rows.test.ts
new file mode 100644
index 00000000000..1b12020530f
--- /dev/null
+++ b/studio/frontend/tests/sidebar-more-menu-rows.test.ts
@@ -0,0 +1,25 @@
+// 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";
+
+test("the More menu's side gutter sits inside its scroll viewport", () => {
+ const css = readSrc("index.css");
+ assert.match(css, /\.sidebar-more-menu\[data-slot\] \{\s*padding-inline: 0 !important;\s*\}/);
+ assert.match(
+ css,
+ /\.sidebar-more-menu > \[data-slot="dropdown-menu-viewport"\] \{\s*padding-inline: var\(--spacing\);\s*\}/,
+ );
+});
+
+test("New badges keep More rows at the plain row height", () => {
+ const sidebar = readSrc("components/app-sidebar.tsx");
+ assert.equal(
+ sidebar.match(/\{badge && <Badge variant="accent" className="-my-0\.5">\{badge\}<\/Badge>\}/g)?.length,
+ 2,
+ );
+ assert.doesNotMatch(sidebar, /\{badge && <Badge variant="accent">\{badge\}<\/Badge>\}/);
+});