Skip to content

refactor(css): WP1.1 sprint 5 — orphan cleanup (-67.5K lines) + hugo_stats cachebuster - #359

Merged
pftg merged 7 commits into
masterfrom
css-migration/wp1.1-sprint-5
Jul 12, 2026
Merged

pftg merged 7 commits into
masterfrom
css-migration/wp1.1-sprint-5

Conversation

@pftg

@pftg pftg commented Jul 12, 2026 •

Copy link
Copy Markdown
Member

Summary

Sprint-5 of Project 2509 CSS Migration: executes the sprint-4 cleanup follow-up queue. 28 files, +24 / -67,517 lines, zero compiled-output changes.

Commits

  1. 08b0c6e — delete dead aggregators critical.css, _consolidated-layouts.css, _consolidated-components.css + orphaned forms.css. Note: _consolidated-components.css was not on the sprint-4 list but is the same verified class (zero loaders); forms.css's only importer was that aggregator.
  2. 6a92e20 — delete all 13 orphan CSS files (66,459 lines): 9 fl-*-layout files, fl-clients{,-alt}-bundle, beaver-grid-layout, utilities.css. Only remaining references were provenance comments. Removes the ~157 untokenized #121212 literals counted in sprint 4.
  3. 23eda40 — delete dead variables/colors.css; fix the two stale comments pointing at it.
  4. c458213 — delete dead templates: page/service-template.html (no content uses the layout), partials/homepage/services.html + clients.html (zero external callers), partials/components/cta-block.html (only caller was the draft-only _test layout; its test section removed there).
  5. 31e0e9a — delete dead .c-content-block__paragraph rule pair (the sprint-4 documented inline-bundle flicker source) + commented-out forms import.
  6. 21ca378 — add [[build.cachebusters]] hugo_stats.json → css (Hugo defaults replicated, since custom entries replace them).

Verification (per commit)

  • Converged production build to scratch (build twice, take second) diffed against a converged pre-sprint baseline: all 19 css bundle hashes byte-identical, inline style blocks byte-identical, whole-tree HTML diff empty modulo documented noise (sw.js?v= stamp, taxonomy term-casing races).
  • bin/rake test:critical 46/46 (84 screenshots, 0 diffs) + bin/dtest 46/46, per commit. Zero rollbacks.
  • Cachebuster proof: after wiping the project hugo_cache + resources/_gen, the cold build now byte-matches the warm build. Before the fix, this sprint's own baseline reproduced the flicker — cold differed from warm by 7 inline navigation-bundle rules (incl. a body{font-family} rule).

New finding (pre-existing, NOT fixed here)

partials/page/header.html renders the whole header via partialCached with no variant key — nav -active state is computed once from whichever page renders first and reused on all ~1300 pages. One build during gating marked "Blog" active site-wide; steady state is no item ever active. Documented in the tracker as a follow-up (fixing it changes visuals and deserves its own PR).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes

    • Improved build cache invalidation to reduce stale CSS and JavaScript assets between builds.
    • Removed redundant styling definitions and consolidated legacy styles to improve consistency.
  • Refactor

    • Removed unused legacy layout, form, navigation, utility, and critical styling resources.
    • Retired outdated service, client, and call-to-action templates and homepage sections.
  • Documentation

    • Updated CSS migration tracking with completed work, retained exceptions, and follow-up items.

Paul Keen and others added 7 commits July 12, 2026 12:46
…youts.css, _consolidated-components.css + orphaned forms.css

All four verified zero loaders: no template resources.Get, no live @import
(components.css forms import is commented out; _consolidated-components.css
was the only forms.css importer and is itself bundled nowhere).

Gate: converged production build — 19 css bundle hashes identical, inline
style blocks identical; HTML diffs limited to documented noise (sw.js stamp,
taxonomy term-casing race). test:critical 46/46, dtest 46/46.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fl-{about,careers,clients,contact,homepage,services,use-cases,component,
service-detail}-layout.css, fl-clients{,-alt}-bundle.css,
beaver-grid-layout.css, utilities.css — zero loaders repo-wide; only
remaining references were provenance comments and the dead aggregators
removed in the previous commit. ~157 untokenized #121212 literals from
the sprint-4 count leave with them.

Gate: converged production build — all bundle hashes identical, inline
styles identical, zero non-noise HTML diffs. test:critical 46/46,
dtest 46/46.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
variables/colors.css is bundled nowhere (sprint-4 finding); its --color-dark
def duplicated the canonical one in foundations/css-variables.css. Updated
the two comments that still pointed at it (css-variables.css, c-navigation.css).

Gate: converged production build — bundles and inline styles byte-identical
(comments are stripped by cssnano). test:critical 46/46, dtest 46/46.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ervices+clients, cta-block

- page/service-template.html: no content sets its layout; was also the
  only loader of the already-deleted fl-service-detail-layout.css.
- partials/homepage/services.html + clients.html: services.html has zero
  callers; clients.html's only caller was services.html.
- partials/components/cta-block.html: only caller was the draft-only
  _test layout (content/_test is draft: true, never built) — removed
  that test section and renumbered.

Gate: converged production build — bundles + inline styles byte-identical,
zero non-noise HTML diffs; drafts-enabled build still compiles.
test:critical 46/46, dtest 46/46.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ed forms import

The __paragraph pair was the sprint-4 documented flicker source in the
inline components bundle: the class renders only in dead/draft templates,
so hugo_stats.json omits it and PurgeCSS drops it — except when a stale
postcss cache resurrected it between builds. Deleting the source rules
makes the purged state deterministic. Also dropped the commented-out
components/forms import (forms.css itself deleted earlier this sprint).

Gate: converged production build — bundles + inline styles byte-identical
across 404/home/blog/services, zero non-noise HTML diffs.
test:critical 46/46, dtest 46/46.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…che flicker)

PurgeCSS reads ./hugo_stats.json but Hugo's asset cache didn't invalidate
css targets when the stats file changed — a stale postcss cache could
resurrect purged rules between builds (sprint-4 documented flicker; this
sprint's baseline reproduced it: cold build differed from warm by 7 inline
navigation-bundle rules). Custom cachebusters replace Hugo's defaults, so
the defaults are replicated alongside the new rule.

Verified: after wiping the project hugo_cache + resources/_gen, cold build
now byte-matches the warm build (previously they diverged). Converged
output identical to sprint baseline. test:critical 46/46, dtest 46/46.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ader race documented

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR adds Hugo cachebuster rules, records CSS migration cleanup, removes legacy CSS bundles, utilities, templates, and homepage partials, updates token documentation, and adjusts the layout test ordering.

Changes

CSS migration cleanup

Layer / File(s) Summary
Cache configuration and migration tracking
config/_default/hugo.toml, docs/projects/2509-css-migration/TASK-TRACKER.md
Hugo cachebuster patterns now cover generated stats and asset files, while the tracker records sprint 5 cleanup and follow-up findings.
Legacy CSS source cleanup
themes/beaver/assets/css/*, themes/beaver/assets/css/components/*, themes/beaver/assets/css/foundations/*
Consolidated stylesheets, critical CSS, client and contact bundles, utilities, forms, color variables, and related imports were removed; navigation and token comments were updated, and content-block paragraph rules were deleted.
Template and homepage cleanup
themes/beaver/layouts/page/service-template.html, themes/beaver/layouts/partials/components/cta-block.html, themes/beaver/layouts/partials/homepage/*
The service template, CTA partial, and homepage clients and services sections were removed.
Layout test ordering
themes/beaver/layouts/_test/single.html
The CTA test was removed and the testimonial test was moved into section 3.
Estimated code review effort: 3 (Moderate) ~20 minutes

Possibly related PRs

Suggested reviewers: dgorodnichy, AucT

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the CSS cleanup and Hugo cachebuster additions in this PR.
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 css-migration/wp1.1-sprint-5

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

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

Inline comments:
In `@docs/projects/2509-css-migration/TASK-TRACKER.md`:
- Around line 557-608: Replace every em dash in the newly added TASK-TRACKER.md
content with a hyphen, including the sprint heading, commit descriptions,
finding label, and any other affected prose; preserve the surrounding wording
and Markdown structure.
- Around line 560-561: Update the dead-aggregators entry in TASK-TRACKER.md by
wrapping _consolidated-layouts.css and _consolidated-components.css in
backticks, preserving the surrounding text and formatting.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 65c853c3-29c3-4a18-8165-ae3557644bd3

📥 Commits

Reviewing files that changed from the base of the PR and between e2f81c0 and a761171.

📒 Files selected for processing (29)
  • config/_default/hugo.toml
  • docs/projects/2509-css-migration/TASK-TRACKER.md
  • themes/beaver/assets/css/_consolidated-layouts.css
  • themes/beaver/assets/css/beaver-grid-layout.css
  • themes/beaver/assets/css/components.css
  • themes/beaver/assets/css/components/_consolidated-components.css
  • themes/beaver/assets/css/components/c-navigation.css
  • themes/beaver/assets/css/components/content-block.css
  • themes/beaver/assets/css/components/forms.css
  • themes/beaver/assets/css/critical.css
  • themes/beaver/assets/css/fl-about-layout.css
  • themes/beaver/assets/css/fl-careers-layout.css
  • themes/beaver/assets/css/fl-clients-alt-bundle.css
  • themes/beaver/assets/css/fl-clients-bundle.css
  • themes/beaver/assets/css/fl-clients-layout.css
  • themes/beaver/assets/css/fl-component-layout.css
  • themes/beaver/assets/css/fl-contact-layout.css
  • themes/beaver/assets/css/fl-homepage-layout.css
  • themes/beaver/assets/css/fl-service-detail-layout.css
  • themes/beaver/assets/css/fl-services-layout.css
  • themes/beaver/assets/css/fl-use-cases-layout.css
  • themes/beaver/assets/css/foundations/css-variables.css
  • themes/beaver/assets/css/utilities.css
  • themes/beaver/assets/css/variables/colors.css
  • themes/beaver/layouts/_test/single.html
  • themes/beaver/layouts/page/service-template.html
  • themes/beaver/layouts/partials/components/cta-block.html
  • themes/beaver/layouts/partials/homepage/clients.html
  • themes/beaver/layouts/partials/homepage/services.html
💤 Files with no reviewable changes (14)
  • themes/beaver/assets/css/components/_consolidated-components.css
  • themes/beaver/layouts/partials/homepage/clients.html
  • themes/beaver/assets/css/fl-contact-layout.css
  • themes/beaver/assets/css/_consolidated-layouts.css
  • themes/beaver/assets/css/critical.css
  • themes/beaver/layouts/partials/components/cta-block.html
  • themes/beaver/assets/css/utilities.css
  • themes/beaver/layouts/partials/homepage/services.html
  • themes/beaver/assets/css/components.css
  • themes/beaver/layouts/page/service-template.html
  • themes/beaver/assets/css/variables/colors.css
  • themes/beaver/assets/css/components/forms.css
  • themes/beaver/assets/css/fl-clients-bundle.css
  • themes/beaver/assets/css/components/content-block.css

Comment on lines +557 to +608
### 2026-07-12 (sprint 5 — orphan cleanup)
- **Landed** (branch css-migration/wp1.1-sprint-5, one bundled PR, 6 commits,
28 files, +24/-67,517):
1. 08b0c6e3 — dead aggregators deleted: critical.css,
_consolidated-layouts.css, _consolidated-components.css (zero loaders;
the last was NOT on the sprint-4 list but is the same class — flagged),
plus forms.css (its only importer was _consolidated-components.css).
2. 6a92e204 — all 13 orphan CSS files deleted (66,459 lines): the 9
fl-*-layout files, fl-clients{,-alt}-bundle, beaver-grid-layout,
utilities.css. Only remaining refs were provenance comments. The ~157
untokenized #121212 literals from the sprint-4 count leave with them.
3. 23eda403 — dead variables/colors.css deleted; stale comments pointing
at it fixed (foundations/css-variables.css, c-navigation.css).
4. c458213b — dead templates deleted: page/service-template.html (no
content uses the layout; only loader of fl-service-detail-layout.css),
partials/homepage/services.html + clients.html (zero callers / only
called by each other), partials/components/cta-block.html (only caller
was the draft-only _test layout; test section removed there too).
5. 31e0e9a6 — dead .c-content-block__paragraph rule pair deleted from
content-block.css (the sprint-4 flicker source) + commented-out
components/forms import removed.
6. 21ca3789 — [[build.cachebusters]] hugo_stats.json → css added to
hugo.toml (Hugo defaults replicated alongside, since custom entries
replace them). Verified: cold-cache build now byte-matches warm build;
before the fix this sprint's own baseline reproduced the flicker (cold
differed from warm by 7 inline navigation-bundle rules).
- **Gate method**: per commit — converged production build to scratch
(build twice, take the second) diffed against a converged pre-sprint
baseline: all 19 css bundle hashes + inline style blocks byte-identical,
whole-tree HTML diff empty modulo documented noise (sw.js?v= stamp,
taxonomy term-casing races). test:critical 46/46 + dtest 46/46 per
commit. Zero rollbacks.
- **NEW FINDING — header partialCached race (pre-existing, NOT fixed)**:
partials/page/header.html caches header-content.html via partialCached
with NO variant key, so the whole header (incl. navigation -active
state) is computed once from whichever page renders first and reused on
ALL pages. One build during this sprint marked "Blog" -active on all
1300 pages; the steady state is NO item ever -active. Menu active-state
is effectively dead/nondeterministic site-wide. Fix (own change, visual
impact): key the cache by section/menu-state or drop active-state from
the cached fragment.
- **New follow-ups**:
- hero-section.html, testimonial.html, use-case-card.html + the _test
layout/content are only reachable via the draft-only test page —
delete-or-keep decision (they'd take the remaining
.c-content-block__text/.u-text-center dead classes with them).
- header partialCached -active race (above).
- **Carried follow-ups**: inline components tree tokenization (~19
literals) if components.css gets the foundation; --jt-text-color /
--cta-button-bg repoint decision (deliberate value change — Paul);
fl-common-modules.css Bootstrap reboot purge (own sprint); WP1.2.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Replace em dashes with hyphens per coding guidelines.

The new content uses em dashes (—) in several places (e.g., line 557 "sprint 5 — orphan cleanup", line 560 "08b0c6e3 — dead aggregators", line 589 "NEW FINDING — header partialCached race"). As per coding guidelines, **/*.md files should use -, not an em dash, in content.

📝 Proposed fix
-### 2026-07-12 (sprint 5 — orphan cleanup)
+### 2026-07-12 (sprint 5 - orphan cleanup)
-  1. 08b0c6e3 — dead aggregators deleted: critical.css,
+  1. 08b0c6e3 - dead aggregators deleted: critical.css,
-- **NEW FINDING — header partialCached race (pre-existing, NOT fixed)**:
+- **NEW FINDING - header partialCached race (pre-existing, NOT fixed)**:
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 561-561: Spaces inside emphasis markers

(MD037, no-space-in-emphasis)

🤖 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 `@docs/projects/2509-css-migration/TASK-TRACKER.md` around lines 557 - 608,
Replace every em dash in the newly added TASK-TRACKER.md content with a hyphen,
including the sprint heading, commit descriptions, finding label, and any other
affected prose; preserve the surrounding wording and Markdown structure.

Source: Coding guidelines

Comment on lines +560 to +561
1. 08b0c6e3 — dead aggregators deleted: critical.css,
_consolidated-layouts.css, _consolidated-components.css (zero loaders;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Wrap filenames with underscores in backticks to fix markdownlint MD037.

markdownlint flags line 561 because _consolidated-layouts.css and _consolidated-components.css are interpreted as emphasis markers with spaces inside. Wrap filenames in backticks to resolve the warning and improve readability.

[source_static_analysis_hints]

📝 Proposed fix
-  1. 08b0c6e3 — dead aggregators deleted: critical.css,
-     _consolidated-layouts.css, _consolidated-components.css (zero loaders;
+  1. 08b0c6e3 - dead aggregators deleted: `critical.css`,
+     `_consolidated-layouts.css`, `_consolidated-components.css` (zero loaders;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. 08b0c6e3 — dead aggregators deleted: critical.css,
_consolidated-layouts.css, _consolidated-components.css (zero loaders;
1. 08b0c6e3 - dead aggregators deleted: `critical.css`,
`_consolidated-layouts.css`, `_consolidated-components.css` (zero loaders;
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)

[warning] 561-561: Spaces inside emphasis markers

(MD037, no-space-in-emphasis)

🤖 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 `@docs/projects/2509-css-migration/TASK-TRACKER.md` around lines 560 - 561,
Update the dead-aggregators entry in TASK-TRACKER.md by wrapping
_consolidated-layouts.css and _consolidated-components.css in backticks,
preserving the surrounding text and formatting.

@pftg
pftg merged commit 583591c into master Jul 12, 2026
3 checks passed
@pftg
pftg deleted the css-migration/wp1.1-sprint-5 branch July 12, 2026 11:59
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