fix: brand color overrides, v0.4.2 release, readme, changelog - #85
Conversation
Two issues:
1. Brand/status color overrides set in Design Settings never recolored
the live site. Slashed_CSS_Generator emitted --sf-color-{family}-light
/ -dark, but the framework reads its brand inputs from
--sf-color-{family}-source-light / -source-dark. The emitted names were
neither defined nor read by the bundle, so every override was a no-op.
Emit the -source-light / -source-dark source tokens instead. Updates the
now-stale sync comments in Slashed_Inventory (its hex-preview resolver
keeps its own -light/-dark lookup, which is a separate, self-consistent
subsystem).
2. The v0.4.2 release built no plugin zip. A mis-cased tag baked the
literal string "V0.4.2" into every version field (package.json,
readme Stable tag, Version: headers, *_VERSION constants, changelog
headers). version-sync.js then failed with "pattern not found" on the
non-numeric readme Stable tag, aborting the release run before the zip
step. Heal all version fields back to 0.4.2, and harden the tooling:
- version-sync.js / changelog-release.js strip a leading v/V
case-insensitively and validate the resolved version is numeric.
- version-sync.js match patterns tolerate a stray leading v/V so a
corrupted value is found and rewritten on the next run.
Note: CHANGELOG.md has pre-existing duplicate sections across all
versions from the changelog automation; only the V0.4.2 headers from
this incident are corrected here.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H3KFf8JG1y9JspxUCnJer3
Every version from 0.3.0 through 0.4.2 had 2–4 duplicate ## [X.Y.Z] headers caused by the changelog automation inserting sections without checking for existing entries. Merge to one block per version, taking the union of unique items across all duplicates, and remove ~250 lines of redundant content. Co-Authored-By: Claude <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 51 minutes and 29 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughFixes mis-cased ChangesVersion normalization, CSS token rename, and changelog cleanup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
PR Summary by QodoFix frontend brand color tokens and harden v0.4.2 release/version sync Description
Diagram
High-Level Assessment
Files changed (10)
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/changelog-release.js (1)
55-57: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd semver validation after stripping the tag.
changelog-release.js::resolveVersion()strips the leadingv/Vbut does not validate the result, unlikeversion-sync.jswhich throws when the tag does not resolve to a valid version. A malformed tag (e.g.,Vbad) would silently produce a malformed changelog heading.Add the same validation guard that
version-sync.jsuses:// Strip a leading v/V case-insensitively so a mis-cased tag like `V0.4.2` // doesn't produce a `= V0.4.2 =` changelog heading. const version = tag.replace(/^v/i, ''); + if (!/^\d+\.\d+\.\d+(?:[-.][A-Za-z0-9.]+)*$/.test(version)) { + console.error(`changelog-release: tag "${tag}" does not resolve to a valid version`); + process.exit(1); + } return version;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/changelog-release.js` around lines 55 - 57, resolveVersion() currently strips a leading v/V but then returns whatever remains without checking it is a valid semver, which can lead to malformed changelog headings for bad tags like Vbad. Update changelog-release.js so that after the tag is normalized, it applies the same validation guard used in version-sync.js and throws when the result is not a valid version, keeping the behavior consistent between resolveVersion() and the version-sync flow.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@scripts/changelog-release.js`:
- Around line 55-57: resolveVersion() currently strips a leading v/V but then
returns whatever remains without checking it is a valid semver, which can lead
to malformed changelog headings for bad tags like Vbad. Update
changelog-release.js so that after the tag is normalized, it applies the same
validation guard used in version-sync.js and throws when the result is not a
valid version, keeping the behavior consistent between resolveVersion() and the
version-sync flow.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 83cf317f-b950-4177-b516-4b3f5a857761
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (10)
CHANGELOG.mdSLASHED-for-WP/includes/class-css-generator.phpSLASHED-for-WP/includes/class-inventory.phpSLASHED-for-WP/integrations/bricks/slashed-bricks.phpSLASHED-for-WP/integrations/gutenberg/slashed-gutenberg.phpSLASHED-for-WP/readme.txtSLASHED-for-WP/slashed.phppackage.jsonscripts/changelog-release.jsscripts/version-sync.js
Matches the guard already present in version-sync.js — a malformed tag like `Vbad` now exits with an error instead of silently producing a corrupt changelog heading. Co-Authored-By: Claude <noreply@anthropic.com>
[A-Za-z0-9.]+ inside a *-repeated group allows exponential backtracking on inputs like "0.0.0-......". Replace with [A-Za-z0-9]+(?:\.[A-Za-z0-9]+)* so dots are explicit separators and each segment is unambiguously alphanumeric-only. Applied to both version-sync.js (SEMVER constant) and changelog-release.js (validation guard). Co-Authored-By: Claude <noreply@anthropic.com>
Summary
Three bugs fixed and the readme/changelog cleaned up:
Brand color overrides silently failing —
class-css-generator.phpwas emitting--sf-color-*-light/-darkbut the framework reads--sf-color-*-source-light/-source-dark. Colors set in Design Settings had no effect on the live site.v0.4.2 release produced no zip —
changelog-release.jsused/^v/(lowercase only) to strip the tag prefix, so aV0.4.2tag wroteV0.4.2into all version fields.version-sync.jsthen couldn't match theStable tagfield because its pattern required a bare semver. Fixed with/^v/iin both scripts, and addedSEMVER_MATCH = [vV]?\d+...to version-sync so it can heal any pre-existing prefixed values.readme.txt stale and inaccurate — Rewritten from scratch: correct bundle contents, correct token names, accurate Gutenberg panel description, user-facing changelog.
CHANGELOG.md duplicate sections — Every version from 0.3.0 through 0.4.2 had 2–4 duplicate
## [X.Y.Z]headers from the changelog automation running repeatedly without deduplication. Merged to one block per version (union of unique items), removing ~250 lines.Type
Checklist
feat:,fix:,docs:, …)npm run verifypasses (version metadata in sync)CHANGELOG.mdupdated under## [Unreleased](for user-facing changes)Notes
The
class-inventory.phpcomment was updated to document the two-path architecture:get_admin_color_overrides()uses-light/-darkkeys for the PHP hex-preview resolver (intentional, self-consistent subsystem), while the frontend CSS generator uses-source-light/-source-dark(what the framework CSS actually reads).Generated by Claude Code
Summary by CodeRabbit
New Features
Bug Fixes
vorV.