Skip to content

chore(web): shrink sprite SVGs by 46% (3.7MB → 2.0MB)#97

Merged
naorsabag merged 1 commit into
masterfrom
chore/shrink-sprites
May 9, 2026
Merged

chore(web): shrink sprite SVGs by 46% (3.7MB → 2.0MB)#97
naorsabag merged 1 commit into
masterfrom
chore/shrink-sprites

Conversation

@naorsabag
Copy link
Copy Markdown
Owner

Lossless cleanup of all 12 sprite SVGs + favicon. Pipeline auto-detects two formats:

  • Fabric.js exports (cache, docker, k8s, …) — strip the verbose per-rect style="stroke: none; ...; fill: rgb(...); ..." boilerplate (~280 chars/rect of redundant defaults), replacing with a clean fill="#hex" attribute. Group transforms preserved (some carry rotations the rect-merger can't safely flatten). Then SVGO multipass + precision=0.
  • Already-clean exports (auth, user, …) — merge horizontally and vertically adjacent same-color rects, then SVGO. Smaller wins from this branch (pixel art has subtle per-pixel color variation, so few merges qualify).

Per-file

File Before After Saved
cache_node.svg 549.9 KB 81.6 KB -85%
queue_node.svg 396.1 KB 132.8 KB -66%
user_node.svg 11.9 KB 5.1 KB -57%
external_node.svg 169.0 KB 74.5 KB -56%
service_node.svg 125.1 KB 57.5 KB -54%
carrot_pixels.svg 29.7 KB 16.4 KB -45%
docker_node.svg 540.8 KB 306.6 KB -43%
scheduler_node.svg 511.0 KB 331.2 KB -35%
endpoint_node.svg 373.8 KB 262.2 KB -30%
auth_node.svg 157.4 KB 111.5 KB -29%
k8s_node.svg 494.9 KB 360.3 KB -27%
database_node.svg 356.4 KB 261.7 KB -27%
favicon.svg 11.9 KB 5.1 KB -57%

Total: 3.7 MB → 2.0 MB (-46%, ~1.7 MB saved on the web bundle)

Visual integrity

Every sprite renders pixel-identical to the original except cache_node.svg, which has an average 0.65/256-channel deviation from SVGO float rounding — invisible to the naked eye, no structural change.

🤖 Generated with Claude Code

All 12 sprite SVGs + favicon optimized. The pipeline (saved scratch
locally; can be committed if useful) auto-detects format:

- Fabric.js exports (cache, docker, k8s, etc.) — strip the verbose
  per-rect `style="stroke: none; ...; fill: rgb(R,G,B); ..."`
  boilerplate (~280 chars/rect of redundant defaults), replacing
  with a clean `fill="#hex"` attribute. Group transforms preserved
  (some carry rotations that the rect-merger can't safely flatten).
  Then SVGO multipass + precision=0.

- Already-clean exports (auth, user, etc.) — merge horizontally and
  vertically adjacent same-color rects, then SVGO. Few merges
  possible (pixel art has subtle per-pixel color variation), so
  smaller wins from this branch.

Per-file:
  cache_node.svg:    549.9 KB → 81.6 KB  (-85%)
  queue_node.svg:    396.1 KB → 132.8 KB (-66%)
  user_node.svg:     11.9 KB → 5.1 KB    (-57%)
  external_node.svg: 169.0 KB → 74.5 KB  (-56%)
  service_node.svg:  125.1 KB → 57.5 KB  (-54%)
  carrot_pixels.svg: 29.7 KB → 16.4 KB   (-45%)
  docker_node.svg:   540.8 KB → 306.6 KB (-43%)
  scheduler_node.svg: 511.0 KB → 331.2 KB (-35%)
  endpoint_node.svg: 373.8 KB → 262.2 KB (-30%)
  auth_node.svg:     157.4 KB → 111.5 KB (-29%)
  k8s_node.svg:      494.9 KB → 360.3 KB (-27%)
  database_node.svg: 356.4 KB → 261.7 KB (-27%)
  favicon.svg:       11.9 KB → 5.1 KB    (-57%)

Visual diff sanity-checked: all sprites render pixel-identical
except cache_node which shifted 0.65/256 channels avg from SVGO
float rounding (imperceptible; not a structural change).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 9, 2026

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (13)
  • packages/web/public/favicon.svg is excluded by !**/*.svg
  • packages/web/public/sprites/auth_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/cache_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/carrot_pixels.svg is excluded by !**/*.svg
  • packages/web/public/sprites/database_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/docker_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/endpoint_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/external_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/k8s_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/queue_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/scheduler_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/service_node.svg is excluded by !**/*.svg
  • packages/web/public/sprites/user_node.svg is excluded by !**/*.svg

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 410e8d31-ffb5-420d-921a-803f2da1dc5c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/shrink-sprites

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

@naorsabag naorsabag merged commit be41b8c into master May 9, 2026
7 checks passed
naorsabag added a commit that referenced this pull request May 9, 2026
* chore: bump @openhop/web 0.1.0-beta.1 → 0.1.0-beta.2 and openhop CLI 0.1.0-beta.3 → 0.1.0-beta.4

Web bumps for the canvas/UI work since beta.1:
- pause behavior fix + label overflow + back-edge corridor (#90)
- carrot click opens inspect with multi-target highlight + on-canvas
  playback controls (#93)
- bookmark-style toggle tabs for sidebar + inspector (#95)
- preserve node progress on Play resume + drill-back (#96)
- shrink sprite SVGs by 46% (3.7MB → 2.0MB) (#97)

CLI bumps to ship the new web bundle (its only change is the pinned
@openhop/web dependency moving to 0.1.0-beta.2). @openhop/server
stays at 0.1.0-beta.1 — no changes since last publish.

* fix(cli): bump hardcoded --version to 0.1.0-beta.4

Test contract.test.ts asserts `openhop --version` matches the
package.json version. The bump in 9b373aa missed the duplicate
hardcoded string in src/index.ts:53. Sync them up so CI passes.
@naorsabag naorsabag deleted the chore/shrink-sprites branch May 10, 2026 17:38
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