Skip to content

fix(kiwi): convert SVG primitives to vector geometry - #692

Merged
mezotv merged 3 commits into
usenotra:mainfrom
swsarancodes:fix/kiwi-svg-primitive-geometry
Aug 24, 2026
Merged

fix(kiwi): convert SVG primitives to vector geometry#692
mezotv merged 3 commits into
usenotra:mainfrom
swsarancodes:fix/kiwi-svg-primitive-geometry

Conversation

@swsarancodes

@swsarancodes swsarancodes commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

Kiwi only imported SVG path elements, so logos and icons built from circle, rect, line, polyline, polygon, and ellipse pasted into Figma incomplete. Primitive geometry is now converted to path data during DOM extraction, then reused by the existing vector-network pipeline, including fill/stroke inheritance.

Screenshot/Recording (if applicable)

notra.figma.vector.mov
Checklist
  • I ran a self-review before opening this PR
  • I ran formatting/linting/type checks locally
  • I updated docs when behavior or setup changed
  • I only added comments where the logic is not obvious
  • I have used conventional commits for the PR title and commit messages
  • I did not use AI to write the code in this PR or have disclosed that I did

Summary by cubic

Imports SVG primitives by converting them to path geometry during DOM extraction, so pasted SVGs with circle, ellipse, rect, line, polyline, and polygon import completely. Previously only path was imported; now primitives convert to path data and reuse the existing vector pipeline with inherited fill and stroke.

  • Collects geometry with SVG_GEOMETRY_SELECTOR and converts each element via svgPrimitiveToSubpaths.
  • Conversion: circle/ellipse via arc commands; rect supports rx/ry; line becomes a two-point open path; polyline is open; polygon is closed; invalid or zero-size primitives are ignored.
  • Styling/transforms: reads computed style; preserves fill/stroke inheritance and fill-rule; carries linecap/linejoin; scales stroke width by the element CTM; restores stroke-dasharray parsing (element → SVG → computed style) and scales dash segments by the CTM.
  • Adds SvgPrimitiveAttrs and svgPrimitiveToPathData; tests cover each primitive for closure, bbox, and points. No API or data model changes.

Written for commit 35c3254. Summary will update on new commits.

Review in cubic

@swsarancodes
swsarancodes requested a review from mezotv as a code owner August 21, 2026 08:08
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated (UTC)
notra-agent Skipped Skipped Aug 24, 2026 10:21pm
notra-console Skipped Skipped Aug 24, 2026 10:21pm
notra-onboarding-agent Skipped Skipped Aug 24, 2026 10:21pm

Request Review

@vercel
vercel Bot temporarily deployed to Preview – notra-onboarding-agent August 21, 2026 08:08 Inactive
@vercel
vercel Bot temporarily deployed to Preview – notra-agent August 21, 2026 08:08 Inactive
@CLAassistant

CLAassistant commented Aug 21, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ mezotv
✅ swsarancodes
❌ Sarankumar


Sarankumar seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@vercel
vercel Bot temporarily deployed to Preview – notra-console August 21, 2026 08:08 Inactive
@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Someone is attempting to deploy a commit to the Notra Team on Vercel.

A member of the Team first needs to authorize it.

@mezotv

mezotv commented Aug 21, 2026

Copy link
Copy Markdown
Member

Do you have a before video to better grasp how this fixed the issue?

@vercel
vercel Bot temporarily deployed to Preview – notra-console August 21, 2026 08:15 Inactive
@vercel
vercel Bot temporarily deployed to Preview – notra-onboarding-agent August 21, 2026 08:15 Inactive
@vercel
vercel Bot temporarily deployed to Preview – notra-agent August 21, 2026 08:15 Inactive
@swsarancodes

Copy link
Copy Markdown
Contributor Author

Sorry, I don’t have a before-and-after video. I recently moved to a new Mac after losing my old laptop, along with my previous code and configs, so I’ve been setting everything up again from scratch.

I also recently met with an accident and am still recovering, so I may not be able to reply or provide additional material for the next few days. Sorry for the inconvenience, and thanks for understanding.

@vercel
vercel Bot temporarily deployed to Preview – notra-onboarding-agent August 24, 2026 22:21 Inactive
@vercel
vercel Bot temporarily deployed to Preview – notra-agent August 24, 2026 22:21 Inactive
@vercel
vercel Bot temporarily deployed to Preview – notra-console August 24, 2026 22:21 Inactive
@mezotv
mezotv merged commit 87a7366 into usenotra:main Aug 24, 2026
8 of 11 checks passed
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.

3 participants