fix: person shape renders as ellipse in Draw.io export#2682
Conversation
🦋 Changeset detectedLatest commit: a83602d The changes in this PR will be included in the next version bump. This PR includes changesets to release 19 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughChanged DrawIO handling: map node shape Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/generators/src/drawio/generate-drawio.ts`:
- Around line 238-239: The inferKind function in parse-drawio.ts currently only
matches 'umlactor' or 'shape=person' when determining an actor shape; update the
pattern used in inferKind to also recognize 'shape=actor' so exported Draw.io
shapes round-trip correctly (i.e., add 'shape=actor' to the existing matcher
that checks for 'umlactor' or 'shape=person' so it returns 'actor' instead of
falling through to 'container').
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 68b5f515-f6a1-4eb7-aa3b-5f752b329702
📒 Files selected for processing (1)
packages/generators/src/drawio/generate-drawio.ts
|
@sraphaz Hey Raphael, can you review this one? |
…export The umlActor shape renders as a stick figure inside an ellipse boundary. When combined with HTML content rendering (overflow=fill;html=1;), the HTML content fills the ellipse and hides the stick figure, leaving only the ellipse visible. The actor shape is a built-in mxGraph person silhouette that renders correctly with HTML content. Fixes #2679 Co-Authored-By: Claude Haiku 4.5 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
The inferKind function only matched umlactor and shape=person. After changing the export to use shape=actor, re-imported files would not recognize the person shape correctly. Co-Authored-By: Claude Opus 4.6 <[email protected]>
3eda7ea to
a83602d
Compare
Review: fix: person shape renders as ellipse in Draw.io export (#2682)We contributed the initial Draw.io export/import feature to LikeC4 and were asked to review this PR. We take that responsibility seriously and have reviewed the change with care for correctness, round-trip integrity, and alignment with the project’s guidelines. 🌟 RecognitionThank you for addressing #2679 and for the clear PR description and commit messages. What this PR does: Elements with We recognize the care put into the implementation, the explanation of the root cause, and the inclusion of the parser change so that export and import stay in sync. 🔍 Our view on the integrity of the solutionFrom the perspective of maintainability and round-trip behavior: ✅Correctness: The change fixes the reported bug. Export now produces a shape that renders as intended in Draw.io, and import still classifies those cells as 🎉 We consider the solution sound and ready to merge from a correctness and integrity standpoint. ⚙️ Technical review✅Export ( ✅Import ( ✅Quote handling in ✅Conventions 💡 Optional enhancement: explicit
|
inferKind() now includes shape=actor so vertex with shape=actor is emitted as actor (not container). Aligns with upstream likec4#2682 and makes this branch pass ci:test without depending on likec4#2682 merge. Made-with: Cursor
sraphaz
left a comment
There was a problem hiding this comment.
LGTM. We (contributors of the initial Draw.io export/import) reviewed this PR in detail in an earlier comment. The fix is correct: switching export to shape=actor and recognizing it in inferKind restores proper person rendering in Draw.io and keeps round-trip consistent. Optional follow-up (explicit shape person on re-import) is addressed in our PR #2685. Approving.
…#2685) * feat(drawio): infer shape person on re-import for round-trip fidelity inferShape() now returns 'person' when DrawIO cell style contains shape=actor, shape=person, or umlactor. Re-imported actor cells get explicit style { shape person } in emitted .c4. Made-with: Cursor * fix(drawio): recognize shape=actor in inferKind for CI/self-contained PR inferKind() now includes shape=actor so vertex with shape=actor is emitted as actor (not container). Aligns with upstream #2682 and makes this branch pass ci:test without depending on #2682 merge. Made-with: Cursor * docs(drawio): align changeset and comment with current exporter (shape=actor or umlActor) CodeRabbit: changeset now states export may emit shape=actor or shape=umlActor; inferShape comment updated to match. Made-with: Cursor
Summary
Fixes #2679: Elements with
shape personnow render correctly in Draw.io exports. Changed fromshape=umlActortoshape=actor.The
umlActorshape is a stick figure inside an ellipse boundary. When combined with HTML content rendering (overflow=fill;html=1;), the HTML fills the ellipse and hides the figure, leaving only the ellipse visible. The built-inactorshape is a person silhouette that renders correctly with HTML content.Checklist
pnpm vitest run packages/generators/src/drawio/generate-drawio.spec.ts)Summary by CodeRabbit