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

Make adding duplicate disabled by default #5044

Open
wants to merge 6 commits into
base: development
Choose a base branch
from

Conversation

PikachuEXE
Copy link
Collaborator

@PikachuEXE PikachuEXE commented Apr 30, 2024

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Closes #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

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

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

@PikachuEXE
Copy link
Collaborator Author

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

@jasonhenriquez
Copy link
Collaborator

jasonhenriquez commented May 4, 2024

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.

@PikachuEXE
Copy link
Collaborator Author

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

@jasonhenriquez
Copy link
Collaborator

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

@PikachuEXE
Copy link
Collaborator Author

Like this?
image
image

@PikachuEXE PikachuEXE force-pushed the feature/playlists/no-duplicate-added-by-default branch from 2b282e1 to f76c50f Compare May 5, 2024 00:27
@PikachuEXE PikachuEXE marked this pull request as ready for review May 23, 2024 02:19
@github-actions github-actions bot added PR: waiting for review For PRs that are complete, tested, and ready for review and removed PR: WIP labels May 23, 2024
@PikachuEXE PikachuEXE added the PR: waiting for review For PRs that are complete, tested, and ready for review label May 23, 2024
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) May 23, 2024 02:19
Comment on lines +31 to +44
class="matchingVideoToggle"
:label="$t('User Playlists.Playlists with Matching Videos')"
:compact="true"
:default-value="doSearchPlaylistsWithMatchingVideos"
@change="doSearchPlaylistsWithMatchingVideos = !doSearchPlaylistsWithMatchingVideos"
/>
<ft-toggle-switch
v-if="anyPlaylistContainsVideosToBeAdded"
class="allowDuplicateToggle"
:label="$t('User Playlists.AddVideoPrompt.Allow Adding Duplicate Video(s)')"
:compact="true"
:default-value="addingDuplicateVideosEnabled"
@change="addingDuplicateVideosEnabled = !addingDuplicateVideosEnabled"
/>
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion (blocking): Thanks for moving these to the right. Could you also stack these two toggles vertically (to increase alignment and further visually group the controls)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think we have any existing design for having vertical grouping inside a row unless width is passed a breakpoint

image

This is not like settings which we have so many so that they are aligned horizontally with limited slots per row (well a table)
image

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm having trouble understanding, are you expressing that it's difficult to implement, or that it shouldn't be implemented for X reason?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could you also stack these two toggles vertically

I posted screenshot above (not pushed) to see (1) if this is what you want (2) if it is what you want then it shouldn't be like that since it's not a table and there is enough width

>
<ft-playlist-selector
tabindex="0"
:tabindex="playlistDisabled(playlist._id) ? -1 : 0"
Copy link
Collaborator

Choose a reason for hiding this comment

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

thought (future): I would also like to refactor this to use input type="checkbox" someday, and similar for other form elements, because us imitating accessible functionality with custom controls ends up being error-prone and more work (this is pre-existing to this PR, just seems especially apparent with what we have to do to imitate the powerful disabled attribute)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: waiting for review For PRs that are complete, tested, and ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants