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 app's titlebar chrome off the desktop update screen (#12465)

oobabooga564e98902248
diff --git a/studio/frontend/src/app/provider.tsx b/studio/frontend/src/app/provider.tsx
index 9966b229856..abd051717d7 100644
--- a/studio/frontend/src/app/provider.tsx
+++ b/studio/frontend/src/app/provider.tsx
@@ -62,6 +62,7 @@ import {
type CSSProperties,
type ReactNode,
useEffect,
+ useLayoutEffect,
useMemo,
useRef,
useState,
@@ -466,10 +467,12 @@ function TauriUpdateLayer({
isExternalServer,
children,
appContent,
+ onUpdateScreenChange,
}: {
isExternalServer: boolean;
children?: ReactNode;
appContent: ReactNode;
+ onUpdateScreenChange: (shown: boolean) => void;
}) {
const update = useTauriUpdate(isExternalServer);
const isUpdating =
@@ -490,6 +493,12 @@ function TauriUpdateLayer({
);
}, [isUpdating]);
+ // Sync the parent titlebar before paint to avoid flashing sidebar chrome.
+ useLayoutEffect(() => {
+ onUpdateScreenChange(isUpdating);
+ return () => onUpdateScreenChange(false);
+ }, [isUpdating, onUpdateScreenChange]);
+
const content = isUpdating ? (
<UpdateScreen
status={update.status}
@@ -683,6 +692,7 @@ function TauriWrapper({ children }: { children: ReactNode }) {
const [desktopAuthRetry, setDesktopAuthRetry] = useState(0);
const [nativeMacControlsHidden, setNativeMacControlsHidden] = useState(false);
const [appShellReady, setAppShellReady] = useState(false);
+ const [updateScreenShown, setUpdateScreenShown] = useState(false);
const canMountApp = status === "running" && desktopAuthReady;
// Same as showApp below: until the shell is ready the app sits hidden behind the startup screen.
useEffect(() => {
@@ -921,6 +931,7 @@ function TauriWrapper({ children }: { children: ReactNode }) {
<AppReadinessBoundary onReady={setAppShellReady} revealed={showApp}>
<TauriUpdateLayer
isExternalServer={isExternalServer}
+ onUpdateScreenChange={setUpdateScreenShown}
appContent={
<>
{showApp && <NativeIntentDrain />}
@@ -1018,7 +1029,9 @@ function TauriWrapper({ children }: { children: ReactNode }) {
);
}
- const showSidebarSurface = showApp && !hidesTitlebarSidebar;
+ // Use the startup screen's bare titlebar during updates.
+ const showSidebarSurface =
+ showApp && !hidesTitlebarSidebar && !updateScreenShown;
return (
<div
diff --git a/studio/frontend/tests/update-screen-titlebar.test.ts b/studio/frontend/tests/update-screen-titlebar.test.ts
new file mode 100644
index 00000000000..5d1afed4748
--- /dev/null
+++ b/studio/frontend/tests/update-screen-titlebar.test.ts
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: AGPL-3.0-only
+// Copyright 2026-present the Unsloth AI Inc. team. All rights reserved. See /studio/LICENSE.AGPL-3.0
+
+// Check source wiring because rendering TauriWrapper requires the desktop runtime.
+
+import assert from "node:assert/strict";
+import test from "node:test";
+
+import { readSrc } from "./helpers/kit.ts";
+
+const PROVIDER = readSrc("app/provider.tsx");
+
+function region(source: string, from: string, to: string): string {
+ const start = source.indexOf(from);
+ const end = source.indexOf(to, start);
+ assert.ok(start !== -1, `region start not found: ${from}`);
+ assert.ok(end > start, `region end not found after start: ${to}`);
+ return source.slice(start, end);
+}
+
+test("the update layer reports the update screen with the flag that shows it", () => {
+ const layer = region(
+ PROVIDER,
+ "function TauriUpdateLayer(",
+ "const HIDDEN_TITLEBAR_SIDEBAR_ROUTES",
+ );
+ assert.match(layer, /const content = isUpdating \? \(\s*<UpdateScreen/);
+ assert.match(
+ layer,
+ /useLayoutEffect\(\(\) => \{\s*onUpdateScreenChange\(isUpdating\);/,
+ );
+ assert.match(layer, /onUpdateScreenChange\(false\)/);
+});
+
+test("the titlebar drops the sidebar surface while the update screen is shown", () => {
+ assert.match(PROVIDER, /onUpdateScreenChange=\{setUpdateScreenShown\}/);
+ const surface = region(
+ PROVIDER,
+ "const showSidebarSurface =",
+ "<WindowTitlebar showSidebarSurface={showSidebarSurface} />",
+ );
+ assert.match(surface, /!updateScreenShown/);
+});