Move the shared media players into page-components - #3875
Merged
Merged
Conversation
page-components/TiptapEditor embeds both VideoResourcePlayer and PodcastEmbedPlayer, but both lived in app-pages, which the import/no-restricted-paths zone in frontends/.eslintrc.js forbids page-components from importing. eslint-plugin-import 2.29 missed it; 2.31 (in #3851) reports all four. Moving only the two player entry points would have relocated the violation rather than fixed it, since each pulls in siblings, so each cluster moved with the modules it needs: page-components/VideoPlayer/ VideoResourcePlayer, VideoJsPlayer, YouTubeIframePlayer, videoSources page-components/PodcastEmbedPlayer/ PodcastEmbedPlayer, useAudioPlayer, usePlaybackRecovery, AudioPlayer.styled Only what the players need moved. The old shared.styled.ts keeps its seven page-chrome exports and gives up NoVideoMessage and ScreenReaderOnly; PodcastPlayer stays on the podcast page and now imports the hooks from page-components, which is an allowed direction. getEpisodeAudioUrl went to common/podcasts.ts instead of either player folder: the listing page and the embed player both need it, and common/ is already where this kind of pure helper lives. helpers.ts re-exports it so its existing importers and tests are untouched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FyJ72HRTyQf6jVYmw3GZSt
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
Contributor
There was a problem hiding this comment.
Pull request overview
Relocates shared video and podcast players into page-components, resolving component hierarchy violations exposed by the dependency upgrade.
Changes:
- Moves video and podcast player modules with their supporting code and tests.
- Updates consumers and Jest mocks to use the new paths.
- Moves the shared podcast URL helper into
common.
Reviewed changes
Copilot reviewed 24 out of 34 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
page-components/VideoPlayer/YouTubeIframePlayer.tsx |
Relocates YouTube player. |
page-components/VideoPlayer/videoSources.ts |
Relocates source resolution. |
page-components/VideoPlayer/videoSources.test.ts |
Relocates source tests. |
page-components/VideoPlayer/VideoResourcePlayer.tsx |
Relocates resource player. |
page-components/VideoPlayer/VideoResourcePlayer.test.tsx |
Relocates player tests. |
page-components/VideoPlayer/VideoJsPlayer.tsx |
Relocates Video.js wrapper. |
page-components/VideoPlayer/shared.styled.ts |
Houses shared player styles. |
TiptapEditor/.../PodcastEpisodeEmbedViewer.tsx |
Updates podcast player import. |
TiptapEditor/.../PodcastEpisodeEmbedNode.tsx |
Updates podcast player import. |
TiptapEditor/.../MediaEmbedViewer.tsx |
Updates video player import. |
TiptapEditor/.../MediaEmbedNodeView.tsx |
Updates video player import. |
page-components/PodcastEmbedPlayer/usePlaybackRecovery.ts |
Relocates recovery hook. |
page-components/PodcastEmbedPlayer/useAudioPlayer.ts |
Relocates audio hook. |
page-components/PodcastEmbedPlayer/PodcastEmbedPlayer.tsx |
Relocates podcast player. |
page-components/PodcastEmbedPlayer/PodcastEmbedPlayer.test.tsx |
Relocates podcast tests. |
page-components/PodcastEmbedPlayer/AudioPlayer.styled.ts |
Relocates shared audio styles. |
common/podcasts.ts |
Centralizes podcast URL helper. |
app/(embed)/podcast/embed/[id]/page.tsx |
Updates podcast import. |
app/(embed)/podcast/embed/[id]/page.test.tsx |
Updates podcast mock. |
VideoPlaylistCollectionPage/VideoShareButton.tsx |
Updates player type import. |
VideoPlaylistCollectionPage/VideoShareButton.test.tsx |
Updates test type import. |
VideoPlaylistCollectionPage/VideoSeriesDetailPage.tsx |
Updates player imports. |
VideoPlaylistCollectionPage/VideoSeriesDetailPage.test.tsx |
Updates Video.js mock. |
VideoPlaylistCollectionPage/VideoSeriesDetailPage.styled.ts |
Re-exports relocated styles. |
VideoPlaylistCollectionPage/VideoDetailPage.tsx |
Updates player type import. |
VideoPlaylistCollectionPage/VideoDetailPage.test.tsx |
Updates Video.js mock. |
VideoPlaylistCollectionPage/VideoDetailPage.styled.ts |
Uses relocated player and styles. |
VideoPlaylistCollectionPage/shared.styled.ts |
Removes relocated styles. |
VideoEmbedPage/VideoEmbedPage.tsx |
Updates player import. |
VideoEmbedPage/VideoEmbedPage.test.tsx |
Updates Video.js mock. |
PodcastsListingPage/helpers.ts |
Re-exports common helper. |
PodcastPage/PodcastPlayer.tsx |
Imports relocated audio modules. |
HomePage/VideoShortsModal.tsx |
Updates Video.js import. |
HomePage/VideoShortsModal.test.tsx |
Updates Video.js mock. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
1 task
shanbady
self-requested a review
September 1, 2026 14:11
This was referenced Sep 1, 2026
Closed
Closed
Closed
Merged
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.
What are the relevant tickets?
Unblocks #3851 (the dev-dependency bundle), which is where the violation surfaced. Companion to #3868, which cleared the a11y half of that same bump.
Description (What does it do?)
page-components/TiptapEditorembeds bothVideoResourcePlayerandPodcastEmbedPlayer, but both lived inapp-pages. Theimport/no-restricted-pathszone infrontends/.eslintrc.jsforbids exactly that:eslint-plugin-import2.29 did not catch it. 2.31, which #3851 pulls in, reports all four.Moving only the two entry points would have relocated the violation rather than fixed it, since each player imports siblings from its old directory. So each cluster moved with the modules it actually needs:
page-components/VideoPlayer/VideoResourcePlayer,VideoJsPlayer,YouTubeIframePlayer,videoSources(+ their tests)page-components/PodcastEmbedPlayer/PodcastEmbedPlayer(+ test),useAudioPlayer,usePlaybackRecovery,AudioPlayer.styledDeliberately not moved:
shared.styled.tsgives up onlyNoVideoMessageandScreenReaderOnly. Its other seven exports are video-page chrome (SkipLinksNav,StyledBreadcrumbs,DurationBadge,ThumbnailWrapper,PlayOverlay,PlayIcon,VideoTitle) and stay inapp-pages.PodcastPlayer.tsxstays on the podcast page and now imports the hooks and styles frompage-components, which is the allowed direction.getEpisodeAudioUrlwent to a newcommon/podcasts.tsrather than into either player folder: the listing page (app-pages) and the embed player (page-components) both need it, andcommon/is already where this kind of pure helper lives (slugs.ts,urls.ts,certificateUtils.ts).PodcastsListingPage/helpers.tsre-exports it, so its six existing importers are untouched.Two judgment calls worth a reviewer's eye:
getEpisodeAudioUrltests still live inhelpers.test.tsand now exercise it through that re-export. Moving them to acommon/podcasts.test.tswould be tidier; it seemed like churn for a move PR, and the coverage is identical either way../helpers.How can this be tested?
The boundary is clean by construction —
rg '@/app-pages/' frontends/main/src/page-components/returns nothing, where before this change it returned the four violating imports. That check is worth more than the linter here, since it does not depend on which resolver version is installed.lint-checkon this branch passes but does not prove the fix: the rule only fires witheslint-plugin-import2.31, which lands with #3851. Confirmation comes when #3851 rebases onto this.yarn workspace frontends run typecheck— passes.yarn test VideoResourcePlayer videoSources PodcastEmbedPlayer PodcastPlayer VideoDetailPage VideoSeriesDetailPage VideoShareButton VideoShortsModal VideoEmbedPage MediaEmbed PodcastEpisodeEmbed helpers.test— 13 suites, 237 tests, all passing.Every relocated file is a pure rename with no content change; only
PodcastEmbedPlayer.tsxhas a one-line edit (itsgetEpisodeAudioUrlimport). Reviewing withgit log --followorgit diff -Mshould show that clearly.🤖 Generated with Claude Code
https://claude.ai/code/session_01FyJ72HRTyQf6jVYmw3GZSt