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

Show Confirmation Dialog when removing Playlist from Bookmarks #6618

Closed
3 tasks done
ktprograms opened this issue Jul 7, 2021 · 13 comments
Closed
3 tasks done

Show Confirmation Dialog when removing Playlist from Bookmarks #6618

ktprograms opened this issue Jul 7, 2021 · 13 comments
Labels
duplicate Issue or discussion is a duplicate of an existing issue or discussion

Comments

@ktprograms
Copy link
Contributor

Checklist

Describe the feature you want

A Confirmation Dialog should be shown when removing a Playlist from your Bookmarks.

Is your feature request related to a problem? Please describe it

When viewing a bookmarked playlist, it is too easy to accidentally click the remove button, and then you have to go and find the playlist again to bookmark it.

Additional context

BTW I would like to work on adding this feature.

Here's where I currently am with implementing it:
device-2021-07-07-110404

Also, in which category of settings should the option to enable/disable this dialog be?

How will you/everyone benefit from this feature?

For those who enable the confirmation dialog, they will not accidentally remove the playlist.

@ktprograms ktprograms added the feature request Issue is related to a feature in the app label Jul 7, 2021
@ktprograms
Copy link
Contributor Author

Would this be the correct workflow for implementing a feature?

  1. Fork the repo.
  2. Make a new branch for the feature.
  3. Make the feature.
  4. Make a pull request.

@SameenAhnaf
Copy link
Collaborator

How about this type of toast instead? It will deliver the flexibility to ignore the alert if unnecessary.
IMG_20210707_101239

@ktprograms
Copy link
Contributor Author

I'm not sure. This kind of UI doesn't seem to be used anywhere else in NewPipe.

@SameenAhnaf
Copy link
Collaborator

SameenAhnaf commented Jul 7, 2021

It's okay not to be familiar with a UI. A lot of apps like Opera, Firefox etc actually have it.

I would personally ask you to keep the alert optional.

@triallax
Copy link
Contributor

triallax commented Jul 7, 2021

@ktprograms you should read https://github.com/TeamNewPipe/NewPipe/blob/dev/.github/CONTRIBUTING.md to know the instructions and things you need to do to contribute.

@SameenAhnaf I believe we already have something similar IIRC: snackbars with an undo button. I can't recall where they were, but I'm fairly sure we have them somewhere.

@ktprograms
Copy link
Contributor Author

@mhmdanas This seems to be the most relevant line in the CONTRIBUTING.md:

Make changes on a separate branch with a meaningful name, not on the master branch or the dev branch. This is commonly known as feature branch workflow. You may then send your changes as a pull request (PR) on GitHub.

So I'm guessing that means fork the repo, then checkout a new feature branch?

@triallax
Copy link
Contributor

triallax commented Jul 7, 2021

Correct.

@ktprograms
Copy link
Contributor Author

Thanks.

So would it be preferred to use an AlertDialog or a Snackbar?

@triallax
Copy link
Contributor

triallax commented Jul 7, 2021

Sorry, I don't have a strong opinion on that. I'm leaning towards the dialog approach, since deleting playlists is not something one would typically spend a lot of time on I think, and people have complained before of the snackbar approach because they find it to be misleading (#6162 (comment)). However, I think you should wait a bit for people to discuss this.

@ktprograms
Copy link
Contributor Author

BTW I found this AlertDialog code, but it's currently private. What about moving it to /util (or elsewhere) and making it public to use in this case? Will also have to extract the disposables.add argument into a lambda.

private void showDeleteDialog(final String name, final Single<Integer> deleteReactor) {
if (activity == null || disposables == null) {
return;
}
new AlertDialog.Builder(activity)
.setTitle(name)
.setMessage(R.string.delete_playlist_prompt)
.setCancelable(true)
.setPositiveButton(R.string.delete, (dialog, i) ->
disposables.add(deleteReactor
.observeOn(AndroidSchedulers.mainThread())
.subscribe(ignored -> { /*Do nothing on success*/ }, throwable ->
showError(new ErrorInfo(throwable,
UserAction.REQUESTED_BOOKMARK,
"Deleting playlist")))))
.setNegativeButton(R.string.cancel, null)
.show();
}

@ktprograms
Copy link
Contributor Author

ktprograms commented Jul 7, 2021

BTW what should the feature branch be called? Just something like feature-6618?

@XiangRongLin
Copy link
Collaborator

BTW what should the feature branch be called? Just something like feature-6618?

@ktprograms See contribution guidelines


  1. As for the feature itself, I find adding the dialog very interrupting. Yes you want to allow to configure it, but I don't think bloating the setting for this is a good idea.
  2. If you take a look at the YouTube app itself it also just immediatly removes the playlist. It only show a snackbars after the fact, but no dialog before.
  3. Taking into account that you have to remove the playlist AND navigate away for you described problem to occur, I don't find this is necessary

@triallax triallax added the GUI Issue is related to the graphical user interface label Oct 21, 2021
@opusforlife2 opusforlife2 added the playlist Anything to do with playlists in the app label Oct 24, 2022
@SameenAhnaf
Copy link
Collaborator

Closing in favor of #6027

@SameenAhnaf SameenAhnaf added duplicate Issue or discussion is a duplicate of an existing issue or discussion and removed feature request Issue is related to a feature in the app GUI Issue is related to the graphical user interface playlist Anything to do with playlists in the app labels Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issue or discussion is a duplicate of an existing issue or discussion
Projects
None yet
Development

No branches or pull requests

5 participants