Skip to content

fix: link the podcast episode to its detail page and fix the video count on collection page#3345

Open
ahtesham-quraish wants to merge 2 commits into
mainfrom
ahtesham/fix-video-count
Open

fix: link the podcast episode to its detail page and fix the video count on collection page#3345
ahtesham-quraish wants to merge 2 commits into
mainfrom
ahtesham/fix-video-count

Conversation

@ahtesham-quraish
Copy link
Copy Markdown
Contributor

What are the relevant tickets?

n/a

Description (What does it do?)

  • Podcast episode having hover and it should link to its detail page instead of playing it
  • The video count on video collection page should be total of all the video count which are part of that particular playlist
  • Some spaces issues are fixed which happens in case there is single episode in podcast or no episode at all

Screenshots (if appropriate):

Screen.Recording.2026-05-15.at.4.43.20.PM.mov

How can this be tested?

if you don't have playlist data locally then in frontend env file you should add the following variable NEXT_PUBLIC_MITOL_API_BASE_URL="https://api.rc.learn.mit.edu" it will connect with RC learn backend
then we need to enable the flag which is podcast-detail-page and then visit the following url http://open.odl.local:8062/podcast/detail/15261?podcast=15260

Additional Context

Copilot AI review requested due to automatic review settings May 15, 2026 11:46
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

OpenAPI Changes

1 changes: 0 error, 1 warning, 0 info

View full changelog

Unexpected changes? Ensure your branch is up-to-date with main (consider rebasing).

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the video playlist collection and podcast pages to (1) display a correct total video count for a playlist and (2) make podcast episode rows navigate to the episode detail page (while keeping play/pause on the play button).

Changes:

  • Video playlist collection page now derives totalVideos from the paginated response count instead of the number of currently loaded items.
  • Podcast episode list items now accept an href and navigate to episode detail on row click; play/pause is handled via the play button with propagation stopped.
  • Podcast episode detail page “More from …” list now links each episode to its own detail page.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
frontends/main/src/app-pages/VideoPlaylistCollectionPage/VideoPlaylistCollectionPage.tsx Adjusts total video count logic and playlist page gating; passes updated totals to header/featured components.
frontends/main/src/app-pages/PodcastPage/PodcastEpisodeDetailPage.tsx Adds episode detail linking for the “More from …” episode list.
frontends/main/src/app-pages/PodcastPage/PodcastDetailPage.tsx Makes episode rows navigable via href and updates click handling to separate navigation vs play/pause.

limit: VIDEOS_PAGE_SIZE,
})

console.log("itemsData", itemsData)
})

if (!showVideoPlaylistPage) {
if (showVideoPlaylistPage) {
isSeries={playlistType}
totalVideos={totalVideos}
totalVideos={totalCount}
totalTime={totalTime}
Comment on lines 152 to 156
}))

const EpisodeList = styled.ul({
const EpisodeList = styled.div({
listStyle: "none",
margin: 0,
onClick={() => (isPlaying ? onPauseClick?.() : onPlayClick(episode))}
isEpisodePage={isEpisodePage}
>
<EpisodeRow onClick={() => router.push(href)} isEpisodePage={isEpisodePage}>
Comment on lines 357 to +361
{episodes.map((episode) => (
<EpisodeItem
key={episode.id}
episode={episode}
href={
@ahtesham-quraish ahtesham-quraish force-pushed the ahtesham/fix-video-count branch 2 times, most recently from 4e69fb5 to 0aeec2e Compare May 15, 2026 12:10
@ahtesham-quraish ahtesham-quraish force-pushed the ahtesham/fix-video-count branch from 0aeec2e to 06ee46c Compare May 15, 2026 12:12
@daniellefrappier18 daniellefrappier18 self-assigned this May 15, 2026
handleRowNavigate()
}
}}
role="link"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

role="link" semantically implies an href attribute (like an anchor). Screen readers will announce it as a link but there's no associated URL in the accessible tree, and AT-users can't copy/open-in-new-tab.

Instead render EpisodeRow as an tag passing href directly, and remove the manual role, tabIndex, onClick, and onKeyDown, the browser handles all of that natively.

}
isPlayable={Boolean(getEpisodeAudioUrl(episode))}
/>
<div key={episode.id} role="listitem">
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

EpisodeList is now a div role="list", and each item is wrapped in <div role="listitem"> containing <EpisodeItem> which itself renders EpisodeRow (another div). This adds an extra DOM node with no purpose.

if you change:

{episodes.map((episode) => (
  <div key={episode.id} role="listitem">
    <EpisodeItem
      episode={episode}
      href={...}
      ...
    />
  </div>
))}

to

{episodes.map((episode) => (
  <EpisodeItem
    key={episode.id}
    episode={episode}
    href={...}
    ...
  />
))}

and add role="listitem" to EpisodeRow that eliminates the extra div wrapper with no semantic purpose

Copy link
Copy Markdown
Contributor

@daniellefrappier18 daniellefrappier18 left a comment

Choose a reason for hiding this comment

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

This looks good but I think we should fix the role="link" on a div without href which is an invalid ARIA pattern before merging

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants