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 search playlists with matching videos function #4537

Conversation

PikachuEXE
Copy link
Collaborator

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Improvement to #4234

Description

  • Update user playlists page to add search playlists with matching videos function
  • Update add videos to playlists prompt to add search playlists with matching videos function

Screenshots

image
image

Testing

  • Add video(s) not matching playlist name
  • Search with partial video title, turn on/off toggle to see search results

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

@FreeTubeBot FreeTubeBot enabled auto-merge (squash) January 9, 2024 02:04
@github-actions github-actions bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 9, 2024
@PikachuEXE PikachuEXE force-pushed the feature/playlist-search-playlists-with-matching-videos branch from 1674a34 to f370a07 Compare January 9, 2024 05:37
@PikachuEXE
Copy link
Collaborator Author

If there is no web build nesting can be used now (I tested locally before submitting PR, just not the web build)
https://caniuse.com/css-nesting

Anyway updated

@absidue
Copy link
Member

absidue commented Jan 9, 2024

Also won't work if we ever switch to Tauri, but we'll probably have to get rid of loads of other modern CSS and JavaScript stuff then anyway. Tauri 1 supports macOS 10.13+ (High Sierra), which was released in 2017.

However we could always set the minimum version higher ourselves.

absidue
absidue previously approved these changes Jan 12, 2024
@ChunkyProgrammer
Copy link
Member

Also won't work if we ever switch to Tauri, but we'll probably have to get rid of loads of other modern CSS and JavaScript stuff then anyway. Tauri 1 supports macOS 10.13+ (High Sierra), which was released in 2017.

If we need to support older versions then we could always use browserslist with postcss and babel configurations https://github.com/browserslist/browserslist?tab=readme-ov-file#browserslist-

@toby63
Copy link

toby63 commented Jan 27, 2024

Well this only shows the playlist that the video is included in, not the video(s) itself.

@@ -141,6 +141,7 @@ User Playlists:
You have no playlists. Click on the create new playlist button to create a new one.: You have no playlists. Click on the create new playlist button to create a new one.
Empty Search Message: There are no videos in this playlist that matches your search
Search bar placeholder: Search in Playlist
Search in Videos: Search in Videos

Choose a reason for hiding this comment

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

This could be more specific imo

Suggested change
Search in Videos: Search in Videos
Search in Videos: Search for Videos in Playlist

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is not searching for videos, but searching for playlist(s) with matching videos
No idea how to make it short

@@ -141,6 +141,7 @@ User Playlists:
You have no playlists. Click on the create new playlist button to create a new one.: You have no playlists. Click on the create new playlist button to create a new one.
Empty Search Message: There are no videos in this playlist that matches your search
Search bar placeholder: Search in Playlist

Choose a reason for hiding this comment

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

Suggested change
Search bar placeholder: Search in Playlist
Search bar placeholder: Search for Playlist

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

Not a huge fan of the placement. I understand why you picked that placement for it but i looks weird to me.

What about aligning it with the dropdown, something like

Capture

@PikachuEXE
Copy link
Collaborator Author

Updated UI & label text, take a look
I think aligning the toggle with the sort is weird (feel detached from the search input text box for no good reason)
image

@kommunarr
Copy link
Collaborator

kommunarr commented Jan 30, 2024

Trying to understand the use case. Someone wants to find videos they saved with a specific keyword (which is what this search bar did in previous versions of FreeTube, and what most people will assume this does when loading up the updated app). They put the keyword into the search bar and are presented with the playlists that contain a specific video. They then have to scroll a lot to find that section of their playlist. It doesn't sound like a pleasant UX. I would not be personally familiar with any other use cases.

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

@PikachuEXE hmm i understand what you're saying. Not sure whats the best approach here

@jasonhenriquez suggestion: Maybe make the searchbar function as before without the toggle? So remove toggle and users can use the searchbar to 1) playlist name, 2) video title. If we go that way maybe we should also add a search in the playlist it self so the user can look up the vid they're trying to find

@kommunarr
Copy link
Collaborator

kommunarr commented Jan 30, 2024

@efb4f5ff-1298-471a-8973-3d47447115dc I'm not sure if that addresses my concern. Or rather, not a concern, but just a question of what problem is being solved by this feature being present on the User Playlists page. At least in my usage, I haven't encountered the use case of needing to find which playlist has which video based on a keyword. If I did, what would I do from there? Click to open the playlist and then do another search to find the video I just searched?

Instead, I often encounter the problem of needing to find the video link(s) / entry(s) that exists in one of my playlists based on the keyword. The location of this search bar is where we've trained current users of FreeTube to find the feature for that second use case. I think this space would be better reserved for a playlist-agnostic video search bar. This would work in that the video search results would load in lieu of or below the playlists, very similar to what we had there prior. There's then the question of what to do when one video appears in multiple playlists or has duplicate entries (my thought would be to just show it multiple times, optionally with information on its owning playlist and/or playlist index), but that's thankfully a rarer and far less irksome problem to encounter than the ones this solution resolves. This minimize the jarringness of the existing feature being replaced with something that looks similar but does something very different and is more comparatively niche in utility.

@PikachuEXE
Copy link
Collaborator Author

  • Make it search for video info always would return to many results, not good
  • I understand the search for video in playlist UX requires improvement which depends on feature for searching video inside single playlist view which cannot be pushed yet (implemented but would conflict w/ Playlist performance improvements #4597)

Actions for me:

@PikachuEXE PikachuEXE marked this pull request as draft January 31, 2024 00:46
auto-merge was automatically disabled January 31, 2024 00:46

Pull request was converted to draft

@github-actions github-actions bot removed the PR: waiting for review For PRs that are complete, tested, and ready for review label Jan 31, 2024
@toby63
Copy link

toby63 commented Jan 31, 2024

  • Make it search for video info always would return to many results, not good

    • I understand the search for video in playlist UX requires improvement which depends on feature for searching video inside single playlist view which cannot be pushed yet (implemented but would conflict w/ Playlist performance improvements #4597)

Sry if it is seen as inappropriate to comment, but I think:

  1. Users can/could search for videos in the old unified playlist, so why should this feature disappear now?
  2. The main reason people would like to search is probably for videos, but still it can be useful to search for playlists too, so I would of course keep the toogle (playlist/videos)
  3. One additional idea would be, to add some note to the search results from or in which playlist(s) the videos are.
    e.g.
    Video Thumbnail
    Video title
    included in Playlist X & Y

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

I guess you mean it shouldn't be active inside empty playlists Let me know if wrong

You are correct. LGTM

Now better? image

LGTM

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

@toby63 We cant just show playlists and videos along side each other that will create a big mess. The playlist default search is searching only for playlist titles BUT if the user wants to find a video the just hit that toggle and search for the video title and it will show you results of the playlists that matches the search query for the video you are looking for.

How this is currently implemented is a step into the right direction IMO

Copy link
Member

Choose a reason for hiding this comment

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

LGTM

@toby63
Copy link

toby63 commented Mar 9, 2024

@toby63 We cant just show playlists and videos along side each other that will create a big mess. The playlist default search is searching only for playlist titles BUT if the user wants to find a video the just hit that toggle and search for the video title and it will show you results of the playlists that matches the search query for the video you are looking for.

How this is currently implemented is a step into the right direction IMO

I disagree.

  1. It doesn't have to be a mess.
    One way would be: You would have a toogle "Search for Videos" and then you only show video results. I bet that this is the thing 99% of the users want. It will not matter to most users in what playlist the video is that they are searching for.
  2. Even if you implement my proposal to also show playlists, it won't be a mess IMHO.
    It will only be a UI thing:

Example for how one specific result would like:

###############################
# Upper part:
#  Shows Video title and maybe thumnail etc. If you click on it, it will open the video
#
######################
# Lower Part (clearly seperated):
# Shows Playlist title. If you click on it, it will load the playlist (at best at the position that the video is on).
#
####################

Comment on lines 19 to 46
.searchInputsRow {
display: grid;

/* 2 columns */
grid-template-columns: 1fr auto;
column-gap: 16px;
}
@media only screen and (max-width: 800px) {
.searchInputsRow {
/* Switch to 2 rows from 2 columns */
grid-template-columns: auto;
grid-template-rows: auto auto;
}
}

.optionsRow {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: 1fr;
}
@media only screen and (max-width: 800px) {
.optionsRow {
/* Switch to 2 rows from 2 columns */
grid-template-columns: auto;
grid-template-rows: auto auto;
}
}

Copy link
Member

Choose a reason for hiding this comment

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

As they both use the same media query and CSS rules, the two media query blocks can be merged into one.

Suggested change
.searchInputsRow {
display: grid;
/* 2 columns */
grid-template-columns: 1fr auto;
column-gap: 16px;
}
@media only screen and (max-width: 800px) {
.searchInputsRow {
/* Switch to 2 rows from 2 columns */
grid-template-columns: auto;
grid-template-rows: auto auto;
}
}
.optionsRow {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: 1fr;
}
@media only screen and (max-width: 800px) {
.optionsRow {
/* Switch to 2 rows from 2 columns */
grid-template-columns: auto;
grid-template-rows: auto auto;
}
}
.searchInputsRow {
display: grid;
/* 2 columns */
grid-template-columns: 1fr auto;
column-gap: 16px;
}
.optionsRow {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-template-rows: 1fr;
}
@media only screen and (max-width: 800px) {
.searchInputsRow,
.optionsRow {
/* Switch to 2 rows from 2 columns */
grid-template-columns: auto;
grid-template-rows: auto auto;
}
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No longer valid, they now have different properties

Copy link
Member

Choose a reason for hiding this comment

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

The code inside the media queries is the same for both.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No really
The diff shown in thread is outdated
image

Copy link
Member

Choose a reason for hiding this comment

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

I can't see align-items: stretch on the GitHub website or in the mobile app, are you sure that all of your local changes got pushed to GitHub?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh that's caused by missing change to make new toggle vertically centered
Just committed the missing change

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

efb4f5ff-1298-471a-8973-3d47447115dc commented Mar 10, 2024

I bet that this is the thing 99% of the users want. It will not matter to most users in what playlist the video is that they are searching for.

This isnt a strong argument and one you cant make. You cant voice your opinion and make that a reflection of how others will or will not use FT.

###############################
Upper part:
Shows Video title and maybe thumnail etc. If you click on it, it will open the video

That would be nice yes but im pretty sure that isnt something we can do. First of all Videos are now properly part of a Playlist. That means that a Playlist contains X amount of Videos. Doing something like you suggested would mean we have to somehow decouple the Video that is stored inside the Playlist when you want to watch the video.

I dont see anything like this happening and i stand by my point that this implementation is in the right direction.

@PikachuEXE PikachuEXE requested a review from absidue March 10, 2024 11:54
@ArthurKun21
Copy link

Would it be possible to also include the channel name in the search

like if the search text is in the video title and/or youtube channel.

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

efb4f5ff-1298-471a-8973-3d47447115dc commented Mar 10, 2024

@ArthurKun21 I think that suits the search within a specific Playlist better than the global Playlist search but i like to hear from the other devs in the team about this. If we decide that it suits the search within a Playlist better than that is out of scope of this PR.

Edit: If we do this then we should do it for both searches otherwise it would cause confusion

@toby63
Copy link

toby63 commented Mar 10, 2024

I bet that this is the thing 99% of the users want. It will not matter to most users in what playlist the video is that they are searching for.

This isnt a strong argument and one you cant make. You cant voice your opinion and make that a reflection of how others will or will not use FT.

It will still turn out to be true, believe me.
If I were you, I would at least warn users about such a change and maybe even offer the old "way" with a unified playlist for those who like that a lot (in newer versions).

###############################
Upper part:
Shows Video title and maybe thumnail etc. If you click on it, it will open the video

That would be nice yes but im pretty sure that isnt something we can do. First of all Videos are now properly part of a Playlist. That means that a Playlist contains X amount of Videos. Doing something like you suggested would mean we have to somehow decouple the Video that is stored inside the Playlist when you want to watch the video.

I dont see anything like this happening and i stand by my point that this implementation is in the right direction.

Well it would probably be possible with PikachuEXE#66, but I acknowledge that it's difficult (as outlined in that FR).
Still I don't quite understand, here you also search for the videos (because otherwise you would not know where they are), so how is it done and why can't the videos then be shown directly?
I mean, a title and a link to the video would be enough, no thumbnails would need to be loaded IMHO etc.

And what about my "side-line" proposal, that if you click on the playlist FreeTube could at least "jump" directly to the video position in the playlist? It would still be two clicks, but not a double-search.
Or is this already the plan?

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

efb4f5ff-1298-471a-8973-3d47447115dc commented Mar 10, 2024

I would at least warn users about such a change

Ofcourse we will inform current users about the change

And what about my "side-line" proposal, that if you click on the playlist FreeTube could at least "jump" directly to the video position in the playlist? It would still be two clicks, but not a double-search. Or is this already the plan?

@toby63 This is how it behaves now

VirtualBoxVM_ZeWk10pGUd.mp4

@toby63
Copy link

toby63 commented Mar 10, 2024

I would at least warn users about such a change

Ofcourse we will inform current users about the change

And what about my "side-line" proposal, that if you click on the playlist FreeTube could at least "jump" directly to the video position in the playlist? It would still be two clicks, but not a double-search. Or is this already the plan?

@toby63 This is how it behaves now
VirtualBoxVM_ZeWk10pGUd.mp4

Thx for the illustration, I see you already had this idea 😉.
Well thats not perfect, but it's ok.

I will then wait until PikachuEXE#66 might be functional and then we might get full video search once again 🤞.

Just out of curiosity, does this work with mutiple search results in one playlist too?

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

efb4f5ff-1298-471a-8973-3d47447115dc commented Mar 10, 2024

What do you mean by multiple searches? Multiple video results showing inside the playlist based on the search?

@toby63
Copy link

toby63 commented Mar 10, 2024

What do you mean by multiple searches? Multiple video results showing inside the playlist based on the search?

Yes.

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

Yes it does that

@toby63
Copy link

toby63 commented Mar 11, 2024

@efb4f5ff-1298-471a-8973-3d47447115dc Thx and also thx for the patience 🙂.

@PikachuEXE
Copy link
Collaborator Author

@efb4f5ff-1298-471a-8973-3d47447115dc
I forgot to make the toggle in add to playlist prompt to be vertically centered (now done)
Please recheck
image

…h-matching-videos

* development:
  Fix handling of video published date in video lists (FreeTubeApp#4752)
  Translated using Weblate (Dutch)
  Translated using Weblate (Chinese (Simplified))
  Bump lefthook from 1.6.4 to 1.6.5 (FreeTubeApp#4758)
  Bump marked from 12.0.0 to 12.0.1 (FreeTubeApp#4757)
  Bump electron from 29.1.0 to 29.1.1 (FreeTubeApp#4756)
  Translated using Weblate (Portuguese)
  Translated using Weblate (Portuguese (Brazil))
  Improve touch controls for dash quality selector (FreeTubeApp#4750)
  Translated using Weblate (Serbian)
  Translated using Weblate (Spanish)
  Translated using Weblate (French)
  Translated using Weblate (German)
  Translated using Weblate (Estonian)
@FreeTubeBot FreeTubeBot merged commit 65a5b0c into FreeTubeApp:development Mar 14, 2024
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 Mar 14, 2024
PikachuEXE added a commit to PikachuEXE/FreeTube that referenced this pull request Mar 15, 2024
* development:
  Translated using Weblate (Czech)
  Translated using Weblate (Slovenian)
  Add search playlists with matching videos function (FreeTubeApp#4537)
  Translated using Weblate (Danish)
  Translated using Weblate (Danish)
  Translated using Weblate (Danish)

# Conflicts:
#	src/renderer/views/UserPlaylists/UserPlaylists.js
@PikachuEXE PikachuEXE deleted the feature/playlist-search-playlists-with-matching-videos branch April 2, 2024 03:12
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.

8 participants