Skip to content

perf(react): reduce SVG path precision - #6839

Open
j15z wants to merge 1 commit into
mainfrom
perf/react-doctor-svg-precision
Open

perf(react): reduce SVG path precision#6839
j15z wants to merge 1 commit into
mainfrom
perf/react-doctor-svg-precision

Conversation

@j15z

@j15z j15z commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

SVG assets now use two-decimal coordinates where extra precision is not visible. This reduces shipped source size while preserving rendered geometry, and React Doctor's SVG precision warnings fall from 8 to 0.

This is stack PR 1 of 3. It is followed by #6840 for stable list keys and #6841 for module-scope constants.

The Circleback pattern keeps its exact 1/280 image scale because rounding that structural value to zero would hide the image.

Metric Before This PR
React Doctor total findings 3,540 3,532
SVG precision warnings 8 0

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: Performance improvement

Testing

  • npx react-doctor@latest --verbose: 3,532 findings; rendering-svg-precision is 0
  • Type checks passed for @sim/app, @sim/emcn, and docs
  • Biome pre-commit checks passed for all 8 changed files

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

Not applicable. This PR changes numeric precision without an intended visual change.

Post-Deploy Monitoring & Validation

  • Validation window: first 24 hours after deploy; owner: PR author
  • Healthy signal: affected icons continue to render without missing or deformed artwork
  • Failure signal: any reproducible icon regression
  • Mitigation trigger: revert this PR if an icon loses visible geometry

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 19, 2026 3:08am

Request Review

@cursor

cursor Bot commented Aug 19, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Cosmetic SVG path rounding in docs-only assets; visual output should be unchanged aside from negligible sub-pixel differences.

Overview
Addresses React Doctor SVG precision warnings by shortening numeric coordinates in inline SVG path d attributes and related transform values, without changing viewBoxes or component structure.

apps/docs/components/icons.tsx — bulk update across many integration/brand icons (AgentPhoneIcon, RB2BIcon, MintlifyIcon, OneDriveIcon, DynatraceIcon, GranolaIcon, TriggerDevIcon, JupyterIcon, and others): long decimal path data is rounded to fewer digits; a few transforms are simplified (e.g. QuartrIcon scale 0.166240.17, rotation/matrix values in DaytonaIcon).

apps/docs/app/api/og/route.tsx — same rounding on the SimWordmark paths used in dynamic OG image generation.

Reviewed by Cursor Bugbot for commit 0965452. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR reduces numeric precision in static SVG geometry to decrease icon markup size while preserving component APIs and rendering structure.

  • Rounds SVG path coordinates in the shared docs and Sim icon collections.
  • Applies the same optimization to five EMCN icon components.
  • Rounds the Sim wordmark geometry used by the documentation Open Graph image endpoint.

Confidence Score: 5/5

The 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.

Important Files Changed

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

@j15z j15z changed the title perf/react doctor svg precision perf(react): reduce SVG path precision Aug 19, 2026
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