Add video search in user playlist feature
Pull Request Type
- [ ] Bugfix
- [x] Feature Implementation
- [ ] Documentation
- [ ] Other
Related issue
Code based on https://github.com/FreeTubeApp/FreeTube/pull/4597 So maybe reviewing the code after that PR is merged
Description
Add button to single playlist view for user playlists to search for videos Visible videos changes based on input & video titles
Screenshots
Testing
- Ensure remote playlist view remains unchanged
- Ensure new button shown on user playlist view
- Ensure search mode can be entered and exited (and visible videos reverted to all videos when exited)
- Ensure pagination from https://github.com/FreeTubeApp/FreeTube/pull/4597 applied even when displaying matching videos
- Ensure cannot move video position when search mode entered
- Ensure can remove video items correctly when search mode entered
- Ensure a message shown when there are no search results
- Ensure search results showing only some videos show original indexes
- Ensure exiting search mode would move focus back to search button
- Ensure search button hidden in empty user playlists
Desktop
- OS:
- OS Version:
- FreeTube version:
Additional context
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved. A maintainer will review the pull request shortly.
Shouldnt the focus stay on the search button when i cancel the search?
https://github.com/FreeTubeApp/FreeTube/assets/73130443/0990277d-1171-4f9a-a440-5a6330860337
Umm maybe discussion is needed here but i dont the numbering in the list should change. 2 reasons against it, 1) when i click on a video to watch that is presented as nr 2 in the search it wont be nr 2 on the player page. This could lead to confusion, users can think that we support playing videos within a playlist with certain words are in it 2) That number can be used as reference point, e.g. i searched for something that is 93 in the list and i know around that video number are videos that im searching for but cant find it with search so i can go to that number in the list and start looking from there
https://github.com/FreeTubeApp/FreeTube/assets/73130443/f0ffe279-816e-4967-98a5-079077011d7b
Canceling search drops error bomb
Cannot reproduce
We need to show a message here when there are no results
Canceling search drops error bomb
Cannot reproduce
Did some digging around and i think i found reproducible steps
- Create playlist with duplicates
- search for one of the duplicate vids
- cancel search
- error
https://github.com/FreeTubeApp/FreeTube/assets/73130443/086334bb-0be2-4e0a-9345-42a2a9045c69
Cannot reproduce (I did cancel afterward, lazy to make video)
I did see that error sometimes in watch page (in my custom build) when I watch videos I think it's related to visibility detection code but I have no way to reproduce it reliably
However it's not an issue created by this PR
This pull request has conflicts, please resolve those before we can evaluate the pull request.
Conflicts have been resolved. A maintainer will review the pull request shortly.
Looks like you accidentally merged an unrelated commit into this branch.
Updated! When will this be reviewed -,-...
When will this be reviewed -,-... Now
@absidue looking for help on https://github.com/FreeTubeApp/FreeTube/pull/4622#issuecomment-1924674933
Shouldnt the focus stay on the search button when i cancel the search?
Yes, it should.
Umm maybe discussion is needed here but i dont the numbering in the list should change.
It's not very efficient, but hopefully if it's only applicable in search mode, it shouldn't be too bad (presumably most people will be using pretty exact queries, so it won't have to do it for too many items).
<ft-list-video-numbered
...
:playlist-index="!playlistInVideoSearchMode ? index : playlistItems.findIndex(i => i === item)"
:video-index="!playlistInVideoSearchMode ? index : playlistItems.findIndex(i => i === item)"
...
/>
Oh this is because I keep missing comments when you have 2 (or more) in a row (It jumps me to latest review when I click the link on email)
Done these (added to testing)
- Ensure search results showing only some videos show original indexes
- Ensure exiting search mode would move focus back to search button
Done~
- I checked latest dev and edit mode does not disable any action on video too
- Edit mode only updates title and description, no idea why we disable video actions when edit mode is on (We can but I have no idea why nor it's an issue of this PR)
Hmm weird because i definitely saw this do that in this PR. I might be imagining things srry about that