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: let the Mac window be moved during an app update (#12316)
Nilay1f4aa14f7f04
diff --git a/studio/frontend/src/components/tauri/update-screen.tsx b/studio/frontend/src/components/tauri/update-screen.tsxindex 163eeb812e0..2c1a98c075d 100644--- a/studio/frontend/src/components/tauri/update-screen.tsx+++ b/studio/frontend/src/components/tauri/update-screen.tsx@@ -4,6 +4,7 @@import { parseBackendDownloadProgress } from "@/components/tauri/backend-download-progress";import { DiagnosticsCopyActions } from "@/components/tauri/diagnostics-copy-actions";import { LogDetails } from "@/components/tauri/log-details";+import { shouldUseNativeMacWindowTitlebar } from "@/components/tauri/window-titlebar";import { Button } from "@/components/ui/button";import { Spinner } from "@/components/ui/spinner";import type { UpdateStatus } from "@/hooks/use-tauri-update";@@ -91,6 +92,13 @@ export function UpdateScreen({return (<div className="box-border flex h-full w-full flex-col items-center overflow-y-auto bg-background pb-6 pt-[var(--studio-startup-top-inset,0px)]">+ {shouldUseNativeMacWindowTitlebar() && (+ <div+ data-tauri-drag-region={true}+ aria-hidden="true"+ className="pointer-events-auto fixed inset-x-0 top-0 z-50 h-[var(--studio-mac-titlebar-height,34px)] select-none"+ />+ )}<div className="flex min-h-0 w-full max-w-md flex-1 items-center justify-center px-6"><motion.divinitial={{ opacity: 0 }}diff --git a/studio/frontend/tests/backend-download-progress.test.ts b/studio/frontend/tests/backend-download-progress.test.tsindex e5c9b7ce12d..9bbee3155f6 100644--- a/studio/frontend/tests/backend-download-progress.test.ts+++ b/studio/frontend/tests/backend-download-progress.test.ts@@ -23,6 +23,9 @@ const { UpdateScreen } = loadWithStubs<typeof UpdateScreenModule>(DiagnosticsCopyActions: () => null,},"@/components/tauri/log-details": { LogDetails: () => null },+ "@/components/tauri/window-titlebar": {+ shouldUseNativeMacWindowTitlebar: () => false,+ },"@/components/ui/button": { Button: () => null },"@/components/ui/spinner": { Spinner: () => null },},diff --git a/studio/frontend/tests/update-screen-drag-region.test.ts b/studio/frontend/tests/update-screen-drag-region.test.tsnew file mode 100644index 00000000000..0848a0e5ef7--- /dev/null+++ b/studio/frontend/tests/update-screen-drag-region.test.ts@@ -0,0 +1,77 @@+// 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 * as motion from "motion/react";+import * as React from "react";+import { renderToStaticMarkup } from "react-dom/server";+import * as jsxRuntime from "react/jsx-runtime";+import type * as UpdateScreenModule from "../src/components/tauri/update-screen.tsx";+import { loadWithStubs } from "./helpers/module-stubs.ts";++let nativeMacTitlebar = true;++const { UpdateScreen } = loadWithStubs<typeof UpdateScreenModule>(+ new URL("../src/components/tauri/update-screen.tsx", import.meta.url),+ {+ "react/jsx-runtime": jsxRuntime,+ "motion/react": motion,+ "@/components/tauri/backend-download-progress": {+ parseBackendDownloadProgress: () => null,+ },+ "@/components/tauri/diagnostics-copy-actions": {+ DiagnosticsCopyActions: () => null,+ },+ "@/components/tauri/log-details": { LogDetails: () => null },+ "@/components/tauri/window-titlebar": {+ shouldUseNativeMacWindowTitlebar: () => nativeMacTitlebar,+ },+ "@/components/ui/button": { Button: () => null },+ "@/components/ui/spinner": { Spinner: () => null },+ },+);++function render(status: React.ComponentProps<typeof UpdateScreen>["status"]) {+ return renderToStaticMarkup(+ React.createElement(UpdateScreen, {+ status,+ logs: [],+ progress: 0,+ error: status === "error" ? "boom" : null,+ onRetry() {},+ onSkipRestart() {},+ onCopyDiagnostics: async () => ({+ ok: true,+ report: "",+ source: "tauri" as const,+ }),+ }),+ );+}++test("the mac update screen keeps a window drag region", () => {+ nativeMacTitlebar = true;+ for (const status of [+ "updating-backend",+ "downloading",+ "installing",+ "error",+ ] as const) {+ assert.match(render(status), /data-tauri-drag-region/, status);+ }+});++// A Radix modal's body lock (pointer-events: none) is inherited, and would leave the strip undraggable.+test("the mac update screen drag region opts back into pointer events", () => {+ nativeMacTitlebar = true;+ assert.match(+ render("updating-backend"),+ /<div data-tauri-drag-region="true"[^>]*class="pointer-events-auto /,+ );+});++test("the update screen adds no drag region beside the custom titlebar", () => {+ nativeMacTitlebar = false;+ assert.doesNotMatch(render("updating-backend"), /data-tauri-drag-region/);+});