Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add back favorites shortcut #4517

Conversation

kommunarr
Copy link
Collaborator

@kommunarr kommunarr commented Jan 4, 2024

Add back favorites shortcut

Pull Request Type

  • Feature Implementation

Related issue

favorites shortcut removed in #4234
reopens #3536 and #1762

Description

  • Adds back favorites shortcut
    • Fixes broken internal functions (removeVideos and deleteVideoIdsByPlaylistId) to do so
    • Shortcut does not show on Favorites playlist page (to avoid redundancy)
    • Minor visual improvement: video overlay icons show on :has(:focus-visible) instead of :focus-within
  • Removes Watch Later playlist (as discussed in Matrix developer chat, there is no reason to make Favorites legacy, thus there is no need for a separate "Watch Later" playlist)
  • Makes Favorites playlist protected (prevents deletion of playlist, which would be problematic)

Screenshots

Screenshot_20240103_175611
Screenshot_20240103_180431
Screenshot_20240103_175507

Testing

  • Test adding/removing from Favorites using shortcut
  • Test removing from Favorites using shortcut removes all duplicates as well
  • Test added/removed videos appear properly after restarting FreeTube
  • Visual improvement test: Unfavorite a video in Subscriptions using a mouse click, stop hovering over the video, and see the Save to Favorites & Add to Playlist buttons disappear from view. See that they still show when unfavoriting using keyboard navigation & the Space key.

Desktop

  • OS: OpenSUSE Tumbleweed
  • OS Version: 2023xxxx
  • FreeTube version: 0.19.1

Watch Later is now protected, given that its manipulation requires its specific id. The addToPlaylists icon is now persistently visible whenever the favorites icon is (i.e., when the video is favorited). The :focus-within logic to that was changed to be :has(:focus-visible) to fix an issue with it staying visible after clicked (pre-existing).
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) January 4, 2024 00:06
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 4, 2024
@kommunarr kommunarr requested a review from PikachuEXE January 4, 2024 00:12
@PikachuEXE
Copy link
Collaborator

I can't test this much due to missing playlist
image

That's one of the reasons I allow user to pick the playlist they want to use (no special treatment = most backward compatible)

@kommunarr
Copy link
Collaborator Author

You're probably the only user who has deleted it - it's protected as of this PR.

@PikachuEXE
Copy link
Collaborator

I am a user who don't need that playlist and the feature (quick bookmark)
As mentioned before I want to be able to disabled the feature and more importantly remove the useless empty playlist
Making it protected is exactly what I don't want

@kommunarr
Copy link
Collaborator Author

kommunarr commented Jan 4, 2024

See comment under other PR - don't care how it's resolved, but "missing" items need to be addressed. If you don't have a protected Favorites playlist, you need to find some other mechanism for programmatically selecting a default bookmarked playlist.

@@ -147,7 +147,7 @@ class Playlists {
static deleteVideoIdsByPlaylistId(_id, videoIds) {
return db.playlists.updateAsync(
{ _id },
{ $pull: { videos: { $in: videoIds } } },
{ $pull: { videos: { videoId: { $in: videoIds } } } },
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this a fix?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, it is. But this function is not in use in your PR, it seems. You can add this fix as well.

@kommunarr kommunarr closed this Jan 4, 2024
auto-merge was automatically disabled January 4, 2024 04:08

Pull request was closed

@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 4, 2024
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.

2 participants