Add tag ids section id to header#15702
Conversation
a6b3923 to
8570d23
Compare
8570d23 to
bbadec8
Compare
4240783 to
2fcbfdc
Compare
2fcbfdc to
5bed551
Compare
|
Hello 👋! When you're ready to run Chromatic, please apply the You will need to reapply the label each time you want to run Chromatic. |
There was a problem hiding this comment.
Pull request overview
This PR threads additional page-context fields (content type, section, and tags) from page layouts into the Masthead → TopBar → TopBarSupport chain so the remote Support header request can target more accurately.
Changes:
- Add optional
tagIds,sectionId, andcontentTypeprops through Masthead/TopBar/TopBarSupport. - Populate these fields from a wide range of layouts (including front-specific trending-topics →
tagIdsmapping). - Extend the Support header request payload targeting to include
tagIds,sectionId, andcontentType.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dotcom-rendering/src/layouts/TagPageLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/StandardLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/SportDataPageLayout.tsx | Pass section / content type into Masthead. |
| dotcom-rendering/src/layouts/ShowcaseLayout.tsx | Pass header targeting context into Masthead (note: not in all branches). |
| dotcom-rendering/src/layouts/PictureLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/NewsletterSignupLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/LiveLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/InteractiveLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/ImmersiveLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/GalleryLayout.tsx | Thread tag IDs into BannerAndMasthead, then into Masthead and payload context. |
| dotcom-rendering/src/layouts/FullPageInteractiveLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/FrontLayout.tsx | Map trending topic IDs into tagIds, pass through to Masthead. |
| dotcom-rendering/src/layouts/CrosswordLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/CommentLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/layouts/AudioLayout.tsx | Pass tag IDs / section / content type into Masthead. |
| dotcom-rendering/src/components/TopBarSupport.island.tsx | Add new optional props and include them in the Support header targeting payload. |
| dotcom-rendering/src/components/TopBar.island.tsx | Thread new props down into TopBarSupport. |
| dotcom-rendering/src/components/Masthead/Masthead.tsx | Extend Masthead props and pass new fields into TopBar. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| tagIds={article.tags.map( | ||
| (tag) => tag.id, | ||
| )} | ||
| sectionId={article.config.section} |
There was a problem hiding this comment.
In the Labs branch, Masthead is not being passed contentType, so the support header request won't consistently include page content type for Labs showcase pages. Please pass contentType here as well (ideally using the same source as the non-Labs branch).
| sectionId={article.config.section} | |
| sectionId={article.config.section} | |
| contentType={article.config.contentType} |
| pageId={article.pageId} | ||
| tagIds={article.tags.map((tag) => tag.id)} | ||
| sectionId={article.config.section} | ||
| contentType={article.config.contentType} |
There was a problem hiding this comment.
contentType is passed from article.config.contentType here, but this layout (and most others) typically use article.contentType. Mixing the two sources makes it easy to accidentally diverge and can lead to inconsistent targeting. Consider standardising on one source (preferably article.contentType for articles) across all Masthead call sites.
| contentType={article.config.contentType} | |
| contentType={article.contentType} |
|
Seen on PROD (merged by @AnastasiiaBalenko 8 minutes and 15 seconds ago) Please check your changes! |
Ticket link
What does this change?
This change adds page context fields to the header support request so targeting can use it.
Why?
Support header targeting needs contentTyle, section and tags context to make more accurate decisions. This change ensures those fields are consistently available across supported layout types.