Skip to content

Commit aec8c43

Browse files
Merge branch 'main' into cc/aag-read-more-tracking
2 parents 30999ba + d67fc69 commit aec8c43

24 files changed

+438
-116
lines changed

ab-testing/config/abTests.ts

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,34 @@ const ABTests: ABTest[] = [
101101
expirationDate: "2026-02-25",
102102
type: "server",
103103
status: "ON",
104-
audienceSize: 0 / 100,
104+
audienceSize: 20 / 100,
105105
audienceSpace: "A",
106106
groups: ["control", "prefer", "add"],
107+
},
108+
{
109+
name: "commercial-mobile-inline1-halfpage",
110+
description:
111+
"To measure impact (RPM) and CLS of adding halfPage as an additional size option to mobile inline1 ad slot",
112+
owners: ["[email protected]"],
113+
expirationDate: `2026-02-28`,
114+
type: "client",
115+
status: "ON",
116+
audienceSize: 20 / 100,
117+
audienceSpace: "A",
118+
groups: ["control", "variant"],
119+
shouldForceMetricsCollection: false,
120+
},
121+
{
122+
name: "thefilter-at-a-glance-redesign",
123+
description:
124+
"Testing redesigned at a glance component on The Filter articles",
125+
owners: ["[email protected]"],
126+
expirationDate: "2026-02-25",
127+
type: "server",
128+
status: "ON",
129+
audienceSize: 0 / 100,
130+
audienceSpace: "A",
131+
groups: ["control", "stacked", "carousel"],
107132
shouldForceMetricsCollection: false,
108133
},
109134
];

dotcom-rendering/.storybook/decorators/splitThemeDecorator.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ const Theme = ({
308308
* mode, once for each format, and three times in dark mode, once for each
309309
* format.
310310
*
311+
* @deprecated
311312
* The returned "splitTheme" decorator was historically used directly in story
312313
* files. This approach is now deprecated in favour of the "global colour
313314
* scheme" decorator and toolbar item, which use the "splitTheme" decorator in

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ export const ArticleMeta = ({
519519
</div>
520520
</div>
521521
{preferredSource.hasButton ? (
522-
<PreferredSourceButton text={preferredSource.copy} />
522+
<PreferredSourceButton kind={preferredSource.kind} />
523523
) : null}
524524
</div>
525525
</div>

dotcom-rendering/src/components/Masthead/HighlightsCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ const container = css`
3939
flex-direction: column;
4040
height: 100%;
4141
column-gap: ${space[2]}px;
42+
justify-content: space-between;
4243
/** Relative positioning is required to absolutely position the card link overlay */
4344
position: relative;
4445
padding: ${space[2]}px ${space[2]}px 0 ${space[2]}px;

dotcom-rendering/src/components/PreferredSourceButton.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Story = StoryObj<typeof meta>;
1414

1515
export const VariantA = {
1616
args: {
17-
text: 'Prefer the Guardian on Google',
17+
kind: 'prefer',
1818
},
1919
parameters: {
2020
chromatic: {
@@ -27,7 +27,7 @@ export const VariantA = {
2727

2828
export const VariantB = {
2929
args: {
30-
text: 'Add the Guardian on Google',
30+
kind: 'add',
3131
},
3232
parameters: {
3333
chromatic: {

dotcom-rendering/src/components/PreferredSourceButton.tsx

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,21 @@ import {
66
textSans14Object,
77
} from '@guardian/source/foundations';
88
import { LinkButton, SvgGoogleBrand } from '@guardian/source/react-components';
9+
import type { ButtonKind } from '../experiments/preferredSource';
910
import { palette } from '../palette';
1011

1112
type Props = {
12-
text: string;
13+
kind: ButtonKind;
1314
};
1415

15-
export const PreferredSourceButton = ({ text }: Props) => (
16+
export const PreferredSourceButton = ({ kind }: Props) => (
1617
<LinkButton
1718
priority="tertiary"
1819
icon={<SvgGoogleBrand />}
1920
size="small"
2021
href="https://www.google.com/preferences/source?q=theguardian.com"
22+
data-component={`preferred-source-button-${kind}`}
23+
data-link-name={`preferred-source-button-${kind}`}
2124
cssOverrides={css({
2225
...textSans14Object,
2326
padding: '8px 12px 10px',
@@ -49,6 +52,15 @@ export const PreferredSourceButton = ({ text }: Props) => (
4952
backgroundTertiaryHover: palette('--preferred-source-button-hover'),
5053
}}
5154
>
52-
{text}
55+
{copy(kind)}
5356
</LinkButton>
5457
);
58+
59+
const copy = (kind: Props['kind']): string => {
60+
switch (kind) {
61+
case 'prefer':
62+
return 'Prefer the Guardian on Google';
63+
case 'add':
64+
return 'Add the Guardian on Google';
65+
}
66+
};
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import type { ArticleFormat } from '../lib/articleFormat';
2+
import type { ABTestVariant } from '../model/enhance-product-summary';
3+
import type { ProductBlockElement } from '../types/content';
4+
import { Island } from './Island';
5+
import { ScrollableProduct } from './ScrollableProduct.importable';
6+
import { StackedProducts } from './StackedProducts.importable';
7+
8+
export const ProductSummary = ({
9+
products,
10+
format,
11+
variant,
12+
}: {
13+
products: ProductBlockElement[];
14+
format: ArticleFormat;
15+
variant: ABTestVariant;
16+
}) => {
17+
if (variant === 'carousel') {
18+
return (
19+
<Island priority="feature" defer={{ until: 'idle' }}>
20+
<ScrollableProduct products={products} format={format} />
21+
</Island>
22+
);
23+
}
24+
25+
return (
26+
<Island priority="feature" defer={{ until: 'idle' }}>
27+
<StackedProducts
28+
products={products}
29+
heading={'At a glance'}
30+
format={format}
31+
/>
32+
</Island>
33+
);
34+
};

dotcom-rendering/src/components/marketing/banners/designableBanner/DesignableBanner.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import { DesignableBannerHeader } from './components/DesignableBannerHeader';
4545
import { DesignableBannerVisual } from './components/DesignableBannerVisual';
4646
import type {
4747
BannerTemplateSettings,
48-
ChoiceCardSettings,
48+
ChoiceCardDesignSettings,
4949
CtaSettings,
5050
} from './settings';
5151
import { buttonStyles, buttonThemes } from './styles/buttonStyles';
@@ -82,7 +82,7 @@ const buildHeaderImageSettings = (
8282

8383
const buildChoiceCardSettings = (
8484
design: ConfigurableDesign,
85-
): ChoiceCardSettings | undefined => {
85+
): ChoiceCardDesignSettings | undefined => {
8686
if (design.visual?.kind === 'ChoiceCards') {
8787
const {
8888
buttonColour,
@@ -478,7 +478,9 @@ const DesignableBanner: ReactComponent<BannerRenderProps> = ({
478478
choices={choiceCards}
479479
id={'banner'}
480480
submitComponentEvent={submitComponentEvent}
481-
choiceCardSettings={choiceCardSettings}
481+
choiceCardDesignSettings={
482+
choiceCardSettings
483+
}
482484
/>
483485
)}
484486
<div

dotcom-rendering/src/components/marketing/banners/designableBanner/settings.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export interface HeaderSettings {
3636
headerImage?: Image;
3737
}
3838

39-
export interface ChoiceCardSettings {
39+
export interface ChoiceCardDesignSettings {
4040
buttonColour?: string;
4141
buttonTextColour?: string;
4242
buttonBorderColour?: string;
@@ -58,7 +58,7 @@ export interface BannerTemplateSettings {
5858
articleCountTextColour?: string;
5959
imageSettings?: Image;
6060
alternativeVisual?: ReactNode;
61-
choiceCardSettings?: ChoiceCardSettings;
61+
choiceCardSettings?: ChoiceCardDesignSettings;
6262
bannerId?: BannerId;
6363
tickerStylingSettings?: TickerSettings['tickerStylingSettings'];
6464
headerSettings?: HeaderSettings;

dotcom-rendering/src/components/marketing/lib/storybook.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,48 @@ export const choiceCardsSettings: ChoiceCardsSettings = {
9797
],
9898
};
9999

100+
export const choiceCardsSettingsWithDiscountPill: ChoiceCardsSettings = {
101+
...choiceCardsSettings,
102+
choiceCards: choiceCardsSettings.choiceCards.map((card, index) => {
103+
if (index === 1) {
104+
return {
105+
...card,
106+
label: 'Support <s>£12</s> £6/monthly',
107+
pill: {
108+
copy: '50% off',
109+
backgroundColour: {
110+
kind: 'hex',
111+
r: 'BB',
112+
g: '80',
113+
b: '3B',
114+
},
115+
},
116+
};
117+
}
118+
return card;
119+
}),
120+
mobileChoiceCards: choiceCardsSettings.mobileChoiceCards?.map(
121+
(card, index) => {
122+
if (index === 1) {
123+
return {
124+
...card,
125+
label: 'Support <s>£12</s> £6/monthly',
126+
pill: {
127+
copy: '50% off',
128+
backgroundColour: {
129+
kind: 'hex',
130+
r: 'BB',
131+
g: '80',
132+
b: '3B',
133+
},
134+
},
135+
};
136+
}
137+
return card;
138+
},
139+
),
140+
};
141+
100142
export const choiceCardsWithMixedDestinations: ChoiceCardsSettings = {
101143
choiceCards: [
102144
{

0 commit comments

Comments
 (0)