Summary
As a VS Code user of the Team Topologies Modeler, I want the extension's core operations —
creating a diagram and exporting the current diagram — available as first-class Command
Palette commands under one shared "Team Topologies" category, so that I can reach them from
Cmd/Ctrl+Shift+P without knowing about the in-canvas 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 collapsed
(Excalidraw-style) 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 Team Topologies category makes the extension self-describing and keyboard-friendly.
What exists today — declared in apps/vscode/package.json → contributes.commands, each with
category: "Team Topologies". There is no contributes.menus.commandPalette restriction, so all
three are already reachable from the palette:
| Command id |
Title |
In palette? |
In file/newFile? |
teamTopologies.newDiagram |
New Empty Diagram |
✅ |
✅ |
teamTopologies.newFromExample |
New Diagram from Example |
✅ |
❌ |
teamTopologies.newPngDiagram |
New Empty Diagram (embedded PNG) |
✅ |
✅ |
What's missing — core operations that are NOT exposed as commands:
| Operation |
Today |
Proposed command id |
| Export current diagram as SVG |
webview menu only |
teamTopologies.exportSvg |
| Export current diagram as PNG |
webview menu only |
teamTopologies.exportPng |
(secondary) New Diagram from Example in File ▸ New File… |
palette only |
add to file/newFile menu |
Proposed Solution
-
Add two new commands under the shared Team Topologies category:
teamTopologies.exportSvg — "Export as SVG"
teamTopologies.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
TtEditorProvider.ts:66 and TtPngEditorProvider.ts:160). The new commands should:
- resolve the active Team Topologies editor,
- send a new host → webview "request export" message so the webview produces the SVG text /
base64 PNG (the same data it already produces for the in-canvas menu),
- 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 diagram editor is focused, via
contributes.menus.commandPalette with a when clause (e.g.
activeCustomEditorId == 'teamTopologies.editor' || activeCustomEditorId == 'teamTopologies.pngEditor'),
so the palette isn't cluttered when no diagram is open.
-
(Secondary) Add teamTopologies.newFromExample to the file/newFile menu for parity with the
other two create commands.
-
Keep category: "Team Topologies" 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.
- 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.
Summary
As a VS Code user of the Team Topologies Modeler, I want the extension's core operations —
creating a diagram and exporting the current diagram — available as first-class Command
Palette commands under one shared "Team Topologies" category, so that I can reach them from
Cmd/Ctrl+Shift+Pwithout knowing about the in-canvas 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 collapsed
(Excalidraw-style) 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
Team Topologiescategory makes the extension self-describing and keyboard-friendly.What exists today — declared in
apps/vscode/package.json→contributes.commands, each withcategory: "Team Topologies". There is nocontributes.menus.commandPaletterestriction, so allthree are already reachable from the palette:
file/newFile?teamTopologies.newDiagramteamTopologies.newFromExampleteamTopologies.newPngDiagramWhat's missing — core operations that are NOT exposed as commands:
teamTopologies.exportSvgteamTopologies.exportPngNew Diagram from Examplein File ▸ New File…file/newFilemenuProposed Solution
Add two new commands under the shared
Team Topologiescategory:teamTopologies.exportSvg— "Export as SVG"teamTopologies.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 inTtEditorProvider.ts:66andTtPngEditorProvider.ts:160). The new commands should:base64 PNG (the same data it already produces for the in-canvas menu),
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 diagram editor is focused, via
contributes.menus.commandPalettewith awhenclause (e.g.activeCustomEditorId == 'teamTopologies.editor' || activeCustomEditorId == 'teamTopologies.pngEditor'),so the palette isn't cluttered when no diagram is open.
(Secondary) Add
teamTopologies.newFromExampleto thefile/newFilemenu for parity with theother two create commands.
Keep
category: "Team Topologies"on every command so they group together in the palette.Acceptance Criteria
Team Topologies: Export as SVGandTeam Topologies: Export as PNGappear in the CommandPalette when a
.tt/.ttm.json/*.tt.pngeditor is focused, and are hidden otherwise.in-canvas export menu, via
exportImageToFile— no duplicated export/render logic.Team Topologiescategory in the palette.New Diagram from Exampleis reachable from File ▸ New File… alongside the other createcommands.
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.
exportImageToFileplus the existing
exportprotocol message should stay the single source of truth.