Summary
As a VS Code user of the Wardley Mapping Modeler, I want the extension's core operations —
creating a map and exporting the current map — available as first-class Command Palette
commands under the existing shared "Wardley" category, so that I can reach them from
Cmd/Ctrl+Shift+P without knowing about the in-canvas toolbar menu.
Motivation
The Command Palette is the primary discovery surface in VS Code. Today only the create operations
are palette commands; the export operations live solely inside the webview's canvas toolbar
menu, so a new user who wants an SVG/PNG has no way to discover them from the palette, and they
can't be bound to a keyboard shortcut. Consolidating the core operations under the existing
Wardley category makes the extension self-describing and keyboard-friendly.
What exists today — declared in apps/vscode/package.json → contributes.commands, each with
category: "Wardley". There is no contributes.menus.commandPalette restriction, so all three are
already reachable from the palette:
| Command id |
Title |
In palette? |
In file/newFile? |
wardley.newMap |
New Empty Map |
✅ |
✅ |
wardley.newMapFromExample |
New Map from Example |
✅ |
❌ |
wardley.newPngMap |
New Empty Map (embedded PNG) |
✅ |
✅ |
What's missing — core operations that are NOT exposed as commands:
| Operation |
Today |
Proposed command id |
| Export current map as SVG |
webview menu only |
wardley.exportSvg |
| Export current map as PNG |
webview menu only |
wardley.exportPng |
(secondary) New Map from Example in File ▸ New File… |
palette only |
add to file/newFile menu |
Proposed Solution
-
Add two new commands under the shared Wardley category:
wardley.exportSvg — "Export as SVG"
wardley.exportPng — "Export as PNG"
-
Reuse existing logic, don't duplicate. The write-to-disk half already exists in
apps/vscode/src/exportImage.ts (exportImageToFile), and the webview already emits an export
protocol message with the rendered data (apps/vscode/src/protocol.ts, handled in the editor
providers WardleyEditorProvider.ts / WardleyPngEditorProvider.ts). The new commands should:
- resolve the active Wardley editor,
- send a new host → webview "request export" message so the webview produces the SVG text /
base64 PNG (the same data its exportSvg() / exportPng() in src/webview/main.ts already
produce for the in-canvas menu) — mirroring the existing requestPng round-trip used for PNG
save,
- pipe that into the existing
exportImageToFile().
No new export/render code — just a command entry point into the path that already runs.
-
Gate the export commands so they only appear when a map editor is focused, via
contributes.menus.commandPalette with a when clause (e.g.
activeCustomEditorId == 'wardley.mapEditor' || activeCustomEditorId == 'wardley.pngMapEditor'),
so the palette isn't cluttered when no map is open. (Create commands stay ungated. Commands in
contributes.commands get implicit onCommand activation on the engine ^1.96.)
-
(Secondary) Add wardley.newMapFromExample to the file/newFile menu for parity with the
other two create commands.
-
Keep category: "Wardley" on every command so they group together in the palette.
Acceptance Criteria
Alternatives Considered
- Leave export in the canvas menu only. Rejected: not discoverable from the palette and can't be
keybound.
- A single
Export… command with a Quick Pick for SVG/PNG. Viable and arguably cleaner; noted as
an option, but two explicit commands are more directly discoverable and individually keybindable.
- Also add "Open As" convert commands (Open as Editable Text / Open as Embedded PNG via
vscode.openWith) and an "Open Map…" picker. Deferred: VS Code's built-in Reopen Editor
With… already converts between the editors, and file association already opens maps.
- Duplicate the export logic in a command handler. Rejected: violates reuse —
exportImageToFile
plus the existing export protocol message should stay the single source of truth.
Note: the repo has no workspace/scope label (only enhancement, documentation, bug, refactor,
…), so this issue uses enhancement only.
Summary
As a VS Code user of the Wardley Mapping Modeler, I want the extension's core operations —
creating a map and exporting the current map — available as first-class Command Palette
commands under the existing shared "Wardley" category, so that I can reach them from
Cmd/Ctrl+Shift+Pwithout knowing about the in-canvas toolbar menu.Motivation
The Command Palette is the primary discovery surface in VS Code. Today only the create operations
are palette commands; the export operations live solely inside the webview's canvas toolbar
menu, so a new user who wants an SVG/PNG has no way to discover them from the palette, and they
can't be bound to a keyboard shortcut. Consolidating the core operations under the existing
Wardleycategory makes the extension self-describing and keyboard-friendly.What exists today — declared in
apps/vscode/package.json→contributes.commands, each withcategory: "Wardley". There is nocontributes.menus.commandPaletterestriction, so all three arealready reachable from the palette:
file/newFile?wardley.newMapwardley.newMapFromExamplewardley.newPngMapWhat's missing — core operations that are NOT exposed as commands:
wardley.exportSvgwardley.exportPngNew Map from Examplein File ▸ New File…file/newFilemenuProposed Solution
Add two new commands under the shared
Wardleycategory:wardley.exportSvg— "Export as SVG"wardley.exportPng— "Export as PNG"Reuse existing logic, don't duplicate. The write-to-disk half already exists in
apps/vscode/src/exportImage.ts(exportImageToFile), and the webview already emits anexportprotocol message with the rendered data (
apps/vscode/src/protocol.ts, handled in the editorproviders
WardleyEditorProvider.ts/WardleyPngEditorProvider.ts). The new commands should:base64 PNG (the same data its
exportSvg()/exportPng()insrc/webview/main.tsalreadyproduce for the in-canvas menu) — mirroring the existing
requestPnground-trip used for PNGsave,
exportImageToFile().No new export/render code — just a command entry point into the path that already runs.
Gate the export commands so they only appear when a map editor is focused, via
contributes.menus.commandPalettewith awhenclause (e.g.activeCustomEditorId == 'wardley.mapEditor' || activeCustomEditorId == 'wardley.pngMapEditor'),so the palette isn't cluttered when no map is open. (Create commands stay ungated. Commands in
contributes.commandsget implicitonCommandactivation on the engine^1.96.)(Secondary) Add
wardley.newMapFromExampleto thefile/newFilemenu for parity with theother two create commands.
Keep
category: "Wardley"on every command so they group together in the palette.Acceptance Criteria
Wardley: Export as SVGandWardley: Export as PNGappear in the Command Palette when a.wmap/.owm/.wmap.png/.owm.pngeditor is focused, and are hidden otherwise.export menu, via
exportImageToFile— no duplicated export/render logic.Wardleycategory in the palette.New Map from Exampleis reachable from File ▸ New File… alongside the other create commands.npm run lint,npm test, andnpm run typecheckstay green.Alternatives Considered
keybound.
Export…command with a Quick Pick for SVG/PNG. Viable and arguably cleaner; noted asan option, but two explicit commands are more directly discoverable and individually keybindable.
vscode.openWith) and an "Open Map…" picker. Deferred: VS Code's built-in Reopen EditorWith… already converts between the editors, and file association already opens maps.
exportImageToFileplus the existing
exportprotocol message should stay the single source of truth.Note: the repo has no workspace/scope label (only
enhancement,documentation,bug,refactor,…), so this issue uses
enhancementonly.