Skip to content

fix: brand color overrides, v0.4.2 release, readme, changelog - #85

Merged
jackgranatowski merged 4 commits into
mainfrom
claude/wp-plugin-readme-rewrite-3klmvg
Jun 28, 2026
Merged

fix: brand color overrides, v0.4.2 release, readme, changelog#85
jackgranatowski merged 4 commits into
mainfrom
claude/wp-plugin-readme-rewrite-3klmvg

Conversation

@jackgranatowski

@jackgranatowski jackgranatowski commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Three bugs fixed and the readme/changelog cleaned up:

Brand color overrides silently failingclass-css-generator.php was emitting --sf-color-*-light/-dark but 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 zipchangelog-release.js used /^v/ (lowercase only) to strip the tag prefix, so a V0.4.2 tag wrote V0.4.2 into all version fields. version-sync.js then couldn't match the Stable tag field because its pattern required a bare semver. Fixed with /^v/i in both scripts, and added SEMVER_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

  • fix
  • feat
  • docs
  • chore / tooling

Checklist

  • Conventional Commit messages (feat:, fix:, docs:, …)
  • npm run verify passes (version metadata in sync)
  • CHANGELOG.md updated under ## [Unreleased] (for user-facing changes)

Notes

The class-inventory.php comment was updated to document the two-path architecture: get_admin_color_overrides() uses -light/-dark keys 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

    • Design Settings color overrides now apply more reliably to the live site for brand and status colors.
  • Bug Fixes

    • Improved handling of version tags so releases work correctly even when tags use v or V.
    • Fixed version information consistency across the plugin and related release files.
    • Cleaned up the changelog to remove duplicate release entries and improve readability.

Claude and others added 2 commits June 28, 2026 22:12
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>
@coderabbitai

coderabbitai Bot commented Jun 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@jackgranatowski, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: dad592bf-09e7-4f54-b651-6b2871b096ac

📥 Commits

Reviewing files that changed from the base of the PR and between adb62df and 3d8cf35.

📒 Files selected for processing (2)
  • scripts/changelog-release.js
  • scripts/version-sync.js
📝 Walkthrough

Walkthrough

Fixes mis-cased V-prefixed version strings across plugin PHP files, readme.txt, and package.json to bare 0.4.2. Updates release scripts to strip v/V case-insensitively. Renames CSS color custom property suffixes from -light/-dark to -source-light/-source-dark. Deduplicates repeated version blocks in CHANGELOG.md.

Changes

Version normalization, CSS token rename, and changelog cleanup

Layer / File(s) Summary
Release scripts: case-insensitive v/V tag stripping
scripts/version-sync.js, scripts/changelog-release.js
version-sync.js adds SEMVER_MATCH regex for optional leading v/V and uses it in all README, plugin header, and define() replace operations; resolveVersion() in both scripts now strips v/V case-insensitively when resolving tags.
Plugin and package version strings corrected to 0.4.2
SLASHED-for-WP/slashed.php, SLASHED-for-WP/integrations/bricks/slashed-bricks.php, SLASHED-for-WP/integrations/gutenberg/slashed-gutenberg.php, SLASHED-for-WP/readme.txt, package.json
Plugin header Version: fields, SLASHED_VERSION/SLASHED_BRICKS_VERSION/SLASHED_GUTENBERG_VERSION constants, readme stable tag, and package version changed from V0.4.2 to 0.4.2.
CSS color custom property suffix rename
SLASHED-for-WP/includes/class-css-generator.php, SLASHED-for-WP/includes/class-inventory.php
generate_color_declarations() now emits --sf-color-*-source-light and --sf-color-*-source-dark instead of --sf-color-*-light/--sf-color-*-dark; comments in class-inventory.php updated to document the distinction between hex-preview resolver keys and frontend source tokens.
CHANGELOG.md deduplication
CHANGELOG.md
Repeated version blocks for V0.4.2, 0.4.1, 0.3.15, 0.3.14/0.3.13, 0.3.9, 0.3.8, 0.3.6, 0.3.5/0.3.4, 0.3.2, 0.3.0, and 0.2.7 removed so each version header and its subsections appear exactly once.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.86% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly reflects the main changes: brand color overrides, release/version sync, and documentation updates.
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 claude/wp-plugin-readme-rewrite-3klmvg

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.

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Fix frontend brand color tokens and harden v0.4.2 release/version sync
🐞 Bug fix 📝 Documentation ⚙️ Configuration changes 🕐 20-40 Minutes

Grey Divider

Description

• Emit framework-recognized color source variables so Design Settings overrides apply on the
 frontend.
• Harden release/version sync to tolerate v/V-prefixed tags and heal corrupted version fields.
• Clean up end-user docs: rewrite readme and dedupe/merge repeated CHANGELOG sections.
Diagram

graph TD
A["Design Settings (WP admin)"] --> B[("Token settings (WP options)")] --> C["CSS generator"] --> D[/"Frontend CSS variables"/]
B --> E["Editor preview resolver"]
F{{"Git tag"}} --> G["Release tooling"] --> H[/"Versioned metadata (readme/changelog/headers/package)"/]
subgraph Legend
direction LR
_cmp["Component"] ~~~ _db[("Storage")] ~~~ _doc[/"Files"/] ~~~ _ext{{"External"}}
end
Loading
High-Level Assessment

The following are alternative approaches to this PR:

1. Use a semver parser library for tag/version handling
  • ➕ More robust parsing/validation for prereleases/build metadata and edge cases
  • ➕ Avoids maintaining custom regexes across scripts
  • ➖ Adds dependency/supply-chain surface area for a small need
  • ➖ Requires aligning ESM usage and lockfile updates in the release pipeline
2. Enforce lowercase tag format at the workflow/repo level
  • ➕ Prevents mis-cased tags from being created in the first place
  • ➕ Keeps tooling simpler by reducing recovery logic
  • ➖ Doesn’t heal already-corrupted version fields without additional logic
  • ➖ May require org/repo policy changes or additional CI checks

Recommendation: The PR’s approach is a good balance: it both fixes the immediate release breakage and makes the tooling self-healing for future runs. If tag/version edge cases expand (prereleases, build metadata), adopting a semver library would be the next pragmatic step; otherwise, the current lightweight regex + validation is appropriate.

Files changed (10) +69 / -292

Bug fix (1) +4 / -4
class-css-generator.phpEmit correct framework color source tokens for overrides +4/-4

Emit correct framework color source tokens for overrides

• Changes emitted custom properties for brand/status overrides from '--sf-color-*-light/-dark' to '--sf-color-*-source-light/-source-dark'. This aligns with the framework bundle’s expected inputs so Design Settings colors affect the live site.

SLASHED-for-WP/includes/class-css-generator.php

Documentation (3) +37 / -275
CHANGELOG.mdDeduplicate repeated version sections and consolidate entries +18/-254

Deduplicate repeated version sections and consolidate entries

• Removes duplicated release headers (including repeated 0.4.x and earlier sections) produced by prior automation runs. Leaves a single canonical section per version with merged unique bullet items.

CHANGELOG.md

class-inventory.phpClarify preview-vs-frontend token naming for color overrides +16/-7

Clarify preview-vs-frontend token naming for color overrides

• Updates inline documentation explaining that the PHP preview resolver intentionally uses '-light/-dark' keys, while the frontend CSS generator emits '-source-light/-source-dark'. Tightens comments around source/derived families and the sync requirement for the family list.

SLASHED-for-WP/includes/class-inventory.php

readme.txtRewrite readme and correct Stable tag/changelog for 0.4.2 +3/-14

Rewrite readme and correct Stable tag/changelog for 0.4.2

• Updates 'Stable tag' to a clean numeric '0.4.2' and refreshes the readme’s changelog entry to reflect current user-facing fixes. Overall readme content is refreshed for accuracy and current feature descriptions.

SLASHED-for-WP/readme.txt

Other (6) +28 / -13
slashed-bricks.phpNormalize Bricks integration version strings to semver +2/-2

Normalize Bricks integration version strings to semver

• Fixes the plugin header 'Version:' and 'SLASHED_BRICKS_VERSION' constant from 'V0.4.2' to '0.4.2' to restore a numeric semver value.

SLASHED-for-WP/integrations/bricks/slashed-bricks.php

slashed-gutenberg.phpNormalize Gutenberg integration version strings to semver +2/-2

Normalize Gutenberg integration version strings to semver

• Fixes the plugin header 'Version:' and 'SLASHED_GUTENBERG_VERSION' constant from 'V0.4.2' to '0.4.2' to restore a numeric semver value.

SLASHED-for-WP/integrations/gutenberg/slashed-gutenberg.php

slashed.phpNormalize core plugin version header/constant to semver +2/-2

Normalize core plugin version header/constant to semver

• Fixes the main plugin header 'Version:' and 'SLASHED_VERSION' constant from 'V0.4.2' to '0.4.2' so version-sync and release tooling can match/update reliably.

SLASHED-for-WP/slashed.php

package.jsonCorrect package.json version to numeric semver +1/-1

Correct package.json version to numeric semver

• Changes the package version from 'V0.4.2' to '0.4.2', restoring the canonical semver value used by tooling.

package.json

changelog-release.jsStrip v/V tag prefix case-insensitively for changelog generation +4/-2

Strip v/V tag prefix case-insensitively for changelog generation

• Updates version derivation and latest-tag comparisons to use '/^v/i' so mis-cased tags like 'V0.4.2' don’t leak into generated changelog headings or logic branches.

scripts/changelog-release.js

version-sync.jsMake version sync self-healing for v/V-prefixed values and validate semver +17/-4

Make version sync self-healing for v/V-prefixed values and validate semver

• Introduces a tolerant 'SEMVER_MATCH' pattern ('[vV]?…') so previously corrupted fields (e.g., 'Stable tag: V0.4.2') can still be found and rewritten. Also strips tag prefixes case-insensitively when resolving '--from-tag' and validates the resolved version is a clean semver before stamping files.

scripts/version-sync.js

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
scripts/changelog-release.js (1)

55-57: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add semver validation after stripping the tag.

changelog-release.js::resolveVersion() strips the leading v/V but does not validate the result, unlike version-sync.js which 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.js uses:

    // 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

📥 Commits

Reviewing files that changed from the base of the PR and between 3a20ad3 and adb62df.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (10)
  • CHANGELOG.md
  • SLASHED-for-WP/includes/class-css-generator.php
  • SLASHED-for-WP/includes/class-inventory.php
  • SLASHED-for-WP/integrations/bricks/slashed-bricks.php
  • SLASHED-for-WP/integrations/gutenberg/slashed-gutenberg.php
  • SLASHED-for-WP/readme.txt
  • SLASHED-for-WP/slashed.php
  • package.json
  • scripts/changelog-release.js
  • scripts/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>
@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Qodo Logo

Comment thread scripts/changelog-release.js Fixed
[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>
@jackgranatowski
jackgranatowski merged commit 32f7696 into main Jun 28, 2026
9 checks passed
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.

3 participants