Repository navigation
Feat clickable playlist progress bar - #7782
FreeTubeBot merged 25 commits into
Conversation
|
I think what #7207 describes is to scroll to the video in the view not start watching clicked video |
@NishPatel101 Yes, to confirm, what @PikachuEXE is suggesting is my original proposal. You can probably do this through something like calling |
|
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)) ...
…e small width one
| updateProgressBarPreview: function (event) { | ||
| if (!this.showProgressBarPreview) return | ||
|
|
||
| const rect = event.currentTarget.querySelector('.playlistProgressBar').getBoundingClientRect() |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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.
|
Fixed width applied |
Yeah not much we can do about that. Lets not address that.
Lets not cap it to an arbitrary amount |
efb4f5ff-1298-471a-8973-3d47447115dc
left a comment
There was a problem hiding this comment.
Number overlaps with title
VirtualBoxVM_XjlEf6TUID.mp4
| /* 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; | ||
| } | ||
| } |
There was a problem hiding this comment.
| /* 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] |
| 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))) |
There was a problem hiding this comment.
Not important: We seem to be multiplying by 100 at the top only to then divide by 100 again at the bottom.
* 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) ...
* 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)
* 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)





Pull Request Type
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.
Screenshots
Testing
Desktop
Additional context