Skip to content

fix: stabilize Space drag projections#300

Merged
DeadWaveWave merged 3 commits into
mainfrom
codex/fix-space-drag-projection
Jul 10, 2026
Merged

fix: stabilize Space drag projections#300
DeadWaveWave merged 3 commits into
mainfrom
codex/fix-space-drag-projection

Conversation

@DeadWaveWave

Copy link
Copy Markdown
Owner

💡 Change Scope

  • Small Change: Fast feedback, localized UI/logic, low-risk.
  • Large Change: New feature, cross-boundary logic, runtime-risk (persistence, IPC, lifecycle, recovery).

📝 What Does This PR Do?

Fixes two regressions in Workspace Canvas node/Space interaction:

  • keeps the active window stable while slowly crossing or following a Space edge;
  • previews the required Space expansion while a window is still held over a crowded Space, instead of revealing the expansion only after release.

The drag pipeline now separates per-frame primary constraints from throttled secondary peer/Space layout. Live Space geometry is a reversible UI projection; release still recomputes the authoritative ownership and geometry from durable state.


🏗️ Large Change Spec (Required if "Large Change" is checked)

1. Context & Business Logic

The previous drag throttling skipped the whole projection during slow edge movement, causing raw and constrained positions to alternate. The follow-up live path then intentionally returned unchanged Space geometry, so crowded-Space expansion was invisible until mouseup.

This change runs primary active-window constraints on every coalesced frame, keeps peer/Space reflow in the existing secondary lane, and derives expanded preview frames without persisting them. Capacity lower-bound and postcondition checks avoid the expensive bounded solver for known-overflow layouts.

2. State Ownership & Invariants

  • Durable Space rects and membership remain owned by spacesRef / persistence and are written only by the release/finalization path.
  • Ordinary node-drag Space previews are renderer-derived and reversible; they cannot be committed as Space-dominant drag state.
  • The active dragged window always uses the primary projection. Secondary peer layout and auto-resize cannot overwrite it.
  • A target Space change bypasses secondary distance/time throttling, preventing stale peer or Space previews.

3. Verification Plan & Regression Layer

  • Unit: live/primary/final projection invariants, target switching, preview ownership isolation, Child Space/ancestor expansion, packed 81-window performance budget.
  • Hook integration: secondary preview survives primary-only frames and cannot trigger Space persistence.
  • Electron E2E: mouse-held crowded-Space expansion with durable state unchanged before release; slow Space-edge drag stability; Child Space and push-away regressions.
  • Full gate: pnpm pre-commit exited 0 (237 E2E passed, 47 conditional skips, 3 unrelated flaky cases passed on retry).

✅ Delivery & Compliance Checklist

  • My code passes the ultimate gatekeeper: pnpm pre-commit is completely green.
  • I have signed the CLA if required (see CLA.md).
  • I have included new tests to lock down the behavior (or explicitly stated why it's untestable).
  • I have strictly adhered to the DEVELOPMENT.md architectural boundaries.
  • I have attached a screenshot or screen recording (if this touches the UI).
  • I have updated the documentation accordingly (if adding a feature or changing a contract).

📸 Screenshots / Visual Evidence

The interaction is covered by Electron E2E while the mouse remains held: the DOM Space frame expands before release, persistence remains at its baseline, and release commits the final non-overlapping layout. No review-only media was committed to the repository.

Keep active-window constraints on every drag frame, throttle only secondary peer layout, and preview crowded Space expansion before release. Add unit, performance, and Electron regression coverage for edge jitter, preview ownership, and Child Space expansion.
@DeadWaveWave DeadWaveWave marked this pull request as ready for review July 10, 2026 13:51
@DeadWaveWave DeadWaveWave merged commit d3d6ea1 into main Jul 10, 2026
7 of 8 checks passed
@DeadWaveWave DeadWaveWave deleted the codex/fix-space-drag-projection branch July 10, 2026 13:51
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