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.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Studio: keep the desktop browser page live when it opens as a dialog (#13734)
Daniel Han8756dfd5218f
diff --git a/studio/frontend/src/features/browser/native-view.ts b/studio/frontend/src/features/browser/native-view.tsindex a7e8276eea3..fb01c6e4abf 100644--- a/studio/frontend/src/features/browser/native-view.ts+++ b/studio/frontend/src/features/browser/native-view.ts@@ -408,6 +408,8 @@ function overlays(selector: string, rect: DOMRect | null, skip: string | null =const boxes: DOMRect[] = [];for (const element of outsideThread(selector)) {if (element.closest("[data-native-page]")) continue;+ // The dialog the browser opens in over compare, projects and phones holds the page, not covers it.+ if (element.querySelector("[data-native-page]")) continue;if (skip && element.querySelector(skip)) continue;const box = element.getBoundingClientRect();if (box.width > 0 && box.height > 0 && (!rect || intersects(box, rect))) boxes.push(box);diff --git a/studio/frontend/tests/browser-native-view-layered.test.ts b/studio/frontend/tests/browser-native-view-layered.test.tsindex b8bd873851c..07a6a44bf09 100644--- a/studio/frontend/tests/browser-native-view-layered.test.ts+++ b/studio/frontend/tests/browser-native-view-layered.test.ts@@ -10,7 +10,11 @@ const frames: (() => void)[] = [];const mutations: (() => void)[] = [];const rect = (x: number, y: number, width: number, height: number) =>({ left: x, top: y, right: x + width, bottom: y + height, width, height }) as DOMRect;-type Overlay = { getBoundingClientRect: () => DOMRect; closest: () => null; querySelector: () => object | null };+type Overlay = {+ getBoundingClientRect: () => DOMRect;+ closest: () => null;+ querySelector: (selector: string) => object | null;+};const overlay = (box: DOMRect): Overlay => ({getBoundingClientRect: () => box,closest: () => null,@@ -199,7 +203,19 @@ test("a menu over a layered page neither captures nor hides it, and owns its inpawait frame();assert.deepEqual(lastInput(), { blocked: true, exclude: [] });blocking.length = 0;- blocking.push({ ...overlay(rect(0, 600, 200, 100)), querySelector: () => ({}) });+ blocking.push({+ ...overlay(rect(0, 600, 200, 100)),+ querySelector: (selector: string) => (selector.includes("hover-card") ? {} : null),+ });+ await frame();+ assert.deepEqual(lastInput(), { blocked: false, exclude: [] });++ // the dialog the browser opens in (compare, projects, phones) holds the page: it isn't over it+ blocking.length = 0;+ blocking.push({+ ...overlay(rect(0, 0, 1000, 800)),+ querySelector: (selector: string) => (selector.startsWith("[data-native-page") ? placeholder : null),+ });await frame();assert.deepEqual(lastInput(), { blocked: false, exclude: [] });diff --git a/studio/frontend/tests/browser-native-view-snapshot.test.ts b/studio/frontend/tests/browser-native-view-snapshot.test.tsindex 144fac0c58f..00c646f2718 100644--- a/studio/frontend/tests/browser-native-view-snapshot.test.ts+++ b/studio/frontend/tests/browser-native-view-snapshot.test.ts@@ -243,6 +243,30 @@ test("tooltips along the toolbar capture the page once, and it returns when the}});+test("the dialog the browser opens in over compare, projects and phones leaves its page live", async () => {+ const stop = startNativeViews();+ try {+ useBrowserStore.getState().openUrl("https://example.org/overlay", { newTab: true });+ await frame();+ await frame();+ const tabId = useBrowserStore.getState().activeTabId;+ const captures = calls.filter(({ command }) => command === "browser_capture").length;+ overlays.push({+ getBoundingClientRect: () => rect(0, 0, 1000, 800),+ closest: () => null,+ querySelector: (selector: string) => (selector.startsWith("[data-native-page") ? placeholder : null),+ });+ await frame();+ await frame();+ const lastShow = calls.filter(({ command }) => command === "browser_view_show").at(-1)?.args;+ assert.deepEqual([lastShow?.tabId, lastShow?.parked], [tabId, undefined], "shown, not parked");+ assert.equal(calls.filter(({ command }) => command === "browser_capture").length, captures, "nothing is captured");+ } finally {+ stop();+ overlays.length = 0;+ }+});+test("a capture that never lands keeps the page on screen instead of parking it blank, and tries again", async () => {const stop = startNativeViews();try {