Skip to content

fix(gui): keep a drag region reachable while onboarding is on screen#192

Open
AmirF194 wants to merge 1 commit into
andrewyng:mainfrom
AmirF194:fix/95-onboarding-window-drag
Open

fix(gui): keep a drag region reachable while onboarding is on screen#192
AmirF194 wants to merge 1 commit into
andrewyng:mainfrom
AmirF194:fix/95-onboarding-window-drag

Conversation

@AmirF194

Copy link
Copy Markdown

On macOS the native title bar is hidden (src-tauri/src/lib.rs gates TitleBarStyle::Overlay + hidden_title(true) behind cfg(target_os = "macos")), so moving the window depends entirely on a data-tauri-drag-region element receiving the pointer event. Onboarding's full-viewport backdrop (Onboarding.tsx, fixed inset-0 z-50) sits above both of the app's only drag surfaces, Sidebar's brand row and App.tsx's topbar, and carries no drag region of its own, so the window cannot be moved for as long as onboarding is on screen. Resizing is unaffected: it is handled by the native OS edge, outside the web content.

Fix

Mirrors the app's own precedent for this exact situation: the boot splash (App.tsx, rendered before Sidebar/topbar mount) already renders a transparent .titlebar-drag strip at z-index: 180, above any backdrop, for the same "no chrome mounted yet" gap. Onboarding now renders the identical strip while the macOS overlay layout is active.

Verification

Verified in a clean container (Node 20, Playwright 1.61.1 chromium) against HEAD. Added surfaces/gui/e2e/onboarding-drag.spec.ts, which simulates the macOS shell (__TAURI__ + __OCW_PLATFORM__=macos) and asserts a data-tauri-drag-region element is the actual elementFromPoint hit at its own coordinates while onboarding is showing. It fails on HEAD (the hit is the backdrop) and passes with this change.

Full suites: npm test (68/68 pass) and npm run e2e (154/155 pass; the one failure, nav-collapse.spec.ts's Cmd+B toggle test, fails identically on unmodified HEAD and is unrelated to this change).

Not verified: actual native window dragging in a compiled macOS build, which this Linux environment cannot produce. The strip is visually transparent, matching the existing boot-splash strip, so a before/after screenshot of the running app would be pixel-identical; the behavioral proof above is what this PR relies on instead.

Fixes #95

On macOS the native title bar is hidden (src-tauri/src/lib.rs gates
TitleBarStyle::Overlay + hidden_title(true) behind cfg(target_os = "macos")),
so moving the window depends entirely on a data-tauri-drag-region element
receiving the pointer event. Onboarding's full-viewport backdrop
(Onboarding.tsx, fixed inset-0 z-50) sits above both of the app's only drag
surfaces, Sidebar's brand row and App.tsx's topbar, and carries no drag
region of its own, so the window cannot be moved for as long as onboarding
is on screen. Resizing is unaffected because it is handled by the native OS
edge, outside the web content.

The fix mirrors the app's own precedent for this exact situation: the boot
splash (App.tsx, rendered before Sidebar/topbar mount) already renders a
transparent `.titlebar-drag` strip at z-index 180, above any backdrop, for
the same "no chrome mounted yet" gap. Onboarding now renders the identical
strip while the macOS overlay layout is active.

Verified in a clean container (Node 20, Playwright 1.61.1 chromium) against
HEAD: added surfaces/gui/e2e/onboarding-drag.spec.ts, which simulates the
macOS shell (__TAURI__ + __OCW_PLATFORM__=macos) and asserts a
data-tauri-drag-region element is the actual elementFromPoint hit at its
own coordinates while onboarding is showing. Fails on HEAD (the hit is the
backdrop), passes with this change. Full suites: `npm test` (68/68) and
`npm run e2e` (154/155, the one failure is nav-collapse.spec.ts's
⌘B-toggle test, which fails identically on unmodified HEAD and is
unrelated to this change).

Not verified: actual native window dragging in a compiled macOS build,
which this Linux VPS cannot produce. The strip is visually transparent
(matching the existing boot-splash strip), so a before/after screenshot of
the running app would be pixel-identical; the behavioral proof above is
what this PR relies on instead.

Fixes andrewyng#95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mac Desktop Window cannot be moved (but can be resized)

1 participant