Skip to content

Open and write SimpleMind .smmx maps - #8

Open
Martin-PB wants to merge 9 commits into
mainfrom
mp-simplemind-smmx
Open

Martin-PB wants to merge 9 commits into
mainfrom
mp-simplemind-smmx

Conversation

@Martin-PB

@Martin-PB Martin-PB commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

Intention

Seventh format of the multi-format program: open and write SimpleMind .smmx maps, the same way the FreeMind, MindManager, WiseMapping, Mindomo and iThoughts formats were added. SimpleMind is a long-running, actively developed mind map app and its format is zip + XML, so it can be read and written without guessing.

Réalisation

  • src/simplemind.ts (new): reader and writer. A .smmx file is a zip holding document/mindmap.xml: a flat list of <topic> elements, each pointing at its parent by id ("-1" for a map's own root), with line breaks inside a topic's text travelling as the two characters \N, and a file able to hold several <mindmap> elements.
    • Reading: PK check, entry lookup (case-insensitive), byte-order mark and <!DOCTYPE simplemind-mindmaps> dropped (the strict XML reader refuses a DOCTYPE), one sheet per <mindmap>, tree rebuilt from the parent ids in file order, \N decoded, <note> child to a note, <link urllink> to a link, progress/checked/checkbox task attributes to progress, <relations> to relationship lines, <meta><title> labels the sheet. A topic whose parent has not been seen opens as its own sheet. Strict errors: not a zip, no document/mindmap.xml, unexpected root, no topic.
    • Writing: one <mindmap> per sheet (extra sheets may not show in SimpleMind itself), fresh guids, textfmt="plain", \N for line breaks, notes, web links, task checkboxes, relations written back by numeric id, and the same BOM + DOCTYPE header SimpleMind itself writes.
    • Not carried: callout labels (<children>), boundaries (<node-groups>), colours, positions, layout hints, dates, folding.
  • src/simplemind.test.ts (new): 4 vitest tests - reads a map (flat list, \N, note, link, task checkbox, relation, sheet title); reads every mindmap of a file; refuses what is not a SimpleMind map; writes an .smmx and reads it back (BOM + DOCTYPE, escapes, \N, progress, relation).
  • src/files.ts: smmx branches of docBytes/parseDoc, "smmx" in the Open filters, SimpleMind (.smmx) in Save as. src/files.test.ts: plan.smmx round trip. src/App.tsx: "SimpleMind (.smmx)" in the export menu. README.md: SimpleMind paragraph (between iThoughts and the safety rule), Save as list, import rule.

The reading follows a map saved by SimpleMind itself (the SimpleMind search tool's test fixture, decoded and checked in full) plus the SimpleMind MCP server's reader/writer; the writing follows the same shape, but has not been checked against SimpleMind itself.

Ce que l'agent a fait

Researched the format from three open-source implementations (pahund/simple-mind-search, including decoding its real .smmx test fixture down to the zip entry and CRC; BartRuSec/xmind2smmx, validated against SimpleMind Pro 2.4.0; kharabiner/simplemind-mcp-server), wrote the module, its tests and the integration, and verified everything in an executable sandbox twin (UTF-8 codec, zip/unzip and XML parser transcribed by hand): 35 behavioural checks green, round trip verified, files on the branch re-read from GitHub and compared byte-for-byte (no re-encoded characters, keyboard-symbol count unchanged).

  • Correctif CI (2026-10-18) : un second commit répare deux échecs de CI — le filtre de relations du lecteur WiseMapping porte désormais une garde de type (le compilateur voyait encore des extrémités potentiellement absentes et refusait le build), et le test gzip FreeMind compare les deux lectures sans leurs ids frais (correctif déjà présent sur la branche FreeMind). Le test d’écriture SimpleMind laisse aussi la marque d’ordre d’octet survivre au décodage (TextDecoder la retire par défaut), ce qu’un troisième commit corrige.

Vérifications humaines

Agent: Vibe (Mistral, glm-5-latest-short) - relu par Martin-PB.

FreeMind's .mm is the de facto open interchange format for mind maps, so
Cartocortex reads and writes it. Reading is the strict XML parser from the
old .xmind files (no DOCTYPE, predefined entities only), on plain and
gzipped files: texts (richcontent keeps its line order), notes (richcontent
and the old map/Note hook), links, links between topics (arrowlink),
folding, fill and text colour, bold / italic, priority (full-N) and
progress (0%-100%) icons. Left-side top-level topics open as a logic-left
or two-sided map. Writing goes the other way (Save as .mm and a new
"Export FreeMind" button): one root node per sheet, so extra sheets may
not show in FreeMind itself, and structures beyond the sideways layouts,
pictures, relationships, summaries, per-word style and floating positions
are not carried. The xmindxml entity decoder is exported for the reader.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
The first commit of this branch wrote App.tsx and README.md with the
parts it did not mean to change double-encoded: every non-ASCII
character (the command-key shortcut signs, arrows, ellipses) had become
mojibake. Both files are rebuilt from main with the same .mm edits, so
the branch now only changes what the FreeMind support needs.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
MindManager keeps its maps in a zip holding Document.xml (X5 and later;
the Mac builds of MindManager 10 wrote flat XML), and Cartocortex now
reads and writes that. Reading is the strict XML parser from the old
.xmind files (no DOCTYPE, predefined entities only): texts, notes (the
XHTML note and its plain-text preview), links, task priorities (Prio1-9)
and progress (TaskPercentage), fill and text colour ("aarrggbb", alpha
first), folding, relationships (as the map's relationship lines),
floating topics and callouts. The growth direction of the central topic
opens as a logic-left, logic-right or two-sided map. Writing goes the
other way (Save as .mmap and a new "Export MindManager" button): one map
per sheet, so extra sheets may not show in MindManager itself, and topic
links to other topics, pictures, per-word style, boundaries and
summaries are not carried. The unzip of the .xmind reader is exported
for the .mmap reader.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
WiseMapping keeps its maps as plain XML (the current "tango" dialect
and the older "pela" files), and Cartocortex now reads and writes
that. Reading is the strict XML parser from the old .xmind files (no
DOCTYPE, predefined entities only): texts (a single-line attribute or
a multi-line block), notes (the CDATA note and the percent-encoded
attribute of the old files), links, fill and text colours, bold and
italic, shapes (box and line), folding, the map's relationships (as
relationship lines) and its free branches (as floating topics,
positions kept). The side a topic sits on comes from its position, so
a left-leaning map opens as Logic (left) and a two-sided one as a
map. Writing goes the other way (Save as .wxml and a new "Export
WiseMapping" button): the first sheet is the map and the sheets after
it are WiseMapping's free branches, with positions worked out from
the tree shape; markers keep their emoji, but priorities, progress,
pictures, per-word style, boundaries, summaries and topic links are
not carried. The format was taken from WiseMapping's own serializer
and importer, and has not been checked against WiseMapping itself.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
Mindomo Desktop keeps its maps as zips of JSON parts, and Cartocortex
now reads and writes that. Reading walks nodes.json: titles keep
their line breaks, folded topics stay folded, a topic's video or web
address opens as its link, the map's relations open as relationship
lines, and topics the file marks as deleted (and everything under
them) are quietly skipped; the map named in document.json opens as
the first sheet, and any other parentless topic in the file opens as
a sheet of its own. A file that is not a zip is refused, with a note
that the older Mindomo XML is not read. Writing goes the other way
(Save as .mom and a new "Export Mindomo" button): one map per sheet,
with fresh ids, the chain of brothers kept in order and the
relationship lines written back. Notes, colours, markers, priorities,
pictures, per-word style, boundaries and summaries are not carried,
and .pmom files are not read. The format was taken apart from files
saved by Mindomo Desktop 11, and has not been checked against
Mindomo itself.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
iThoughts keeps a map as a zip holding one mapdata.xml, and Cartocortex
now reads and writes that. Reading walks the nested <topic> elements
(wrapped in a <topics> element the way iThoughts writes them, or straight
inside <iThoughts> the way MultiMarkdown writes them): titles keep their
line breaks, notes travel along, and a topic at the top level besides the
map's own opens as its own sheet. A file that is not a zip, or a zip
without mapdata.xml, is refused with a clear error. Writing goes the
other way (Save as .itmz and a new "Export iThoughts" button): one map
per sheet, each topic with a fresh uuid and its note, and a leaf closing
itself the way iThoughts writes one. Colours, icons, images, hyperlinks,
task info, folding, floating topics and sheet names are not carried,
and the old iThoughtsHD .itm files are not read. The format was taken
from what iThoughts writes (as documented by toketaWare and the iThoughts
community) and from MultiMarkdown's own exporter, and has not been
checked against iThoughts itself.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
SimpleMind keeps a map as a zip holding document/mindmap.xml: a flat list of topics,
each pointing at its parent by id. Open reads those maps (topics with their line
breaks, notes, web links, task checkboxes and the map's relations), one sheet per
mindmap in the file, and Export SimpleMind (and Save as .smmx) writes one mindmap
per sheet.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
The reader drops relationships whose ends are missing, but the type
checker still saw both ends as possibly undefined and refused the
build; the filter now carries a type guard saying what it keeps. The
FreeMind gzip test also compares the two reads without their fresh
ids, the same fix the FreeMind branch already carries.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
TextDecoder skips a leading byte-order mark unless ignoreBOM is set,
so the mark the writer puts in the file never showed up in the decoded
string and the shape check could not pass. The decode now keeps it.

Agent: Vibe (Mistral, glm-5-latest-short)
Relu-par-humain: Martin-PB
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.

1 participant