fix: auto-layout zero-position nodes, fix new-node x===y stacking - #25
Merged
Conversation
- computeAutoLayout() BFS tree layout seeds from anchored nodes; assigns
distinct x/y to workspaces returned at 0,0 by the API and persists via PATCH
- buildNodesAndEdges() accepts layoutOverrides map so hydration uses computed
positions instead of raw 0,0 coordinates
- canvas-events WORKSPACE_PROVISIONING grid layout replaces offset===offset
assignment that caused position:{x:t,y:t} in the minified bundle
- 8 new vitest tests cover computeAutoLayout and override behaviour (365 pass)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
7-gate verification passed:
Merging. |
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Apr 14, 2026
Adds a `canvas-deploy-reminder` job to ci.yml that fires on every push to main once `canvas-build` passes. It posts a commit comment via the built-in GITHUB_TOKEN (no new secrets needed) reminding whoever monitors CI to run: cd /g/personal_programs/molecule-monorepo git pull origin main docker compose build canvas && docker compose up -d canvas The comment includes the commit SHA and a direct link to the build log. Rationale: 5 consecutive merge cycles (PRs #21, #25, #30, #32, #34) went undeployed because there is no auto-deploy hook and the manual step was silently forgotten. A commit comment on the merge commit is the lowest-friction reminder that requires no external secrets or infra. Does NOT run on PRs — only on direct pushes to main (i.e. post-merge). Uses `needs: canvas-build` so the reminder only fires after build+tests pass; a failing build produces no comment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
HongmingWang-Rabbit
pushed a commit
that referenced
this pull request
Apr 14, 2026
…ewport clipping New nodes now start at (100, 100) instead of (0, 0), preventing them from being clipped at the viewport edge. Also normalises the index source from filtered root-only nodes to nodes.length, consistent with the form-created node path from PR #25. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 tasks
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
fix: auto-layout zero-position nodes, fix new-node x===y stacking
molecule-ai Bot
pushed a commit
that referenced
this pull request
Apr 21, 2026
Adds a `canvas-deploy-reminder` job to ci.yml that fires on every push to main once `canvas-build` passes. It posts a commit comment via the built-in GITHUB_TOKEN (no new secrets needed) reminding whoever monitors CI to run: cd /g/personal_programs/molecule-monorepo git pull origin main docker compose build canvas && docker compose up -d canvas The comment includes the commit SHA and a direct link to the build log. Rationale: 5 consecutive merge cycles (PRs #21, #25, #30, #32, #34) went undeployed because there is no auto-deploy hook and the manual step was silently forgotten. A commit comment on the merge commit is the lowest-friction reminder that requires no external secrets or infra. Does NOT run on PRs — only on direct pushes to main (i.e. post-merge). Uses `needs: canvas-build` so the reminder only fires after build+tests pass; a failing build produces no comment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
canvas_layoutsrow come back asx:0, y:0.computeAutoLayout()(BFS tree layout) detects these and assigns distinct positions, persisting them back viaapi.patchso they survive reload.position:{x:t,y:t}in minified bundle:WORKSPACE_PROVISIONINGincanvas-events.tsusedconst x = offset; const y = offset;— identical bindings collapse to a single variable in minification. Replaced with a 4-column grid layout (GRID_COL_WIDTH=320,GRID_ROW_HEIGHT=160) giving distinct x/y values.Files changed
canvas/src/store/canvas-topology.tscomputeAutoLayout()BFS layout;buildNodesAndEdgesacceptslayoutOverridesmapcanvas/src/store/canvas.tshydrate()callscomputeAutoLayout, passes overrides, persists positions via PATCHcanvas/src/store/canvas-events.tsx = offset; y = offsetcanvas/src/store/__tests__/canvas-topology.test.tscomputeAutoLayoutand override behaviourTest plan
npm test— 365/365 pass (357 original + 8 new)npm run build— clean, no type errors🤖 Generated with Claude Code