diff options
| author | MtBntChvn <[email protected]> | 2026-02-20 23:30:34 +0000 |
|---|---|---|
| committer | MtBntChvn <[email protected]> | 2026-02-20 23:30:34 +0000 |
| commit | 45d96c31d620d33727d598602d023dd9d09a146a (patch) | |
| tree | c1715d7fc2f6ad9e2e9908cadade9b106c1d740e /src | |
| parent | fix collapsed nodes not re-expandable (diff) | |
| download | zen-45d96c31d620d33727d598602d023dd9d09a146a.tar.xz zen-45d96c31d620d33727d598602d023dd9d09a146a.zip | |
prevent re-push on collapse and re-expand
Mark nodes with _was_pushed after the first push-away from parent.
On subsequent expand after collapse, the node stays in place instead
of being pushed further away each time.
Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/zenserver/frontend/html/util/graphengine.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/zenserver/frontend/html/util/graphengine.js b/src/zenserver/frontend/html/util/graphengine.js index 3ac4d97a7..276326a99 100644 --- a/src/zenserver/frontend/html/util/graphengine.js +++ b/src/zenserver/frontend/html/util/graphengine.js @@ -548,12 +548,14 @@ export class GraphEngine const visible = Math.min(deps.length, MAX_VISIBLE_DEPS); // push non-root node away from parent to make room for children - if (parent && !node._skip_push) + // skip if already pushed once (collapse + re-expand) or re-expanding in place + if (parent && !node._skip_push && !node._was_pushed) { const push_dist = 400 + visible * 6; node.x += Math.cos(outward_angle) * push_dist; node.y += Math.sin(outward_angle) * push_dist; node.pinned = true; + node._was_pushed = true; } var arc_start, arc_span; |