Skip to content

Work Archive Template: Audit & Fix (LS-2244) - #19

Open
brandonmarshal wants to merge 7 commits into
developfrom
feature/ls-2244-work-archive-template-audit-fix
Open

Work Archive Template: Audit & Fix (LS-2244)#19
brandonmarshal wants to merge 7 commits into
developfrom
feature/ls-2244-work-archive-template-audit-fix

Conversation

@brandonmarshal

@brandonmarshal brandonmarshal commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Audited the archive-work template and its section patterns for broken/recurring paragraph block errors (LS-2244) and rebuilt the affected blocks to match approved DEV markup
  • Fixed Stats Grid card borders/heights and relocated block style variation files to WordPress's actual auto-discovery path
  • Added a custom breakpoint for the Selected Projects grid (3→2→1 columns) and the Stats Grid card row (4→2 columns), since WordPress has no native attribute for a custom pixel breakpoint here
  • Centered Related Routes card icons and adjusted Selected Projects filter spacing
  • Added generic, reusable Playwright assertion helpers (tests/helpers/assertions.ts) extracted from manually QA-testing this template, plus an example spec for the upcoming work-single template
  • Added a hover/focus-within state (lift, border, shadow) to the Selected Projects cards, matching the existing card-motion treatment used elsewhere on the page
  • Added a new surface.canvas-alt design token (light + dark values, WCAG AA 2.2 verified) and a content-band-alt style variation, applied to the Selected Projects and Discuss Project sections for an alternating section background rhythm
  • Fixed a pre-existing text.brand contrast gap by swapping brand-500 for brand-600 so it clears 4.5:1 AA against canvas, card, and canvas-alt backgrounds

Closes LS-2244

Test plan

  • Manually QA'd all 19 test cases against the Work Archive page on localhost (mobile, tablet, desktop)
  • Verified Selected Projects and Stats Grid breakpoints at every checkpoint (375/600/700/800/834/900px)
  • Verified new card hover/focus states in the browser
  • Verified surface.canvas-alt and text.brand contrast ratios against WCAG AA 2.2 (4.5:1) for all text tokens used directly on section bands
  • npm run build:css compiles cleanly
  • AI + Zared review

Summary by CodeRabbit

  • New Features

    • Added a tinted alternate content style for selected sections.
    • Improved responsive layouts for statistics and selected-project grids.
    • Added expanded project-category filtering with visible result counts.
    • Added interactive hover and focus states for case-study cards, with reduced-motion support.
    • Added improved card dividers, spacing, alignment, and brand color treatments.
    • Updated dark-theme surface and color options.
  • Bug Fixes

    • Improved mobile and tablet readability by preventing cramped layouts and divider issues.
  • Tests

    • Added coverage for Work page structure, navigation, card content, responsive grids, and visual styling.

brandonmarshal and others added 6 commits August 4, 2026 13:09
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ilter spacing

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…grid; update text for clarity and add Playwright test helpers for improved testing coverage.
- Add hover/focus-within lift, border, and shadow to
  is-style-card-case-study (Selected Projects cards), matching the
  existing card-motion treatment used elsewhere on the page
- Add surface.canvas-alt token (theme.json + styles/dark.json) with
  new neutral-150/neutral-850 palette swatches, verified against WCAG
  AA 2.2 for text tokens rendered directly on section bands
- Fix text.brand contrast: swap brand-500 for brand-600 so it clears
  4.5:1 AA on canvas, card, and canvas-alt backgrounds
- Add content-band-alt style variation (canvas-alt background, 16px
  radius) and apply it to the Selected Projects and Discuss Project
  sections for an alternating section rhythm down the page
@brandonmarshal brandonmarshal added area:design-system Tokens/components guidelines area:theme Theme & styles (templates, template parts, FSE) comp:block-patterns Patterns library/registration comp:section-styles Section/background styles comp:theme-json Tokens, presets, settings lang:css Stylesheets lang:json JSON config/content lang:php PHP code status:needs-review Awaiting code review labels Aug 6, 2026
@linear-code

linear-code Bot commented Aug 6, 2026

Copy link
Copy Markdown

LS-2244

@brandonmarshal brandonmarshal self-assigned this Aug 6, 2026
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@brandonmarshal, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 37 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

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

How do review 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 refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1ade1fc5-76fd-40cf-9ec8-586f5d33d0c5

📥 Commits

Reviewing files that changed from the base of the PR and between c709cc0 and 97481f7.

📒 Files selected for processing (10)
  • assets/css/animations.css
  • patterns/hero/work-hero.php
  • patterns/sections/work-categories.php
  • patterns/sections/work-discuss-project.php
  • patterns/sections/work-related-routes.php
  • patterns/sections/work-selected-projects.php
  • src/scss/animations/_card-motion.scss
  • src/scss/sections/_stats-grid.scss
  • tests/helpers/assertions.ts
  • tests/specs/work-single.spec.ts

Note

.coderabbit.yml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key: "version"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

The PR refines Work page patterns, statistics layouts, theme styles, responsive behavior, card motion, and Playwright coverage. It adds alternate content bands, updates color tokens, adjusts card alignment, and validates the Work Single template across viewports.

Changes

Work page refinement

Layer / File(s) Summary
Theme and style foundations
styles/blocks/..., styles/dark.json, styles/sections/..., theme.json
Adds alternate content-band, divider, and surface styles. Adds neutral palette tokens and updates surface and brand color mappings.
Statistics layout
patterns/section-stats-grid.php, patterns/cards/work-engagement-stat.php
Reorganizes statistics into nested column groups with borders, wrapping labels, updated alignment, and revised supporting copy.
Work pattern updates
patterns/hero/..., patterns/sections/..., patterns/cards/work-next-steps-card.php
Updates Work section styles, eyebrow icons, selected-project filtering, card alignment, and column sizing.
Motion and responsive behavior
src/scss/animations/..., src/scss/sections/..., assets/css/animations.css
Adds case-study card hover and focus motion with reduced-motion overrides. Adds responsive rules for statistics and selected-project grids.
Work page validation
tests/helpers/assertions.ts, tests/specs/work-single.spec.ts
Adds reusable Playwright assertions and Work Single coverage for structure, card content, navigation, responsive grids, and computed styles.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: lang:js, release:patch

Suggested reviewers: zaredrogers

🚥 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 clearly identifies the Work Archive Template audit and fixes, which match the primary objectives of the pull request.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/ls-2244-work-archive-template-audit-fix

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.

@mergify

mergify Bot commented Aug 6, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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

This PR updates the LightSpeed Theme’s Work archive section patterns and supporting styles/tokens to resolve recurring block markup issues, improve responsive layout/styling (Selected Projects + Stats Grid), and introduce a new alternate “content band” surface treatment. It also adds generic Playwright assertion helpers plus an example spec intended to demonstrate how those helpers would be used for a future Work Single template.

Changes:

  • Extended theme.json colour palette and semantic colour mappings (incl. new surface.canvas-alt and improved text.brand contrast), with a matching dark-mode semantic mapping.
  • Added/relocated block/style-variation JSON and Sass overrides to fix Stats Grid borders/heights and introduce a custom 3→2→1 and 4→2 responsive behaviour where core attributes are insufficient.
  • Added Playwright assertion helpers and an example Work Single spec.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
theme.json Adds new palette steps and updates semantic colour mappings (brand + canvas-alt).
styles/dark.json Adds dark-mode mapping for the new surface.canvas-alt semantic token.
styles/sections/content/content-band-alt.json Introduces a section style variation using the new canvas-alt surface.
styles/blocks/groups/stat-segment.json Adjusts the Stat Segment style variation (removes inline css).
styles/blocks/columns/card-divider-both.json Adds a Columns style variation to standardise top/bottom dividers and equal-height behaviour.
src/scss/sections/_stats-grid.scss Adds a custom breakpoint override for the Stats Grid layout and divider behaviour.
src/scss/sections/_selected-projects.scss Adds an intermediate 2-column breakpoint for the Selected Projects query grid.
src/scss/animations/_card-motion.scss Adds hover/focus-within motion treatment for case-study cards + reduced-motion handling.
src/scss/animations.scss Wires the new section Sass partials into the compiled CSS output.
assets/css/animations.css Compiled CSS output for the new motion + section breakpoint rules.
patterns/sections/work-selected-projects.php Applies the new content band alt section style and updates filter/query markup.
patterns/sections/work-related-routes.php Adjusts layout alignment and updates eyebrow/icon markup.
patterns/sections/work-discuss-project.php Applies the new content band alt section style and adjusts columns sizing/markup.
patterns/sections/work-categories.php Replaces the eyebrow badge pattern with inline eyebrow/icon markup.
patterns/section-stats-grid.php Rebuilds the Stats Grid structure to fix borders/heights and breakpoint behaviour.
patterns/hero/work-hero.php Updates eyebrow/icon markup in the Work archive hero.
patterns/cards/work-next-steps-card.php Updates card layout alignment to vertically centre icon/content.
patterns/cards/work-engagement-stat.php Updates segment markup (border + spacing + copy).
tests/helpers/assertions.ts Adds reusable Playwright assertion helpers for template/pattern QA.
tests/specs/work-single.spec.ts Adds an example Playwright spec for a future Work Single template.
Suppressed comments (1)

tests/helpers/assertions.ts:118

  • getPropertyValue() often returns values with leading/trailing whitespace; comparing untrimmed strings makes this assertion brittle across browsers/properties.
	const value = await page
		.locator(selector)
		.first()
		.evaluate((el, prop) => getComputedStyle(el).getPropertyValue(prop), property);

Comment thread tests/specs/work-single.spec.ts Outdated
Comment thread tests/helpers/assertions.ts Outdated
Comment thread tests/helpers/assertions.ts
Comment thread patterns/sections/work-discuss-project.php Outdated
Comment thread patterns/sections/work-selected-projects.php Outdated
Comment thread patterns/sections/work-related-routes.php Outdated
Comment thread patterns/sections/work-discuss-project.php Outdated
Comment thread patterns/sections/work-categories.php Outdated
Comment thread patterns/hero/work-hero.php Outdated

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

Actionable comments posted: 7

🧹 Nitpick comments (1)
src/scss/sections/_stats-grid.scss (1)

15-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the shared breakpoint mixin in both section partials.

Both new partials add raw media queries instead of using the repository breakpoint abstraction.

  • src/scss/sections/_stats-grid.scss#L15-L15: express the 833.98px threshold through the shared mq mixin.
  • src/scss/sections/_selected-projects.scss#L12-L12: express the 601px-to-800px interval through the shared mq mixin.

As per path instructions, src/scss/**/*.scss must reuse the shared breakpoint mixin.

🤖 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 `@src/scss/sections/_stats-grid.scss` at line 15, Replace the raw media query
in src/scss/sections/_stats-grid.scss:15 with the shared mq mixin for the
833.98px threshold. Also update src/scss/sections/_selected-projects.scss:12 to
express the 601px-to-800px interval through mq, preserving each partial’s
existing responsive behavior.

Source: Path instructions

🤖 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 `@patterns/sections/work-discuss-project.php`:
- Around line 22-23: Update the wp:columns block markup to keep its serialized
style.spacing.blockGap and rendered gap styling consistent: either restore the
corresponding rendered gap style or remove the stale style object from the block
comment, while preserving the intended layout.

In `@src/scss/animations/_card-motion.scss`:
- Around line 249-255: Add an empty line between the custom properties and the
transition declaration in the case-study rule in
src/scss/animations/_card-motion.scss (lines 249-255), then regenerate the
corresponding compiled rule in assets/css/animations.css (lines 409-414) so both
sources satisfy Stylelint and remain synchronized.

In `@src/scss/sections/_selected-projects.scss`:
- Around line 12-14: The responsive grid breakpoint is inconsistent with the
intended 600.01px lower bound. Update the media query surrounding
.work-selected-projects-grid in src/scss/sections/_selected-projects.scss:12-14
to use 600.01px or the shared equivalent token, then regenerate
assets/css/animations.css:2032-2034 from the corrected source so both files
match.

In `@src/scss/sections/_stats-grid.scss`:
- Line 7: Remove the standalone empty SCSS comment from the stylesheet, leaving
the surrounding styles unchanged.
- Around line 24-25: Update the responsive override in
src/scss/sections/_stats-grid.scss at lines 24-25 to use border-inline-end: none
!important instead of border-right, reducing the selector depth where possible
while preserving its target behavior. Regenerate assets/css/animations.css at
lines 2028-2029 so the compiled override uses the same logical property.

In `@tests/helpers/assertions.ts`:
- Around line 46-49: Update expectCardParts() to verify that each required part
is present without requiring exactly one match. Replace the toHaveCount(1)
assertion on card.locator(part) with the appropriate presence assertion while
preserving the existing timeout and diagnostic message.

In `@tests/specs/work-single.spec.ts`:
- Around line 11-17: Replace the placeholder content in the work-single spec
with the finalized Work Single template URL, selectors, and expected UI
assertions. Update the six helper usages to target real elements and remove the
illustrative comments and guessed constants, ensuring the test provides actual
regression coverage.

---

Nitpick comments:
In `@src/scss/sections/_stats-grid.scss`:
- Line 15: Replace the raw media query in src/scss/sections/_stats-grid.scss:15
with the shared mq mixin for the 833.98px threshold. Also update
src/scss/sections/_selected-projects.scss:12 to express the 601px-to-800px
interval through mq, preserving each partial’s existing responsive behavior.
🪄 Autofix

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

Review profile: CHILL

Plan: Pro Plus

Run ID: da1b6337-2eb9-4d3a-848e-7f30c579b483

📥 Commits

Reviewing files that changed from the base of the PR and between be67839 and c709cc0.

📒 Files selected for processing (20)
  • assets/css/animations.css
  • patterns/cards/work-engagement-stat.php
  • patterns/cards/work-next-steps-card.php
  • patterns/hero/work-hero.php
  • patterns/section-stats-grid.php
  • patterns/sections/work-categories.php
  • patterns/sections/work-discuss-project.php
  • patterns/sections/work-related-routes.php
  • patterns/sections/work-selected-projects.php
  • src/scss/animations.scss
  • src/scss/animations/_card-motion.scss
  • src/scss/sections/_selected-projects.scss
  • src/scss/sections/_stats-grid.scss
  • styles/blocks/columns/card-divider-both.json
  • styles/blocks/groups/stat-segment.json
  • styles/dark.json
  • styles/sections/content/content-band-alt.json
  • tests/helpers/assertions.ts
  • tests/specs/work-single.spec.ts
  • theme.json

Comment thread patterns/sections/work-discuss-project.php Outdated
Comment thread src/scss/animations/_card-motion.scss
Comment thread src/scss/sections/_selected-projects.scss
Comment thread src/scss/sections/_stats-grid.scss Outdated
Comment thread src/scss/sections/_stats-grid.scss Outdated
Comment thread tests/helpers/assertions.ts Outdated
Comment thread tests/specs/work-single.spec.ts
- Remove 5 hardcoded iconColor/iconColorValue attributes; they already
  rendered via the icon.background custom token (light + dark values)
- Restore missing block-gap inline style on work-discuss-project's
  wp:columns wrapper to match its serialized attribute
- Fix expectCardParts() to check presence instead of an exact count of 1
- Remove unused Locator import and trim getPropertyValue() output in
  tests/helpers/assertions.ts
- Skip the illustrative work-single.spec.ts suite until the template exists
- Fix two Stylelint violations and switch to border-inline-end for RTL
  safety in the SCSS section partials
- Rebuild assets/css/animations.css from the corrected SCSS sources

Not applied (3 recommendations):
- CodeRabbit suggested reverting the Selected Projects breakpoint from
  601px back to 600.01px. Declined: 600.01px was already tried and
  caused a devicePixelRatio:2 rounding bug where it and WordPress's
  native ≤600px query matched simultaneously at reported width 600,
  breaking the native 1-column mobile layout. 601px was the verified fix.
- CodeRabbit suggested routing the 833.98px and 601–800px breakpoints
  through the shared mq() Sass mixin. Declined: mq() only supports named
  breakpoints from the theme's $ls-breakpoints map, and neither of these
  custom pixel values exists in that map — using raw @media queries was
  the deliberate workaround for that exact limitation, not an oversight.
- Copilot suggested the grid-template-columns column count in
  expectGridColumnsAtViewport() is unreliable because minmax() isn't
  split correctly. Declined: getComputedStyle().gridTemplateColumns is a
  CSSOM special case that returns resolved pixel tracks, not the
  minmax()/repeat() source syntax, so splitting on spaces is correct —
  confirmed by this session's own live browser testing.
--ls-card-case-study-border-active: var(--wp--custom--color--link--accent);
--ls-card-case-study-shadow-active: var(--wp--custom--shadow--card--hover);
--ls-card-case-study-lift: -4px;

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.

@brandonmarshal, these classes the agent keeps adding just to reference a variable and call once, is there a reason why it's doing this? Or is this just a wrong path it's gone down. I recommend asking it.
If it is wrong, I imagine, unfortunately, that it may be quite prevalent, I've seen it twice in this PR already.
I would also recommend defining some default "lift" values as custom variables in theme.json that it can use in animations, like the animation duration variables

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:design-system Tokens/components guidelines area:theme Theme & styles (templates, template parts, FSE) comp:block-patterns Patterns library/registration comp:section-styles Section/background styles comp:theme-json Tokens, presets, settings lang:css Stylesheets lang:json JSON config/content lang:php PHP code status:needs-review Awaiting code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants