FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

Make adding duplicate disabled by default

Open PikachuEXE opened this issue 1 year ago • 6 comments

Pull Request Type

  • [ ] Bugfix
  • [x] Feature Implementation
  • [ ] Documentation
  • [ ] Other

Related issue

Closes https://github.com/FreeTubeApp/FreeTube/pull/4818

Description

Disable adding duplicate videos to playlists by default (cannot select playlists with all to be added videos already present) Can be enabled via new toggle only visible on prompt when any duplicate detected

Screenshots

Nothing changed for video when absent in all playlists, only screenshots of adding video(s) with some/all already present in playlists

Adding single video image

Adding multiple videos (duplicate disallowed) image

Adding multiple videos (duplicate allowed) image

Testing

(A) Add one video (A1) Video absent from all playlists (A2) Video present in some playlists (B) Add multiple videos (B1) Videos absent from all playlists (B2) Some but not all videos present in some playlists (B3) All videos present in some playlists

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

Style/UI/Text not finalized

PikachuEXE avatar Apr 30 '24 02:04 PikachuEXE

Yeah not sure about the placement of that. The Add to Playlist prompt is already very overcrowded as is. Also still not sure if we should go this way at all

The idea is that user need to be able to enable the option before potentially tabbing into the playlists so they can select the potentially disabled playlist(s) instead of finding out playlists disabled and go back to enable it

No idea where to place it best

PikachuEXE avatar May 02 '24 00:05 PikachuEXE

Could you justify the three controls at the top all next to each other on the right? It's not a perfect solution for now, but we can reassess in the future.

kommunarr avatar May 04 '24 01:05 kommunarr

Here is my imagined flow:

  1. Enter query text
  2. Optionally search for playlists with matching video title instead of just matching playlist names
  3. Optionally realize that it's already added but want to add duplicate anyway
  4. Sort it when playlist cannot be found

Ideally it should be (4) then (3) but it might look strange if there is an extra row just for one toggle on desktop image

PikachuEXE avatar May 04 '24 03:05 PikachuEXE

Sorry, to clarify, I mean right-justify the controls so they're grouped

kommunarr avatar May 04 '24 03:05 kommunarr

Like this? image image

PikachuEXE avatar May 05 '24 00:05 PikachuEXE

Only thing im missing tbh is a remove duplicates button within a playlist. Make it only appear when we know there are duplicates in the playlists other wise do not show it

Preventing duplicates to be added and removing duplicates are different features IMO I will open another PR for that

PikachuEXE avatar May 30 '24 00:05 PikachuEXE

I agree left align look more natural / consistent with existing design in FT & in other places Especially the Playlist with Matching Videos is meant to be grouped with search input above

Question is do you want it to look like OP screenshots or image

Hiding my code here since not committed yet

.optionsRow {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  align-items: center;
}

.tightOptions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, max-content));
  column-gap: 16px;
  align-items: center;
}

@media only screen and (width <= 800px) {
  .optionsRow {
    /* Switch to rows from columns */
    grid-template-columns: auto;
    grid-template-rows: repeat(auto-fit, auto);
    align-items: stretch;
  }

  .tightOptions {
    /* Switch to rows from columns */
    grid-template-columns: auto;
    grid-template-rows: repeat(auto-fit, auto);
    align-items: stretch;
  }
}

PikachuEXE avatar May 30 '24 00:05 PikachuEXE

I prefer the screenshots in your recent comment

I'd prefer if we move the sort box over to the left as well if we do that, because I don't like the cognitive aspect of the UX of requiring the user's eyes to dart to parse the meaning, but again, not a blocking issue, and does not matter much if we're going to pursue more expansive changes to the modal in the future

kommunarr avatar May 30 '24 01:05 kommunarr

Putting sort box in the right is existing design in FT and I consider that as a separate issue which should not be the concern of this PR

PikachuEXE avatar May 30 '24 01:05 PikachuEXE

Putting sort box in the right is existing design in FT and I consider that as a separate issue which should not be the concern of this PR

I agree.