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: center the sidebar row kebab and pin in their hover circle (#12502)

Michael Han11cc2ab411b4
diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx
index b3ec14f001f..4dcff95bbdd 100644
--- a/studio/frontend/src/components/app-sidebar.tsx
+++ b/studio/frontend/src/components/app-sidebar.tsx
@@ -336,6 +336,12 @@ type NavRowDef = {
};
// An expanded project shows this many recent chats before "Show more".
+// Row kebab with centred dots: Hugeicons draws them half a unit low.
+const MoreVerticalCenteredIcon = MoreVerticalIcon.map(([tag, attrs]) => [
+ tag,
+ { ...attrs, transform: "translate(0 -0.5)" },
+]) as unknown as IconSvgElement;
+
const PROJECT_CHAT_LIMIT = 4;
// And the Projects section shows this many folders before its own "Show more".
const SIDEBAR_PROJECT_LIMIT = 5;
@@ -4679,7 +4685,7 @@ export function AppSidebar() {
className={actionClass}
>
<span className="sidebar-row-action-glyph">
- <HugeiconsIcon icon={MoreVerticalIcon} strokeWidth={1.75} className="size-icon" />
+ <HugeiconsIcon icon={MoreVerticalCenteredIcon} strokeWidth={1.75} className="size-icon" />
</span>
</button>
)}
@@ -4867,7 +4873,7 @@ export function AppSidebar() {
className="sidebar-row-action sidebar-touch-reveal group-hover/recent-item:opacity-100 group-hover/recent-item:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto"
>
<span className="sidebar-row-action-glyph">
- <HugeiconsIcon icon={MoreVerticalIcon} strokeWidth={1.75} className="size-icon" />
+ <HugeiconsIcon icon={MoreVerticalCenteredIcon} strokeWidth={1.75} className="size-icon" />
</span>
</button>
)}
@@ -5530,7 +5536,7 @@ export function AppSidebar() {
className="sidebar-row-action group-hover/run-item:opacity-100 group-hover/run-item:pointer-events-auto focus-visible:opacity-100 focus-visible:pointer-events-auto"
>
<span className="sidebar-row-action-glyph">
- <HugeiconsIcon icon={MoreVerticalIcon} strokeWidth={1.75} className="size-icon" />
+ <HugeiconsIcon icon={MoreVerticalCenteredIcon} strokeWidth={1.75} className="size-icon" />
</span>
</button>
)}
diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css
index 7217406e9a0..56819171ef2 100644
--- a/studio/frontend/src/index.css
+++ b/studio/frontend/src/index.css
@@ -2340,6 +2340,24 @@ html[data-chat-font] .aui-root {
.sidebar-row-action-glyph {
@apply inline-flex size-6 items-center justify-center rounded-full text-sidebar-foreground/55;
}
+ /* The hover circle is painted on the icon, padded out to the glyph box. On the glyph it kept
+ subpixel precision while the icon snapped to whole pixels, so the icon sat up to half a
+ pixel off centre. !important: outranks the icon's own size-* utility. */
+ .sidebar-row-action-glyph > svg {
+ --glyph-icon: var(--icon-size);
+ box-sizing: border-box;
+ width: 100% !important;
+ height: 100% !important;
+ padding: calc((100% - var(--glyph-icon)) / 2);
+ border-radius: 9999px;
+ overflow: visible;
+ }
+ .sidebar-row-action-glyph > svg.size-4 {
+ --glyph-icon: calc(var(--spacing) * 4);
+ }
+ .sidebar-row-action-glyph > svg.size-3\.5 {
+ --glyph-icon: calc(var(--spacing) * 3.5);
+ }
/* A disclosure stays put while its list is open, unlike the hover-only row actions. */
.sidebar-row-action.is-disclosure-open {
@apply opacity-100 pointer-events-auto;
@@ -2378,6 +2396,9 @@ html[data-chat-font] .aui-root {
.sidebar-row-action:hover .sidebar-row-action-glyph,
.sidebar-row-action[data-state="open"] .sidebar-row-action-glyph {
@apply text-nav-fg;
+ }
+ .sidebar-row-action:hover .sidebar-row-action-glyph > svg,
+ .sidebar-row-action[data-state="open"] .sidebar-row-action-glyph > svg {
/* A step darker than the row hover so the circle reads on top of it. */
background-color: color-mix(in srgb, var(--foreground) calc(11% * var(--contrast-wash-gain, 1)), transparent);
}
diff --git a/studio/frontend/tests/sidebar-row-action-glyph-centre.test.ts b/studio/frontend/tests/sidebar-row-action-glyph-centre.test.ts
new file mode 100644
index 00000000000..69f35498201
--- /dev/null
+++ b/studio/frontend/tests/sidebar-row-action-glyph-centre.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";
+
+// A sidebar row's pin, pencil and "…" sit in a 24px hover circle. Painted on the glyph box, the
+// circle kept subpixel precision while the browser snapped the 15px icon inside it to whole
+// pixels, so the icon drifted off centre by up to half a pixel.
+
+const CSS = readSrc("index.css");
+const SIDEBAR = readSrc("components/app-sidebar.tsx");
+
+test("the hover circle is painted on the icon, padded out to the glyph box", () => {
+ assert.match(
+ CSS,
+ /\.sidebar-row-action-glyph > svg \{\n\t\t--glyph-icon: var\(--icon-size\);\n\t\tbox-sizing: border-box;\n\t\twidth: 100% !important;\n\t\theight: 100% !important;\n\t\tpadding: calc\(\(100% - var\(--glyph-icon\)\) \/ 2\);\n\t\tborder-radius: 9999px;/,
+ );
+ // Each icon size the glyphs hold keeps its own drawn size.
+ assert.match(CSS, /\.sidebar-row-action-glyph > svg\.size-4 \{\n\t\t--glyph-icon: calc\(var\(--spacing\) \* 4\);/);
+ assert.match(CSS, /\.sidebar-row-action-glyph > svg\.size-3\\\.5 \{\n\t\t--glyph-icon: calc\(var\(--spacing\) \* 3\.5\);/);
+ // The tint is on the icon, not the glyph box, or the two would snap apart again.
+ const hover = /\.sidebar-row-action:hover \.sidebar-row-action-glyph,\n\t\.sidebar-row-action\[data-state="open"\] \.sidebar-row-action-glyph \{([^}]*)\}/.exec(CSS);
+ assert.ok(hover);
+ assert.doesNotMatch(hover[1], /background-color/);
+ assert.match(
+ CSS,
+ /\.sidebar-row-action:hover \.sidebar-row-action-glyph > svg,\n\t\.sidebar-row-action\[data-state="open"\] \.sidebar-row-action-glyph > svg \{\n[^}]*background-color: color-mix/,
+ );
+});
+
+test("the row kebab draws its dots on the circle's centre", () => {
+ // Hugeicons draws them around y = 12.5 of a 24-unit box.
+ assert.match(SIDEBAR, /\{ \.\.\.attrs, transform: "translate\(0 -0\.5\)" \}/);
+ assert.equal(SIDEBAR.includes("icon={MoreVerticalIcon}"), false);
+ assert.equal((SIDEBAR.match(/icon=\{MoreVerticalCenteredIcon\}/g) ?? []).length, 3);
+});