Skip to content

fix(canvas): WORKSPACE_PROVISIONING grid origin offset — prevent viewport clipping - #122

Merged
HongmingWang-Rabbit merged 1 commit into
mainfrom
fix/provisioning-grid-origin
Apr 15, 2026
Merged

fix(canvas): WORKSPACE_PROVISIONING grid origin offset — prevent viewport clipping#122
HongmingWang-Rabbit merged 1 commit into
mainfrom
fix/provisioning-grid-origin

Conversation

@HongmingWang-Rabbit

Copy link
Copy Markdown
Contributor

Summary

  • New workspaces were spawning at (0,0) (or close to it), placing them behind the left toolbar/palette chrome and the top bar, requiring users to manually pan to find them
  • Adds GRID_ORIGIN_X = 100 / GRID_ORIGIN_Y = 100 constants so the first deployed node lands in clear canvas space
  • Updates the canvas-events.test.ts position assertion from { x: 0, y: 0 }{ x: 100, y: 100 } to match

Files changed

  • canvas/src/store/canvas-events.ts — WORKSPACE_PROVISIONING new-node branch: introduce GRID_ORIGIN_X/Y, rename spacing constants to COL_SPACING/ROW_SPACING, use idx = nodes.length
  • canvas/src/store/__tests__/canvas-events.test.ts — update position assertion for first provisioned node

Test plan

  • canvas-events.test.ts — 30/30 passing (run: npx vitest run src/store/__tests__/canvas-events.test.ts)
  • npm run build — clean, no errors
  • Manual: deploy a new workspace from the template palette and confirm it appears at ~(100, 100) rather than behind the toolbar

🤖 Generated with Claude Code

…port clipping

New nodes were placed at (0,0) or close to it, causing them to spawn
behind the toolbar/palette chrome and require manual panning to find.
Add GRID_ORIGIN_X/Y = 100 offset so the first node lands in clear canvas
space, and update the position assertion in the unit test accordingly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@HongmingWang-Rabbit
HongmingWang-Rabbit merged commit a44cd01 into main Apr 15, 2026
1 of 7 checks passed
@HongmingWang-Rabbit
HongmingWang-Rabbit deleted the fix/provisioning-grid-origin branch April 16, 2026 12:31
molecule-ai Bot pushed a commit that referenced this pull request Apr 21, 2026
fix(canvas): WORKSPACE_PROVISIONING grid origin offset — prevent viewport clipping
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