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 sidebar More flyout shut when a modal opens during its hover delay (#13237)

Daniel Han0ec5ae6bd1b6
diff --git a/studio/frontend/src/hooks/use-hover-flyout.ts b/studio/frontend/src/hooks/use-hover-flyout.ts
index f67827b1f6e..ca7ad271aef 100644
--- a/studio/frontend/src/hooks/use-hover-flyout.ts
+++ b/studio/frontend/src/hooks/use-hover-flyout.ts
@@ -11,6 +11,7 @@ import {
useState,
} from "react";
+import { isBlockedByActiveModal } from "@/components/ui/tooltip-modal-layer";
import { type HoverFlyoutIntent, isPointerHeadingInto } from "@/lib/hover-intent";
type PointerHandler = (event: ReactPointerEvent<HTMLElement>) => void;
@@ -45,7 +46,12 @@ export function useHoverFlyout(
if (event.pointerType !== "mouse") return;
cancel();
if (open) return;
- timerRef.current = window.setTimeout(() => setOpen(true), intent.openDelay);
+ const trigger = event.currentTarget;
+ // A modal opened inside the delay (a shortcut while the pointer rests here) sends WebKit no
+ // pointerleave, so the timer would open the flyout over the dialog.
+ timerRef.current = window.setTimeout(() => {
+ if (!isBlockedByActiveModal(trigger)) setOpen(true);
+ }, intent.openDelay);
},
[cancel, intent.openDelay, open],
);
diff --git a/studio/frontend/tests/hover-intent.test.ts b/studio/frontend/tests/hover-intent.test.ts
index e9c7f6d296a..26fbb294f64 100644
--- a/studio/frontend/tests/hover-intent.test.ts
+++ b/studio/frontend/tests/hover-intent.test.ts
@@ -54,6 +54,15 @@ test("the hover flyout answers the mouse only", () => {
assert.match(hook, /isPointerHeadingInto\(exit, pointer, target\)/);
});
+test("a hover timer that fires under a modal opened meanwhile leaves the flyout shut (#9244)", () => {
+ const hook = readSrc("hooks/use-hover-flyout.ts");
+ assert.match(
+ hook,
+ /setTimeout\(\(\) => \{\s*if \(!isBlockedByActiveModal\(trigger\)\) setOpen\(true\);\s*\}, intent\.openDelay\)/,
+ );
+ assert.doesNotMatch(hook, /setTimeout\(\(\) => setOpen\(true\)/);
+});
+
test("the sidebar scopes nav tooltip intent to itself", () => {
const sidebar = readSrc("components/app-sidebar.tsx");
assert.match(sidebar, /<TooltipProvider \{\.\.\.NAV_TOOLTIP_INTENT\}>\s*<Sidebar\b/);