Skip to content

feat(cli,playground,docs,generators): Export LikeC4 views to Draw.io#2614

Closed
sraphaz wants to merge 30 commits intomainfrom
feat/drawio-export
Closed

feat(cli,playground,docs,generators): Export LikeC4 views to Draw.io#2614
sraphaz wants to merge 30 commits intomainfrom
feat/drawio-export

Conversation

@sraphaz
Copy link
Copy Markdown
Collaborator

@sraphaz sraphaz commented Feb 12, 2026

feat(cli,playground,docs,generators): Export LikeC4 views to Draw.io

Summary

This PR adds export of LikeC4 views to Draw.io (.drawio) format. Users can export from the CLI (likec4 export drawio) and from the Playground (right-click on diagram → DrawIO → Export view / Export all). This allows editing diagrams in Draw.io and reusing them in tools that support the format.

This PR does not include import. Import from Draw.io will be proposed in a separate PR after this one is merged.


What's in this PR

1. Generators (@likec4/generators)

  • packages/generators/src/drawio/generate-drawio.ts — Exports a single view or multiple views to Draw.io XML. Maps LikeC4 elements (title, description, shape, color, relationships, etc.) to mxCell vertices/edges. Supports optional layoutOverride, strokeColorByNodeId, strokeWidthByNodeId, edgeWaypoints, and compressed. Refactors: computeDiagramLayout split into smaller helpers; getViewDescriptionString extracted for buildRootCellStyle; constants and buildNodeCellXml for clarity (SOLID/DRY/KISS).
  • packages/generators/src/drawio/parse-drawio.ts — Round-trip comment parsing (parseDrawioRoundtripComments) and parse-to-LikeC4 (parseDrawioToLikeC4 / parseDrawioToLikeC4Multi) for future import. Refactors: parseDrawioToLikeC4Multi split into mergeDiagramStatesIntoMaps, buildRootsFromFqnToCell, emitMultiDiagramModel (orchestrator ~50–60 lines); buildViewBlockLines and escapeLikec4Quotes in view block; O(n²) cell deduplication replaced with parsedIds Set; UserObject-level <data> preserved by using innerXml for fullTag in UserObject-wrapped cells.
  • packages/generators/src/drawio/index.ts — Public API: generateDrawio, generateDrawioMulti, GenerateDrawioOptions, plus getAllDiagrams, parseDrawioRoundtripComments, parseDrawioToLikeC4, parseDrawioToLikeC4Multi.
  • Tests: generate-drawio.spec.ts, parse-drawio.spec.ts; snapshots in __snapshots__/.

2. CLI (@likec4/likec4)

  • packages/likec4/src/cli/export/drawio/handler.tslikec4 export drawio [path] with options: --outdir, -o, --all-in-one, --roundtrip, --uncompressed, --project, --use-dot. DRY: DEFAULT_DRAWIO_ALL_FILENAME from @likec4/generators.
  • packages/likec4/src/cli/export/index.ts — Registers the drawio export command.

3. Playground

  • DrawIO context menu export only: DrawioContextMenuProvider, DrawioContextMenuDropdown (Export view…, Export all…), useDrawioContextMenuActions (handleExport, handleExportAllViews; uses generateDrawio/generateDrawioMulti and parseDrawioRoundtripComments). DrawioContextMenu, drawio-events (DRAWIO_EXPORT_EVENT). No Import item or file input in this PR.
  • Monaco: only Export to DrawIO action in editor context menu (no Import action). Integration in LanguageClientSync and routes as needed for export.

Playground exports are uncompressed by default so files open reliably in Draw.io desktop.

4. Documentation

  • apps/docs/src/content/docs/tooling/drawio.mdx — Export only: mapping (LikeC4 → Draw.io), options, not preserved, multi-diagram, troubleshooting, re-export using comment blocks. No import sections.
  • apps/docs/src/content/docs/tooling/cli.mdx — Export to DrawIO section only; no Import from DrawIO section.

5. Tests

  • packages/likec4/src/drawio-demo-export-import.spec.ts — Export tests only; import/vice-versa test skipped in this PR.
  • packages/likec4/src/drawio-tutorial-export-import.spec.ts — Export tests only; import and round-trip tests skipped in this PR.
  • e2e/tests/drawio-playground.spec.ts — Asserts DrawIO menu shows Export to DrawIO (and Export all). Run with playwright.playground.config.ts; main e2e config ignores this test.

Refactors on this branch

  • parse-drawio: parseDrawioToLikeC4Multi refactored into helpers: mergeDiagramStatesIntoMaps, buildRootsFromFqnToCell, emitMultiDiagramModel; main function is a short orchestrator (~50–60 lines). buildViewBlockLines and escapeLikec4Quotes for the view block. Cell deduplication uses a parsedIds Set instead of O(n²) .some(). UserObject-wrapped cells: fullTag now uses innerXml so UserObject-level <data> siblings are preserved for round-trip.
  • generate-drawio: computeDiagramLayout split into smaller functions; getViewDescriptionString extracted for buildRootCellStyle; constants and buildNodeCellXml for clarity (SOLID/DRY/KISS).
  • CLI: DEFAULT_DRAWIO_ALL_FILENAME imported from @likec4/generators (DRY).

What's not in this PR

  • No likec4 import drawio command (no packages/likec4/src/cli/import/).
  • No Playground "Import from DrawIO" menu item, file input, or Monaco Import action.
  • No docs for importing from Draw.io.
  • Import/round-trip tests in likec4 specs are skipped; enabled in the import PR.

Checklist

  • I've read the latest contribution guidelines.
  • I've rebased my branch onto main before creating this PR.
  • Commit messages follow Conventional Commits (e.g. feat:, refactor:, fix:).
  • Tests added/updated for export; import tests skipped in this branch.
  • pnpm test and pnpm typecheck (and e2e where applicable) pass.
  • Documentation updated (drawio.mdx and cli.mdx for export only).
  • Changeset added for user-facing packages where applicable.

Notes for reviewers

  • Export: one .drawio file per view by default; --all-in-one for all views as tabs; --roundtrip applies layout/waypoints from comment blocks; --uncompressed for Draw.io desktop compatibility.
  • Playground exposes only Export actions in the DrawIO menu.
  • Generators: parse-drawio is present for round-trip comments and for the upcoming import PR; no import entrypoints used here.
  • E2E: drawio-playground test is excluded from main config (runs only with playground config on port 5174).

Review context

The original DrawIO bidirectional work (branch feat/drawio-bidirectional-playground) was reviewed upstream in likec4/likec4 PR #2593. This export-only PR is a split from that work; feedback from that review has been incorporated (CLI docs, context menu structure, XML generation). Additional refactors on this branch: parse/generate drawio helpers and orchestrators, UserObject fullTag fix for sibling <data> round-trip, and generator CLI DRY.

Summary by CodeRabbit

  • New Features

    • Added DrawIO diagram export functionality with support for styling, colors, and layout preservation.
    • Introduced --all-in-one option to combine multiple views into a single DrawIO file.
    • Added --roundtrip option for maintaining layout and stroke properties across re-exports.
    • Integrated DrawIO export into Playground UI.
  • Improvements

    • Enhanced CLI with new DrawIO export options (--uncompressed, --roundtrip, --all-in-one).
    • Improved cross-platform build process with postpack command.
  • Documentation

    • Added DrawIO integration guide covering export options and behavior.

sraphaz and others added 30 commits February 11, 2026 11:50
- Docs: Export DrawIO option --output,-o -> --outdir,-o
- generate-drawio: pageScale="1" for well-formed XML, mxUserObject after mxGeometry
- generate-drawio: flattenMarkdownOrString and isEmptyish for description/technology
- parse-drawio: infer system only for swimlane not shape=rectangle+rounded
- parse-drawio: toId remove dot from allowed chars to avoid invalid FQN
- Playground: DrawioContextMenu refactor with hook and presentational component

Co-authored-by: Cursor <[email protected]>
…d export/import

- Export: view title/description (diagram name + likec4ViewTitle/Description), summary, links, border, opacity, relationship kind/notation, likec4ColorName
- Import: diagram name as view id, view title/description from root cell, edge strokeColor to style color, opacity, shape (cylinder/document), summary/links/border/relationshipKind/notation
- Add CONVERSION-MAPPING.md documenting mapped and unmapped items
- Add pako.d.ts for typecheck; export DiagramInfo from parse-drawio

Co-authored-by: Cursor <[email protected]>
…pport

- IMPLEMENTATION-PLAN.md: phased plan for full conversion coverage
- parseDrawioToLikeC4Multi(xml): merge multiple diagrams into one model, one view per tab with include list
- getAllDiagrams(xml): extract all diagram name/id/content from mxfile
- First diagram without name attribute still yields view 'index' for backward compatibility
- Test: two-tab drawio produces view overview (include A, B) and view detail (include A, C)

Co-authored-by: Cursor <[email protected]>
…and single English doc

- Import: emit layout as comment block (likec4.layout.drawio) for round-trip
- Import: emit vertex strokeColor as comment block (DSL has no element strokeColor)
- Import: parse likec4Metadata on edges, emit metadata { } block
- Import: parse Draw.io native style 'link', emit element link when no likec4Links
- Export: add likec4StrokeColor on vertex, likec4Metadata on edge
- Docs: single Draw.io integration page (tooling/drawio.mdx) in English; link from CLI
- Remove CONVERSION-MAPPING.md and IMPLEMENTATION-PLAN.md; add changeset

Co-authored-by: Cursor <[email protected]>
…on, size/padding/textSize/iconPosition

- 2.1: Import emit vertex strokeWidth as comment block (likec4.strokeWidth.vertices)
- 2.4: Export likec4ViewNotation on root cell when view has notation
- 2.5: Export/import element size, padding, textSize, iconPosition (likec4Size etc.)
- Export likec4StrokeWidth on vertex for round-trip
- Docs: drawio.mdx updated with new mappings

Co-authored-by: Cursor <[email protected]>
- Export: GenerateDrawioOptions with layoutOverride, strokeColorByNodeId,
  strokeWidthByNodeId, edgeWaypoints; view notation string; customData and
  waypoints in XML.
- Import: view notation and edge waypoints comment blocks (single + multi);
  parseDrawioRoundtripComments() to read comment blocks for re-export.
- Playground: getSourceContent from workspace files; export applies round-trip
  options when comment blocks present.
- Playground generate: use PowerShell on Windows (usePowerShell + quotePowerShell)
  so generate runs without bash.
- Generators: export getAllDiagrams, DrawioRoundtripData, parseDrawioRoundtripComments;
  @types/pako; fix view.notation type and layoutByView possibly undefined.
- Docs: drawio.mdx updated with options, waypoints, re-export note.
- Tests: parseDrawioRoundtripComments; generate snapshots updated.
- Changeset: drawio-roundtrip-options.md.

Co-authored-by: Cursor <[email protected]>
- CLI: likec4 export drawio --roundtrip reads .c4 source, parses comment
  blocks (layout, stroke, waypoints), applies options per view.
- Generators: export generateDrawioMulti, parseDrawioRoundtripComments,
  parseDrawioToLikeC4Multi from main index for CLI/consumers.
- Playground: DrawioContextMenu accepts optional getSourceContent for
  round-trip export when used with explicit props.
- Docs: cli.mdx documents --roundtrip and --all-in-one for Export to DrawIO.
- E2E: playwright.playground.config.ts and drawio-playground.spec.ts;
  test:playground script; e2e/.gitignore allows drawio-playground.spec.ts.
- Changeset: drawio-cli-roundtrip-e2e.md (likec4, e2e patch).

Co-authored-by: Cursor <[email protected]>
- Use BBox, ThemeColorValues, RelationshipColorValues from @likec4/core
- Add getEffectiveStyles(viewmodel) and resolveThemeColor for DRY
- JSDoc for public and key internal helpers
- Docs: drawio.mdx export behavior (theme colors, containers behind, edge anchors, layoutOverride BBox)

Co-authored-by: Cursor <[email protected]>
…ut fallbacks

- useDrawioContextMenuActions: build viewModels from likec4model.views() then fill via getLayoutedModel, viewStates, layoutViews so all tabs export
- DrawioContextMenuDropdown: minor copy/tooltip tweaks
- README and schema updates

Co-authored-by: Cursor <[email protected]>
Export:
- Container: keep rounded=0 (no rounded corners)
- Elements: rounded=1 + arcSize=0.12 (subtle curve)
- UserObject with link for navigateTo; style link=data:page/id,likec4-<viewId>
- Docs: navigability and link format

Import:
- Parse UserObject wrapping mxCell: use id and link from UserObject
- navigateTo from link attribute (data:page/id,likec4-<viewId>) for round-trip
- Refactor: buildCellFromMxCell for reuse; skip duplicate id from UserObject

Playground:
- DrawIO context menu font size 10px

Co-authored-by: Cursor <[email protected]>
- Parse: container=1 -> system, child of container -> component; fillOpacity/likec4Opacity; view title/description/notation from root cell
- Merge container title cells (text shape) into container element; exclude from vertex list
- inferKind(style, parentCell); single and multi-diagram use containerIdToTitle and byId
- generate-drawio.spec: ProcessedView type for viewWithNav; drawio-demo: expected nodes include container title count
- CLI: likec4 import drawio described as experimental (import not yet fully validated)

Co-authored-by: Cursor <[email protected]>
- Add devops/commands/postpack.ts: copy packed tgz to package.tgz (Node fs)
- Replace cp ... || true in all 14 packages and styled-system with likec4ops postpack
- Enables pnpm lint:package and validate on Windows

Co-authored-by: Cursor <[email protected]>
- CI: single check-validate job runs pnpm validate (same as local); e2e/docs/playground depend on it
- Root: pnpm validate script (generate -> typecheck -> core type tests -> lint -> build -> lint:package -> test)
- Husky: pre-push runs validate when pushing to main
- AGENTS.md: document pnpm validate
- Changeset: drawio import alignment, CLI experimental, postpack, validate pipeline

Co-authored-by: Cursor <[email protected]>
- Export: preserve node parent links (parentId from view hierarchy); container title cell parent = container id
- Docs: mention --all-in-one early in Export section
- Playground: use layouted diagram for single-view export when available; forEach -> for...of
- generate-drawio: hex regex 3/4/6/8 only; remove sourcePoint/targetPoint from Array points; container margins: horizontal = xl, vertical = xl+md (vertical slightly larger)
- Remove pako.d.ts, use @types/pako
- parse-drawio: likec4LineType only 1 1 / 2 2 = dotted; getAllDiagrams guard empty/invalid content; DRY: stripHtml, stripHtmlForTitle, emitElementToLines, emitEdgesToLines, emitRoundtripComments(Single|Multi)
- worker: errToString guard JSON.stringify circular refs
- drawio-demo spec: assert reimportViews.length > 0; fix NodeId type in containerCount
- Snapshots updated for parent/container changes

Co-authored-by: Cursor <[email protected]>
- generate-drawio: use view.bounds for page, zero offset when content fits
- drawio-demo spec: increase timeout to 15s for vice versa test
- handler: use loggable(err) instead of String(err) for error logging
- worker: avoid String(err) on object in errToString (return literal)

Co-authored-by: Cursor <[email protected]>
…iew LSP request, MonacoEditor props

Co-authored-by: Cursor <[email protected]>
- Wait for .react-flow.initialized (20s) like export snapshot tests
- Increase test timeout to 35s for CI layout delay
- Remove arbitrary sleep and fragile canvas wait

Co-authored-by: Cursor <[email protected]>
- Remove CLI import drawio command and handlers
- Playground: DrawIO menu export only (no Import item, no Monaco import action)
- Docs: export-only sections in drawio.mdx and cli.mdx
- Tests: skip import/round-trip specs (to re-enable in import PR)
- E2E: assert Export to DrawIO and Export all only
- Add DRAWIO-PR-SPLIT.md and .pr-description-export.md / .pr-description-import.md

Co-authored-by: Cursor <[email protected]>
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 12, 2026

🦋 Changeset detected

Latest commit: 3f8346c

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sraphaz sraphaz closed this Feb 12, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 12, 2026

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR introduces Draw.io roundtrip export enhancements across CLI, Playground, and generators, including multi-diagram export (--all-in-one), layout/stroke customization (--roundtrip), and an infrastructure refactor replacing shell-based postpack with a centralized likec4ops command. Includes E2E tests, language-server error handling, and updated CI workflows.

Changes

Cohort / File(s) Summary
DrawIO Roundtrip & Export Core
packages/generators/src/drawio/generate-drawio.ts, packages/generators/src/drawio/parse-drawio.ts, packages/generators/src/drawio/index.ts
Major enhancement to DrawIO export/import: added base64 compression, theme-driven colors, metadata embedding (mxUserObject), edge waypoints, multi-diagram support (generateDrawioMulti), and roundtrip comment parsing for layout/stroke preservation. Added 2000+ lines of logic for cell styling, container rendering, edge geometry, and multi-diagram coordination.
CLI DrawIO Export Handler
packages/likec4/src/cli/export/drawio/handler.ts
Extended DrawIO export with --all-in-one and --roundtrip options; added multi-view file generation via generateDrawioMulti and per-view roundtrip data parsing; removed import command handler integration.
CLI Import/Export Removal
packages/likec4/src/cli/import/index.ts, packages/likec4/src/cli/import/drawio/handler.ts, packages/likec4/src/cli/index.ts
Removed experimental DrawIO import command and its CLI registration, reverting to export-only workflow.
Playground DrawIO Context Menu Refactor
apps/playground/src/components/drawio/DrawioContextMenu.tsx, apps/playground/src/components/drawio/DrawioContextMenuDropdown.tsx, apps/playground/src/components/drawio/DrawioContextMenuProvider.tsx, apps/playground/src/components/drawio/useDrawioContextMenuActions.ts, apps/playground/src/components/drawio/useDrawioActions.ts
Restructured context menu architecture: replaced useDrawioActions with new useDrawioContextMenuActions hook supporting optional layout API and roundtrip options; introduced LayoutedModelApi type for external layout/view access; updated DrawioContextMenuDropdown to export-only UI; added getSourceContent callback for roundtrip data retrieval.
Monaco & Language Client Integration
apps/playground/src/monaco/LanguageClientSync.tsx, apps/playground/src/monaco/MonacoEditor.tsx, apps/playground/src/monaco/index.tsx, apps/playground/src/routes/w.$workspaceId/route.tsx
Introduced LayoutedModelApi integration thread through Monaco components; added setLayoutedModelApi callback prop to surface layouted model and per-view layout requests; removed DrawIO import event handler; wired layout API from language client to context menu provider.
Postpack Infrastructure Overhaul
devops/commands/postpack.ts, devops/likec4ops.ts, packages/*/package.json (15 packages)
Centralized postpack implementation: created likec4ops postpack command for cross-platform tgz-to-package.tgz copying; replaced all shell cp commands across packages (config, core, diagram, generators, icons, language-server, language-services, layouts, likec4, log, mcp, vite-plugin, styled-system/*) with delegated likec4ops postpack call.
GitHub Workflows & CI
.github/workflows/checks.yaml, .github/workflows/ci-pr.yaml
Updated CI runner: replaced ubuntu-24.04-arm with ubuntu-latest across 8 check jobs; added new ci-pr.yaml workflow to mirror main PR checks with conditional execution and concurrency management.
E2E Testing Infrastructure
e2e/playwright.playground.config.ts, e2e/tests/drawio-playground.spec.ts, e2e/package.json, e2e/.gitignore
New Playwright configuration for Playground E2E tests; added DrawIO context menu visibility test (Export to DrawIO, Export all options); created test:playground script; ungit-ignored the test file.
Tests & Specs
packages/generators/src/drawio/generate-drawio.spec.ts, packages/generators/src/drawio/parse-drawio.spec.ts, packages/likec4/src/drawio-demo-export-import.spec.ts, packages/likec4/src/drawio-tutorial-export-import.spec.ts
Expanded test coverage for DrawIO export/import: validation of XML loadability, per-view element/edge counts, multi-diagram handling, roundtrip data parsing, and integration tests using demo and tutorial models.
Documentation & Configuration
apps/docs/src/content/docs/tooling/drawio.mdx, apps/docs/src/content/docs/tooling/cli.mdx, .pr-description-export.md, .pr-description-import.md, DRAWIO-PR-SPLIT.md
New DrawIO export documentation covering mxCell mapping, options, multi-diagram behavior, round-trip support, and troubleshooting; updated CLI docs with --all-in-one and --roundtrip options; documented PR split strategy (export vs import).
Miscellaneous
.gitignore, .changeset/*, apps/playground/README.md, apps/playground/scripts/generate.mts, packages/diagram/src/likec4diagram/ui/notation/NotationPanel.tsx, packages/language-server/src/browser/worker.ts, packages/language-server/src/browser/index.ts
Added PR draft files to .gitignore; added 4 changeset files documenting roundtrip/implementation/import/options; playground troubleshooting docs; Windows PowerShell support for playground generate script; removed empty-state UI from NotationPanel; improved browser worker error handling with safe serialization.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant CLI
    participant Parser as Parser/Generator
    participant Model as LikeC4 Model
    participant Draw.io as Draw.io Export
    participant Roundtrip as Roundtrip Cache

    User->>CLI: likec4 export drawio --roundtrip<br/>--all-in-one
    CLI->>Roundtrip: readWorkspaceSourceContent()<br/>(read .c4 files)
    Roundtrip-->>CLI: c4 source + roundtrip blocks
    CLI->>Parser: parseDrawioRoundtripComments(source)<br/>(layout, strokes, waypoints)
    Parser-->>CLI: DrawioRoundtripData
    CLI->>Model: getLayoutedModel()
    Model-->>CLI: LayoutedLikeC4ModelData
    CLI->>Parser: generateDrawioMulti(viewmodels,<br/>optionsByViewId)
    Parser->>Parser: For each view:<br/>apply layout overrides<br/>apply stroke colors/widths<br/>apply edge waypoints
    Parser->>Draw.io: Emit mxCell elements<br/>with customData/<br/>mxUserObject metadata
    Draw.io-->>Parser: Single diagrams.drawio file<br/>(multiple tabs)
    Parser-->>CLI: Compressed/uncompressed XML
    CLI->>CLI: Write to disk
    CLI-->>User: diagrams.drawio ✓
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • #2592: Introduces initial Draw.io export and roundtrip infrastructure, directly extended by this PR's roundtrip/layout/stroke enhancements
  • #2521: Adds element shape enhancements (bucket, document) and styling changes that influence DrawIO shape rendering logic

Suggested reviewers

  • davydkov

Poem

🐰 A roundtrip through the diagram's night,
From LikeC4 source to Draw.io light,
Waypoints and strokes now preserved with care,
Multi-view exports fill the air—
The postpack hop makes building fair! ✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/drawio-export

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sraphaz sraphaz deleted the feat/drawio-export branch February 12, 2026 09:41
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3f8346c7af

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1489 to +1491
const json = dataLine.slice(3)
layoutByView = JSON.parse(json) as DrawioRoundtripData['layoutByView']
} catch {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Merge layout comment blocks instead of overwriting

parseDrawioRoundtripComments replaces layoutByView every time it sees a // <likec4.layout.drawio> block, so when multiple files contribute blocks only the last one is kept. Because the CLI concatenates all .c4/.likec4 sources before parsing, this causes earlier view layouts to be silently dropped and --roundtrip exports without expected positions for those views.

Useful? React with 👍 / 👎.

Comment on lines +115 to +116
const sourceContent = await readWorkspaceSourceContent(resolve(args.path))
const roundtripData = parseDrawioRoundtripComments(sourceContent)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Scope roundtrip source parsing to the selected project

When --project is used, layouting is done for that project, but roundtrip overrides are still read from every .c4 file under args.path. In multi-project workspaces, comment blocks from unrelated projects can collide on shared view/node IDs and apply wrong layout or stroke overrides to the exported project. The roundtrip input should be restricted to files that belong to the selected project.

Useful? React with 👍 / 👎.

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