perf(icons): reduce and guard SVG path precision - #6839
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryLow Risk Overview The Sim wordmark and Circleback pattern scale are intentionally left unchanged per the PR description. A Reviewed by Cursor Bugbot for commit 61a843a. Bugbot is set up for automated code reviews on this repo. Configure here. |
Greptile SummaryThis PR reduces numeric precision in static SVG geometry to decrease icon markup size while preserving component APIs and rendering structure.
Confidence Score: 5/5The PR appears safe to merge because the SVG precision reductions preserve valid geometry and existing component contracts. The changes are limited to static numeric SVG data; command structures, fills, view boxes, exports, and runtime behavior remain intact, with no concrete observable failure identified.
|
| Filename | Overview |
|---|---|
| apps/docs/app/api/og/route.tsx | Rounds the Sim wordmark’s path coordinates without changing the OG image route behavior or SVG structure. |
| apps/docs/components/icons.tsx | Reduces precision across static icon geometry; paths remain valid and no actionable rendering regression was identified. |
| apps/sim/components/icons.tsx | Mirrors the docs icon precision reductions without changing exported component contracts. |
| packages/emcn/src/icons/bubble-chat-delay.tsx | Rounds static path coordinates while preserving the icon component API and SVG command structure. |
| packages/emcn/src/icons/download.tsx | Rounds static path coordinates with no identified functional or rendering defect. |
| packages/emcn/src/icons/duplicate.tsx | Rounds static path coordinates with no identified functional or rendering defect. |
| packages/emcn/src/icons/mic.tsx | Rounds static path coordinates with no identified functional or rendering defect. |
| packages/emcn/src/icons/upload.tsx | Rounds static path coordinates with no identified functional or rendering defect. |
Reviews (1): Last reviewed commit: "perf(react): reduce SVG path precision" | Re-trigger Greptile
0965452 to
56e83f5
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 58c07c1. Configure here.
07b8422 to
61a843a
Compare

Summary
Reusable icon SVGs now ship without invisible coordinate precision, and CI prevents that byte cost from returning. Literal icon paths are limited to three decimal places across 180 scoped files, with a reasoned path-local exception available when rounding would visibly change geometry.
The Sim wordmark remains byte-for-byte unchanged and is the sole remaining React Doctor SVG precision finding. The Quartr pattern also keeps its exact
1/280scale because rounding that structural transform would hide the image.stagingThe gzip measurement compares source files, not production bundles; final download savings depend on bundling and tree-shaking.
Type of Change
Testing
bun run test:icon-path-precision: 6 tests passed, covering the three-decimal boundary, scientific notation, literal JSX forms, and the reasoned exception contractbun run check:audits: all 31 repository audits passed, including icon path syntax, SVG precision, generated docs, API validation, and monorepo boundariesbun run type-checkpassed inapps/sim,apps/docs, andpackages/emcnbunx react-doctor@latest --verbose: 3,449 total existing findings;rendering-svg-precisionreports only the untouched OG wordmarkReviewers should focus on whether the three-decimal boundary and path-local exception are appropriate for reusable icons. The check intentionally excludes transforms, view boxes, dynamic path expressions, and page-specific artwork.
Checklist
Screenshots/Videos