Skip to content

Feat clickable playlist progress bar - #7782

Merged
FreeTubeBot merged 25 commits into
FreeTubeApp:developmentfrom
NishPatel101:feat/clickable-playlist-progressbar
Nov 5, 2025
Merged

FreeTubeBot merged 25 commits into
FreeTubeApp:developmentfrom
NishPatel101:feat/clickable-playlist-progressbar

Conversation

@NishPatel101

Copy link
Copy Markdown
Contributor

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Closes #7207

Description

Enhances the playlist progress bar to be clickable so users can select a video in their playlist without needing to scroll through the videos playlist.

  • Expands bar for visibility when hovering
  • Has the playlist in ticks, with each tick corresponding to a video index
  • Shows the video thumbnail and title for the currently hovered video

Screenshots

Before
Screenshot 2025-08-04 200110
After
demo_fix

Testing

  • View playlist with videos
  • Hover over playlist progress bar and view preview thumbnails/titles
  • Select video in playlist through progress bar
  • Ensure index numbering and progress fill match current video's rank in playlist

Desktop

  • OS: Windows
  • OS Version: 11, 24H2
  • FreeTube version: 0.23.5 Beta

Additional context

@FreeTubeBot
FreeTubeBot enabled auto-merge (squash) August 5, 2025 05:48
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Aug 5, 2025
@PikachuEXE

Copy link
Copy Markdown
Member

I think what #7207 describes is to scroll to the video in the view not start watching clicked video
Progress bar clicking especially with long playlists is very easy to misclick (especially on mobile/with touchscreen
Scrolling to specific video much safer action

@absidue absidue added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Aug 6, 2025
@kommunarr

Copy link
Copy Markdown
Collaborator

I think what #7207 describes is to scroll to the video in the view not start watching clicked video
Progress bar clicking especially with long playlists is very easy to misclick (especially on mobile/with touchscreen
Scrolling to specific video much safer action

@NishPatel101 Yes, to confirm, what @PikachuEXE is suggesting is my original proposal. You can probably do this through something like calling scrollIntoView() on the selected video element.

@github-actions

Copy link
Copy Markdown
Contributor

This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 14 days.

* development: (84 commits)
  Translated using Weblate (Chinese (Traditional Han script))
  Show more information on long playlists. (FreeTubeApp#7804)
  Translated using Weblate (French)
  Refactor/cleanup tray related code after PR merged (FreeTubeApp#7856)
  Translated using Weblate (Estonian)
  Translated using Weblate (Italian)
  Translated using Weblate (Afrikaans)
  Translated using Weblate (Latvian)
  Translated using Weblate (Lithuanian)
  Translated using Weblate (Norwegian Nynorsk)
  Translated using Weblate (Galician)
  Translated using Weblate (Korean)
  Translated using Weblate (Slovenian)
  Translated using Weblate (Danish)
  Translated using Weblate (Kurdish)
  Translated using Weblate (Catalan)
  Translated using Weblate (Indonesian)
  Translated using Weblate (Greek)
  Translated using Weblate (Slovak)
  Translated using Weblate (Spanish (Mexico))
  ...
@PikachuEXE

Copy link
Copy Markdown
Member

Updated the progress bar click to scroll to playlist item instead of start watching that video
Also updated thumbnail style to be slightly larger and has 4/3 ratio like width < 768px one
Screenshot 2025-08-25 at 13 31 16

@PikachuEXE PikachuEXE added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested PR: stale labels Aug 25, 2025
updateProgressBarPreview: function (event) {
if (!this.showProgressBarPreview) return

const rect = event.currentTarget.querySelector('.playlistProgressBar').getBoundingClientRect()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could probably replace this querySelector call with a template ref.


if (targetArrayIndex >= 0 && targetArrayIndex < this.playlistItems.length) {
const container = this.$refs.playlistItems
const targetPlaylistItemEl = (this.$refs.playlistItem || [])[targetArrayIndex]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Vue does not guarantee that template ref arrays created by v-for are in the same order as the elements on the page for performance reasons, as it is a lot faster to insert new elements at the end of an array or leave them in their current positions when the elements on the page move, than maintaining the correct order. So this code would only work if nobody modifies the playlist sort order or the playlist iteself from another window while you are on the watch page in this window.

In the chapters component we solve this by adding template ref to the parent element and using the .children property on the parent element.

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Aug 30, 2025
@PikachuEXE

Copy link
Copy Markdown
Member

All addressed

Also removed opacity to workaround preview covered by other elements in theatre mode
image

@PikachuEXE

Copy link
Copy Markdown
Member

Fixed width applied
Touch device updated to have this feature disabled as I cannot find a way to have separate implementation for touch (no preview, just expanded progress bar)

@efb4f5ff-1298-471a-8973-3d47447115dc

efb4f5ff-1298-471a-8973-3d47447115dc commented Oct 21, 2025 •

Copy link
Copy Markdown
Member

issue (non-blocking): precise navigation near-impossible for large playlists (500+ videos), but not well-versed enough with this kind of UI component to know what's best practice

Yeah not much we can do about that. Lets not address that.

nitpick: safe to disable this feature for playlists with >3 videos IMO

Lets not cap it to an arbitrary amount

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Number overlaps with title

VirtualBoxVM_XjlEf6TUID.mp4

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Oct 21, 2025
@PikachuEXE

Copy link
Copy Markdown
Member

Updated preview for small width viewport to be like
image
image

No change for larger width viewport
image

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Oct 22, 2025
Comment on lines +213 to +237
/* The primary input mechanism includes a pointing device of limited accuracy, such as a finger on a touchscreen. */
@media (pointer: coarse) {
.progressBarPreview {
display: none;
}

/* Show progress bar as always expanded */
.playlistProgressBar {
block-size: 12px;
margin-block: -3px;
}
}

/* The primary input mechanism does not include a pointing device.. */
@media (pointer: none) {
.progressBarPreview {
display: none;
}

/* Show progress bar as always expanded */
.playlistProgressBar {
block-size: 12px;
margin-block: -3px;
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
/* The primary input mechanism includes a pointing device of limited accuracy, such as a finger on a touchscreen. */
@media (pointer: coarse) {
.progressBarPreview {
display: none;
}
/* Show progress bar as always expanded */
.playlistProgressBar {
block-size: 12px;
margin-block: -3px;
}
}
/* The primary input mechanism does not include a pointing device.. */
@media (pointer: none) {
.progressBarPreview {
display: none;
}
/* Show progress bar as always expanded */
.playlistProgressBar {
block-size: 12px;
margin-block: -3px;
}
}
/* The primary input mechanism does not include a pointing device or includes a pointing device of limited accuracy, such as a finger on a touchscreen. */
@media (pointer: none), (pointer: coarse) {
.progressBarPreview {
display: none;
}
/* Show progress bar as always expanded */
.playlistProgressBar {
block-size: 12px;
margin-block: -3px;
}
}

const container = this.$refs.playlistItems
const currentVideoItem = (this.$refs.currentVideoItem || [])[0]
if (container != null && currentVideoItem != null) {
const currentVideoItemEl = (this.$refs.playlistItem || [])[this.currentVideoIndexZeroBased]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please see: #7782 (comment)

Comment on lines +592 to +595
const percentage = Math.max(0, Math.min(100, (mouseX / progressBarWidth) * 100))

this.previewPosition = percentage
this.previewVideoIndex = Math.max(1, Math.min(this.playlistVideoCount, Math.ceil((percentage / 100) * this.playlistVideoCount)))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not important: We seem to be multiplying by 100 at the top only to then divide by 100 again at the bottom.

@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: changes requested and removed PR: waiting for review For PRs that are complete, tested, and ready for review labels Oct 30, 2025
* development: (38 commits)
  Replace vue-portal dependency with Vue's built-in <Teleport> component (FreeTubeApp#8207)
  Update to Vue 3 (FreeTubeApp#8094)
  Translated using Weblate (Basque)
  Translated using Weblate (Hungarian)
  Translated using Weblate (Icelandic)
  Translated using Weblate (Turkish)
  Properly fix CORS in PO token web views (FreeTubeApp#8203)
  Translated using Weblate (Italian)
  Translated using Weblate (Norwegian Bokmål)
  Translated using Weblate (French)
  Configure nedb to always clean up corrupted data (FreeTubeApp#8202)
  Translated using Weblate (Portuguese (Brazil))
  Add video paused check to frame shortcuts (FreeTubeApp#8200)
  Fix toast with timeout 0 will be displayed for default 3s (FreeTubeApp#8168)
  Translated using Weblate (Chinese (Simplified Han script))
  Change containing text input limit (FreeTubeApp#8174)
  Translated using Weblate (Dutch)
  Add support for AppImageUpdate (FreeTubeApp#8153)
  Added New Window option to Tray (FreeTubeApp#7995)
  Translated using Weblate (Japanese)
  ...
@efb4f5ff-1298-471a-8973-3d47447115dc efb4f5ff-1298-471a-8973-3d47447115dc added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Nov 3, 2025
@FreeTubeBot
FreeTubeBot merged commit fa79120 into FreeTubeApp:development Nov 5, 2025
@github-actions github-actions Bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Nov 5, 2025
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Nov 6, 2025
* development:
  Change clear filter button from text to icon (FreeTubeApp#8205)
  Feat clickable playlist progress bar (FreeTubeApp#7782)
  Add Hide channels based on text (FreeTubeApp#7948)
  Clean up defunct shaka-player types patching (FreeTubeApp#8224)
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Nov 6, 2025
* development:
  Change clear filter button from text to icon (FreeTubeApp#8205)
  Feat clickable playlist progress bar (FreeTubeApp#7782)
  Add Hide channels based on text (FreeTubeApp#7948)
  Clean up defunct shaka-player types patching (FreeTubeApp#8224)
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.

[Feature Request]: Click on playlist progress bar to scroll to index

6 participants