Skip to content

Hide window-link graphs in split view; fix left-edge drag-out dead zone - #354

Merged
epeicher merged 1 commit into
trunkfrom
deskmod-24-hide-graphs-in-split-view-and-allow-dragging-from-the-left
Jul 15, 2026
Merged

Hide window-link graphs in split view; fix left-edge drag-out dead zone#354
epeicher merged 1 commit into
trunkfrom
deskmod-24-hide-graphs-in-split-view-and-allow-dragging-from-the-left

Conversation

@epeicher

@epeicher epeicher commented Jul 14, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #337.

CleanShot.2026-07-14.at.18.33.17.mp4

What it does

Two fixes for window links (#337) interacting with split view:

  1. Graphs hide in split view. Windows snapped into a half-screen tile (snapped-left / snapped-right) no longer draw relation ties. The ties come back the moment a window is dragged back out to floating.
  2. The left window can be dragged out of split view. Dragging a snapped-left window's title bar now moves it with the cursor from the first pixel, same as the right window always did.

Rationale

Graphs. With two related windows tiled side-by-side, a spline's natural anchors sit on the split seam — which the partner window covers. The occlusion-aware anchoring then fell back to the only visible border stretch, the screen edge, and drew an artifact spline from the edge of the desktop across the snapped window's content. A half-screen tile has no free border to anchor on: any tie either crosses the partner or re-anchors on the screen edge — noise, not information.

Drag. commitUnstate re-anchors an un-snapping window under the cursor at cursorX - savedWidth × grabRatio. For a snapped-left window whose saved floating width exceeds the half-screen (the default 1200 px window vs a ~770 px half), that anchor is negative. The drag offsets derived from the unclamped value, but the move loop clamps x ≥ 0 — so the window stayed pinned at the left edge (sliding only vertically) until the cursor traveled the entire overshoot, ~200 px+. Snapped-right windows never produce a negative anchor, which is why only the left side felt broken.

Implementation

  • src/window-links/render-host.ts: new drawableRectOf() — snapped windows contribute null rects to edges and group members, the same not-drawable signal minimized windows already send (renderers skip null-endpoint edges per the existing contract). They stay in obstacles: a half-screen tile still occludes other windows' borders. The frame pipeline also subscribes to SNAP_ZONE_COMMITTED / SNAP_SPLIT_FILLED — snap geometry lands after the drag session ends, so without them the last drag frame went stale.
  • src/window/pointer.ts: commitUnstate clamps the re-anchor left/top to EDGE_MARGIN, the same lower bound the move loop enforces, so the drag offset matches the geometry actually written and the window tracks the cursor 1:1 immediately.
  • Contract docs (src/window-links/types.ts, docs/javascript-reference.md, docs/examples/window-links.md): the null-rect semantics now list split view alongside minimized / other-desktop.

Testing instructions

npm run test:js -- drag-unstate window-links-render-host

Both new regression tests fail on trunk and pass here.

Manual (wp-env, two related windows — e.g. a post editor and one of its comments):

  1. With both windows floating, confirm the spline draws between them.
  2. Drag one to the left edge to snap it; pick the other in the split overview. No spline should draw while tiled.
  3. Grab the left window's title bar mid-bar and drag right a short distance — the window must follow the cursor immediately instead of sticking to the edge.
  4. Once both windows float again, the spline reappears.

Windows snapped into split view (snapped-left / snapped-right) now send
the same not-drawable signal as minimized ones, so link renderers skip
their ties; they still count as obstacles. The render host also
refreshes frames on SNAP_ZONE_COMMITTED / SNAP_SPLIT_FILLED, whose
geometry lands after the drag session ends.

commitUnstate now clamps the un-state re-anchor to the desktop's lower
bound so the drag offset matches the written geometry. A snapped-left
window whose saved floating width exceeded the half-screen re-anchored
at a negative left, and the move-loop clamp pinned it at x=0 until the
cursor traveled the whole overshoot.

Fixes DESKMOD-24.
@epeicher epeicher self-assigned this Jul 14, 2026
@epeicher
epeicher merged commit 430448c into trunk Jul 15, 2026
5 checks passed
@epeicher
epeicher deleted the deskmod-24-hide-graphs-in-split-view-and-allow-dragging-from-the-left branch July 15, 2026 08:39
epeicher added a commit that referenced this pull request Jul 15, 2026
Overview lays windows out as scaled CSS-transform thumbnails, but the
link frame geometry reads offset* metrics, which transforms don't
touch — so the ties kept pointing at the pre-overview window
positions. Hide the link layers for the mode's whole lifetime: fade
out on OVERVIEW_ENTERING alongside the thumbnail animation, fade back
in on OVERVIEW_EXITED once the windows have settled home.

Follow-up to #354.
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.

1 participant