fix(gui): keep a drag region reachable while onboarding is on screen#192
Open
AmirF194 wants to merge 1 commit into
Open
fix(gui): keep a drag region reachable while onboarding is on screen#192AmirF194 wants to merge 1 commit into
AmirF194 wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS the native title bar is hidden (
src-tauri/src/lib.rsgatesTitleBarStyle::Overlay+hidden_title(true)behindcfg(target_os = "macos")), so moving the window depends entirely on adata-tauri-drag-regionelement 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-dragstrip atz-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 adata-tauri-drag-regionelement is the actualelementFromPointhit 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) andnpm 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