Skip to content

fix: drag the window from the sidebar's empty area#119

Merged
arzafran merged 1 commit into
mainfrom
fix/window-drag-areas
Jul 10, 2026
Merged

fix: drag the window from the sidebar's empty area#119
arzafran merged 1 commit into
mainfrom
fix/window-drag-areas

Conversation

@lsoengas

Copy link
Copy Markdown

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

  • SidebarEmptyArea now mounts the existing WindowDragHandleView as a frontmost .overlay. A .background placement does not work: the Color.clear + .contentShape content in front is the hit-test target, so the drag view never receives the click.
  • WindowDragHandleView gains two opt-in parameters, handlesDoubleClick and onDoubleClick. 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.
  • Drop-to-reorder into the empty area is unaffected: the drag view's hitTest bails for anything that is not a left mouse down, so drag sessions fall through to the existing onDrop target.
  • Debug-build dlog instrumentation added at the capture/double-click decision points.

Note: dragging from the top tab bar's empty strip needs changes in the vendor/bonsplit submodule, which currently points at manaflow-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

  • Manual: drag from sidebar empty space moves the window
  • Manual: double-click sidebar empty space still creates and selects a new workspace
  • Manual: dragging a tab into the sidebar empty area still reorders
  • Manual: titlebar and sidebar-top drag/zoom behavior unchanged
  • CI

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.

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.
@lsoengas lsoengas requested review from arzafran and Copilot and removed request for Copilot July 10, 2026 15:37
@lsoengas lsoengas marked this pull request as ready for review July 10, 2026 15:37
@arzafran arzafran merged commit 8699f84 into main Jul 10, 2026
9 checks passed
@arzafran arzafran deleted the fix/window-drag-areas branch July 10, 2026 16:04
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.

2 participants