Skip to content

Conversation

JamieB-gu
Copy link
Contributor

The primary reason for this change is to add support for story packages to the new gallery layout.

At the moment every layout duplicates the same transformation on the frontend story package data, mapping over the trails with decideTrail. This change extracts the story package type definition and parsing into its own module, and calls the parsing code up front when the Article type is constructed (i.e. in one place rather than several). For now, we can only use this in galleries, as other layouts are still using the ArticleDeprecated type.

Also adds a type annotation to the story package fixtures, so that we can use them in stories without type errors.

Resolves #14424.

Screenshots

Note: The grey box in the web screenshot is the "merchandising high" ad slot.

Apps Web
apps-story-package web-story-package

The primary reason for this change is to add support for story packages
to the new gallery layout.

At the moment every layout duplicates the same transformation on the
frontend story package data, mapping over the trails with `decideTrail`.
This change extracts the story package type definition and parsing into
its own module, and calls the parsing code up front when the `Article`
type is constructed (i.e. in one place rather than several). For now, we
can only use this in galleries, as other layouts are still using the
`ArticleDeprecated` type.

Also adds a type annotation to the story package fixtures, so that we
can use them in stories without type errors.
@JamieB-gu JamieB-gu requested a review from a team as a code owner August 19, 2025 16:31
Copy link

github-actions bot commented Aug 19, 2025

Copy link

github-actions bot commented Aug 19, 2025

Copy link
Contributor

@marjisound marjisound left a comment

Choose a reason for hiding this comment

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

Looks great

@JamieB-gu JamieB-gu added the run_chromatic Runs chromatic when label is applied label Aug 22, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Aug 22, 2025
@JamieB-gu JamieB-gu added the run_chromatic Runs chromatic when label is applied label Aug 22, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Aug 22, 2025
To make it fit the maximum snapshot size in chromatic

Co-authored-by: Jamie B <[email protected]>
@marjisound marjisound added the run_chromatic Runs chromatic when label is applied label Aug 22, 2025
@github-actions github-actions bot removed the run_chromatic Runs chromatic when label is applied label Aug 22, 2025
@JamieB-gu JamieB-gu merged commit 3d0a4b8 into main Aug 22, 2025
31 checks passed
@JamieB-gu JamieB-gu deleted the gallery-story-packages branch August 22, 2025 14:01
@gu-prout
Copy link

gu-prout bot commented Aug 22, 2025

Seen on PROD (merged by @JamieB-gu 9 minutes and 1 second ago) Please check your changes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gallery Story Packages
2 participants