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.

Polish Studio desktop chrome (#6332)

Wasim Yousef Saide25e7895a502
diff --git a/.github/workflows/release-desktop.yml b/.github/workflows/release-desktop.yml
index e7476053228..884ff02d11c 100644
--- a/.github/workflows/release-desktop.yml
+++ b/.github/workflows/release-desktop.yml
@@ -438,6 +438,12 @@ jobs:
if (/\brpm\b|\.rpm/i.test(body)) {
throw new Error('Desktop release body must not advertise RPM packages');
}
+ if (/AppImage.*universal|universal.*AppImage/i.test(body)) {
+ throw new Error('Desktop release body must not advertise AppImage as universal');
+ }
+ if (!/AppImage.*experimental/i.test(body)) {
+ throw new Error('Desktop release body must mark AppImage as experimental');
+ }
}
JS
@@ -580,9 +586,10 @@ jobs:
**macOS**: Download the Apple Silicon `.dmg`.
**Windows**: Download the `-setup.exe` installer.
- **Linux**: Download `.deb` (Ubuntu/Debian) or `.AppImage` (universal).
+ **Linux**: Download `.deb` for Ubuntu/Debian. `.AppImage` is experimental.
> Linux in-app updates are AppImage-oriented. Package installs should update by downloading a new package.
+ > Linux AppImage can show a blank window on some Tauri/WebKitGTK + Wayland/Mesa stacks; use `.deb` when available.
> Linux AppImage on Ubuntu 24.04+ may require: `sudo apt install libfuse2t64`
> First-run system dependency elevation is supported on Ubuntu/Debian. Other Linux distributions should install system packages manually.
releaseDraft: ${{ inputs.draft }}
@@ -611,9 +618,10 @@ jobs:
**macOS**: Download the Apple Silicon `.dmg`.
**Windows**: Download the `-setup.exe` installer.
- **Linux**: Download `.deb` (Ubuntu/Debian) or `.AppImage` (universal).
+ **Linux**: Download `.deb` for Ubuntu/Debian. `.AppImage` is experimental.
> Linux in-app updates are AppImage-oriented. Package installs should update by downloading a new package.
+ > Linux AppImage can show a blank window on some Tauri/WebKitGTK + Wayland/Mesa stacks; use `.deb` when available.
> Linux AppImage on Ubuntu 24.04+ may require: `sudo apt install libfuse2t64`
> First-run system dependency elevation is supported on Ubuntu/Debian. Other Linux distributions should install system packages manually.
releaseDraft: ${{ inputs.draft }}
@@ -643,9 +651,10 @@ jobs:
**macOS**: Download the Apple Silicon `.dmg`.
**Windows**: Download the `-setup.exe` installer.
- **Linux**: Download `.deb` (Ubuntu/Debian) or `.AppImage` (universal).
+ **Linux**: Download `.deb` for Ubuntu/Debian. `.AppImage` is experimental.
> Linux in-app updates are AppImage-oriented. Package installs should update by downloading a new package.
+ > Linux AppImage can show a blank window on some Tauri/WebKitGTK + Wayland/Mesa stacks; use `.deb` when available.
> Linux AppImage on Ubuntu 24.04+ may require: `sudo apt install libfuse2t64`
> First-run system dependency elevation is supported on Ubuntu/Debian. Other Linux distributions should install system packages manually.
releaseDraft: ${{ inputs.draft }}
diff --git a/studio/frontend/src/app/provider.tsx b/studio/frontend/src/app/provider.tsx
index 802f22e21ea..914abbbf1de 100644
--- a/studio/frontend/src/app/provider.tsx
+++ b/studio/frontend/src/app/provider.tsx
@@ -6,6 +6,7 @@ import { UpdateBanner } from "@/components/tauri/update-banner";
import { UpdateScreen } from "@/components/tauri/update-screen";
import {
WindowTitlebar,
+ shouldUseNativeMacWindowTitlebar,
shouldUseCustomWindowTitlebar,
} from "@/components/tauri/window-titlebar";
import { Toaster } from "@/components/ui/sonner";
@@ -18,9 +19,16 @@ import { NativeIntentDrain } from "@/features/native-intents/native-intent-drain
import { useTauriBackend, type BackendStatus } from "@/hooks/use-tauri-backend";
import { useTauriUpdate } from "@/hooks/use-tauri-update";
import { isTauri } from "@/lib/api-base";
+import { fetchDeviceType } from "@/config/env";
import { useRouterState } from "@tanstack/react-router";
import { ThemeProvider } from "next-themes";
-import { useEffect, useRef, useState, type ReactNode } from "react";
+import {
+ useEffect,
+ useRef,
+ useState,
+ type CSSProperties,
+ type ReactNode,
+} from "react";
interface AppProviderProps {
children: ReactNode;
@@ -31,18 +39,43 @@ type WindowLayoutGuard = () => boolean;
const MIN_WINDOW_WIDTH = 900;
const MIN_WINDOW_HEIGHT = 600;
+const SETUP_WINDOW_WIDTH = 760;
+const SETUP_WINDOW_HEIGHT = 560;
async function showSetupWindow(isCurrent: WindowLayoutGuard): Promise<void> {
- const { getCurrentWindow } = await import("@tauri-apps/api/window");
+ const { getCurrentWindow, LogicalSize } = await import("@tauri-apps/api/window");
if (!isCurrent()) return;
const win = getCurrentWindow();
+ await win.setResizable(false);
+ if (!isCurrent()) return;
+ await win.setSize(new LogicalSize(SETUP_WINDOW_WIDTH, SETUP_WINDOW_HEIGHT));
if (!isCurrent()) return;
await win.center();
if (!isCurrent()) return;
await win.show();
}
+async function enforceMinimumWindowSize(
+ win: Awaited<ReturnType<typeof import("@tauri-apps/api/window")["getCurrentWindow"]>>,
+ LogicalSize: typeof import("@tauri-apps/api/window")["LogicalSize"],
+ isCurrent: WindowLayoutGuard,
+): Promise<void> {
+ const [innerSize, scaleFactor] = await Promise.all([
+ win.innerSize(),
+ win.scaleFactor(),
+ ]);
+ if (!isCurrent()) return;
+
+ const logicalWidth = Math.round(innerSize.width / scaleFactor);
+ const logicalHeight = Math.round(innerSize.height / scaleFactor);
+ const nextWidth = Math.max(logicalWidth, MIN_WINDOW_WIDTH);
+ const nextHeight = Math.max(logicalHeight, MIN_WINDOW_HEIGHT);
+ if (nextWidth !== logicalWidth || nextHeight !== logicalHeight) {
+ await win.setSize(new LogicalSize(nextWidth, nextHeight));
+ }
+}
+
async function applyAppWindowLayout(isCurrent: WindowLayoutGuard): Promise<void> {
const { getCurrentWindow, currentMonitor, LogicalSize } = await import("@tauri-apps/api/window");
const { invoke } = await import("@tauri-apps/api/core");
@@ -91,6 +124,8 @@ async function applyAppWindowLayout(isCurrent: WindowLayoutGuard): Promise<void>
// Apply constraints after restore/show: doing so before plugin restore can emit
// a Resized event and overwrite the plugin's cached saved size.
await win.setSizeConstraints({ minWidth: MIN_WINDOW_WIDTH, minHeight: MIN_WINDOW_HEIGHT });
+ if (!isCurrent()) return;
+ await enforceMinimumWindowSize(win, LogicalSize, isCurrent);
}
async function showWindowFallback(): Promise<void> {
@@ -123,7 +158,13 @@ function getTauriWindowMode(
}
}
-function TauriUpdateLayer({ isExternalServer }: { isExternalServer: boolean }) {
+function TauriUpdateLayer({
+ isExternalServer,
+ children,
+}: {
+ isExternalServer: boolean;
+ children?: ReactNode;
+}) {
const update = useTauriUpdate(isExternalServer);
const isUpdating =
update.status === "updating-backend" ||
@@ -146,18 +187,22 @@ function TauriUpdateLayer({ isExternalServer }: { isExternalServer: boolean }) {
}
return (
- <UpdateBanner
- status={update.status}
- info={update.info}
- dismissed={update.dismissed}
- lastFailure={update.lastFailure}
- isExternalServer={isExternalServer}
- updatePolicyMode={update.updatePolicyMode}
- manualReleaseUrl={update.manualReleaseUrl}
- onInstall={update.installUpdate}
- onDismiss={update.dismiss}
- onCopyDiagnostics={update.copyDiagnostics}
- />
+ <div className="pointer-events-none fixed bottom-4 right-4 z-[9998] flex w-[calc(100vw-2rem)] max-w-[400px] flex-col items-stretch gap-2">
+ <UpdateBanner
+ status={update.status}
+ info={update.info}
+ dismissed={update.dismissed}
+ lastFailure={update.lastFailure}
+ isExternalServer={isExternalServer}
+ updatePolicyMode={update.updatePolicyMode}
+ manualReleaseUrl={update.manualReleaseUrl}
+ positioned={false}
+ onInstall={update.installUpdate}
+ onDismiss={update.dismiss}
+ onCopyDiagnostics={update.copyDiagnostics}
+ />
+ {children}
+ </div>
);
}
@@ -175,6 +220,35 @@ const WEB_UPDATE_HIDDEN_ROUTES = new Set([
"/signup",
]);
+const MAC_NATIVE_CHROME_STYLE = {
+ "--studio-titlebar-height": "0px",
+ "--studio-mac-titlebar-height": "34px",
+ "--studio-mac-traffic-light-inset": "78px",
+ "--studio-startup-top-inset": "58px",
+ "--studio-content-top-inset": "0px",
+ "--studio-non-chat-content-top-inset": "34px",
+ "--studio-hidden-route-top-inset": "34px",
+ "--studio-chat-header-height": "44px",
+ "--studio-chat-header-padding-top": "8px",
+ "--studio-chat-control-height": "33px",
+ "--studio-chat-header-right-inset": "0px",
+} as CSSProperties;
+
+const CUSTOM_CHROME_STYLE = {
+ "--studio-titlebar-height": "0px",
+ "--studio-custom-titlebar-height": "34px",
+ "--studio-sidebar-expanded-width": "17.5rem",
+ "--studio-sidebar-collapsed-width": "3rem",
+ "--studio-startup-top-inset": "42px",
+ "--studio-content-top-inset": "34px",
+ "--studio-hidden-route-top-inset": "34px",
+ "--studio-chat-header-height": "48px",
+ "--studio-chat-header-padding-top": "9px",
+ "--studio-chat-control-height": "33px",
+ "--studio-chat-header-right-inset": "0px",
+ "--studio-window-control-inset": "112px",
+} as CSSProperties;
+
function TauriWrapper({ children }: { children: ReactNode }) {
const pathname = useRouterState({ select: (s) => s.location.pathname });
const {
@@ -254,6 +328,11 @@ function TauriWrapper({ children }: { children: ReactNode }) {
return () => { disposed = true; };
}, [status, desktopAuthRetry]);
+ useEffect(() => {
+ if (!isTauri || status !== "running" || !desktopAuthReady) return;
+ void fetchDeviceType({ force: true }).catch(() => undefined);
+ }, [status, desktopAuthReady]);
+
if (!isTauri) {
return (
<>
@@ -281,10 +360,19 @@ function TauriWrapper({ children }: { children: ReactNode }) {
status === "running" && !desktopAuthReady
? "Signing in to desktop session..."
: progressDetail;
+ const usesCustomTitlebar = shouldUseCustomWindowTitlebar();
+ const usesNativeMacTitlebar = shouldUseNativeMacWindowTitlebar();
+ const hidesTitlebarSidebar = HIDDEN_TITLEBAR_SIDEBAR_ROUTES.has(pathname);
const content = showApp ? (
<>
- <TauriUpdateLayer isExternalServer={isExternalServer} />
+ <TauriUpdateLayer isExternalServer={isExternalServer}>
+ <LlamaUpdateBanner
+ positioned={false}
+ enabled={!hidesTitlebarSidebar}
+ />
+ <DownloadManagerPanel positioned={false} />
+ </TauriUpdateLayer>
<NativeIntentDrain />
{children}
</>
@@ -305,39 +393,48 @@ function TauriWrapper({ children }: { children: ReactNode }) {
/>
);
- if (!shouldUseCustomWindowTitlebar()) {
+ if (!usesCustomTitlebar) {
// macOS desktop uses the native titlebar and returns here before the
// custom-titlebar branch, so mount the updater banner on this path too.
- return (
- <>
- {content}
- <div className="pointer-events-none fixed bottom-4 right-4 z-[9998] flex w-[calc(100vw-2rem)] max-w-[400px] flex-col items-stretch gap-2">
- <LlamaUpdateBanner
- positioned={false}
- enabled={showApp && !HIDDEN_TITLEBAR_SIDEBAR_ROUTES.has(pathname)}
- />
- {showApp ? <DownloadManagerPanel positioned={false} /> : null}
+ if (usesNativeMacTitlebar) {
+ return (
+ <div
+ className={
+ hidesTitlebarSidebar
+ ? "relative h-dvh min-h-0 overflow-x-hidden overflow-y-auto bg-background"
+ : "relative h-dvh min-h-0 overflow-hidden bg-background"
+ }
+ style={MAC_NATIVE_CHROME_STYLE}
+ >
+ {(!showApp || hidesTitlebarSidebar) ? (
+ <div
+ data-tauri-drag-region
+ aria-hidden="true"
+ className="pointer-events-auto fixed inset-x-0 top-0 z-50 h-[var(--studio-mac-titlebar-height,34px)] select-none"
+ />
+ ) : null}
+ {content}
</div>
- </>
+ );
+ }
+
+ return (
+ <>{content}</>
);
}
const showSidebarSurface =
- showApp && !HIDDEN_TITLEBAR_SIDEBAR_ROUTES.has(pathname);
+ showApp && !hidesTitlebarSidebar;
return (
- <div className="flex h-dvh min-h-0 flex-col overflow-hidden bg-background [--studio-titlebar-height:34px]">
+ <div
+ className="relative h-dvh min-h-0 overflow-hidden bg-background"
+ style={CUSTOM_CHROME_STYLE}
+ >
<WindowTitlebar showSidebarSurface={showSidebarSurface} />
- <div className="min-h-0 flex-1 overflow-hidden">
+ <div className="h-full min-h-0 overflow-hidden">
{content}
</div>
- <div className="pointer-events-none fixed bottom-4 right-4 z-[9998] flex w-[calc(100vw-2rem)] max-w-[400px] flex-col items-stretch gap-2">
- <LlamaUpdateBanner
- positioned={false}
- enabled={showApp && !HIDDEN_TITLEBAR_SIDEBAR_ROUTES.has(pathname)}
- />
- {showApp ? <DownloadManagerPanel positioned={false} /> : null}
- </div>
</div>
);
}
diff --git a/studio/frontend/src/app/routes/__root.tsx b/studio/frontend/src/app/routes/__root.tsx
index 77ba5788db1..e5fa6f0191b 100644
--- a/studio/frontend/src/app/routes/__root.tsx
+++ b/studio/frontend/src/app/routes/__root.tsx
@@ -219,7 +219,7 @@ function RootLayout() {
<SettingsDialog />
<RemoteCodeConsentDialog />
{hideNavbar ? (
- <main className="flex-1">
+ <main className="flex-1 pt-[var(--studio-hidden-route-top-inset,0px)] [--studio-titlebar-height:var(--studio-hidden-route-top-inset,0px)]">
<Suspense fallback={<RouteFallback />}>
<Outlet />
</Suspense>
@@ -235,7 +235,7 @@ function RootLayout() {
<SidebarInset className={isChatRoute ? "overflow-hidden" : "overflow-y-auto"}>
<Navbar />
<div
- className={`relative flex min-h-0 min-w-0 flex-1 basis-0 flex-col ${isChatRoute ? "overflow-hidden" : "overflow-visible"} ${isChatRoute ? "" : "pt-14 md:pt-0"}`}
+ className={`relative flex min-h-0 min-w-0 flex-1 basis-0 flex-col ${isChatRoute ? "overflow-hidden" : "overflow-visible"} ${isChatRoute ? "" : "pt-14 md:pt-[var(--studio-non-chat-content-top-inset,var(--studio-content-top-inset,0px))] md:[--studio-titlebar-height:var(--studio-non-chat-content-top-inset,var(--studio-content-top-inset,0px))]"}`}
>
{/* Stays mounted across navigation so an in-flight generation is
not cancelled when leaving /chat; hidden (not unmounted) off-route.
diff --git a/studio/frontend/src/components/app-sidebar.tsx b/studio/frontend/src/components/app-sidebar.tsx
index f563f9ae591..06f2701a168 100644
--- a/studio/frontend/src/components/app-sidebar.tsx
+++ b/studio/frontend/src/components/app-sidebar.tsx
@@ -44,7 +44,12 @@ import { Button } from "@/components/ui/button";
import { Spinner } from "@/components/ui/spinner";
import { Switch } from "@/components/ui/switch";
import { useAnimatedThemeToggle } from "@/components/ui/animated-theme-toggler";
+import {
+ shouldUseCustomWindowTitlebar,
+ shouldUseNativeMacWindowTitlebar,
+} from "@/components/tauri/window-titlebar";
import { cn } from "@/lib/utils";
+import { isTauri } from "@/lib/api-base";
import { useWebUpdateCheck } from "@/hooks/use-web-update-check";
import {
Archive03Icon,
@@ -272,6 +277,8 @@ function devForceUpdateCard(): boolean {
export function AppSidebar() {
const t = useT();
const { isDark, toggleTheme, anchorRef } = useAnimatedThemeToggle();
+ const [usesCustomTitlebar] = useState(shouldUseCustomWindowTitlebar);
+ const [usesNativeMacTitlebar] = useState(shouldUseNativeMacWindowTitlebar);
const { pathname, search } = useRouterState({
select: (s) => ({
pathname: s.location.pathname,
@@ -458,6 +465,10 @@ export function AppSidebar() {
isStudioRoute,
]);
+ const chatDisabled = trainingInProgress;
+ const showSidebarBrand = !usesCustomTitlebar;
+ const showCompactMacBrand = showSidebarBrand && usesNativeMacTitlebar;
+
function chatSearchForProject(projectId: string | null) {
if (projectId) {
return { project: projectId };
@@ -983,81 +994,118 @@ export function AppSidebar() {
variant="sidebar"
className="font-heading group-data-[collapsible=icon]:[&_[data-sidebar=sidebar]]:bg-white dark:group-data-[collapsible=icon]:[&_[data-sidebar=sidebar]]:bg-background"
>
- <SidebarHeader className="pl-[17px] pr-3 pt-[14px] pb-[8px] group-data-[collapsible=icon]:px-0">
- {/* Expanded: compact logo + close toggle */}
- <div className="flex items-center justify-between gap-[8.5px] group-data-[collapsible=icon]:hidden">
- <Link
- to="/chat"
- onClick={(event) => {
- event.preventDefault();
- openNewChat(null);
- }}
- className="flex items-center gap-[6px] select-none"
- aria-label={t("shell.aria.home")}
- >
- <img
- src="/circle-logo-small.png"
- alt="Unsloth"
- className="h-[34px] w-[34px] rounded-full object-cover"
- />
- <span className="font-heading text-[21px] font-semibold tracking-[0em] dark:tracking-[0.02em] leading-none text-black dark:text-white">
- unsloth
- </span>
- <span className="nav-badge ml-0.5 inline-flex items-center justify-center rounded-full border border-nav-beta-border px-[5px] pt-[3px] pb-[2px] text-[8px] font-medium leading-none tracking-[0.04em] text-nav-fg-muted antialiased subpixel-antialiased shadow-[0_1px_2px_rgba(0,0,0,0.06)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]">
- {t("shell.beta")}
- </span>
- </Link>
- {!isMobile && (
- <Tooltip>
- <TooltipPrimitive.Trigger asChild>
- <button
- type="button"
- onClick={togglePinned}
- className="inline-flex h-[33px] w-[33px] cursor-pointer items-center justify-center rounded-[10px] text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
- aria-label={t("shell.aria.closeSidebar")}
- >
- <HugeiconsIcon icon={LayoutAlignLeftIcon} strokeWidth={1.75} className="size-icon" />
- </button>
- </TooltipPrimitive.Trigger>
- <TooltipContent
- side="bottom"
- sideOffset={6}
- className="tooltip-compact"
- >
- {t("shell.aria.closeSidebar")}
- </TooltipContent>
- </Tooltip>
- )}
- </div>
-
- {/* Collapsed: panel icon doubles as expand trigger */}
- {!isMobile && (
- <div className="hidden group-data-[collapsible=icon]:flex h-[33px] items-center justify-center w-full">
- <Tooltip>
- <TooltipPrimitive.Trigger asChild>
- <button
- type="button"
- onClick={togglePinned}
- className="inline-flex h-[33px] w-[33px] cursor-pointer items-center justify-center rounded-[10px] text-nav-fg transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
- aria-label={t("shell.aria.openSidebar")}
+ <SidebarHeader
+ className={cn(
+ "relative",
+ showSidebarBrand
+ ? showCompactMacBrand
+ ? "h-[var(--studio-chat-header-height,48px)] pl-[calc(var(--studio-mac-traffic-light-inset,78px)+6px)] pr-2 pt-[var(--studio-chat-header-padding-top,9px)] pb-0 group-data-[collapsible=icon]:h-[calc(var(--studio-mac-titlebar-height,34px)+var(--studio-chat-control-height,33px)+8px)] group-data-[collapsible=icon]:px-0 group-data-[collapsible=icon]:pt-[calc(var(--studio-mac-titlebar-height,34px)+8px)]"
+ : "pl-[17px] pr-3 pt-[14px] pb-[8px] group-data-[collapsible=icon]:px-0"
+ : "h-[var(--studio-custom-titlebar-height,34px)] shrink-0 p-0",
+ )}
+ >
+ {showSidebarBrand && (
+ <>
+ {usesNativeMacTitlebar && (
+ <div
+ data-tauri-drag-region
+ aria-hidden="true"
+ className="absolute inset-x-0 top-0 z-0 h-[var(--studio-mac-titlebar-height,34px)] select-none"
+ />
+ )}
+ <div
+ className={cn(
+ "relative z-10 flex items-center gap-[8.5px] group-data-[collapsible=icon]:hidden",
+ showCompactMacBrand &&
+ "h-[var(--studio-chat-control-height,33px)] justify-end gap-2",
+ !showCompactMacBrand && "justify-between",
+ )}
+ >
+ {!showCompactMacBrand && (
+ <Link
+ to="/chat"
+ onClick={(event) => {
+ event.preventDefault();
+ if (chatDisabled) return;
+ openNewChat(null);
+ }}
+ className={cn(
+ "flex items-center gap-[6px] select-none transition-opacity",
+ chatDisabled && "pointer-events-none opacity-50",
+ )}
+ aria-label={t("shell.aria.home")}
+ aria-disabled={chatDisabled}
+ tabIndex={chatDisabled ? -1 : undefined}
>
- <HugeiconsIcon icon={LayoutAlignLeftIcon} strokeWidth={1.75} className="size-icon" />
- </button>
- </TooltipPrimitive.Trigger>
- <TooltipContent
- side="right"
- sideOffset={8}
- className="tooltip-compact"
- >
- {t("shell.aria.openSidebar")}
- </TooltipContent>
- </Tooltip>
- </div>
+ <img
+ src="/circle-logo-small.png"
+ alt="Unsloth"
+ className="h-[34px] w-[34px] rounded-full object-cover"
+ />
+ <span className="font-heading text-[21px] font-semibold tracking-[0em] leading-none text-black dark:text-white dark:tracking-[0.02em]">
+ unsloth
+ </span>
+ <span className="nav-badge ml-0.5 inline-flex items-center justify-center rounded-full border border-nav-beta-border px-[5px] pt-[3px] pb-[2px] text-[8px] font-medium leading-none tracking-[0.04em] text-nav-fg-muted antialiased subpixel-antialiased shadow-[0_1px_2px_rgba(0,0,0,0.06)] dark:shadow-[0_1px_2px_rgba(0,0,0,0.35)]">
+ {t("shell.beta")}
+ </span>
+ </Link>
+ )}
+ {!isMobile && (
+ <Tooltip>
+ <TooltipPrimitive.Trigger asChild>
+ <button
+ type="button"
+ onClick={togglePinned}
+ className="inline-flex h-[33px] w-[32px] cursor-pointer items-center justify-center rounded-[10px] text-nav-icon-idle dark:text-nav-fg-muted transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ aria-label={t("shell.aria.closeSidebar")}
+ >
+ <HugeiconsIcon icon={LayoutAlignLeftIcon} strokeWidth={1.75} className="size-icon" />
+ </button>
+ </TooltipPrimitive.Trigger>
+ <TooltipContent
+ side="bottom"
+ sideOffset={6}
+ className="tooltip-compact"
+ >
+ {t("shell.aria.closeSidebar")}
+ </TooltipContent>
+ </Tooltip>
+ )}
+ </div>
+ {!isMobile && (
+ <div className="relative z-10 hidden group-data-[collapsible=icon]:flex h-[33px] items-center justify-center w-full">
+ <Tooltip>
+ <TooltipPrimitive.Trigger asChild>
+ <button
+ type="button"
+ onClick={togglePinned}
+ className="inline-flex h-[33px] w-[32px] cursor-pointer items-center justify-center rounded-[10px] text-nav-fg transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ aria-label={t("shell.aria.openSidebar")}
+ >
+ <HugeiconsIcon icon={LayoutAlignLeftIcon} strokeWidth={1.75} className="size-icon" />
+ </button>
+ </TooltipPrimitive.Trigger>
+ <TooltipContent
+ side="right"
+ sideOffset={8}
+ className="tooltip-compact"
+ >
+ {t("shell.aria.openSidebar")}
+ </TooltipContent>
+ </Tooltip>
+ </div>
+ )}
+ </>
)}
</SidebarHeader>
{/* Uniform pl-1.5 pr-2 keeps every hover pill the same width, inset from the edge. */}
- <SidebarGroup className="group-data-[collapsible=icon]:px-0 pl-1.5 pr-2 pt-[9px] pb-px shrink-0">
+ <SidebarGroup
+ className={cn(
+ "group-data-[collapsible=icon]:px-0 pl-1.5 pr-2 pb-px shrink-0",
+ showCompactMacBrand ? "pt-0" : "pt-[9px]",
+ )}
+ >
<SidebarGroupContent>
<SidebarMenu>
<NavItem
@@ -1545,25 +1593,29 @@ export function AppSidebar() {
<HugeiconsIcon icon={HelpCircleIcon} strokeWidth={1.75} className="size-icon" />
<span>{t("common.help")}</span>
</DropdownMenuItem>
- <DropdownMenuItem
- onSelect={async () => {
- // Best-effort server revocation; ignore network errors so
- // the local clear still runs and the user lands on /login.
- try {
- await logout();
- } catch {
- clearAuthTokens();
- }
- void navigate({ to: "/login" });
- }}
- >
- <HugeiconsIcon icon={Logout05Icon} strokeWidth={1.75} className="size-icon" />
- <span>{t("shell.navigation.logOut")}</span>
- </DropdownMenuItem>
- <DropdownMenuItem onSelect={() => setShutdownOpen(true)}>
- <HugeiconsIcon icon={PowerIcon} strokeWidth={1.75} className="size-icon" />
- <span>{t("common.shutdown")}</span>
- </DropdownMenuItem>
+ {!isTauri && (
+ <DropdownMenuItem
+ onSelect={async () => {
+ // Best-effort server revocation; ignore network errors so
+ // the local clear still runs and the user lands on /login.
+ try {
+ await logout();
+ } catch {
+ clearAuthTokens();
+ }
+ void navigate({ to: "/login" });
+ }}
+ >
+ <HugeiconsIcon icon={Logout05Icon} strokeWidth={1.75} className="size-icon" />
+ <span>{t("shell.navigation.logOut")}</span>
+ </DropdownMenuItem>
+ )}
+ {!isTauri && (
+ <DropdownMenuItem onSelect={() => setShutdownOpen(true)}>
+ <HugeiconsIcon icon={PowerIcon} strokeWidth={1.75} className="size-icon" />
+ <span>{t("common.shutdown")}</span>
+ </DropdownMenuItem>
+ )}
</DropdownMenuContent>
</DropdownMenu>
</SidebarMenuItem>
@@ -1571,11 +1623,13 @@ export function AppSidebar() {
</SidebarFooter>
</Sidebar>
<ChatSearchDialog />
- <ShutdownDialog
- open={shutdownOpen}
- onOpenChange={setShutdownOpen}
- onAfterShutdown={removeTrainingUnloadGuard}
- />
+ {!isTauri && (
+ <ShutdownDialog
+ open={shutdownOpen}
+ onOpenChange={setShutdownOpen}
+ onAfterShutdown={removeTrainingUnloadGuard}
+ />
+ )}
<Dialog
open={confirmingDelete !== null}
onOpenChange={(open) => {
diff --git a/studio/frontend/src/components/assistant-ui/thread.tsx b/studio/frontend/src/components/assistant-ui/thread.tsx
index bad9a6b7f33..a05910c29f1 100644
--- a/studio/frontend/src/components/assistant-ui/thread.tsx
+++ b/studio/frontend/src/components/assistant-ui/thread.tsx
@@ -968,7 +968,9 @@ export const Thread: FC<{
scrollToBottomOnThreadSwitch={false}
className={cn(
"aui-thread-viewport aui-stream-viewport relative flex min-h-0 min-w-0 flex-1 basis-0 flex-col overflow-x-auto overflow-y-auto scroll-smooth px-5",
- hideComposer ? "pt-4" : "pt-[48px]",
+ hideComposer
+ ? "pt-4"
+ : "pt-[calc(var(--studio-content-top-inset,0px)+48px)]",
)}
>
{!hideWelcome && (
diff --git a/studio/frontend/src/components/navbar.tsx b/studio/frontend/src/components/navbar.tsx
index 716c9d791fa..44387f24802 100644
--- a/studio/frontend/src/components/navbar.tsx
+++ b/studio/frontend/src/components/navbar.tsx
@@ -1,13 +1,24 @@
// 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 { shouldUseNativeMacWindowTitlebar } from "@/components/tauri/window-titlebar";
import { SidebarTrigger, useSidebar } from "@/components/ui/sidebar";
+import { useState } from "react";
export function Navbar() {
const { isMobile } = useSidebar();
+ const [usesNativeMacTitlebar] = useState(shouldUseNativeMacWindowTitlebar);
if (!isMobile) {
return (
- <header className="absolute top-0 inset-x-0 z-40 h-[48px] pointer-events-none" />
+ <header className="absolute top-0 inset-x-0 z-40 h-[48px] pointer-events-none">
+ {usesNativeMacTitlebar && (
+ <div
+ data-tauri-drag-region
+ aria-hidden="true"
+ className="pointer-events-auto absolute inset-x-0 top-0 h-[var(--studio-mac-titlebar-height,34px)] select-none"
+ />
+ )}
+ </header>
);
}
return (
diff --git a/studio/frontend/src/components/tauri/startup-screen.tsx b/studio/frontend/src/components/tauri/startup-screen.tsx
index fd67a8a8416..678051b36bd 100644
--- a/studio/frontend/src/components/tauri/startup-screen.tsx
+++ b/studio/frontend/src/components/tauri/startup-screen.tsx
@@ -433,12 +433,12 @@ export function StartupScreen({
}
return (
- <div className="flex h-full w-full flex-col items-center bg-background">
- <div className="flex flex-1 w-full max-w-md items-center justify-center px-6">
+ <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)]">
+ <div className="flex min-h-0 flex-1 w-full max-w-md items-center justify-center px-6">
<AnimatePresence mode="wait">
<motion.div
key={status}
- className="flex h-full w-full flex-col items-center text-center"
+ className="flex h-full w-full flex-col items-center justify-center text-center"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
exit={{ opacity: 0 }}
diff --git a/studio/frontend/src/components/tauri/update-banner.tsx b/studio/frontend/src/components/tauri/update-banner.tsx
index 62038f92a92..4fe8a543771 100644
--- a/studio/frontend/src/components/tauri/update-banner.tsx
+++ b/studio/frontend/src/components/tauri/update-banner.tsx
@@ -9,6 +9,8 @@ import type {
UpdateStatus,
} from "@/hooks/use-tauri-update";
import type { CopySupportDiagnosticsResult } from "@/lib/tauri-diagnostics";
+import { cn } from "@/lib/utils";
+import { CircleAlert, Download } from "lucide-react";
import { AnimatePresence, motion } from "motion/react";
import { useState } from "react";
@@ -20,6 +22,8 @@ interface UpdateBannerProps {
isExternalServer?: boolean;
updatePolicyMode: DesktopUpdatePolicyMode;
manualReleaseUrl: string | null;
+ // false fills a shared overlay stack; true self-anchors.
+ positioned?: boolean;
onInstall: () => void;
onDismiss: () => void;
onCopyDiagnostics: () => Promise<CopySupportDiagnosticsResult>;
@@ -27,6 +31,11 @@ interface UpdateBannerProps {
const EASE_OUT_QUART: [number, number, number, number] = [0.165, 0.84, 0.44, 1];
+function formatVersion(version: string | null | undefined): string {
+ if (!version) return "";
+ return version.startsWith("v") ? version : `v${version}`;
+}
+
export function UpdateBanner({
status,
info,
@@ -35,6 +44,7 @@ export function UpdateBanner({
isExternalServer = false,
updatePolicyMode,
manualReleaseUrl,
+ positioned = true,
onInstall,
onDismiss,
onCopyDiagnostics,
@@ -49,6 +59,9 @@ export function UpdateBanner({
const installDisabled = isManualLinuxPackage
? manualReleaseUrl === null
: isExternalServer;
+ const currentVersion = formatVersion(info?.currentVersion);
+ const latestVersion = formatVersion(info?.version);
+ const Icon = showFailure ? CircleAlert : Download;
async function handleCopyDiagnostics() {
setCopying(true);
@@ -59,7 +72,10 @@ export function UpdateBanner({
setManualMessage(null);
} else {
setManualReport(result.report);
- setManualMessage(result.error ?? "Clipboard copy failed. Select and copy the diagnostics below.");
+ setManualMessage(
+ result.error ??
+ "Clipboard copy failed. Select and copy the diagnostics below.",
+ );
}
} catch (error) {
setManualReport(null);
@@ -73,30 +89,60 @@ export function UpdateBanner({
<AnimatePresence>
{show && (
<motion.div
- initial={{ opacity: 0, y: -12, scale: 0.96 }}
+ initial={{ opacity: 0, y: 12, scale: 0.96 }}
animate={{ opacity: 1, y: 0, scale: 1 }}
- exit={{ opacity: 0, y: -8, scale: 0.97 }}
+ exit={{ opacity: 0, y: 8, scale: 0.97 }}
transition={{ duration: 0.35, ease: EASE_OUT_QUART }}
- className="fixed top-4 right-4 z-[9999] w-[380px]"
+ className={cn(
+ positioned
+ ? "fixed bottom-4 right-4 z-[9999] w-[calc(100vw-2rem)] max-w-[400px]"
+ : "pointer-events-auto w-full",
+ )}
+ data-testid="tauri-update-banner"
>
- <div className="corner-squircle relative overflow-hidden border border-border/60 bg-background/95 px-5 py-4 shadow-lg backdrop-blur-md">
+ <div className="relative overflow-hidden rounded-[24px] bg-white px-5 pb-4 pt-5 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.16)] dark:bg-card dark:shadow-[0_8px_28px_-6px_rgba(0,0,0,0.28)]">
<button
type="button"
onClick={onDismiss}
- className="absolute top-3 right-3 flex size-6 items-center justify-center rounded-md text-muted-foreground/60 transition-colors hover:bg-muted hover:text-foreground"
+ className="absolute top-2.5 right-3 flex size-6 items-center justify-center rounded-full text-muted-foreground/60 transition-colors hover:bg-muted hover:text-foreground"
+ aria-label="Dismiss app update notification"
>
- <svg aria-hidden="true" width="14" height="14" viewBox="0 0 14 14" fill="none" xmlns="http://www.w3.org/2000/svg">
- <path d="M11 3L3 11M3 3l8 8" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
+ <svg
+ aria-hidden="true"
+ width="12"
+ height="12"
+ viewBox="0 0 14 14"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+ <path
+ d="M11 3L3 11M3 3l8 8"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinecap="round"
+ />
</svg>
</button>
- <div className="flex items-center gap-2">
- <span className="text-lg">🦥</span>
- <div>
- <p className="text-sm font-semibold text-foreground">
- {showFailure ? "App update failed" : `New version: v${info?.version}`}
+ <div className="flex min-w-0 items-start gap-4 pr-6">
+ <Icon
+ aria-hidden="true"
+ className="mt-1 size-5 shrink-0 text-foreground"
+ strokeWidth={1.75}
+ />
+ <div className="min-w-0">
+ <p className="font-heading text-base font-medium text-foreground">
+ {showFailure ? "App update failed" : "New Unsloth version"}
</p>
- <p className="text-xs text-muted-foreground">
+ {showFailure ? null : (
+ <p className="mt-0.5 text-xs text-muted-foreground">
+ {currentVersion} &rarr;{" "}
+ <span className="font-medium text-foreground">
+ {latestVersion}
+ </span>
+ </p>
+ )}
+ <p className="mt-1 text-[11px] text-muted-foreground/70">
{showFailure
? "Backend recovered. Diagnostics are still available."
: isManualLinuxPackage
@@ -114,31 +160,56 @@ export function UpdateBanner({
</p>
)}
- <div className="mt-3 flex items-center gap-2">
+ <div className="mt-4 flex flex-wrap items-center justify-end gap-x-1 gap-y-2">
{showFailure ? (
<>
- <Button size="sm" variant="outline" className="corner-squircle" onClick={() => {
- handleCopyDiagnostics().catch(console.error);
- }}>
- {copying ? "Copying..." : "Copy Diagnostics"}
+ <Button
+ size="sm"
+ variant="ghost"
+ className="h-auto rounded-full px-3 py-2 text-[13px] font-medium text-foreground"
+ onClick={() => {
+ handleCopyDiagnostics().catch(console.error);
+ }}
+ >
+ {copying ? "Copying..." : "Copy diagnostics"}
+ </Button>
+ <Button
+ size="sm"
+ variant="ghost"
+ className="h-auto rounded-full px-3 py-2 text-[13px] font-medium text-foreground"
+ onClick={onDismiss}
+ >
+ Later
</Button>
- <Button size="sm" className="corner-squircle" onClick={onInstall} disabled={installDisabled}>
- {isManualLinuxPackage ? "Open Release Page" : "Retry Update"}
+ <Button
+ size="sm"
+ className="-mr-1 h-auto rounded-full px-3.5 py-2 text-[13px]"
+ onClick={onInstall}
+ disabled={installDisabled}
+ >
+ {isManualLinuxPackage ? "Open release page" : "Retry update"}
</Button>
</>
) : (
<>
- <Button size="sm" className="corner-squircle" onClick={onInstall} disabled={installDisabled}>
- {isManualLinuxPackage ? "Open Release Page" : "Update Now"}
+ <Button
+ size="sm"
+ variant="ghost"
+ className="h-auto rounded-full px-3 py-2 text-[13px] font-medium text-foreground"
+ onClick={onDismiss}
+ >
+ Remind me later
</Button>
- <Button size="sm" variant="outline" className="corner-squircle" disabled={true}>
- Release Notes
+ <Button
+ size="sm"
+ className="-mr-1 h-auto rounded-full px-3.5 py-2 text-[13px]"
+ onClick={onInstall}
+ disabled={installDisabled}
+ >
+ {isManualLinuxPackage ? "Open release page" : "Update"}
</Button>
</>
)}
- <Button size="sm" variant="ghost" className="corner-squircle" onClick={onDismiss}>
- Later
- </Button>
</div>
{manualMessage && (
<p className="mt-3 text-xs text-destructive">{manualMessage}</p>
diff --git a/studio/frontend/src/components/tauri/update-screen.tsx b/studio/frontend/src/components/tauri/update-screen.tsx
index aa540b7813d..3199425f694 100644
--- a/studio/frontend/src/components/tauri/update-screen.tsx
+++ b/studio/frontend/src/components/tauri/update-screen.tsx
@@ -117,12 +117,12 @@ export function UpdateScreen({
}
return (
- <div className="flex h-full w-full items-center justify-center bg-background">
+ <div className="box-border flex h-full w-full overflow-y-auto bg-background">
<motion.div
initial={{ opacity: 0, y: 8 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.4, ease: EASE_OUT_QUART }}
- className="flex w-full max-w-xl flex-col items-center px-6"
+ className="mx-auto flex min-h-full w-full max-w-xl flex-col items-center justify-center px-6 pb-6 pt-[var(--studio-startup-top-inset,0px)]"
>
<Logo />
diff --git a/studio/frontend/src/components/tauri/window-titlebar.tsx b/studio/frontend/src/components/tauri/window-titlebar.tsx
index 96556a79995..66efe8d74a9 100644
--- a/studio/frontend/src/components/tauri/window-titlebar.tsx
+++ b/studio/frontend/src/components/tauri/window-titlebar.tsx
@@ -1,10 +1,17 @@
// 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 { SIDEBAR_WIDTH, SIDEBAR_WIDTH_ICON } from "@/components/ui/sidebar";
import { useSidebarPin } from "@/hooks/use-sidebar-pin";
import { isTauri } from "@/lib/api-base";
import { cn } from "@/lib/utils";
+import {
+ Cancel01Icon,
+ LayoutAlignLeftIcon,
+ MinusSignIcon,
+ SquareIcon,
+ SquareSquareIcon,
+} from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
import type { Window as TauriWindow } from "@tauri-apps/api/window";
import {
type MouseEvent,
@@ -56,6 +63,13 @@ export function shouldUseCustomWindowTitlebar(): boolean {
return CUSTOM_TITLEBAR_PLATFORMS.some((token) => platform.includes(token));
}
+export function shouldUseNativeMacWindowTitlebar(): boolean {
+ if (!isTauri) {
+ return false;
+ }
+ return getClientPlatform().includes("mac");
+}
+
async function getAppWindow(): Promise<TauriWindow> {
const { getCurrentWindow } = await import("@tauri-apps/api/window");
return getCurrentWindow();
@@ -79,7 +93,7 @@ function WindowControlButton({
title={label}
onClick={onClick}
className={cn(
- "relative z-[80] inline-flex size-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted/80 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ "relative z-[80] inline-flex size-8 items-center justify-center rounded-[10px] text-muted-foreground/90 transition-colors hover:bg-nav-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
className,
)}
>
@@ -88,39 +102,6 @@ function WindowControlButton({
);
}
-function MinimizeGlyph(): ReactElement {
- return (
- <span aria-hidden="true" className="h-px w-3.5 rounded-full bg-current" />
- );
-}
-
-function MaximizeGlyph(): ReactElement {
- return (
- <span
- aria-hidden="true"
- className="size-3 rounded-[2px] border border-current"
- />
- );
-}
-
-function RestoreGlyph(): ReactElement {
- return (
- <span aria-hidden="true" className="relative size-3.5">
- <span className="absolute left-0.5 top-0 size-2.5 rounded-[2px] border border-current" />
- <span className="absolute bottom-0 right-0 size-2.5 rounded-[2px] border border-current bg-muted" />
- </span>
- );
-}
-
-function CloseGlyph(): ReactElement {
- return (
- <span aria-hidden="true" className="relative size-3.5">
- <span className="absolute left-1/2 top-0 h-3.5 w-px -translate-x-1/2 rotate-45 rounded-full bg-current" />
- <span className="absolute left-1/2 top-0 h-3.5 w-px -translate-x-1/2 -rotate-45 rounded-full bg-current" />
- </span>
- );
-}
-
export function WindowTitlebar({
showSidebarSurface = false,
}: {
@@ -128,7 +109,13 @@ export function WindowTitlebar({
}): ReactElement | null {
const [enabled] = useState(shouldUseCustomWindowTitlebar);
const [maximized, setMaximized] = useState(false);
- const { pinned } = useSidebarPin();
+ const { pinned, togglePinned } = useSidebarPin();
+ const sidebarWidth = showSidebarSurface
+ ? pinned
+ ? "var(--studio-sidebar-expanded-width,17.5rem)"
+ : "var(--studio-sidebar-collapsed-width,3rem)"
+ : "0px";
+ const contentBorderLeft = `calc(${sidebarWidth} + 12px)`;
const refreshMaximized = useCallback(async () => {
if (!enabled) {
@@ -239,29 +226,113 @@ export function WindowTitlebar({
return (
<>
<header
- className="relative z-[60] flex h-[var(--studio-titlebar-height)] shrink-0 select-none items-center text-foreground"
+ className={cn(
+ "pointer-events-none absolute inset-x-0 top-0 z-[70] h-[var(--studio-custom-titlebar-height)] select-none text-foreground",
+ showSidebarSurface && "bg-sidebar text-sidebar-foreground",
+ )}
aria-label="Window titlebar"
>
+ {showSidebarSurface && (
+ <div
+ aria-hidden="true"
+ className="pointer-events-none absolute top-full h-3 w-px -translate-x-px bg-sidebar"
+ style={{ left: sidebarWidth }}
+ />
+ )}
+ {showSidebarSurface && (
+ <div
+ aria-hidden="true"
+ className="pointer-events-none absolute top-full h-px bg-sidebar-border"
+ style={{ left: contentBorderLeft, right: 0 }}
+ />
+ )}
+ {showSidebarSurface && (
+ <div
+ aria-hidden="true"
+ className="pointer-events-none absolute top-full size-3 -translate-x-px rounded-tl-[12px] border-l border-t border-sidebar-border bg-background"
+ style={{ left: sidebarWidth }}
+ />
+ )}
{showSidebarSurface && (
<div
className={cn(
- "h-full shrink-0 border-r border-sidebar-border dark:border-r-0",
- pinned ? "bg-sidebar" : "bg-white dark:bg-background",
+ "pointer-events-auto absolute left-0 top-0 flex h-full min-w-0 items-center",
+ pinned ? "gap-2 px-3" : "justify-center",
)}
- style={{ width: pinned ? SIDEBAR_WIDTH : SIDEBAR_WIDTH_ICON }}
+ style={{ width: sidebarWidth }}
onMouseDown={handleDragMouseDown}
onDoubleClick={handleDragDoubleClick}
- aria-hidden="true"
- />
+ >
+ {pinned ? (
+ <>
+ <div className="flex min-w-0 flex-1 items-center gap-2">
+ <img
+ src="/rounded-512.png"
+ alt=""
+ aria-hidden="true"
+ draggable={false}
+ className="size-5 shrink-0 rounded-[6px] object-cover"
+ />
+ <span className="min-w-0 truncate text-[13px] font-semibold leading-none tracking-[0.01em] text-nav-fg">
+ Unsloth Studio
+ </span>
+ </div>
+ <button
+ type="button"
+ title="Collapse sidebar"
+ aria-label="Collapse sidebar"
+ onMouseDown={(event) => event.stopPropagation()}
+ onDoubleClick={(event) => event.stopPropagation()}
+ onClick={(event) => {
+ event.stopPropagation();
+ togglePinned();
+ }}
+ className="inline-flex size-8 shrink-0 items-center justify-center rounded-[10px] text-nav-icon-idle transition-colors hover:bg-nav-surface-hover hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <HugeiconsIcon
+ icon={LayoutAlignLeftIcon}
+ strokeWidth={1.75}
+ className="size-icon"
+ />
+ </button>
+ </>
+ ) : (
+ <button
+ type="button"
+ title="Expand sidebar"
+ aria-label="Expand sidebar"
+ onMouseDown={(event) => event.stopPropagation()}
+ onDoubleClick={(event) => event.stopPropagation()}
+ onClick={(event) => {
+ event.stopPropagation();
+ togglePinned();
+ }}
+ className="inline-flex size-8 items-center justify-center rounded-[10px] transition-colors hover:bg-nav-surface-hover focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <img
+ src="/rounded-512.png"
+ alt=""
+ aria-hidden="true"
+ draggable={false}
+ className="size-5 rounded-[6px] object-cover"
+ />
+ <span className="sr-only">Expand sidebar</span>
+ </button>
+ )}
+ </div>
)}
<div
- className="h-full min-w-0 flex-1 border-b border-border/35 bg-muted/35"
+ className="pointer-events-auto absolute top-0 h-full"
+ style={{
+ left: sidebarWidth,
+ right: "calc(var(--studio-window-control-inset,112px) + 0.5rem)",
+ }}
onMouseDown={handleDragMouseDown}
onDoubleClick={handleDragDoubleClick}
aria-hidden="true"
/>
<div
- className="flex h-full shrink-0 items-center gap-0.5 border-b border-border/35 bg-muted/35 px-1"
+ className="pointer-events-auto absolute right-1 top-0 flex h-full items-center gap-0.5 px-1"
role="toolbar"
aria-label="Window controls"
>
@@ -269,7 +340,11 @@ export function WindowTitlebar({
label="Minimize window"
onClick={() => runWindowAction((appWindow) => appWindow.minimize())}
>
- <MinimizeGlyph />
+ <HugeiconsIcon
+ icon={MinusSignIcon}
+ strokeWidth={1.75}
+ className="size-[15px]"
+ />
</WindowControlButton>
<WindowControlButton
label={maximized ? "Restore window" : "Maximize window"}
@@ -277,14 +352,22 @@ export function WindowTitlebar({
runWindowAction((appWindow) => appWindow.toggleMaximize())
}
>
- {maximized ? <RestoreGlyph /> : <MaximizeGlyph />}
+ <HugeiconsIcon
+ icon={maximized ? SquareSquareIcon : SquareIcon}
+ strokeWidth={1.75}
+ className="size-[14px]"
+ />
</WindowControlButton>
<WindowControlButton
label="Close window"
onClick={() => runWindowAction((appWindow) => appWindow.close())}
- className="hover:bg-destructive hover:text-destructive-foreground focus-visible:ring-destructive/70"
+ className="hover:bg-destructive/10 hover:text-destructive focus-visible:ring-destructive/70 dark:hover:bg-destructive/20"
>
- <CloseGlyph />
+ <HugeiconsIcon
+ icon={Cancel01Icon}
+ strokeWidth={1.75}
+ className="size-[15px]"
+ />
</WindowControlButton>
</div>
</header>
diff --git a/studio/frontend/src/features/chat/chat-page.tsx b/studio/frontend/src/features/chat/chat-page.tsx
index a288a60fb67..dfd96a1e86f 100644
--- a/studio/frontend/src/features/chat/chat-page.tsx
+++ b/studio/frontend/src/features/chat/chat-page.tsx
@@ -512,7 +512,7 @@ function CompareShell({
<div className="flex min-h-0 min-w-0 flex-1 basis-0 flex-col">
<div
data-tour="chat-compare-view"
- className="flex min-h-0 min-w-0 flex-1 basis-0 flex-col md:flex-row"
+ className="flex min-h-0 min-w-0 flex-1 basis-0 flex-col pt-[var(--studio-content-top-inset,0px)] md:flex-row"
>
{children}
</div>
@@ -650,11 +650,16 @@ function GeneralCompareHeader({
// Controlled so the body-portaled popover can't linger over another tab off-route.
const active = useChatActive();
const [selectorOpen, setSelectorOpen] = useState(false);
+ const { pinned } = useSidebar();
return (
<div
className={cn(
- "flex h-[48px] shrink-0 items-start pt-[11px] gap-2 bg-background",
- side === "left" ? "pl-12 pr-3 md:pl-2" : "pl-3 pr-12",
+ "pointer-events-none relative z-[65] flex h-[48px] shrink-0 items-start gap-2 bg-background pt-[var(--studio-chat-header-padding-top,11px)]",
+ side === "left"
+ ? pinned
+ ? "pl-12 pr-3 md:pl-2"
+ : "pl-12 pr-3 md:pl-[calc(0.5rem+max(0px,var(--studio-mac-traffic-light-inset,0px)-var(--sidebar-width-icon,3rem)))]"
+ : "pl-3 pr-[calc(3rem+var(--studio-chat-header-right-inset,var(--studio-window-control-inset,0px)))]",
)}
>
<ModelSelector
@@ -667,7 +672,7 @@ function GeneralCompareHeader({
onModelsChange={onModelsChange}
deleteDisabled={deleteDisabled}
variant="ghost"
- className="max-w-[80%] !h-[34px]"
+ className="pointer-events-auto max-w-[80%] !h-[var(--studio-chat-control-height,34px)]"
open={active && selectorOpen}
onOpenChange={(open) => setSelectorOpen(active && open)}
/>
@@ -2049,7 +2054,7 @@ export function ChatPage({
() => setSettingsOpen(false),
[setSettingsOpen],
);
- const { isMobile } = useSidebar();
+ const { isMobile, pinned } = useSidebar();
const enterCompare = useCallback(() => {
viewBeforeCompareRef.current = { ...search };
@@ -2377,19 +2382,23 @@ export function ChatPage({
beneath it, instead of a hard cut. */}
{view.mode !== "compare" && (
<div
- aria-hidden={true}
- className="pointer-events-none absolute left-0 right-[10px] top-[48px] z-20 h-6 bg-gradient-to-b from-background to-[rgb(from_var(--background)_r_g_b/0)]"
+ aria-hidden
+ className="pointer-events-none absolute left-0 right-[10px] top-[calc(var(--studio-content-top-inset,0px)+var(--studio-chat-header-height,48px))] z-20 h-6 bg-gradient-to-b from-background to-transparent"
/>
)}
<div
className={cn(
- "absolute top-0 left-0 right-[10px] z-30 flex h-[48px] shrink-0 items-start pt-[11px] pr-2 bg-background",
- isMobile ? "pl-12 pr-1.5" : "pl-2",
+ "pointer-events-none absolute top-[var(--studio-content-top-inset,0px)] left-0 right-[10px] z-[66] flex h-[var(--studio-chat-header-height,48px)] shrink-0 items-start bg-background pt-[var(--studio-chat-header-padding-top,11px)] pr-[calc(0.5rem+var(--studio-chat-header-right-inset,var(--studio-window-control-inset,0px)))]",
+ isMobile
+ ? "pl-12"
+ : pinned
+ ? "pl-2"
+ : "pl-[calc(0.5rem+max(0px,var(--studio-mac-traffic-light-inset,0px)-var(--sidebar-width-icon,3rem)))]",
view.mode === "compare" &&
- "right-[10px] left-auto w-auto bg-transparent pl-0 pr-2",
+ "right-[10px] left-auto w-auto bg-transparent pl-0 pr-[calc(0.5rem+var(--studio-chat-header-right-inset,var(--studio-window-control-inset,0px)))]",
)}
>
- <div className="flex items-center gap-1">
+ <div className="pointer-events-auto flex items-center gap-1">
{view.mode !== "compare" && (
<ModelSelector
models={models}
@@ -2409,13 +2418,23 @@ export function ChatPage({
triggerDataTour="chat-model-selector"
contentDataTour="chat-model-selector-popover"
showCloudIndicator={isExternalModel}
- className="max-w-[62vw] !pr-3 sm:max-w-none !h-[34px]"
+ className="max-w-[62vw] !pr-3 sm:max-w-none !h-[var(--studio-chat-control-height,34px)]"
/>
)}
+ {incognito && view.mode === "single" && (
+ <div className="flex h-[var(--studio-chat-control-height,34px)] shrink-0 items-center gap-1.5 self-center rounded-full bg-primary/10 px-2.5 font-medium text-[13px] text-primary">
+ <HugeiconsIcon
+ icon={BubbleChatTemporaryIcon}
+ strokeWidth={2}
+ className="size-3.5"
+ />
+ <span>Temporary</span>
+ </div>
+ )}
{view.mode !== "compare" && currentProjectId && (
<nav
aria-label="Project location"
- className="flex h-[34px] min-w-0 items-center gap-1.5 self-center text-[13.5px] tracking-nav text-muted-foreground"
+ className="flex h-[var(--studio-chat-control-height,34px)] min-w-0 items-center gap-1.5 self-center text-[13.5px] tracking-nav text-muted-foreground"
>
<ProjectSwitcher
currentProject={currentProject}
@@ -2474,7 +2493,7 @@ export function ChatPage({
</div>
) : null}
</div>
- <div className="ml-auto flex items-center gap-2">
+ <div className="pointer-events-auto ml-auto flex items-center gap-2">
{view.mode === "single" && contextUsage ? (
<ContextUsageBar
used={contextUsage.totalTokens}
@@ -2484,7 +2503,7 @@ export function ChatPage({
cacheWrites={contextUsage.cacheWriteTokens}
promptTokens={contextUsage.promptTokens}
completionTokens={contextUsage.completionTokens}
- className="h-[34px]"
+ className="h-[var(--studio-chat-control-height,34px)]"
/>
) : null}
{view.mode === "single" && (
@@ -2494,7 +2513,7 @@ export function ChatPage({
type="button"
onClick={toggleIncognito}
className={cn(
- "flex h-[34px] w-[34px] cursor-pointer items-center justify-center rounded-full transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ "flex size-[var(--studio-chat-control-height,34px)] cursor-pointer items-center justify-center rounded-[12px] transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
incognito
? "bg-primary/10 text-primary hover:bg-primary/15"
: "text-nav-fg hover:bg-nav-surface-hover hover:text-black dark:hover:text-white",
@@ -2524,7 +2543,7 @@ export function ChatPage({
<button
type="button"
onClick={() => setSettingsOpen(true)}
- className="flex h-[34px] w-[34px] translate-x-[2px] cursor-pointer items-center justify-center rounded-full text-nav-fg transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ className="flex size-[var(--studio-chat-control-height,34px)] translate-x-[2px] cursor-pointer items-center justify-center rounded-[12px] text-nav-fg transition-colors hover:bg-nav-surface-hover hover:text-black dark:hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
aria-label="Open run settings"
>
<HugeiconsIcon
diff --git a/studio/frontend/src/features/chat/chat-settings-sheet.tsx b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
index bc73e1ddf22..f5136e01818 100644
--- a/studio/frontend/src/features/chat/chat-settings-sheet.tsx
+++ b/studio/frontend/src/features/chat/chat-settings-sheet.tsx
@@ -1783,7 +1783,14 @@ export function ChatSettingsPanel({
return (
<aside
data-tour="chat-settings"
- className={`relative z-50 shrink-0 h-full overflow-hidden bg-panel-surface text-panel-surface-fg font-heading ${open ? "w-[17rem] border-l border-sidebar-border" : "w-0"}`}
+ className={cn(
+ "relative z-50 shrink-0 overflow-hidden bg-panel-surface text-panel-surface-fg font-heading",
+ open ? "w-[17rem] border-l border-sidebar-border" : "w-0",
+ )}
+ style={{
+ height: "calc(100% - var(--studio-custom-titlebar-height, 0px))",
+ marginTop: "var(--studio-custom-titlebar-height, 0px)",
+ }}
>
<div className="h-full w-full">{settingsContent}</div>
</aside>
diff --git a/studio/frontend/src/features/settings/tabs/about-tab.tsx b/studio/frontend/src/features/settings/tabs/about-tab.tsx
index 084a3ab5b6e..ff751e3cd61 100644
--- a/studio/frontend/src/features/settings/tabs/about-tab.tsx
+++ b/studio/frontend/src/features/settings/tabs/about-tab.tsx
@@ -250,29 +250,33 @@ export function AboutTab() {
</SettingsRow>
</SettingsSection>
- <SettingsSection title={t("settings.about.dangerZone")}>
- <SettingsRow
- destructive={true}
- label={t("settings.about.shutDownStudio")}
- description={t("settings.about.shutDownStudioDescription")}
- >
- <Button
- variant="outline"
- size="sm"
- onClick={() => setShutdownOpen(true)}
- className="text-destructive hover:text-destructive hover:border-destructive/60"
+ {!isTauri && (
+ <SettingsSection title={t("settings.about.dangerZone")}>
+ <SettingsRow
+ destructive={true}
+ label={t("settings.about.shutDownStudio")}
+ description={t("settings.about.shutDownStudioDescription")}
>
- <HugeiconsIcon icon={Cancel01Icon} className="size-3.5 mr-1.5" />
- {t("settings.about.shutDown")}
- </Button>
- </SettingsRow>
- </SettingsSection>
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => setShutdownOpen(true)}
+ className="text-destructive hover:text-destructive hover:border-destructive/60"
+ >
+ <HugeiconsIcon icon={Cancel01Icon} className="size-3.5 mr-1.5" />
+ {t("settings.about.shutDown")}
+ </Button>
+ </SettingsRow>
+ </SettingsSection>
+ )}
- <ShutdownDialog
- open={shutdownOpen}
- onOpenChange={setShutdownOpen}
- onAfterShutdown={removeTrainingUnloadGuard}
- />
+ {!isTauri && (
+ <ShutdownDialog
+ open={shutdownOpen}
+ onOpenChange={setShutdownOpen}
+ onAfterShutdown={removeTrainingUnloadGuard}
+ />
+ )}
</div>
);
}
diff --git a/studio/src-tauri/icons/128x128.png b/studio/src-tauri/icons/128x128.png
index c1dae04e6df..bfa6e735838 100644
Binary files a/studio/src-tauri/icons/128x128.png and b/studio/src-tauri/icons/128x128.png differ
diff --git a/studio/src-tauri/icons/32x32.png b/studio/src-tauri/icons/32x32.png
index bd08d7bcbb6..d5c1123fceb 100644
Binary files a/studio/src-tauri/icons/32x32.png and b/studio/src-tauri/icons/32x32.png differ
diff --git a/studio/src-tauri/icons/icon.icns b/studio/src-tauri/icons/icon.icns
index e67a5e64744..428b048faaf 100644
Binary files a/studio/src-tauri/icons/icon.icns and b/studio/src-tauri/icons/icon.icns differ
diff --git a/studio/src-tauri/icons/icon.ico b/studio/src-tauri/icons/icon.ico
index acc6eb82b9b..72bb4631f23 100644
Binary files a/studio/src-tauri/icons/icon.ico and b/studio/src-tauri/icons/icon.ico differ
diff --git a/studio/src-tauri/icons/icon.png b/studio/src-tauri/icons/icon.png
index 635900d8a7e..7837ab40ddc 100644
Binary files a/studio/src-tauri/icons/icon.png and b/studio/src-tauri/icons/icon.png differ
diff --git a/studio/src-tauri/src/main.rs b/studio/src-tauri/src/main.rs
index 4ed12051edb..1130ad2d5cd 100644
--- a/studio/src-tauri/src/main.rs
+++ b/studio/src-tauri/src/main.rs
@@ -159,12 +159,36 @@ fn setup_tray(app: &tauri::App) -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
+#[cfg(target_os = "linux")]
+fn apply_linux_appimage_webkit_workarounds() {
+ if std::env::var_os("APPIMAGE").is_none() {
+ return;
+ }
+
+ // AppImage bundles WebKitGTK/GTK while still using host Mesa/EGL.
+ // On some rolling Linux stacks that mixed path leaves WebKit blank.
+ set_env_if_missing("WEBKIT_DISABLE_COMPOSITING_MODE", "1");
+ set_env_if_missing("WEBKIT_DISABLE_DMABUF_RENDERER", "1");
+}
+
+#[cfg(target_os = "linux")]
+fn set_env_if_missing(key: &str, value: &str) {
+ if std::env::var_os(key).is_none() {
+ std::env::set_var(key, value);
+ }
+}
+
+#[cfg(not(target_os = "linux"))]
+fn apply_linux_appimage_webkit_workarounds() {}
+
fn main() {
// Fix PATH for GUI apps (macOS .app bundles, Linux AppImage, Windows)
// GUI apps don't inherit shell dotfile PATH — this spawns the user's
// login shell to source .zshrc/.bashrc/.profile and sets PATH properly.
let _ = fix_path_env::fix();
+ apply_linux_appimage_webkit_workarounds();
+
setup_logging();
info!("Unsloth Studio desktop app starting");
windows_job::initialize();
diff --git a/studio/src-tauri/tauri.conf.json b/studio/src-tauri/tauri.conf.json
index 44fccaa447a..5b521a2e159 100644
--- a/studio/src-tauri/tauri.conf.json
+++ b/studio/src-tauri/tauri.conf.json
@@ -22,17 +22,21 @@
{
"label": "main",
"title": "Unsloth Studio (Desktop)",
- "width": 690,
- "height": 480,
+ "width": 760,
+ "height": 560,
"center": true,
"visible": false,
- "resizable": false
+ "resizable": false,
+ "decorations": true,
+ "titleBarStyle": "Overlay",
+ "trafficLightPosition": { "x": 14, "y": 24 },
+ "hiddenTitle": true
}
]
},
"plugins": {
"updater": {
- "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEQ2RDhGMDMzNDNEMTlGMkQKUldRdG45RkRNL0RZMXZsaVo2TElUQlVHb1hVNWEyajhUOGFXeTdNVDFZTFdBVUtlZUh5L2wwWVYK",
+ "pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDE0NjlBNkEwQTc0QjY0Q0UKUldUT1pFdW5vS1pwRkl3TXRrOGlYdDNMeTh1bEhSbURrM3IyT2lTK1BiekpTc0Z2SXZFeVNibDIK",
"endpoints": [
"https://github.com/unslothai/unsloth/releases/download/desktop-latest/latest.json"
],