Skip to content

fix: guard terminal renderer sync during drag#224

Merged
DeadWaveWave merged 5 commits intomainfrom
fix/canvas-crashed
May 3, 2026
Merged

fix: guard terminal renderer sync during drag#224
DeadWaveWave merged 5 commits intomainfrom
fix/canvas-crashed

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 the renderer crash that could happen while dragging a task/node when the embedded terminal renderer is transiently detached.

This branch also hardens the regression coverage around the same canvas interaction surface:

  • keeps the detached-renderer drag crash locked down on the real user path
  • swaps the flaky arrange-in-space keep-fit warning case to a deterministic test harness path
  • moves the space-owned node resize expansion assertion to a deterministic unit regression around the layout owner

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

1. Context & Business Logic

Dragging a canvas task can temporarily detach the xterm renderer subtree while drag/geometry synchronization is still flushing. The renderer must treat that detach as a harmless transient state instead of trying to reconcile against a missing renderer and crashing the React tree. The surrounding canvas regression coverage also needs to stay stable enough for pnpm pre-commit to prove the bug stays fixed.

2. State Ownership & Invariants

  • Terminal runtime owns renderer attachment state; drag-time sync must not force renderer work after the renderer becomes detached.
  • Arrange-in-space with spaceFit=keep must remain side-effect free when there is not enough room.
  • Space-owned node resize layout must keep owned nodes enclosed while keeping root windows non-overlapping.

3. Verification Plan & Regression Layer

  • pnpm pre-commit (exit 0)
  • pnpm exec playwright test tests/e2e/workspace-canvas.arrange.space.spec.ts --project electron --reporter=line -g "warns and keeps layout unchanged when arrange-in-space keep-fit has no room" --repeat-each=8
  • pnpm test -- --run tests/unit/contexts/workspaceCanvasNodeResizeLayout.spec.ts

✅ 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

Not attached from CLI. Regression proof is covered by Playwright + unit tests in this branch.

@DeadWaveWave DeadWaveWave merged commit c3d7796 into main May 3, 2026
7 checks passed
@DeadWaveWave DeadWaveWave deleted the fix/canvas-crashed branch May 3, 2026 07:06
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