Add Puzzle Page: DCR layout for iframe-based puzzles (V0) - #16754
Open
andresilva-guardian wants to merge 24 commits into
Open
andresilva-guardian wants to merge 24 commits into
andresilva-guardian wants to merge 24 commits into
Conversation
Restructure PuzzlePageLayout to use the same Article-domain components (ArticleTitle, ArticleHeadline, ArticleMeta, SubMeta, DiscussionLayout, StickyBottomBanner) and grid structure as CrosswordLayout, while keeping Puzzle-specific content. The puzzleGroup label is now rendered as a real section link through ArticleTitle instead of plain text. Update design format from Standard to Crossword to reuse existing width-handling logic. Add proper ad slot handling (header, survey, merchandising) and comments section (hardcoded off). Extensive comments document hardcoded fallback values for fields not present in FEPuzzlePageType.
Normalize puzzle headlines to match SEO titles (e.g., "Easy sudoku" not "sudoku-easy puzzle"). Add puzzle family names as series kickers using the existing tag pattern. Implement hardcoded Puzzles & Games sub-nav matching the crossword page's design. Change theme from News to Lifestyle to render proper palette colors. Suppress age warning for puzzle content. Export puzzlePageFormat for global style consistency.
…implement buildFrameStyles function
…e overrides and enhance responsiveness
…ouch-specific overrides for wordiply
…and reducing straight lines count
- Introduced isAdFreeUser to FEPuzzlePageType to indicate if a reader has an ad-free subscription. - Updated canRenderAds function to include FEPuzzlePageType. - Modified PuzzlePageLayout to conditionally render ads based on isAdFreeUser. - Enhanced validation tests to accommodate isAdFreeUser field.
…r print functionality
andresilva-guardian
force-pushed
the
afs/puzzle-page-design-v0
branch
from
September 18, 2026 11:52
4fc56e6 to
70e1834
Compare
🚀 Image pushed to AWS ECRImage digest: 🐛 Run the image locallyThe following can be used to run the image locally: # Refer to image using the immutable digest. Find alternatives below.
IMAGE_IDENTIFIER="@sha256:d7f5d75aa0baa67d000e795a5595a61199d27fcc0d759d37b1886fdbef8183ad"
# Refer to image using branch tag
# IMAGE_IDENTIFIER=":branch-afs-puzzle-page-design-v0"
# Refer to image using build tag
# IMAGE_IDENTIFIER=":build-31334"
# Set environment variables for the AWS CLI
AWS_PROFILE="<A_PROFILE_FROM_JANUS>"
AWS_DEFAULT_REGION="eu-west-1"
IMAGE_ACCOUNT_ID=$(aws ssm get-parameter --name /organisation/accounts/artifacts --query "Parameter.Value" --output text)
REGISTRY="${IMAGE_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com"
IMAGE="${REGISTRY}/guardian/dotcom-rendering${IMAGE_IDENTIFIER}"
# Login to AWS ECR https://docs.aws.amazon.com/AmazonECR/latest/userguide/registry_auth.html
aws ecr get-login-password | docker login --username AWS --password-stdin $REGISTRY
# Pull the image
docker pull $IMAGE
# Run the image. You'll likely need to set additional flags. See https://docs.docker.com/reference/cli/docker/container/run.
docker run $IMAGE |
andresilva-guardian
marked this pull request as ready for review
September 18, 2026 12:12
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
…ests - Suppress declaration-no-important on the button's :focus outline override (existing, intentional !important; lint just needed the disable comment used elsewhere in the codebase). - Update print button role/name assertions to match the actual "Print version" label (button text was changed but tests weren't). - Drop the #dfp-ad--merchandising assertion from the non-ad-free ads test: that slot is gated behind showComments, which is permanently false on Puzzle Page, so it never renders regardless of ad-free status. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Introduces Puzzle Page, a new generic DCR-owned page/layout for the Guardian's iframe-based puzzles (Sudoku easy/medium/hard/killer, Word wheel, Wordiply):
POST /PuzzlePageendpoint, request validation (validate.puzzlePage.ts) andPuzzlePageLayout, a near-verbatim structural replica ofCrosswordLayout(sameArticleTitle/ArticleHeadline/ArticleMeta/DiscussionLayout/StickyBottomBannercomponents and grid areas), with the crossword game body swapped for a sandboxedPuzzleIframe.island, which resolves per-provider (AmuseLabs/Wordiply) iframe URLs.PrintButton.island.PuzzleCard/Rowsimplementation out ofPuzzlesDirectory.tsxinto a new, sharedPuzzleCard.tsx, so the Hub and this rail render from the same code and can't visually drift apart. Cards collapse to a single column below the 740px breakpoint.puzzles-new-hubexperiment (mirroring the Puzzles Hub's own gate), with a separate v1-scoped flag gating the related rail specifically.canRenderAds, via a newisAdFreeUserfield onFEPuzzlePageType, so ad-free subscribers don't see ads on puzzle pages either.min-heightconfiguration) and dateline-style puzzle date formatting.Why?
Iframe-based puzzles didn't have a page template consistent with the rest of DCR. Crosswords already get this treatment via
CrosswordLayout, but Sudoku/Word wheel/Wordiply were left without proper header/meta/print/ads/related-content handling. This brings them in line with the rest of the site, as part of the wider Puzzles & Games hub rollout.Reusing the Hub's own card component for the related rail (rather than a second, independent styling of the same
PuzzleItemdata) keeps the two surfaces visually identical and avoids duplicated, divergence-prone CSS.How has this change been tested?
PuzzlePageLayout,PuzzleIframe,PuzzlesDirectory,validate.puzzlePage, the/PuzzlePagehandler, andpuzzleDateformatting.fixtures/manual/puzzlePage.ts) across sudoku/word-wheel/wordiply, checking print button gating (Sudoku-only), ad gating (ad-free vs not), thepuzzles-new-hub/v1 AB-test gates, and the related rail's card styling and responsive breakpoints (single column below 740px).Screenshots