Fix graph-wide reheat during node drag - #135
Conversation
Pre-PR Code Review — engraphis#135Code Quality: ✅ SoundThe diff correctly identifies and fixes the root cause of graph-wide explosive movement during node drags:
Security: ✅ No issues (purely client-side physics)Hard Gate Blocks (cannot approve yet)
Verdict: REQUEST_CHANGESThe code change itself is clean and well-targeted. Once the contributor and improvement gates are satisfied, this is approvable. Suggested next steps:
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a27d6d3e8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| dragIsolated = true; | ||
| dragCenterForce = fg.d3Force('center'); | ||
| } | ||
| ['charge', 'x', 'y', 'radial', 'collide', 'center'].forEach(name => fg.d3Force(name, null)); |
There was a problem hiding this comment.
Re-register the velocity guard after restoring drag forces
Removing these forces deletes their entries from D3's insertion-ordered force map; restoreDragPhysics() then calls applyForces(), which recreates charge, x, y, and collide after the existing velocityGuard. Consequently the guard runs before those restored forces and cannot cap the velocity they add during the release reheat, so every completed drag can again produce the high-speed graph-wide movement this change is intended to prevent. Reinstall the guard after all normal forces have been restored.
Useful? React with 👍 / 👎.
What changed
Why
A pinned node could move far from its prior position while the full global force field remained active. The charge, centering, radial, and collision forces then injected motion into unrelated nodes, and the infinite drag budget kept that response alive for the entire gesture. This produced the graph-wide explosive movement reported during node drags.
Validation
node --check engraphis/dashboard_assets/engraphis-graph.jspython -m pytest tests/test_graph_engine_asset.py -qruff check .ENGRAPHIS_PLAYWRIGHT_PORT=8701 npx playwright test tests/e2e/graph-engine.spec.js --reporter=line— 15 passed