Skip to content

Commit 03366da

Browse files
authored
Merge branch 'main' into tear-down-interactives-ec2-in-code-and-prod
2 parents 0c5a336 + 2981383 commit 03366da

30 files changed

Lines changed: 361 additions & 86 deletions

‎ab-testing/config/abTests.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,17 @@ const ABTests: ABTest[] = [
176176
groups: ["control", "variant"],
177177
shouldForceMetricsCollection: false,
178178
},
179+
{
180+
name: "fronts-and-curation-card-mini-nav",
181+
description: "Opt-in preview of mini subnavs on front cards",
182+
owners: ["fronts.and.curation@guardian.co.uk"],
183+
status: "ON",
184+
expirationDate: "2026-12-16",
185+
type: "server",
186+
audienceSize: 0 / 100,
187+
groups: ["control", "variant"],
188+
shouldForceMetricsCollection: false,
189+
},
179190
{
180191
name: "fronts-and-curation-editorial-test",
181192
description: "Allow editorial A/B tests to run on web",

‎dotcom-rendering/docs/puzzle-page.md‎

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,27 @@ scroll/resize and visibility/page restoration; hidden documents are ignored.
1414
Previously reported buckets remain reported if late content changes the height.
1515
Archive and game pages are excluded.
1616

17+
## Game-page interaction context
18+
19+
PDF, print and share/copy controls append labelled puzzle context to the existing
20+
Ophan `data-link-name`; the `clickComponent` and number of events are unchanged.
21+
For example:
22+
23+
```text
24+
puzzles | print-request | slug-sudoku-easy | date-2026-11-09 | provider-amuselabs
25+
puzzles | share-attempt | copy | ArticleMeta | slug-quick | date-2026-11-08 | provider-guardian-crossword
26+
```
27+
28+
For iframe pages, slug/provider come from `PuzzleConfig` and date from
29+
`instance.puzzleDate`. For crossword pages, slug is the `crosswordType` series
30+
identifier, date is the crossword data timestamp's UTC calendar date, and provider
31+
is `guardian-crossword`. Iframe providers are `amuselabs`, `wordiply` or `moviegrid`.
32+
Missing/invalid dates are omitted, never inferred from the URL or today's date.
33+
Controls without context retain their existing tracking names.
34+
35+
The labelled values are transmitted within an entry of the existing
36+
`clickLinkNames` array, not new structured Ophan fields. This identifies the source puzzle for host-page actions only.
37+
1738
## Puzzles API URL resolution
1839

1940
Frontend fetches dated puzzles with `GET /game?puzzleType=...&date=YYYY-MM-DD`
@@ -159,7 +180,7 @@ archive. The hub remains at `/puzzles-and-games`; DCR's rendering endpoint is `/
159180

160181
**Access control is enforced on both sides.** `frontend` gates reader
161182
access to these routes via its `PuzzlesHubAccess` edition check (currently
162-
International edition only) before it ever POSTs to DCR. DCR's own
183+
the International, Europe and Australia editions) before it ever POSTs to DCR. DCR's own
163184
`/PuzzlePage` endpoint additionally checks the same edition rule itself
164185
(via `isPuzzlesHubAvailable`, mirroring
165186
`/PuzzlesPage`'s hub gate) and returns `404` when it isn't enabled for the
@@ -759,7 +780,7 @@ were removed: everything they gated is now gated by `isPuzzlesHubAvailable`.
759780

760781
- **The hub (formerly `puzzles-new-hub-v1`)**: available only in the
761782
editions listed in `PUZZLES_HUB_EDITIONS` (currently International,
762-
`INT`, only). To roll it out to another edition, add its id to that list
783+
`INT`, Europe, `EUR`, and Australia, `AU`). To roll it out to another edition, add its id to that list
763784
here and to `PuzzlesHubAccess.scala` in `frontend`. Gates
764785
the Puzzles Hub page, the 6 puzzle pages (sudoku x4, word-wheel,
765786
wordiply), full hub sub-nav links, a sign-in-to-track-progress message, a
@@ -783,7 +804,7 @@ The corresponding gate-check helpers live in DCR:
783804
`isPuzzlesHubV2Enabled` (`src/lib/puzzlesHubVersionExperiment.ts`),
784805
cumulative, as described above.
785806

786-
**Current state**: the hub is available in the International edition only,
807+
**Current state**: the hub is available in the International, Europe and Australia editions,
787808
and v2 sits at `audienceSize: 0/100`. The hub gate is enforced at both
788809
layers: `frontend`'s route-level `PuzzlesHubAccess` check decides whether a
789810
request reaches `/PuzzlePage` at all, and DCR's `handlePuzzlePage`

‎dotcom-rendering/playwright/tests/puzzles.actions-tracking.e2e.spec.ts‎

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ const loadActions = async (
6868
theme: 'LifestylePillar',
6969
display: 'StandardDisplay',
7070
},
71-
crossword: { ...quickCrossword, pdf },
71+
crossword: {
72+
...quickCrossword,
73+
crosswordType: 'quick',
74+
date: Date.UTC(2026, 10, 8),
75+
pdf,
76+
},
7277
pageId: crosswordPath,
7378
isAdFreeUser: true,
7479
isCommentable: false,
@@ -153,7 +158,9 @@ test.describe('Puzzle PDF, print and share tracking', () => {
153158
expect(clicks).toEqual([
154159
{
155160
component: 'puzzles-actions:puzzle-page',
156-
names: ['puzzles | print-request'],
161+
names: [
162+
'puzzles | print-request | slug-sudoku-easy | date-2026-11-09 | provider-amuselabs',
163+
],
157164
},
158165
]);
159166
});
@@ -182,7 +189,9 @@ test.describe('Puzzle PDF, print and share tracking', () => {
182189
expect(clicks).toEqual([
183190
{
184191
component: 'puzzles-actions:crossword-page',
185-
names: ['puzzles | pdf-open'],
192+
names: [
193+
'puzzles | pdf-open | slug-quick | date-2026-11-08 | provider-guardian-crossword',
194+
],
186195
},
187196
]);
188197
await pdfPage.close();
@@ -203,7 +212,9 @@ test.describe('Puzzle PDF, print and share tracking', () => {
203212
expect(clicks).toEqual([
204213
{
205214
component: 'puzzles-actions:puzzle-page',
206-
names: ['puzzles | share-attempt | copy | ArticleMeta'],
215+
names: [
216+
'puzzles | share-attempt | copy | ArticleMeta | slug-sudoku-easy | date-2026-11-09 | provider-amuselabs',
217+
],
207218
},
208219
]);
209220
});

‎dotcom-rendering/src/components/ArticleMeta.web.tsx‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ import {
2323
import { getAudioData } from '../lib/audio-data';
2424
import { getSoleContributor } from '../lib/byline';
2525
import { decideMainMediaCaption } from '../lib/decide-caption';
26+
import {
27+
crosswordActionContext,
28+
type PuzzleActionContext,
29+
} from '../lib/puzzleActionTracking';
2630
import { hasFilterTag, isRepublished } from '../lib/theFilter';
2731
import { palette as themePalette } from '../palette';
2832
import { hasPreferredSourceButton } from '../preferredSource';
@@ -63,6 +67,7 @@ type Props = {
6367
crossword?: FEArticle['crossword'];
6468
hidePreferredSourceOnPrint?: boolean;
6569
isPuzzlePage?: boolean;
70+
puzzleTrackingContext?: PuzzleActionContext;
6671
};
6772

6873
const meta = (format: ArticleFormat) => {
@@ -335,6 +340,7 @@ export const ArticleMeta = ({
335340
crossword,
336341
hidePreferredSourceOnPrint,
337342
isPuzzlePage = false,
343+
puzzleTrackingContext,
338344
}: Props) => {
339345
const { renderingTarget } = useConfig();
340346
const showPreferredSource = hasPreferredSourceButton(
@@ -584,6 +590,10 @@ export const ArticleMeta = ({
584590
webTitle={webTitle}
585591
format={format}
586592
context="ArticleMeta"
593+
puzzleTrackingContext={
594+
puzzleTrackingContext ??
595+
crosswordActionContext(crossword)
596+
}
587597
puzzleTrackingSource={
588598
isPuzzlePage
589599
? 'puzzle-page'

‎dotcom-rendering/src/components/CrosswordLinks.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ describe('crossword PDF tracking', () => {
2020
});
2121
expect(link).toHaveAttribute(
2222
'data-link-name',
23-
'puzzles | pdf-open',
23+
'puzzles | pdf-open | slug-cryptic | date-2024-11-03 | provider-guardian-crossword',
2424
);
2525
},
2626
);

‎dotcom-rendering/src/components/CrosswordLinks.tsx‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ import { isUndefined } from '@guardian/libs';
33
import { type CrosswordProps } from '@guardian/react-crossword';
44
import { palette, space } from '@guardian/source/foundations';
55
import { LinkButton } from '@guardian/source/react-components';
6-
import { puzzleActionAttributes } from '../lib/puzzleActionTracking';
6+
import {
7+
crosswordActionContext,
8+
puzzleActionAttributes,
9+
} from '../lib/puzzleActionTracking';
710
import { palette as themePalette } from '../palette';
811
import { PrintButton } from './PrintButton.island';
912

@@ -25,12 +28,16 @@ export const CrosswordLinks = ({
2528
<PrintButton
2629
href={crossword.pdf}
2730
puzzleTrackingSource="crossword-page"
31+
puzzleTrackingContext={crosswordActionContext(
32+
crossword,
33+
)}
2834
/>
2935
) : (
3036
<LinkButton
3137
{...puzzleActionAttributes(
3238
'crossword-page',
3339
'pdf-open',
40+
crosswordActionContext(crossword),
3441
)}
3542
href={crossword.pdf}
3643
size="small"

‎dotcom-rendering/src/components/DecideContainer.tsx‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ type Props = {
3232
collectionId: number;
3333
containerLevel?: DCRContainerLevel;
3434
hasPageSkin?: boolean;
35+
isUserOptedInToMiniNav: boolean;
3536
};
3637

3738
export const DecideContainer = ({
@@ -48,6 +49,7 @@ export const DecideContainer = ({
4849
collectionId,
4950
containerLevel,
5051
hasPageSkin,
52+
isUserOptedInToMiniNav,
5153
}: Props) => {
5254
switch (containerType) {
5355
case 'nav/list':
@@ -76,6 +78,7 @@ export const DecideContainer = ({
7678
containerLevel={containerLevel}
7779
collectionId={collectionId}
7880
isStorylines={false}
81+
isUserOptedInToMiniNav={isUserOptedInToMiniNav}
7982
/>
8083
);
8184
case 'scrollable/small':

‎dotcom-rendering/src/components/FlexibleGeneral.stories.tsx‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ const meta = {
173173
aspectRatio: '5:4',
174174
collectionId: 1,
175175
isStorylines: false,
176+
isUserOptedInToMiniNav: true,
176177
},
177178
render: ({ frontSectionTitle, ...args }) => (
178179
<FrontSection
@@ -201,6 +202,7 @@ export const SplashWithStandards: Story = {
201202
boostLevel: index === 0 ? 'boost' : 'default',
202203
})),
203204
},
205+
isUserOptedInToMiniNav: true,
204206
},
205207
};
206208

@@ -211,6 +213,7 @@ export const SplashWithSublinks: Story = {
211213
...emptyGroupedTrails,
212214
splash: [{ ...splashCard, image: undefined }],
213215
},
216+
isUserOptedInToMiniNav: true,
214217
},
215218
render: (args) => {
216219
const Section = ({
@@ -301,6 +304,7 @@ export const SplashBoostLevels: Story = {
301304
...emptyGroupedTrails,
302305
splash: [{ ...splashCard, image: undefined }],
303306
},
307+
isUserOptedInToMiniNav: true,
304308
},
305309
render: (args) => {
306310
const Section = ({
@@ -345,6 +349,7 @@ export const SplashWithImageSupression: Story = {
345349
...emptyGroupedTrails,
346350
splash: [{ ...splashCard, image: undefined }],
347351
},
352+
isUserOptedInToMiniNav: true,
348353
},
349354
render: (args) => {
350355
const Section = ({
@@ -396,6 +401,7 @@ export const SplashWithLiveUpdates: Story = {
396401
...emptyGroupedTrails,
397402
splash: [{ ...liveUpdatesCard, boostLevel }],
398403
}}
404+
isUserOptedInToMiniNav={true}
399405
/>
400406
</FrontSection>
401407
);
@@ -423,6 +429,7 @@ export const SplashWithSnapLinkAndStandards: Story = {
423429
boostLevel: index === 0 ? 'boost' : 'default',
424430
})),
425431
},
432+
isUserOptedInToMiniNav: true,
426433
},
427434
};
428435

@@ -444,6 +451,7 @@ export const StandardBoostedWithLiveUpdates: Story = {
444451
...emptyGroupedTrails,
445452
standard: [{ ...liveUpdatesCard, boostLevel }],
446453
}}
454+
isUserOptedInToMiniNav={true}
447455
/>
448456
</FrontSection>
449457
);
@@ -476,6 +484,7 @@ export const StandardCards: Story = {
476484
...youtubeVideoTrails.slice(0, 2),
477485
],
478486
},
487+
isUserOptedInToMiniNav: true,
479488
},
480489
};
481490

@@ -505,6 +514,7 @@ export const WithSpecialPaletteVariations = {
505514
],
506515
standard: standardCards.slice(0, 2),
507516
},
517+
isUserOptedInToMiniNav: true,
508518
},
509519
render: (args) => (
510520
<>
@@ -535,6 +545,7 @@ export const SecondaryContainerStandardCards: Story = {
535545
...emptyGroupedTrails,
536546
standard: standardCards.slice(0, 4),
537547
},
548+
isUserOptedInToMiniNav: true,
538549
},
539550
};
540551

@@ -549,6 +560,7 @@ export const ImmersiveCardsSplashAndStandard: Story = {
549560
],
550561
standard: [{ ...trails[0], isImmersive: true }],
551562
},
563+
isUserOptedInToMiniNav: true,
552564
},
553565
};
554566

@@ -570,6 +582,7 @@ export const SelfHostedLoopVideoCardsInSplashSlots: Story = {
570582
...emptyGroupedTrails,
571583
splash: [{ ...video, boostLevel }],
572584
}}
585+
isUserOptedInToMiniNav={true}
573586
/>
574587
</FrontSection>
575588
);
@@ -617,6 +630,7 @@ export const SelfHostedDefaultVideoCardsInSplashSlots: Story = {
617630
...emptyGroupedTrails,
618631
splash: [{ ...video, boostLevel }],
619632
}}
633+
isUserOptedInToMiniNav={true}
620634
/>
621635
</FrontSection>
622636
);
@@ -662,6 +676,7 @@ export const YoutubeVideoCardInSplashSlot: Story = {
662676
...emptyGroupedTrails,
663677
splash: [{ ...youtubeVideoTrails[0], boostLevel }],
664678
}}
679+
isUserOptedInToMiniNav={true}
665680
/>
666681
</FrontSection>
667682
);
@@ -696,6 +711,7 @@ export const YoutubeVideoCardInStandardSlot: Story = {
696711
...emptyGroupedTrails,
697712
standard: [{ ...youtubeVideoTrails[0], boostLevel }],
698713
}}
714+
isUserOptedInToMiniNav={true}
699715
/>
700716
</FrontSection>
701717
);
@@ -723,6 +739,7 @@ export const SelfHostedVideoInStandardSlot: Story = {
723739
...emptyGroupedTrails,
724740
standard: [selfHostedLoopVideo54Card], // Self-hosted video is disabled at standard card size
725741
},
742+
isUserOptedInToMiniNav: true,
726743
},
727744
};
728745

@@ -738,6 +755,7 @@ export const StandardBoostedMediaCardWithSublinks: Story = {
738755
supportingContent: getSublinks(2),
739756
})),
740757
},
758+
isUserOptedInToMiniNav: true,
741759
},
742760
};
743761

@@ -756,6 +774,7 @@ export const SplashWithSlideshow: Story = {
756774
],
757775
},
758776
collectionId: 1,
777+
isUserOptedInToMiniNav: true,
759778
},
760779
render: (args) => {
761780
const Section = ({
@@ -896,6 +915,7 @@ export const StandardCardsWithSlideshow: Story = {
896915
],
897916
},
898917
collectionId: 1,
918+
isUserOptedInToMiniNav: true,
899919
},
900920
};
901921

@@ -916,6 +936,7 @@ export const EventGraphic = {
916936
standard: trails.slice(4, 9),
917937
},
918938
collectionId: 1,
939+
isUserOptedInToMiniNav: true,
919940
},
920941
decorators: (Story) => {
921942
global.fetch = customMockFetch([

0 commit comments

Comments
 (0)