fix: drag the window from the sidebar's empty area#119
Merged
Conversation
The main window can only be moved by grabbing the strip right next to the traffic lights. Clicking the empty space in the sidebar below the tab list now moves the window too, using the same WindowDragHandleView the titlebar already uses, mounted as a frontmost overlay so it actually receives the clicks. Double-clicking that area still creates a new workspace: the drag handle now owns the full double-click sequence via a new onDoubleClick callback instead of racing a sibling SwiftUI tap gesture for it. Existing call sites keep their default zoom/minimize behavior.
5 tasks
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.
What this does
Right now the only way to move a Programa window is to grab the tiny strip next to the traffic-light buttons, which is uncomfortable. With this change you can click and drag the empty space in the sidebar (below the tab list) to move the window. Double-clicking that same area still creates a new workspace, exactly like before.
Summary
SidebarEmptyAreanow mounts the existingWindowDragHandleViewas a frontmost.overlay. A.backgroundplacement does not work: theColor.clear+.contentShapecontent in front is the hit-test target, so the drag view never receives the click.WindowDragHandleViewgains two opt-in parameters,handlesDoubleClickandonDoubleClick. With the drag view frontmost it claims the first click of any double-click, so a sibling.onTapGesture(count: 2)can never reliably count to two. The drag view now owns the whole double-click sequence and fires the add-workspace action directly. Both existing call sites (custom titlebar, sidebar top strip) use the defaults and keep byte-identical behavior.hitTestbails for anything that is not a left mouse down, so drag sessions fall through to the existingonDroptarget.dloginstrumentation added at the capture/double-click decision points.Note: dragging from the top tab bar's empty strip needs changes in the
vendor/bonsplitsubmodule, which currently points atmanaflow-ai/bonsplit(no push access). That part is intentionally left out of this PR until we decide whether to fork bonsplit into the org.Test Plan
No automated regression test: this is AppKit hit-testing behavior that our unit environment cannot exercise end-to-end, per the repo test quality policy.