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.

Align the sidebar nav and Recents spinners on one column (#7749)

Daniel Han4ef738e640b8
diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx
index 9d0fe542163..3db318d5d15 100644
--- a/studio/frontend/src/components/app-sidebar.tsx
+++ b/studio/frontend/src/components/app-sidebar.tsx
@@ -323,7 +323,9 @@ function NavItem({
<HugeiconsIcon icon={icon} strokeWidth={1.75} className="size-icon! shrink-0 group-hover/menu-button:animate-icon-pop" />
<span className="text-ui-14p5 leading-ui-19 tracking-nav">{label}</span>
{spinner && (
- <Spinner className="ml-auto size-3.5 shrink-0 text-muted-foreground group-data-[collapsible=icon]:hidden" />
+ // mr-1.5 over the row's pr-2.5 = 16px, matching the chat rows'
+ // pr-4 so nav and Recents spinners share one column.
+ <Spinner className="ml-auto mr-1.5 size-3.5 shrink-0 text-muted-foreground group-data-[collapsible=icon]:hidden" />
)}
</SidebarMenuButton>
{spinner && (
diff --git a/studio/frontend/tests/sidebar-spinner-column.test.ts b/studio/frontend/tests/sidebar-spinner-column.test.ts
new file mode 100644
index 00000000000..18c5b35be36
--- /dev/null
+++ b/studio/frontend/tests/sidebar-spinner-column.test.ts
@@ -0,0 +1,56 @@
+// 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 { readFile } from "node:fs/promises";
+
+// Both spinners are ml-auto, so each one sits at its row's padding-right plus
+// its own margin-right. The two rows carry different padding, so the margins
+// have to make up the difference or the column visibly steps.
+const TAILWIND_UNIT = 4;
+
+function inset(classes: string, prefix: string): number {
+ const m = new RegExp(`(?:^| )${prefix}-([0-9.]+)(?: |$)`).exec(classes);
+ return m ? Number(m[1]) * TAILWIND_UNIT : 0;
+}
+
+function grab(source: string, pattern: RegExp, what: string): string {
+ const m = pattern.exec(source);
+ assert.ok(m, `could not find ${what} in app-sidebar.tsx`);
+ return m[1];
+}
+
+test("nav and Recents spinners land on one trailing column", async () => {
+ const source = await readFile(
+ new URL("../src/components/app-sidebar.tsx", import.meta.url),
+ "utf8",
+ );
+
+ const navRow = grab(
+ source,
+ /className="(sidebar-nav-btn h-\[33px\] rounded-full[^"]*)"/,
+ "NavItem row",
+ );
+ const navSpinner = grab(
+ source,
+ /<Spinner className="(ml-auto[^"]*group-data-\[collapsible=icon\]:hidden)"/,
+ "NavItem spinner",
+ );
+ const chatRow = grab(
+ source,
+ /"(sidebar-nav-btn h-\[33px\] cursor-pointer rounded-full[^"]*)"/,
+ "Recents chat row",
+ );
+ const chatSpinner = grab(
+ source,
+ /data-testid="chat-row-spinner"[\s\S]{0,200}?className="(ml-auto[^"]*)"/,
+ "Recents chat spinner",
+ );
+
+ const nav = inset(navRow, "pr") + inset(navSpinner, "mr");
+ const chat = inset(chatRow, "pr") + inset(chatSpinner, "mr");
+
+ assert.equal(nav, chat, `nav spinner sits ${nav}px in, chat spinner ${chat}px`);
+ assert.equal(nav, 16);
+});