Skip to content

Added an 'Our work' page listing projects and fixed generated card thumbnails. - #281

Merged
AlexSkrypnyk merged 3 commits into
developfrom
feature/our-work-page
Aug 3, 2026
Merged

Added an 'Our work' page listing projects and fixed generated card thumbnails.#281
AlexSkrypnyk merged 3 commits into
developfrom
feature/our-work-page

Conversation

@AlexSkrypnyk

@AlexSkrypnyk AlexSkrypnyk commented Aug 3, 2026

Copy link
Copy Markdown
Member

Checklist before requesting a review

  • Subject includes ticket number as [#123] Verb in past tense.
  • Ticket number #123 added to description
  • Added context in Changed section
  • Self-reviewed code and commented in commented complex areas.
  • Added tests for fix/feature.
  • Relevant tests run and passed locally.

Changed

  1. Added the do_base_deploy_populate_our_work_page() deploy hook in web/modules/custom/do_base/do_base.deploy.php, creating a published civictheme_page node titled "Our work" and adding an "Our work" link ahead of every existing top-level item in the civictheme-primary-navigation menu.
  2. The page is served at /work rather than the /our-work pathauto would derive from its title, so the alias is set on the node's path field with PathautoState::SKIP. Without the skip, pathauto reclaims the alias the first time an author saves the page. The menu link needs no path of its own: it references entity:node/N and follows the alias.
  3. The page combines a large dark banner (generated background image, soft-light blend, title "Work you can go and look at.") with a lead paragraph and a /contact CTA, an intro civictheme_content section, and a civictheme_automated_list paragraph scoped to the project content type rendering civictheme_promo_card items in 3 columns with limit_type: unlimited and limit: 12, giving 12 projects per page with the built-in pager; ordering reuses the automated-list view's existing promote DESC, created DESC so no view change was needed.
  4. Added private helpers _do_base_our_work_build_page() (assembles the paragraphs and node inside one transaction), _do_base_our_work_banner_media() (creates the civictheme_image media entity from the module-shipped asset with a fixed UUID so re-runs are no-ops, returning NULL rather than failing when the file is missing), and _do_base_menu_leading_weight() (reads the lowest existing top-level weight and returns one below it, rather than hard-coding a number that a menu reorder would silently invalidate).
  5. Shipped the banner image at web/modules/custom/do_base/assets/our-work-banner.jpg.
  6. Fixed generated nodes almost never carrying a card thumbnail. NodeGeneratorBase::commonValues() gated field_c_n_thumbnail on CaseMatrix::bit($index, 4), which over a COUNT of 20 only turns on for indices 16 to 19 - the same indices moderationState() withholds from publication. Every bundle therefore ended up with exactly one published node carrying a thumbnail out of seventeen, so promo card grids rendered almost entirely imageless. The thumbnail now shares bit 0, which lifts that to eight of seventeen; it deliberately does not share bit 2, because a card with an image but no summary is a combination worth covering.
  7. Added tests/behat/features/our_work_page.feature with two scenarios: the page opens the primary navigation and shows its copy, and 13 published + 1 draft project prove 12 cards per page, a pager, and that the draft is excluded. The card assertion counts the cards that fill page one rather than a site-wide total, so projects authored later cannot break it.
  8. Documented the module-shipped-asset-to-media pattern in a new "Images a deploy hook needs" section of docs/development.md.

Production currently has no project nodes, so the list renders empty there until the first project is authored; the hook and the page do not depend on any existing content.

Two related defects were found while diagnosing item 6 and left alone, since both are wider than this change: field_c_n_banner_featured_image sits on bit 4 in bannerValues() and has the identical problem, and the underlying cause is that a COUNT of 20 under-provisions a five-bit matrix, which needs 32 indices to cover every combination.

Screenshots

Our work page banner, intro and promo-card grid

Before / After

BEFORE                                    AFTER
Primary navigation                        Primary navigation
+-------------------------+               +-------------------------+
| About Us                |               | Our work            <-- |
| AI-assisted delivery    |               | About Us                |
| Services                |               | AI-assisted delivery    |
| Blog                    |               | Services                |
| Contact                 |               | Blog                    |
+-------------------------+               | Contact                 |
                                          +-------------------------+

(no page listed delivered work)           /work
                                          +-------------------------+
                                          | [ dark banner + image ] |
                                          | "Work you can go and    |
                                          |  look at."              |
                                          | lead copy + Contact CTA |
                                          |-------------------------|
                                          | "The work, not the      |
                                          |  pitch."   intro copy   |
                                          |-------------------------|
                                          | [card] [card] [card]    |
                                          | [card] [card] [card]    |
                                          | [card] [card] [card]    |
                                          | [card] [card] [card]    |
                                          |      < 1  2  next >     |
                                          +-------------------------+
                                          12 projects per page,
                                          newest first

Generated card thumbnails, per bundle over a 20-node run:

BEFORE                                    AFTER
index  0 ................ 15 16 17 18 19  index  0 ................ 15 16 17 18 19
thumb  .................... X  X  X  X    thumb  . X . X . X ... X   .  X  .  X  .
state  published .........  P  d  n  a    state  published .........  P  d  n  a

1 of 17 published nodes had a thumbnail   8 of 17 published nodes have a thumbnail

@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 48 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: cf65298a-fe13-41fb-80d3-a3bad580487b

📥 Commits

Reviewing files that changed from the base of the PR and between 41b517a and 412eb61.

⛔ Files ignored due to path filters (1)
  • web/modules/custom/do_base/assets/our-work-banner.jpg is excluded by !**/*.jpg
📒 Files selected for processing (4)
  • docs/development.md
  • tests/behat/features/our_work_page.feature
  • web/modules/custom/do_base/do_base.deploy.php
  • web/modules/custom/do_generated_content/src/Generator/NodeGeneratorBase.php

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

@AlexSkrypnyk AlexSkrypnyk added the AUTOMERGE Pull request has been approved and set to automerge label Aug 3, 2026
@github-actions

This comment has been minimized.

@codecov-commenter

codecov-commenter commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.84%. Comparing base (41b517a) to head (412eb61).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop     #281   +/-   ##
========================================
  Coverage    85.84%   85.84%           
========================================
  Files           18       18           
  Lines          226      226           
========================================
  Hits           194      194           
  Misses          32       32           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AlexSkrypnyk AlexSkrypnyk added the Needs review Pull request needs a review from assigned developers label Aug 3, 2026
@AlexSkrypnyk
AlexSkrypnyk temporarily deployed to PR-281 August 3, 2026 07:35 Inactive
@github-actions

This comment has been minimized.

@AlexSkrypnyk AlexSkrypnyk changed the title Added an 'Our work' page listing projects and put it first in the primary navigation. Added an 'Our work' page listing projects and fixed generated card thumbnails. Aug 3, 2026
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown

Code coverage (threshold: 80%)

  Classes: 52.94% (9/17)
  Methods: 70.27% (26/37)
  Lines:   91.13% (370/406)
Per-class coverage
Drupal\do_content_api\EventSubscriber\JsonApiWriteGateSubscriber
  Methods:  66.67% ( 2/ 3)   Lines:  88.89% (  8/  9)
Drupal\do_content_api\Hook\EntityCreateAccessHook
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  9/  9)
Drupal\do_content_api\Hook\ModerationPolicyHook
  Methods:  50.00% ( 1/ 2)   Lines:  93.75% ( 15/ 16)
Drupal\do_content_api\Routing\RouteSubscriber
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  6/  6)
Drupal\do_feed\FeedUrlBuilder
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 18/ 18)
Drupal\do_feed\Form\FeedSettingsForm
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 15/ 15)
Drupal\do_feed\Hook\EntityDeleteHook
  Methods:  50.00% ( 1/ 2)   Lines:  92.31% ( 12/ 13)
Drupal\do_feed\Hook\EntityPresaveHook
  Methods: 100.00% ( 4/ 4)   Lines: 100.00% ( 54/ 54)
Drupal\do_feed\Hook\PreprocessParagraphHook
  Methods: 100.00% ( 2/ 2)   Lines: 100.00% ( 14/ 14)
Drupal\do_feed\Hook\PreprocessViewsViewRowRssHook
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  3/  3)
Drupal\do_feed\Hook\ViewsPreViewHook
  Methods:  50.00% ( 1/ 2)   Lines:  96.43% ( 27/ 28)
Drupal\do_generated_content\Generator\CaseMatrix
  Methods: 100.00% ( 3/ 3)   Lines: 100.00% ( 12/ 12)
Drupal\do_generated_content\Generator\RelativeDate
  Methods: 100.00% ( 1/ 1)   Lines: 100.00% (  1/  1)

@AlexSkrypnyk
AlexSkrypnyk enabled auto-merge (squash) August 3, 2026 08:20
@AlexSkrypnyk
AlexSkrypnyk merged commit f39af39 into develop Aug 3, 2026
10 checks passed
@AlexSkrypnyk
AlexSkrypnyk deleted the feature/our-work-page branch August 3, 2026 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AUTOMERGE Pull request has been approved and set to automerge Needs review Pull request needs a review from assigned developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants