FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Add video search in user playlist feature

Open PikachuEXE opened this issue 1 year ago • 18 comments

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

image image image

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

PikachuEXE avatar Jan 31 '24 07:01 PikachuEXE

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

github-actions[bot] avatar Feb 01 '24 12:02 github-actions[bot]

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

github-actions[bot] avatar Feb 01 '24 12:02 github-actions[bot]

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

image

PikachuEXE avatar Feb 03 '24 02:02 PikachuEXE

Canceling search drops error bomb

Cannot reproduce

Did some digging around and i think i found reproducible steps

  1. Create playlist with duplicates
  2. search for one of the duplicate vids
  3. cancel search
  4. error

https://github.com/FreeTubeApp/FreeTube/assets/73130443/086334bb-0be2-4e0a-9345-42a2a9045c69

Cannot reproduce (I did cancel afterward, lazy to make video) image image

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

PikachuEXE avatar Feb 07 '24 00:02 PikachuEXE

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

github-actions[bot] avatar Feb 15 '24 08:02 github-actions[bot]

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

github-actions[bot] avatar Feb 15 '24 23:02 github-actions[bot]

Looks like you accidentally merged an unrelated commit into this branch.

absidue avatar Feb 22 '24 18:02 absidue

Updated! When will this be reviewed -,-...

PikachuEXE avatar Feb 22 '24 23:02 PikachuEXE

When will this be reviewed -,-... Now

absidue avatar Feb 23 '24 19:02 absidue

@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)"
...
/>

absidue avatar Feb 23 '24 20:02 absidue

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)

PikachuEXE avatar Feb 23 '24 23:02 PikachuEXE

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

PikachuEXE avatar Feb 24 '24 03:02 PikachuEXE

Done~ image

PikachuEXE avatar Feb 26 '24 01:02 PikachuEXE

  1. I checked latest dev and edit mode does not disable any action on video too
  2. 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)

PikachuEXE avatar Feb 27 '24 00:02 PikachuEXE

Hmm weird because i definitely saw this do that in this PR. I might be imagining things srry about that