Skip to content

feat(app-server): name image downloads diagram.drawio.png and diagram.drawio.svg - #125

Merged
alderg merged 1 commit into
mainfrom
voice/drawio-export-names
Nov 19, 2026
Merged

alderg merged 1 commit into
mainfrom
voice/drawio-export-names

Conversation

@alderg

@alderg alderg commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

The viewer's Download menu saved its images as diagram.png and diagram.svg. Both carry the .drawio file (the PNG in a tEXt chunk named mxfile, the SVG in its content attribute), so draw.io opens them for editing. They are now saved as diagram.drawio.png and diagram.drawio.svg, the names draw.io gives such files, so the name shows that the image is also an editable diagram.

  • imageFileRequest in mcp-app-server/src/shared.js builds the new names. The viewer has no title-based file names; the .drawio download is unchanged.
  • The menu entries keep their labels (Download PNG, Download SVG).
  • test/download.test.js expects the new names. mcp-app-server/AGENTS.md documents them.

Tested: npm test in mcp-app-server (350 pass, 0 fail, 50 browser tests skipped). A separate headless Chrome check drew a diagram in the viewer and ran both exports through the Download menu's code. The files the host was asked to save were diagram.drawio.png and diagram.drawio.svg. Each carried the full .drawio file with the diagram's cells.

🤖 Generated with Claude Code

….drawio.svg

Both images carry the .drawio file (the PNG in a tEXt chunk, the SVG in
its content attribute), so they get the names draw.io gives such files,
which show that the image opens as an editable diagram. The menu entries
keep their labels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This is a small rename of the PNG and SVG download filenames, and it is covered by the updated test.

What was reviewed:

  • imageFileRequest in mcp-app-server/src/shared.js: only the file:/// URI changes. The MIME types and the text and blob handling are the same as before. Its only caller is downloadImage.
  • I searched the repo for other references to the old diagram.png and diagram.svg names and found none outside the files this PR updates.
  • The mcp-app-server/AGENTS.md paragraph now matches the code. The .drawio download and the menu labels are unchanged.
Extended reasoning...

The PR changes the file URI that imageFileRequest returns for PNG and SVG downloads from diagram.<fmt> to diagram.drawio.<fmt>. It also updates the matching unit test and adds a sentence to mcp-app-server/AGENTS.md. The URI is only a suggested save name passed to the host's ui/download-file, so the change touches no security-sensitive surface. It is an 8-line change with a test, has no reviewer objections in the timeline, and no CODEOWNERS file covers these paths.

@alderg
alderg merged commit f7b7e05 into main Nov 19, 2026
1 check passed
@alderg
alderg deleted the voice/drawio-export-names branch November 19, 2026 11:57
alderg added a commit that referenced this pull request Nov 23, 2026
package.json, package-lock.json and server.json in lockstep; server.json
keeps @drawio/mcp 1.13.1 under packages, released in the same cycle. The
changelog's unreleased section becomes 1.11.0, with #125 and #128.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUK3U3orJF9Q5x2VbPi9jX
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant