fix(mindmap): refresh transformer outline on direction change #31

Merged
AhmedHanafy725 merged 1 commit from development_mindmap_direction_outline into development 2026-04-21 13:24:38 +00:00
Member

Summary

Fix for issue #30: flipping a mindmap between vertical and horizontal left the transformer outline at the previous orientation's bounding box. Also fixes a silent bug where changing direction via the properties-panel select was never persisted (no WhiteboardSync.onUpdate call), so the flip disappeared on reload.

Closes #30

Changes

  • crates/hero_whiteboard_ui/static/web/js/whiteboard/mindmap.js
    • flipDirection: after renderMindmap, call transformer.forceUpdate() if the group is currently selected. Covers the in-widget toggle icon and the L keyboard shortcut.
  • crates/hero_whiteboard_ui/static/web/js/whiteboard/properties.js
    • prop-mm-direction change handler: added transformer.forceUpdate() and WhiteboardSync.onUpdate(currentNode) so the new direction both shows the correct outline immediately and survives reload.

Test Results

  • cargo check --workspace: pass
  • cargo clippy --workspace -- -D warnings: pass
  • cargo fmt --check: pass

Manual verification

  • Flip direction via the in-widget toggle icon — transformer outline updates to hug the new layout in the same frame.
  • Flip direction via the L keyboard shortcut — same.
  • Flip direction via the properties-panel Vertical/Horizontal select — outline refreshes AND the change survives a reload.
## Summary Fix for issue #30: flipping a mindmap between vertical and horizontal left the transformer outline at the previous orientation's bounding box. Also fixes a silent bug where changing direction via the properties-panel select was never persisted (no `WhiteboardSync.onUpdate` call), so the flip disappeared on reload. ## Related Issue Closes https://forge.ourworld.tf/lhumina_code/hero_whiteboard/issues/30 ## Changes - `crates/hero_whiteboard_ui/static/web/js/whiteboard/mindmap.js` - `flipDirection`: after `renderMindmap`, call `transformer.forceUpdate()` if the group is currently selected. Covers the in-widget toggle icon and the L keyboard shortcut. - `crates/hero_whiteboard_ui/static/web/js/whiteboard/properties.js` - `prop-mm-direction` change handler: added `transformer.forceUpdate()` and `WhiteboardSync.onUpdate(currentNode)` so the new direction both shows the correct outline immediately and survives reload. ## Test Results - `cargo check --workspace`: pass - `cargo clippy --workspace -- -D warnings`: pass - `cargo fmt --check`: pass ## Manual verification - [ ] Flip direction via the in-widget toggle icon — transformer outline updates to hug the new layout in the same frame. - [ ] Flip direction via the L keyboard shortcut — same. - [ ] Flip direction via the properties-panel Vertical/Horizontal select — outline refreshes AND the change survives a reload.
fix(mindmap): refresh transformer outline on direction change
All checks were successful
CI / build (pull_request) Successful in 2m17s
a997be93b3
flipDirection (in-widget toggle + L shortcut) and the properties panel
direction select both re-laid-out the mindmap but never told the
transformer, so its outline and anchors stuck to the old orientation's
bounding box until the user deselected and re-selected.

- mindmap.js flipDirection: forceUpdate the transformer when the group
  is the selected node.
- properties.js prop-mm-direction change: same forceUpdate, and also
  call WhiteboardSync.onUpdate so the new direction actually persists
  (it wasn't being saved at all from this entry point).

#30
AhmedHanafy725 merged commit 32558d5157 into development 2026-04-21 13:24:38 +00:00
AhmedHanafy725 deleted branch development_mindmap_direction_outline 2026-04-21 13:24:42 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_whiteboard!31
No description provided.