Clean up and de-duplicate the VideoPlaylistCollectionPage folder - #3706
Open
ahtesham-quraish wants to merge 1 commit into
Open
Clean up and de-duplicate the VideoPlaylistCollectionPage folder#3706ahtesham-quraish wants to merge 1 commit into
ahtesham-quraish wants to merge 1 commit into
Conversation
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
This PR refactors the VideoPlaylistCollectionPage frontend code to reduce duplication by centralizing shared UI primitives and extracting reusable pieces into dedicated modules, while updating imports/tests to reference the consolidated components.
Changes:
- Consolidates shared styled primitives (e.g.,
ScreenReaderOnly,DurationBadge,ThumbnailWrapper,VideoTitle) intoshared.styled.tsand updates consuming components to import from there. - Extracts the “More from playlist” rendering into a new
MoreFromPlaylistcomponent and movesVideoDetailPagestyling into a dedicatedVideoDetailPage.styled.tsmodule. - Removes thin re-export shim files (e.g.,
ShareDialog.tsx,VideoShareDialog.tsx) and updates tests/imports to use the canonicalShareDialog.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| frontends/main/src/page-components/ResourceCard/ResourceCard.test.tsx | Removes now-unneeded mocking tied to the old ShareDialog shim path. |
| frontends/main/src/components/ShareDialog/ShareDialog.test.tsx | Updates test to use the canonical ShareDialog component name/import. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoShareDialog.tsx | Removes re-export shim for the share dialog. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoShareButton.tsx | Moves shared button sizing into this component to eliminate per-page wrappers. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoSeriesDetailPage.tsx | Uses shared VideoTitle styling and removes the extra share button wrapper. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoSeriesDetailPage.styled.ts | Re-exports shared primitives from shared.styled.ts and removes duplicate definitions. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoResourcePlayer.tsx | Uses shared ScreenReaderOnly instead of a local duplicate. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoJsPlayer.tsx | Removes backward-compat re-export of resolveVideoSources (source remains in videoSources.ts). |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoDetailPage.tsx | Splits large inline styling and “More from” rendering into dedicated modules; introduces MORE_FROM_LIMIT constant. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoDetailPage.styled.ts | New: centralizes VideoDetailPage styled primitives and re-exports shared primitives. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoCard.tsx | Switches duplicated thumbnail/badge/overlay primitives to shared exports. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/ShareDialog.tsx | Removes re-export shim for the share dialog. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/shared.styled.ts | Adds shared styled primitives to eliminate duplication across video pages. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/MoreFromPlaylist.tsx | New: extracted component for the “More from playlist” section. |
| frontends/main/src/app-pages/VideoPlaylistCollectionPage/FeaturedVideo.tsx | Uses shared DurationBadge and clarifies overlay distinction. |
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?
https://github.com/mitodl/hq/issues/12420
Description (What does it do?)
Screenshots (if appropriate):
How can this be tested?
Additional Context