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: keep the composer permission shield still while the plus spins (#12506)

Michael Han77b0296045fd
diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css
index 9a39d582863..e669c9d642d 100644
--- a/studio/frontend/src/index.css
+++ b/studio/frontend/src/index.css
@@ -3209,13 +3209,18 @@ html[data-chat-font] .aui-root {
/* Fixed-width icon slot so every pill's icon occupies the same space and
the labels line up on an even rhythm, regardless of icon size. */
.composer-pill-glyph {
- @apply relative inline-flex w-[var(--ui-icon-size)] shrink-0 items-center justify-center transition-opacity;
+ @apply inline-grid w-[var(--ui-icon-size)] shrink-0 place-items-center transition-opacity;
+ }
+ /* Icon and X share one cell. Not relative + absolute: a positioned slot next to the
+ spinning plus got its own WebKit layer and jumped a pixel each spin. */
+ .composer-pill-glyph > * {
+ grid-area: 1 / 1;
}
/* On hover the icon swaps for an X inside a soft circle (ChatGPT-style),
filling the icon slot so every pill's X is identical and centered. */
.composer-pill-x {
- @apply pointer-events-none absolute inset-0 m-auto size-[var(--ui-icon-size)] rounded-full bg-primary/15 p-[calc(3px*var(--ui-space-scale,1))] opacity-0 transition-opacity dark:bg-[rgb(255_255_255_/_calc(0.14*var(--contrast-wash-gain,1)))];
+ @apply pointer-events-none size-[var(--ui-icon-size)] rounded-full bg-primary/15 p-[calc(3px*var(--ui-space-scale,1))] opacity-0 transition-opacity dark:bg-[rgb(255_255_255_/_calc(0.14*var(--contrast-wash-gain,1)))];
}
/* Hovering an active pill swaps the icon for an X (click to turn off). */
diff --git a/studio/frontend/tests/composer-pill-glyph-stack.test.ts b/studio/frontend/tests/composer-pill-glyph-stack.test.ts
new file mode 100644
index 00000000000..3fbaffb2a06
--- /dev/null
+++ b/studio/frontend/tests/composer-pill-glyph-stack.test.ts
@@ -0,0 +1,33 @@
+// 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";
+
+// The permission shield sits right after the composer plus. While the plus spun open or closed,
+// WebKit gave the shield's positioned slot its own layer and snapped it a device pixel up, then
+// dropped the layer and let it fall back. Stacking the icon and X in a grid cell keeps the slot
+// unpositioned, so it always paints with the pill.
+
+const CSS = readSrc("index.css");
+
+function rule(selector: string): string {
+ const match = new RegExp(`\\n\\t${selector.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")} \\{([^}]*)\\}`).exec(CSS);
+ assert.ok(match, `missing ${selector}`);
+ return match[1];
+}
+
+test("the pill glyph slot is an unpositioned grid", () => {
+ const glyph = rule(".composer-pill-glyph");
+ assert.match(glyph, /@apply inline-grid w-\[var\(--ui-icon-size\)\] shrink-0 place-items-center/);
+ assert.doesNotMatch(glyph, /\brelative\b|\babsolute\b/);
+ assert.match(rule(".composer-pill-glyph > *"), /grid-area: 1 \/ 1;/);
+});
+
+test("the hover X shares the icon's cell instead of overlaying it", () => {
+ const x = rule(".composer-pill-x");
+ assert.match(x, /@apply pointer-events-none size-\[var\(--ui-icon-size\)\] rounded-full/);
+ assert.doesNotMatch(x, /\babsolute\b|\binset-0\b|\bm-auto\b/);
+});