Skip to content

repo(chore): scope ImgBot away from hand-authored art and visual baselines - #424

Merged
Ducksss merged 1 commit into
devfrom
chore/imgbot-exclude-authored-art
Aug 3, 2026
Merged

Ducksss merged 1 commit into
devfrom
chore/imgbot-exclude-authored-art

Conversation

@Ducksss

@Ducksss Ducksss commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Why

#390 was opened as a 27-file SVG optimization but its diff was 266 files, +67 / −45,165. ImgBot's own commit (d2bca444) was clean and correct — the damage came from 34 replayed pre-squash dev commits beneath it that resurrected a pre-July tree.

Because merge-base(main, imgbot) was main's own tip, the deletions were real, not the usual cosmetic squash-promote flag:

Target Merge base Files deleted
main main's own tip 158
dev ddd8eb08 (2026-07-24) 109

Either way it took out payload-components/registry.json, the source/blocks/ tree, add.ts / doctor.ts / project.ts, and (into main) package.json and pnpm-lock.yaml. #390 is now closed.

What this does

Scopes the bot so a future run has less to churn over:

  • public/blog/** — the figure-01 diagrams are hand-authored SVG with embedded CSS. Minification is technically clean (verified: visible text, <title>/<desc>, viewBox, role, and all ids/refs preserved) but the win is 4.7 KB gzipped across 27 files — ~0.17 KB per figure, and each blog post loads exactly one. Not worth collapsing 26 maintained diagrams to single lines.
  • public/favicon.svg — already minimal at 343 B; the entire advertised "0.29% reduction" was stripping its trailing newline.
  • tests/e2e/** — Playwright visual-regression baselines are golden captures. A bot should never re-encode them.

aggressiveCompression stays off (lossless only), and minKBReduced goes from the default 10 to 50 so trivial PRs aren't opened. Raster assets elsewhere — e.g. the public/docs/admin screenshots — are still optimized normally.

Caveat

ImgBot reads .imgbotconfig from the repository's default branch, so this only takes effect once dev is promoted to main. Until then a new ImgBot PR is still possible.

Test plan

  • .imgbotconfig is valid JSON
  • prettier --check passes (prettier --check . does match this file, so it needed formatting to clear the gated format:check)
  • No source, test, or build input touched — single added config file

Summary by CodeRabbit

  • Chores
    • Added image optimization settings to exclude specified files, disable aggressive compression, and skip optimizations below a 50 KB reduction threshold.

…lines

ImgBot PR #390 was closed as unmergeable: its branch carried 34 replayed
pre-squash dev commits that resurrected an old tree, so merging would have
deleted 158 files from main (109 from dev), including package.json,
pnpm-lock.yaml, registry.json and the CLI. ImgBot's own commit was clean.

Scope the bot so a future run has less to churn over:

- public/blog/**      the figure-01 diagrams are hand-authored SVG with
                      embedded CSS. Minifying collapses each to one line
                      for ~0.17 KB gzipped per figure, and each blog post
                      loads exactly one figure — not worth losing
                      diff-ability on maintained source art.
- public/favicon.svg  already minimal; the only available "saving" is
                      stripping its trailing newline.
- tests/e2e/**        Playwright visual-regression baselines are golden
                      captures. A bot must never re-encode them.

aggressiveCompression stays off (lossless only) and minKBReduced is raised
from the default 10 to 50 so trivial PRs are not opened.

Raster assets outside those paths (public/docs/admin screenshots) are still
optimized normally.

Co-Authored-By: Claude Opus 5 <[email protected]>
Copilot AI review requested due to automatic review settings August 2, 2026 17:58
@vercel

vercel Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
payload-components Ready Ready Preview Aug 2, 2026 6:02pm
payload-components-97bf Ready Ready Preview Aug 2, 2026 6:02pm

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c9c1f662-8331-4e0c-b3e1-9a86c3654c59

📥 Commits

Reviewing files that changed from the base of the PR and between ac20166 and f773581.

📒 Files selected for processing (1)
  • .imgbotconfig

📝 Walkthrough

Walkthrough

Added .imgbotconfig to define ignored paths, disable aggressive compression, and require a minimum 50 KB reduction.

Changes

ImgBot configuration

Layer / File(s) Summary
Configure ImgBot
.imgbotconfig
Defines ignored paths, disables aggressive compression, and sets a 50 KB minimum reduction threshold.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested reviewers: copilot

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the primary change: limiting ImgBot scope for maintained artwork and visual baselines.
Description check ✅ Passed The description clearly explains the change, rationale, affected paths, caveat, and completed verification steps.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/imgbot-exclude-authored-art

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.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an ImgBot configuration file to reduce bot churn by excluding hand-authored SVG diagrams and Playwright visual-regression baselines from automated “optimization” PRs, keeping the docs site + registry repo stable while still allowing optimization of other raster assets.

Changes:

  • Add .imgbotconfig to ignore public/blog/**, public/favicon.svg, and tests/e2e/** from ImgBot runs.
  • Keep aggressiveCompression disabled and raise minKBReduced to 50KB to avoid trivial PRs.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .imgbotconfig
Comment on lines +2 to +3
"ignoredFiles": ["public/blog/**", "public/favicon.svg", "tests/e2e/**"],
"aggressiveCompression": "false",
@Ducksss
Ducksss enabled auto-merge (squash) August 2, 2026 18:02
@Ducksss
Ducksss merged commit 1fb89d1 into dev Aug 3, 2026
13 checks passed
@Ducksss
Ducksss deleted the chore/imgbot-exclude-authored-art branch August 3, 2026 08:58

This branch was successfully deployed

2 active deployments
Preview – payload-components — f7735812 Deployed Aug 2, 2026 by vercel[bot]
Preview – payload-components-97bf — f7735812 Deployed Aug 2, 2026 by vercel[bot]
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.

2 participants