Skip to content

Hiding Watched Videos on Channel View#7366

Merged
FreeTubeBot merged 55 commits intoFreeTubeApp:developmentfrom
palharesf:feature/4497-hide-watched-videos
Jul 21, 2025
Merged

Hiding Watched Videos on Channel View#7366
FreeTubeBot merged 55 commits intoFreeTubeApp:developmentfrom
palharesf:feature/4497-hide-watched-videos

Conversation

@palharesf
Copy link
Contributor

@palharesf palharesf commented May 5, 2025

Issue 4497 - Hiding Watched Videos on Channel View

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Closes #4497

Description

The 'Hide Videos on Watch' setting has been moved from the 'Subscription' section to the 'Distraction Free' section. Now, it not only hides watched videos (and shorts and lives) from the subscription page, but also from the channel page (from the videos, shorts and lives tab, but not from the home tab).

Screenshots

Current implementation:
image
image
image

Proposed change (settings page):
image
image

Channel pages (untoggled):
image
image
image

Channel pages (toggled):
image
image
image

Tooltip:
image

Testing

(A)

  • Navigate to a random channel
  • Navigate to Videos tab
  • Watch a video or manually mark it as watched -- it should only gray out
  • Go to Settings --> Distraction Free --> General --> toggle 'Hide Videos on Watch'
  • Return to the previously channel page
  • Watched videos should not load anymore
  • Untoggling the 'Hide Videos on Watch' and returning to the page should reload the videos

(B)

  • Repeat all steps from the test (A), but choose a channel with few videos
  • Leave two unwatched videos
  • Ensure the toggle is on
  • Return to the channel page
  • Upon marking one of the last two videos as watched, the 'Sort By' dropdown will disappear (since there's no need to sort a single video, shorts or live)
  • Screenshots:
    image
    image

Desktop

Windows 10 Pro
OS Build: 19045.5796
Freetube v0.23.4 Beta

Additional context

… function; considering moving the check logic to outside the function and call it without checks inside of it
…mmented out filtering implementation for now as I debug the code further
…an event watched to update the video list if the toggle is pressed; separated variable check from inside the filter function (still not working)
…ryCache from the store, and iterate through the videos arrray filtering out entries that exist in the History
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 5, 2025 20:05
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label May 5, 2025
@efb4f5ff-1298-471a-8973-3d47447115dc

hi @palharesf in the testing section you mainly are mentioning how you tested it. It would be nice if you could provide some testcases (ofcourse we will be testing outside of those cases too but would be nice to have some kind of baseline)

@palharesf
Copy link
Contributor Author

Oh, of course @efb4f5ff-1298-471a-8973-3d47447115dc - I thought the request was for information on how I tested it hahaha

For a specific Channels page, the feature is differentiating between four kinds of states:

  • No videos watched, toggle off: all videos should be visible
  • No videos watched, toggle on: all videos should be visible
  • One or more videos watched, toggle: all videos should be visible
  • One or more videos watched, toggle on: one or few videos should not be visible

If I were to write an automated test for this, I would implement these four test cases.

Is that what you were alluding to, @efb4f5ff-1298-471a-8973-3d47447115dc ?

Copy link
Member

Choose a reason for hiding this comment

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

The Shorts and the Live tab also contains videos that can marked as watched so it would be a more consistent user experience to also include the toggle on these tabs

@palharesf
Copy link
Contributor Author

palharesf commented May 5, 2025

I didn't originally touch Shorts and Live as I felt those were outside the scope of the feature, but I'm happy to incorporate those changes soon to harmonize the experience. I'll work on that tomorrow unless told otherwise

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

Oh, of course @efb4f5ff-1298-471a-8973-3d47447115dc - I thought the request was for information on how I tested it hahaha

Maybe that section has to be revised so its more clear that those need to be provided, ill look into it.

For a specific Channels page, the feature is differentiating between four kinds of states:

  • No videos watched, toggle off: all videos should be visible
  • No videos watched, toggle on: all videos should be visible
  • One or more videos watched, toggle: all videos should be visible
  • One or more videos watched, toggle on: one or few videos should not be visible
    If I were to write an automated test for this, I would implement these four test cases.

Is that what you were alluding to, @efb4f5ff-1298-471a-8973-3d47447115dc ?

Sorry i had to provide examples. From looking at your cases they look good. Everyone in our team does it a bit different depending on what type of PR they're sending in but these examples should give you a good view with what i meant with testcases.

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

Also just a tip make sure your branch is up to date with the latest changes from the development branch before opening your PR.

Copy link
Member

Choose a reason for hiding this comment

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

  1. Sort by Most Popular
  2. Mark a few videos as Watched
  3. Enable Hide Watched
  4. See that it doesnt hide the videos
  5. Disable Hide Watched
  6. See that it does hide the videos
VirtualBoxVM_yaodKSyJOF.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 May 5, 2025
@palharesf
Copy link
Contributor Author

Ok, I updated the 'Testing' section of the PR to reflect the examples provided, thank you for those.

I did run git fetch origin and git merge origin/development before running git push origin feature/4497-hide-watched-videos -- all the console messages I got indicated my branch was up-to-date with the dev branch, so I'm sorry if that was not the case.

And the case you mentioned (i.e. marking videos as watched and having them only hidden in the next refresh) was mentioned in my PR as something intentional - I decided against refreshing the video Panel every time one video was marked as watched because I considered it excessive. That said, I can work on an event watcher that tracks videos being marked as 'Watched' manually and forcing a refresh of the Video Panel if that's the preferred way moving forward. I'll include that in my next batch of changes along with the Live and Shorts pages. Thank you!

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

And the case you mentioned (i.e. marking videos as watched and having them only hidden in the next refresh) was mentioned in my PR as something intentional - I decided against refreshing the video Panel every time one video was marked as watched because I considered it excessive. That said, I can work on an event watcher that tracks videos being marked as 'Watched' manually and forcing a refresh of the Video Panel if that's the preferred way moving forward.

I think you interpreted my comment wrong. I pointed out a bug. Look at the screen recording again and try the steps to reproduce for yourself. It hides the videos when the toggle is OFF and doesnt hide them when the toggle is ON

@palharesf
Copy link
Contributor Author

And the case you mentioned (i.e. marking videos as watched and having them only hidden in the next refresh) was mentioned in my PR as something intentional - I decided against refreshing the video Panel every time one video was marked as watched because I considered it excessive. That said, I can work on an event watcher that tracks videos being marked as 'Watched' manually and forcing a refresh of the Video Panel if that's the preferred way moving forward.

I think you interpreted my comment wrong. I pointed out a bug. Look at the screen recording again and try the steps to reproduce for yourself. It hides the videos when the toggle is OFF and doesnt hide them when the toggle is ON

You're right, I had misunderstood your request. I apologize. I believe forcing the video panel to refresh once a video is marked as watched would fix this issue.

I've been trying to implement that, but the code for marking as watched is in 'ft-list-video.js' and the code for refreshing the video panel on the Channel page is, naturally, on Channel.vue. I don't want to tightly couple the two pages, so what's the preferred approach here? Using the Vuex store to manage state?

I don't have a lot of familiarity with Vuex, but I know how to create an event emitter and listener more generally and I assume that's the preferred route here. Any pointers would be welcome.

I'll implement the toggle on the Live and Shorts pages when this is working

* development: (50 commits)
  add rules to issue templates (FreeTubeApp#7516)
  Translated using Weblate (Romanian)
  Translated using Weblate (Serbian)
  Translated using Weblate (Russian)
  Move settings to `more` menu on smaller mobile devices (FreeTubeApp#7506)
  Translated using Weblate (Russian)
  Migrate WatchVideoLiveChat to the composition API (FreeTubeApp#7494)
  Translated using Weblate (Basque)
  Translated using Weblate (Russian)
  Bump shaka-player from 4.14.14 to 4.14.15 (FreeTubeApp#7501)
  Bump electron from 36.3.1 to 36.3.2 (FreeTubeApp#7500)
  Bump sass from 1.89.0 to 1.89.1 (FreeTubeApp#7499)
  Bump the eslint group with 3 updates (FreeTubeApp#7498)
  Bump the stylelint group with 2 updates (FreeTubeApp#7497)
  Bump @babel/core from 7.27.1 to 7.27.4 in the babel group (FreeTubeApp#7496)
  Translated using Weblate (Japanese)
  Translated using Weblate (German)
  Implement context menu item "search X in new window" (FreeTubeApp#7477)
  Translated using Weblate (Portuguese (Brazil))
  Translated using Weblate (French)
  ...

# Conflicts:
#	static/locales/da.yaml
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2025

Conflicts have been resolved. A maintainer will review the pull request shortly.

@github-actions
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

* development:
  Translated using Weblate (English (United Kingdom))
  add beta to asset name (FreeTubeApp#7512)
  Translated using Weblate (Dutch)
  Translated using Weblate (Dutch)
  Fix builds failing due to broken Weblate keys (FreeTubeApp#7560)
  Translated using Weblate (Persian)
  Translated using Weblate (Welsh)
  Migrate FtListVideoLazy to the composition API (FreeTubeApp#7534)
  Bump electron-builder from 26.0.15 to 26.0.16 (FreeTubeApp#7539)
  Bump eslint-plugin-vue from 10.1.0 to 10.2.0 in the eslint group (FreeTubeApp#7537)
  Bump webpack-dev-server from 5.2.1 to 5.2.2 (FreeTubeApp#7538)
  Bump electron from 36.3.2 to 36.4.0 (FreeTubeApp#7540)
  Translated using Weblate (Hungarian)
  Migrate FtPlaylistAddVideoPrompt and FtPlaylistSelector to the composition API (FreeTubeApp#7511)
  Speed up the loading of the geolocation data (FreeTubeApp#7527)
  Remove unnecessary barrel file in store (FreeTubeApp#7522)
  Translated using Weblate (Bulgarian)

# Conflicts:
#	static/locales/fa.yaml
@github-actions
Copy link
Contributor

Conflicts have been resolved. A maintainer will review the pull request shortly.

@PikachuEXE
Copy link
Member

Solved merge conflict again and made changes for #7366 (review) since it's not worth waiting weeks just a for a few changes to review this fully
I will review this tomorrow

@PikachuEXE
Copy link
Member

Tested a bit and realized that we should show the sort select when there are > 1 fetched entries (instead of shown=unwatched entries)
Otherwise the ability to see 1st page of other sorting orders is removed when most/all entries with default sort are watched and hidden

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Member

efb4f5ff-1298-471a-8973-3d47447115dc commented Jun 18, 2025

@palharesf No continuation and dropdown still showing if only one video in the tab present

VirtualBoxVM_kjTt0Wrevr

@palharesf
Copy link
Contributor Author

@efb4f5ff-1298-471a-8973-3d47447115dc I still don't understand the issue with continuations. As per my comment here (#7366 (comment)), it seems to me the original array didn't check for continuation for deciding when to show the "Fetch More" button, so I kept the same logic for the computed array. If we want to change that logic I think it's fine, but it seems to me it's a different issue from hiding watched videos altogether. If I'm wrong, I'd appreciate understanding how, since from my current point of view that doesn't seem like an issue. I'm less stuck on code and more stuck on comprehension here.

Regarding the dropdown, it's still visible when there's only one video being displayed on the channel because of the last change made by PikachuEXE (b232adf). I tested this just now and this is happening because the array responsible for displaying videos on the screen is filteredVideos, whereas the array responsible for displaying the Sort element is latestVideos. They don't match when we have the 'Hide Videos on Watch' setting enabled, so naturally you'll have situations like this one, where the size of the arrays differ and hence the logic doesn't work as intended.

image

My proposed solution here is to revert and let filteredVideos command whether the Sort element would be displayed or not, but naturally I'd like @PikachuEXE two cents here since he's the one that changed this bit of logic and can show me the shortcomings of my suggestion.

Apologies if it seemed I was MIA, but I honestly did not know you all were waiting on me for the pending changes and I already forgot most of what I worked on in this PR since I dove into it a while ago.

@PikachuEXE
Copy link
Member

Updated display logic for sort element again
Now it's hidden when there is no next page and no. visible elements <= 1
i.e. if there is a next page or visible element > 1 = shown

@PikachuEXE PikachuEXE added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: changes requested labels Jul 9, 2025
@FreeTubeBot FreeTubeBot merged commit dc7cb01 into FreeTubeApp:development Jul 21, 2025
5 checks passed
@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jul 21, 2025
@efb4f5ff-1298-471a-8973-3d47447115dc

@palharesf thank you so much for you contribution and bearing with us. Normally merging a PR doesn't take this long. Let me know if you want to work on another issue and i can help you find one that fits your criteria

@palharesf
Copy link
Contributor Author

@efb4f5ff-1298-471a-8973-3d47447115dc thank you all for the patience and bearing with someone doing their first ever contribution to an open source project, hopefully the first of many. I will accept your offer, so feel free to @ me in any other non-critical or time sensitive issues you feel I could contribute. Happy to continue contributing with the project!

@palharesf palharesf deleted the feature/4497-hide-watched-videos branch July 21, 2025 13:01
@palharesf palharesf restored the feature/4497-hide-watched-videos branch September 16, 2025 15:00
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]: option to hide watched videos in channel view

6 participants