fix(desktop): enforce minimum window size on main client (#1189) (#1203)

The main BrowserWindow was created with only `width: 1280, height: 900`
and no `minWidth` / `minHeight`, so Electron honored arbitrary user
drags. Past roughly 900×600 the project page's left/right split (chat
composer + designs panel + preview pane) overlaps and the top
navigation clips, which is the broken first impression reported in
#1189.

Pin `minWidth: 900, minHeight: 600` on the main window — preserves the
usable layout floor while still fitting common 13" small-screen
laptops. The ephemeral print sub-window (`show: false`, closed on
print completion) is unchanged: it isn't user-resizable so a min-size
floor has no observable effect there.
This commit is contained in:
Sid 2026-05-11 12:33:47 +08:00 committed by GitHub
parent b19aa6c907
commit 1dc0224599
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -784,6 +784,12 @@ export async function createDesktopRuntime(options: DesktopRuntimeOptions): Prom
const consoleEntries: DesktopConsoleEntry[] = [];
const window = new BrowserWindow({
height: 900,
// Below this size the project page's left/right split (chat
// composer + designs panel + preview pane) overlaps and the top
// navigation clips, so prevent Electron from honoring user drags
// that would shrink the window past the usable breakpoint.
minHeight: 600,
minWidth: 900,
show: true,
title: "Open Design",
...MAC_WINDOW_CHROME,