Skip to content

Open and write Mindomo .mom maps - #5

Open
Martin-PB wants to merge 6 commits into
mainfrom
mp-mindomo-mom
Open

Martin-PB wants to merge 6 commits into
mainfrom
mp-mindomo-mom

Conversation

@Martin-PB

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

Copy link
Copy Markdown
Collaborator

Intention

Couvrir un format de plus du programme « tous les formats de mind map » : ouvrir et écrire les cartes Mindomo .mom (Mindomo Desktop 11), dans la continuité de FreeMind (#1), MindManager (#3) et WiseMapping (#4).

Réalisation

  • src/mindomo.ts (nouveau) : lecteur/écrivain .mom — un zip de parties JSON. Lecture : nodes.json (liste plate), titres multi-lignes, pliage (style.expanded === false), lien vidéo/web (multimediaUrl http/https), relations (relations.json → lignes de relation, bouts disparus écartés), topics marqués deleted et leurs descendants silencieusement écartés, document.json mapInfo.name → titre de la sheet, mapInfo.rootId → racine, tout autre topic sans parent → sheet supplémentaire. Refus strict : pas un zip (vieux XML Mindomo), pas de nodes.json, parent inconnu, aucun topic, topics hors de l'arbre. Écriture : une carte par sheet (nodes.json en pré-ordre avec chaînage nextId/previousId, ids hex32, document.json minimal, relations.json seulement si besoin, themes.json, changes.json, Document.xml stub). Pertes documentées : notes, couleurs, marqueurs, priorités, images, style par mot, frontières, résumés ; .pmom et le vieux « Mindomo XML Map » non lus.
  • src/mindomo.test.ts (nouveau) : 4 tests vitest (lecture d'une carte synthétique avec deleted, relations et racine multiple ; refus stricts ; aller-retour complet avec vérification des parties du zip ; cas sans relations).
  • src/files.ts : branches mom de docBytes/parseDoc, "mom" dans les filtres Open, { name: "Mindomo (.mom)" } dans Save as. src/files.test.ts : aller-retour plan.mom. src/App.tsx : entrée « Mindomo (.mom) » dans le menu d'export. README.md : paragraphe Mindomo, mentions dans Outline formats et Safety rule.

Ce que l'agent a fait

Recherche du format à partir de vrais fichiers .mom écrits par Mindomo Desktop 11 (dépôt public ; deux fichiers de plus de 4 000 topics, avec topics supprimés gardés au fichier, relations et liens média), puis module et tests écrits et validés dans un jumeau exécutable sandbox (47 contrôles verts : lecture, erreurs, aller-retour, cas sans relations). Push en un commit unique db3f6c4d (trailers Agent: Vibe (Mistral, glm-5-latest-short) / Relu-par-humain: Martin-PB), puis relecture depuis GitHub : 6 fichiers identiques byte-à-byte, 12 ⌘ dans App.tsx, zéro mojibake.

  • 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).

Vérifications humaines

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
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
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