WS-2782: Apply dark UI for 'video' Topic Pages - #14372
Open
alex-magana wants to merge 22 commits into
Open
Conversation
WS-2782: Fix failing darkUI checks
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved moderate issues affect video Topic Page routing, contrast, background coverage, and media indicator colors.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Extends dark UI theming to video Topic Pages through media-type context, responsive styling, and updated snapshots.
Changes:
- Passes
primaryMediaTypethrough request and theme contexts. - Adds dark styling for Topic Pages, pagination, curation, promos, and media icons.
- Refreshes affected integration and component snapshots.
File summaries
| File | Reviewed changes and final notes |
|---|---|
ws-nextjs-app/pages/_app.page.tsx |
Passes media type to context. Moderate (1 vote): video type is not read from the actual topic response. |
ws-nextjs-app/integration/pages/onDemandTVPage/pashtoBrand/__snapshots__/canonical.test.ts.snap |
Refreshed generated styles. |
ws-nextjs-app/integration/pages/onDemandTVPage/hausa/__snapshots__/canonical.test.ts.snap |
Refreshed generated styles. |
ws-nextjs-app/integration/pages/av-embeds/russian/__snapshots__/canonical.test.ts.snap |
Refreshed generated styles. |
ws-nextjs-app/integration/pages/articles/persianMediaPlayer/__snapshots__/canonical.test.ts.snap |
Refreshed generated styles. |
ws-nextjs-app/integration/pages/articles/afrique/__snapshots__/canonical.test.ts.snap |
Refreshed generated styles. |
src/app/pages/TopicPage/TopicPage.jsx |
Adds the dark page wrapper. Moderate (1 vote each): heading contrast and full-height background need correction. |
src/app/pages/TopicPage/index.styles.jsx |
Defines the dark wrapper. Moderate (2 votes): heading contrast needs correction. Nit (1 vote): use the SCSS module convention. |
src/app/legacy/psammead/psammead-assets/src/svgs/mediaIcons.jsx |
Adds responsive video icon colors. |
src/app/legacy/containers/StoryPromo/__snapshots__/index.test.jsx.snap |
Refreshed promo snapshots. |
src/app/legacy/components/Promo/media-icon.jsx |
Adds responsive dark media indicator styling. Moderate (2 votes): use the required EBON/BLACK backgrounds. |
src/app/legacy/components/Promo/a.jsx |
Updates dark promo link colors. |
src/app/contexts/RequestContext/index.tsx |
Stores primaryMediaType in request context. |
src/app/contexts/RequestContext/index.test.tsx |
Tests media type propagation. |
src/app/components/ThemeProviderSCSSModules/withThemeProvider.tsx |
Updates dark UI document state. |
src/app/components/ThemeProvider/withThemeProvider.tsx |
Enables dark UI for video topics. Nit (1 vote): add focused coverage for video and non-video Topic Pages. |
src/app/components/Pagination/index.styles.ts |
Adds dark pagination colors. |
src/app/components/MediaLoader/Placeholder/__snapshots__/index.test.tsx.snap |
Refreshed media-loader snapshots. |
src/app/components/Curation/HierarchicalGrid/index.styles.tsx |
Adds dark curation body colors. |
Review details
Suppressed comments (5)
src/app/components/ThemeProvider/withThemeProvider.tsx:28
- The new video-topic branch is not covered by the existing ThemeProvider tests: those tests render without a RequestContext and do not assert either
isDarkUior thedata-is-dark-uiattribute. Add focused cases for a video Topic Page and a non-video Topic Page, covering both the Emotion and SCSS theme providers, so this routing condition cannot regress.
const isDarkUiPage = ({
pageType,
primaryMediaType,
}: {
pageType: PageTypes;
primaryMediaType?: string | null;
}) =>
(primaryMediaType === 'video' && pageType === TOPIC_PAGE) ||
([MEDIA_ARTICLE_PAGE, TV_PAGE, LIVE_TV_PAGE] as PageTypes[]).includes(
pageType,
);
src/app/pages/TopicPage/TopicPage.jsx:53
- This new dark background makes the existing TopicTitle and TopicDescription colors unreadable: both components set their text to
palette.GREY_10, the same dark value used here for the background. Update those foreground styles forisDarkUi(the title is always rendered), otherwise video topic pages have a severe contrast/accessibility regression.
<div css={theme => (theme.isDarkUi ? styles.pageWrapper : undefined)}>
src/app/pages/TopicPage/TopicPage.jsx:53
- The dark color is applied only to this content-height child.
PageLayoutWrappergives its parent content area the remaining viewport height but keeps that areapalette.GHOST, so a short video topic page will show a light strip below the topic content instead of the dark UI background. Apply the dark background to the full content wrapper or make this wrapper fill it.
<div css={theme => (theme.isDarkUi ? styles.pageWrapper : undefined)}>
src/app/pages/TopicPage/index.styles.jsx:8
- This introduces new component styling in an Emotion style object. The repository's SCSS migration convention uses a co-located
.module.scsswith theme tokens for new or modified component styling (as insrc/app/components/ArticleLinksBlock/index.module.scss), so move this wrapper rule to the TopicPage module stylesheet instead of extending the Emotion styles.
pageWrapper: ({ palette, isDarkUi }) =>
css({
...(isDarkUi && {
backgroundColor: palette.GREY_10,
}),
ws-nextjs-app/pages/_app.page.tsx:166
- The topic route passes its BFF
pageDatathrough unchanged, but the topic responses used here do not expose a top-levelprimaryMediaType; video is represented oncurations[].summaries[].type. This destructuring therefore leaves the context valuenull, soisDarkUiPagenever enables dark UI for video Topic Pages. Populate this value from the actual topic response (or change the route contract) before passing it toRequestContextProvider.
const {
metadata: { atiAnalytics = undefined } = {},
primaryMediaType = null,
} = pageData ?? {};
- Files reviewed: 19/19 changed files
- Comments generated: 2
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves JIRA: WS-2782
Summary
Adopt a dark UI experience on video-centric Topic Pages.
Code changes
primaryMediaTypefrom the BFF response.primaryMediaTypeto the RequestContextProvider.primaryMediaTypeis setto
videoand set in the theme provider and the SCSS theme provider.Testing
Useful Links