Skip to content

Commit c0fadec

Browse files
authored
Merge branch 'main' into ab/tag-page-formatting
2 parents 3698be2 + c9cabe5 commit c0fadec

31 files changed

+478
-307
lines changed

dotcom-rendering/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"@guardian/ophan-tracker-js": "2.3.0",
4242
"@guardian/react-crossword": "6.3.0",
4343
"@guardian/shimport": "1.0.2",
44-
"@guardian/source": "9.0.0",
44+
"@guardian/source": "10.2.0",
4545
"@guardian/source-development-kitchen": "18.1.1",
4646
"@guardian/support-dotcom-components": "7.6.2",
4747
"@guardian/tsconfig": "0.2.0",

dotcom-rendering/scripts/perf/k6/article-nier-automata.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,7 +1590,6 @@
15901590
"enableDiscussionSwitch": true,
15911591
"prebidXaxis": true,
15921592
"stickyVideos": true,
1593-
"interactiveFullHeaderSwitch": true,
15941593
"discussionAllPageSize": true,
15951594
"prebidUserSync": true,
15961595
"audioOnwardJourneySwitch": true,

dotcom-rendering/src/components/ArticleHeadline.tsx

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { css } from '@emotion/react';
22
import {
3+
between,
34
from,
45
headlineBold28,
56
headlineBold34,
@@ -116,13 +117,24 @@ const decideMobileHeadlineFont = (format: ArticleFormat) => {
116117
}
117118
};
118119

119-
const headlineFont = (format: ArticleFormat) => css`
120-
${decideMobileHeadlineFont(format)}
120+
const headlineFont = (format: ArticleFormat) => {
121+
if (format.design === ArticleDesign.Gallery) {
122+
return css`
123+
${decideMobileHeadlineFont(format)}
121124
122-
${from.tablet} {
123-
${decideHeadlineFont(format)}
125+
${from.desktop} {
126+
${decideHeadlineFont(format)}
127+
}
128+
`;
124129
}
125-
`;
130+
return css`
131+
${decideMobileHeadlineFont(format)}
132+
133+
${from.tablet} {
134+
${decideHeadlineFont(format)}
135+
}
136+
`;
137+
};
126138

127139
const invertedFontLineHeight = css`
128140
line-height: 2.1875rem;
@@ -371,6 +383,17 @@ const decideBottomPadding = ({
371383
}
372384
};
373385

386+
const galleryStyles = css`
387+
${grid.between('grid-start', 'centre-column-end')}
388+
389+
grid-row: 7/9;
390+
391+
${from.tablet} {
392+
${grid.between('centre-column-start', 'grid-end')};
393+
margin-left: -10px;
394+
}
395+
`;
396+
374397
export const ArticleHeadline = ({
375398
headlineString,
376399
format,
@@ -825,15 +848,7 @@ export const ArticleHeadline = ({
825848
);
826849
case ArticleDesign.Gallery: {
827850
return (
828-
<div
829-
css={[
830-
darkBackground,
831-
grid.between('centre-column-start', 'grid-end'),
832-
css`
833-
grid-row: 7/9;
834-
`,
835-
]}
836-
>
851+
<div css={galleryStyles}>
837852
<WithAgeWarning
838853
tags={tags}
839854
webPublicationDateDeprecated={
@@ -850,9 +865,16 @@ export const ArticleHeadline = ({
850865
color: ${themePalette(
851866
'--headline-colour',
852867
)};
868+
${darkBackground};
869+
min-height: 84px;
853870
padding-bottom: ${space[6]}px;
854871
padding-left: ${space[3]}px;
855872
padding-right: ${space[3]}px;
873+
874+
${between.mobileLandscape.and
875+
.tablet} {
876+
padding-left: ${space[5]}px;
877+
}
856878
`,
857879
]}
858880
>

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

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,23 @@ const stretchLines = css`
201201
grid-column: 1 / -1;
202202
`;
203203

204+
const galleryMetaContainer = css`
205+
${grid.column.centre}
206+
padding-bottom: ${space[2]}px;
207+
${from.tablet} {
208+
position: relative;
209+
&::before {
210+
content: '';
211+
position: absolute;
212+
left: -10px;
213+
top: 0;
214+
bottom: 0;
215+
width: 1px;
216+
background-color: ${themePalette('--article-border')};
217+
}
218+
}
219+
`;
220+
204221
export const ArticleMetaApps = ({
205222
branding,
206223
format,
@@ -244,13 +261,7 @@ export const ArticleMetaApps = ({
244261
}
245262
css={[
246263
metaContainerMargins,
247-
isGallery ? grid.column.centre : undefined,
248-
isGallery
249-
? {
250-
marginLeft: space[3],
251-
paddingBottom: space[2],
252-
}
253-
: undefined,
264+
isGallery ? galleryMetaContainer : undefined,
254265
]}
255266
>
256267
<div

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

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,21 @@ export const metaContainer = (format: ArticleFormat) => {
190190
case ArticleDesign.Gallery:
191191
return css`
192192
${grid.column.centre}
193-
margin-bottom: ${space[3]}px;
194-
margin-left: ${space[3]}px;
195-
margin-right: ${space[3]}px;
193+
padding-bottom: ${space[3]}px;
194+
${from.tablet} {
195+
position: relative;
196+
&::before {
197+
content: '';
198+
position: absolute;
199+
left: -10px;
200+
top: 0;
201+
bottom: 0;
202+
width: 1px;
203+
background-color: ${themePalette(
204+
'--article-border',
205+
)};
206+
}
207+
}
196208
`;
197209
default:
198210
return defaultMargins;

dotcom-rendering/src/components/ArticlePage.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,11 @@ export const ArticlePage = (props: WebProps | AppProps) => {
9090
<Island priority="enhancement" defer={{ until: 'idle' }}>
9191
<FocusStyles />
9292
</Island>
93+
{!!frontendData.affiliateLinksDisclaimer && (
94+
<Island priority="feature" defer={{ until: 'idle' }}>
95+
<EnhanceAffiliateLinks />
96+
</Island>
97+
)}
9398
{(format.design === ArticleDesign.LiveBlog ||
9499
format.design === ArticleDesign.DeadBlog) && (
95100
<SkipTo id={'key-events-carousel'} label="Skip to key events" />
@@ -131,11 +136,6 @@ export const ArticlePage = (props: WebProps | AppProps) => {
131136
serverSideTests={frontendData.config.abTests}
132137
/>
133138
</Island>
134-
{!!frontendData.affiliateLinksDisclaimer && (
135-
<Island priority="feature" defer={{ until: 'idle' }}>
136-
<EnhanceAffiliateLinks />
137-
</Island>
138-
)}
139139
</>
140140
)}
141141
{renderingTarget === 'Web' ? (
@@ -177,15 +177,13 @@ export const ArticlePage = (props: WebProps | AppProps) => {
177177
)}
178178
{renderingTarget === 'Apps' ? (
179179
<DecideLayout
180-
article={frontendData}
181-
format={format}
180+
article={props.article}
182181
renderingTarget={renderingTarget}
183182
/>
184183
) : (
185184
<DecideLayout
186-
article={frontendData}
185+
article={props.article}
187186
NAV={props.NAV}
188-
format={format}
189187
renderingTarget={renderingTarget}
190188
/>
191189
)}

dotcom-rendering/src/components/ArticleTitle.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,16 @@ const immersiveMargins = css`
4343
`;
4444

4545
const galleryStyles = css`
46-
${grid.between('centre-column-start', 'grid-end')};
46+
${grid.column.all}
47+
4748
grid-row: 6/7;
4849
max-width: 400px;
4950
min-width: 200px;
51+
52+
${from.tablet} {
53+
${grid.between('centre-column-start', 'grid-end')};
54+
margin-left: -10px;
55+
}
5056
`;
5157

5258
export const ArticleTitle = ({

dotcom-rendering/src/components/FrontSection.tsx

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { css } from '@emotion/react';
22
import { isString } from '@guardian/libs';
33
import { between, from, space, until } from '@guardian/source/foundations';
44
import { pageSkinContainer } from '../layouts/lib/pageSkin';
5-
import type { EditionId } from '../lib/edition';
5+
import { type EditionId, isNetworkFront } from '../lib/edition';
66
import { hideAge } from '../lib/hideAge';
77
import { palette, palette as schemePalette } from '../palette';
88
import type { CollectionBranding } from '../types/branding';
@@ -98,13 +98,21 @@ type Props = {
9898
const width = (columns: number, columnWidth: number, columnGap: number) =>
9999
`width: ${columns * columnWidth + (columns - 1) * columnGap}px;`;
100100

101-
const borderColourStyles = (title?: string): string => {
101+
const borderColourStyles = (
102+
title?: string,
103+
showSectionColours?: boolean,
104+
): string => {
105+
if (!showSectionColours) {
106+
return schemePalette('--section-border-primary');
107+
}
108+
102109
switch (title) {
103110
case 'News':
104111
return schemePalette('--section-border-news');
105112
case 'Opinion':
106113
return schemePalette('--section-border-opinion');
107114
case 'Sport':
115+
case 'Sports':
108116
return schemePalette('--section-border-sport');
109117
case 'Lifestyle':
110118
return schemePalette('--section-border-lifestyle');
@@ -115,13 +123,21 @@ const borderColourStyles = (title?: string): string => {
115123
}
116124
};
117125

118-
const articleSectionTitleStyles = (title?: string): string => {
126+
const articleSectionTitleStyles = (
127+
title?: string,
128+
showSectionColours?: boolean,
129+
): string => {
130+
if (!showSectionColours) {
131+
return schemePalette('--article-section-title');
132+
}
133+
119134
switch (title) {
120135
case 'News':
121136
return schemePalette('--article-section-title-news');
122137
case 'Opinion':
123138
return schemePalette('--article-section-title-opinion');
124139
case 'Sport':
140+
case 'Sports':
125141
return schemePalette('--article-section-title-sport');
126142
case 'Lifestyle':
127143
return schemePalette('--article-section-title-lifestyle');
@@ -435,10 +451,13 @@ const bottomPaddingBetaContainer = (
435451
}
436452
`;
437453

438-
const primaryLevelTopBorder = (title?: string) => css`
454+
const primaryLevelTopBorder = (
455+
title?: string,
456+
showSectionColours?: boolean,
457+
) => css`
439458
grid-row: 1;
440459
grid-column: 1 / -1;
441-
border-top: 2px solid ${borderColourStyles(title)};
460+
border-top: 2px solid ${borderColourStyles(title, showSectionColours)};
442461
/** Ensures the top border sits above the side borders */
443462
z-index: 1;
444463
height: fit-content;
@@ -591,6 +610,8 @@ export const FrontSection = ({
591610
const useLargeSpacingDesktop =
592611
!!isNextCollectionPrimary || isAboveDesktopAd;
593612

613+
const showSectionColours = isNetworkFront(pageId ?? '');
614+
594615
/**
595616
* id is being used to set the containerId in @see {ShowMore.importable.tsx}
596617
* this id pre-existed showMore so is probably also being used for something else.
@@ -624,7 +645,10 @@ export const FrontSection = ({
624645
css={[
625646
containerLevel === 'Secondary'
626647
? secondaryLevelTopBorder
627-
: primaryLevelTopBorder(title),
648+
: primaryLevelTopBorder(
649+
title,
650+
showSectionColours,
651+
),
628652
]}
629653
/>
630654
)}
@@ -663,7 +687,10 @@ export const FrontSection = ({
663687
? schemePalette(
664688
'--article-section-secondary-title',
665689
)
666-
: articleSectionTitleStyles(title)
690+
: articleSectionTitleStyles(
691+
title,
692+
showSectionColours,
693+
)
667694
}
668695
// On paid fronts the title is not treated as a link
669696
url={!isOnPaidContentFront ? url : undefined}

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const Without5to4Ratio: Story = {
4444

4545
export const PausePlay: Story = {
4646
...Default,
47+
name: 'Pause and play interaction',
4748
play: async ({ canvasElement }) => {
4849
const canvas = within(canvasElement);
4950
const videoEl = canvas.getByTestId('loop-video');
@@ -64,6 +65,7 @@ export const PausePlay: Story = {
6465

6566
export const UnmuteMute: Story = {
6667
...Default,
68+
name: 'Unmute and mute interaction',
6769
parameters: {
6870
test: {
6971
// The following error is received without this flag: "TypeError: ophan.trackClickComponentEvent is not a function"
@@ -90,6 +92,7 @@ function sleep(ms: number) {
9092

9193
export const InteractionObserver: Story = {
9294
...Default,
95+
name: 'Interaction observer',
9396
render: (args) => (
9497
<div data-testid="test-container">
9598
<LoopVideo {...args} />

dotcom-rendering/src/components/LoopVideoPlayer.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ export const LoopVideoPlayer = forwardRef(
144144
data-link-name={`gu-video-loop-${
145145
showPlayIcon ? 'play' : 'pause'
146146
}-${atomId}`}
147+
data-chromatic="ignore"
147148
preload={preloadPartialData ? 'metadata' : 'none'}
148149
loop={true}
149150
muted={isMuted}

0 commit comments

Comments
 (0)