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: open and close dialogs and menus in long chats without a full thread re-layout on Firefox (#17357)

Daniel Han0c46cdbaa28b
diff --git a/studio/frontend/src/index.css b/studio/frontend/src/index.css
index bdc45d73a04..2e4b7a6d208 100644
--- a/studio/frontend/src/index.css
+++ b/studio/frontend/src/index.css
@@ -2186,6 +2186,20 @@ html[data-chat-font] .aui-root {
z-index: 49;
pointer-events: auto;
}
+ /* Firefox only: the cover is always there and the lock only flips its pointer-events. Adding it per
+ open made Firefox lay out the thread root's flex column again, measuring every message (about
+ 250 ms per modal open and close at 150 turns, 20 ms at 1 turn). Inert when unlocked: no paint,
+ pointer-events: none. Not for WebKit: a permanent cover made the Glass browser pane open there
+ about 60 ms slower at 150 turns. */
+ @supports (-moz-appearance: none) {
+ .aui-thread-root::after {
+ content: "";
+ position: absolute;
+ inset: 0;
+ z-index: 49;
+ pointer-events: none;
+ }
+ }
/* The side pane (browser, research) sets its own pointer-events: auto once shown, so it never
inherited the lock and its scrollers (file view, page) took wheel and touch under a modal menu.
The same cover over it blocks them as react-remove-scroll's document listeners did, without a
diff --git a/studio/frontend/tests/modal-lock-thread-cover.test.ts b/studio/frontend/tests/modal-lock-thread-cover.test.ts
index f0ba5999bc0..9c3edb0c930 100644
--- a/studio/frontend/tests/modal-lock-thread-cover.test.ts
+++ b/studio/frontend/tests/modal-lock-thread-cover.test.ts
@@ -42,4 +42,24 @@ test("while the lock is up a cover keeps the thread unclickable, below portaled
);
assert.equal(CSS.split(".aui-thread-root[data-modal-lock-thread]::after").length - 1, 1);
assert.equal(CSS.split(" .aui-thread-root::after").length - 1, 1);
+ // Plus the Firefox-only permanent cover below.
+ assert.equal(CSS.split("\t.aui-thread-root::after {").length - 1, 1);
});
+
+test("in Firefox the cover is permanent and inert, so a lock only flips its pointer-events", () => {
+ // Adding the cover on each open made Firefox lay out the thread root's flex column again, every
+ // message included (about 250 ms per modal open and close at 150 turns). Firefox only: in WebKit a
+ // permanent cover slowed the Glass browser pane open.
+ const at = CSS.indexOf("@supports (-moz-appearance: none) {\n\t\t.aui-thread-root::after {");
+ assert.ok(at >= 0, "missing the Firefox-only permanent cover");
+ const block = CSS.slice(at, CSS.indexOf("}", at) + 1);
+ assert.match(block, /content: "";/);
+ assert.match(block, /position: absolute;/);
+ assert.match(block, /inset: 0;/);
+ assert.match(block, /z-index: 49;/);
+ assert.match(block, /pointer-events: none;/);
+ assert.doesNotMatch(block, /background|backdrop-filter|box-shadow/);
+ // Lower specificity than the lock rule, which sets pointer-events: auto.
+ assert.ok(at > CSS.indexOf("[data-modal-lock-region] .aui-thread-root::after {"));
+});
+