From d7a948ed5bd27f6f96bdfd92bb635454e5b9b2ea Mon Sep 17 00:00:00 2001 From: ShowhyT <109768004+ShowhyT@users.noreply.github.com> Date: Mon, 20 Jul 2026 02:56:01 +0300 Subject: [PATCH] fix: hide window controls in web runtime Window control icons (minimize/maximize/close) rendered in the web runtime; now hidden there. Extract the visibility check into shouldShowWindowControls(), which uses window.zen.getAppInfo().runtime to detect web vs desktop, and add unit tests covering desktop, web, and mac. --- packages/app-core/src/components/TitleBar.tsx | 4 +++- packages/app-core/src/lib/titlebar.test.ts | 19 +++++++++++++++++++ packages/app-core/src/lib/titlebar.ts | 9 +++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 packages/app-core/src/lib/titlebar.test.ts create mode 100644 packages/app-core/src/lib/titlebar.ts diff --git a/packages/app-core/src/components/TitleBar.tsx b/packages/app-core/src/components/TitleBar.tsx index 62d58caa..0b32c2e8 100644 --- a/packages/app-core/src/components/TitleBar.tsx +++ b/packages/app-core/src/components/TitleBar.tsx @@ -6,6 +6,7 @@ import { isArchiveTabPath } from '@shared/archive' import { isTrashTabPath } from '@shared/trash' import { isQuickNotesTabPath } from '@shared/quick-notes' import { resolveSystemFolderLabels } from '../lib/system-folder-labels' +import { shouldShowWindowControls } from '../lib/titlebar' export function TitleBar(): JSX.Element { const vault = useStore((s) => s.vault) @@ -14,6 +15,7 @@ export function TitleBar(): JSX.Element { const systemFolderLabels = useStore((s) => s.systemFolderLabels) const workspaceMode = useStore((s) => s.workspaceMode) const isMac = window.zen.platformSync() === 'darwin' + const runtime = window.zen.getAppInfo().runtime const labels = resolveSystemFolderLabels(systemFolderLabels) const title = activeNote @@ -47,7 +49,7 @@ export function TitleBar(): JSX.Element { )} - {!isMac && ( + {shouldShowWindowControls(isMac ? 'darwin' : 'other', runtime) && (