Skip to content

Give top-level topics of a two-sided map a side of their own - #30

Merged
thierrysays merged 1 commit into
mainfrom
claude/clever-goodall-xn72z5
Nov 13, 2026
Merged

thierrysays merged 1 commit into
mainfrom
claude/clever-goodall-xn72z5

Conversation

@thierrysays

Copy link
Copy Markdown
Collaborator

Closes the item left open in #29: a two-sided map split its top-level topics by count, so a file with unequal left and right sides opened with topics on the wrong side.

Model

  • Node.side?: "left" | "right", meaningful on top-level topics of a map / map-ccw sheet only. It is the side as drawn, in the anticlockwise map too.
  • mapSides(root) in src/model.ts is the single place that decides the sides. With no side set anywhere it gives exactly the previous split (first half on the starting side), so existing documents draw as before. Otherwise a topic with a side keeps it and the others go, in order, to the side that holds fewer.
  • layout uses it instead of the count cut. moveTo drops the side when a topic is attached elsewhere.

Editor

  • Panel: "Side of the map" (Auto / Left / Right) for a top-level, non-floating topic of a two-sided map.

Formats

  • FreeMind: import sets each first-level topic's side from POSITION and keeps the file's order (it used to reorder right-then-left); export writes POSITION from mapSides, now for the anticlockwise map as well, and no longer counts floating topics in the split.
  • MindManager: import sets the side from the sign of Offset CX and keeps the file's order; a topic with no offset is left to the map. Export writes a token Offset CX="±1" for the topics of a map in which a side was set, and nothing more for a map that balances itself. The "unequal sides" line of the import report and the // ponytail: note are gone.
  • XMind: unchanged, still first half on the starting side in both directions.

Behaviour change to be aware of

FreeMind and MindManager two-sided maps now open with sides pinned on every topic, in file order. New topics added afterwards go to the side that holds fewer.

Tests

Three tests added (model, FreeMind, MindManager), one updated for the file-order change. tsc --noEmit clean, vitest run: 137 passed. The panel control was exercised in the running app (Vite + Chromium): switching a topic to Left moves it and the other topic rebalances to the right.

That Offset CX carries the side in real MindManager files remains an assumption of the reader, unchecked against MindManager itself.


Generated by Claude Code

A topic can be pinned to the left or right of the central topic (panel:
Side of the map); the others are placed for balance. FreeMind and
MindManager imports keep each topic on the side it had, in the file's
order, and both writers emit those sides.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016C1G4PM7XGqJdpzydsnBCc
@thierrysays
thierrysays marked this pull request as ready for review November 13, 2026 15:36
@thierrysays
thierrysays merged commit 69500ee into main Nov 13, 2026
2 checks passed
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.

2 participants