Skip to content

feat(xmind): take over formatting, notes, labels, images and folded branches - #429

Merged
AndyScherzinger merged 2 commits into
mainfrom
feat/xmind-formatting
Oct 22, 2026
Merged

AndyScherzinger merged 2 commits into
mainfrom
feat/xmind-formatting

Conversation

@AndyScherzinger

@AndyScherzinger AndyScherzinger commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #423.

XMind maps opened with only their titles, links and priority/progress markers, so a styled map looked like a plain outline. This PR takes over everything from an XMind map that the editor has a place for, for XMind 8 (content.xml + styles.xml) as well as XMind 2020 and later (content.json), which use the same property names (svg:fill, fo:color, fo:font-*):

  • Formatting: fill, text colour, font size, bold and italic, from the map's theme for the central, main and sub topics and from each topic's own style. XMind 2020+ writes "inherited" for values it takes from the theme, and those fall back to the theme. Where a topic has a fill but no text colour, the text is black or white for contrast, as XMind does.
  • Notes and labels: plain-text notes become notes and labels become tags.
  • Attached images: images inside the .xmind file (xap: links, XMind 8 inline images, XMind 2020+ topic images) are embedded into the node as data: URLs, scaled to the editor's 200 px maximum. Links to attached files can't be opened in Nextcloud, so they are left out instead of showing as dead links.
  • Folded branches (branch="folded") open collapsed, as FreeMind's folded nodes already do.

Left out, because the editor has nothing to show them with: shapes, borders, line colours and styles, boundaries, summaries, relationships and comments. Font families are left out as well, since XMind's theme fonts (Open Sans, Montserrat, NeverMind) are rarely installed and an unknown font falls back to the browser default.

Tested:

  • An XMind 8 map with themed topics, custom fills, a note, a label, a link and an attached JPEG: every topic gets its theme and custom fill and text colour, the note and the tag are there, and the image is embedded at 200 × 150.
  • Three XMind 2020+ maps from public repositories: theme font sizes and fills apply, inherited values fall back to the theme, and a folded branch opens collapsed.
  • New Vitest cases for both formats, including a zip with styles.xml and an attachment. Vitest (113), ESLint and the build pass.
  • In Firefox on Nextcloud: the XMind 8 map shows its colours, note, tag and the embedded image, and the folded branch of an XMind 2020+ map opens collapsed and expands with correctly sized nodes.

XMind 2020+ images, notes and labels are only covered by unit tests, as none of the sample maps had any.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI (N/A)

XMind maps opened with only their titles, links and markers. Take over
what the editor can show as well:

- fill, text colour, font size, bold and italic, from the map's theme
  for the central, main and sub topics and from each topic's own style,
  read from styles.xml for XMind 8 and from content.json for XMind 2020
  and later. Where a topic has a fill but no text colour, contrast the
  text with the fill as XMind does.
- plain-text notes as notes, and labels as tags.
- images attached to the map, embedded into the node, scaled to the
  editor's 200 px maximum. Links to attached files cannot be opened and
  are left out.

Shapes, borders, line styles, boundaries, summaries and relationships
have no counterpart in the editor and are still left out, as are font
families, since XMind's theme fonts are rarely installed.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
XMind marks folded branches with branch="folded", in content.xml as
well as in content.json, but they opened expanded. Collapse them, as
the FreeMind import does with its folded nodes.

Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
@AndyScherzinger AndyScherzinger added this to the v0.2.0 milestone Oct 22, 2026
@AndyScherzinger AndyScherzinger added enhancement New feature or request AI assisted This PR contains AI-assisted commits labels Oct 22, 2026
@AndyScherzinger

Copy link
Copy Markdown
Member Author

/backport to stable-0.1

@AndyScherzinger
AndyScherzinger merged commit 00f8de4 into main Oct 22, 2026
8 checks passed
@AndyScherzinger
AndyScherzinger deleted the feat/xmind-formatting branch October 22, 2026 16:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant