Skip to content

Add onward content to Hosted Gallery pages#16323

Draft
cemms1 wants to merge 2 commits into
mainfrom
cemms1/hosted-onwards-gallery
Draft

Add onward content to Hosted Gallery pages#16323
cemms1 wants to merge 2 commits into
mainfrom
cemms1/hosted-onwards-gallery

Conversation

@cemms1

@cemms1 cemms1 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What does this change?

Adds onward content to Hosted Gallery pages.

Does this by re-using the existing onward component for hosted content and adapting it slightly for gallery pages by using a larger image size and switching to a row display from desktop upwards

This doesn't strictly follow the designs provided but uses the component that already exists as a step towards the final result. This should allow us to release these pages and iterate on them in the background

Why?

We're migrating Hosted Gallery pages from frontend to DCR

Screenshots

Before After
before after
before2 after2
before3 after3

@cemms1 cemms1 force-pushed the cemms1/hosted-onwards-gallery branch from e920c28 to d85ef2f Compare July 3, 2026 15:45
@cemms1 cemms1 added the maintenance Departmental tracking: maintenance work, not a fix or a feature label Jul 3, 2026
@cemms1 cemms1 changed the title Cemms1/hosted onwards gallery Add onward content to Hosted Gallery pages Jul 3, 2026
@cemms1 cemms1 added Commercial 💰 run_chromatic Runs chromatic when label is applied labels Jul 3, 2026
Comment on lines +50 to +54
const hostedGalleryOverrides = css`
${between.desktop.and.leftCol} {
${grid.centreRule(2, 'transparent')}
}
`;

@cemms1 cemms1 Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This removes the vertical rule to the left of the caption (see screenshot of the problem) which appears from desktop until leftCol breakpoint and comes from the new grid logic

Image

@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 3, 2026
Comment on lines +58 to +61
${from.tablet} {
padding-bottom: ${space[10]}px;
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lift and shift to make the CSS easier to read:
small screen -> large screen CSS ordering

@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown

Comment on lines +18 to +24
/**
* Override --accent-colour variable at a higher CSS specificity
* for hosted gallery articles only, because this only has a dark design
*/
const galleryOverrides = css`
--accent-colour: ${palette('--onward-text')};
`;

@cemms1 cemms1 Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to colour contrast issues, we suppress the accent colour from appearing in most dark mode hosted pages. Galleries only ever have "dark mode" so we need to do this in a more permanent way. A simple way to do this is to override the previous one set at the page level by adding a higher specificity colour variable which remains the same between dark and light modes

</div>
</>
);
};

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this to be inline instead of a separate component as I feel it's slightly easier to follow this way

Comment on lines +69 to +74
src={generateImageURL({
mainImage: trail.image.src,
imageWidth: isGalleryPage ? 180 : 120,
resolution: 'low',
aspectRatio: '5:4',
})}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requests the correct image size from Fastly rather than using the trail image URL directly. This allows us to control the aspect ratio and desired resolution of the images

Comment on lines +15 to +22
const mockOnwardsContentFetch = customMockFetch([
{
mockedMethod: 'GET',
mockedUrl: `${hostedGallery.config.ajaxUrl}/${hostedGallery.config.pageId}/onward.json`,
mockedStatus: 200,
mockedBody: { trails: hostedOnwardsTrails },
},
]);

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mocked response of hosted onward content for Storybook stories

@cemms1 cemms1 force-pushed the cemms1/hosted-onwards-gallery branch from d85ef2f to fdf4b67 Compare July 3, 2026 16:50
@cemms1 cemms1 added the run_chromatic Runs chromatic when label is applied label Jul 3, 2026
@github-actions github-actions Bot removed the run_chromatic Runs chromatic when label is applied label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Commercial 💰 maintenance Departmental tracking: maintenance work, not a fix or a feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant