easyeffects icon indicating copy to clipboard operation
easyeffects copied to clipboard

Preset save/delete should require confirmation

Open LebedevRI opened this issue 3 years ago • 5 comments
trafficstars

Unlike loading a preset, which happens often, saving/deleting preset is an extraordinary event, with hard-to-recover consequences. It really should not just happen by a single button press, but require a pop-up "sure? N/y"...

LebedevRI avatar Jul 24 '22 17:07 LebedevRI

Although the chances of a mistake being made with these buttons is low once you know what they do it makes sense to add some kind of confirmation. But considering the problems GTK currently has with popover menus and dialogs I would wait for them to be fixed before putting more dialogs that have to be called by buttons inside popovers. Some people on Xorg already have problems with the dialog window for preset importing.

That being said if libadwaita already has some kind of custom widget that could do this task without the need for a dialog window we could try to do this now.

wwmm avatar Jul 24 '22 17:07 wwmm

the chances of a mistake being made with these buttons is low once you know what they do

I'm afraid knowing what it does, in no way prevents accidental mis-click, since it's literally next to the hot Load button...

LebedevRI avatar Jul 24 '22 18:07 LebedevRI

I'm afraid knowing what it does, in no way prevents accidental mis-click, since it's literally next to the hot Load button...

It does not prevent an accidental click. But considering the difference in size between these buttons in most cases people will click on the delete button by accident when they do not know yet that this is what the button does. Specially when most translations will make the load button even bigger.

Of course how low this chance is will depend on each person. I can only talk about myself. In all these years I have never clicked in these buttons by accident.

In any case I am not against the idea. I just consider a bad moment to implement it. At least with dialogs. This is the kind of GTK bug that even if I tried I doubt I would be able to send patches to them fixing the current widget focus problems.

wwmm avatar Jul 24 '22 19:07 wwmm

That being said if libadwaita already has some kind of custom widget that could do this task without the need for a dialog window we could try to do this now.

There is AdwMessageDialog in libadwaita 1.2 (unreleased), but it doesn't seem very different from the gtk message dialog.

vchernin avatar Jul 24 '22 19:07 vchernin

There is AdwMessageDialog in libadwaita 1.2 (unreleased), but it doesn't seem very different from the gtk message dialog.

If we are lucky by the time libadwaita 1.2 is released some of these GTK bugs will be fixed. Or maybe they won't happen with the custom libadwaita dialog.

wwmm avatar Jul 24 '22 19:07 wwmm

This bug is super frustrating. I really don't see why on earth this needs support on gtk/libadwaita side though.

LebedevRI avatar Mar 12 '23 12:03 LebedevRI

I really don't see why on earth this needs support on gtk/libadwaita side though.

It is not about needing support in adwaita but about GTK menus and dialogs not playing nice with each other in some users setups. Like the ones where people use xorg instead of Wayland. That is why I would like to avoid showing a dialog window there...

wwmm avatar Mar 12 '23 13:03 wwmm

We already use the AdwMessageDialog for corrupted presets not correctly loaded, but it's a simple dialog with the close button. We added (press ESC to close) because of that bug. But for this case we would need a new dialog with Yes-No buttons handling with callables.

It's quite cumbersome for us to deploy it and maybe that bug will also prevent the correct execution. Besided it could be also cumbersome for some users that want to delete multiple presets and they have to click Yes every time on the dialog.

The best solution in my opinion is to separate the delete button from the saving button and maybe applying it a class to show it as red (libAdwaita has something to do that, but I don't remember the specific feature).

Digitalone1 avatar Mar 13 '23 08:03 Digitalone1

@wwmm @LebedevRI what do you think?

Schermata del 2023-03-22 18-09-57

Digitalone1 avatar Mar 22 '23 17:03 Digitalone1

So there is no longer a save button? How would one save the preset then?

LebedevRI avatar Mar 22 '23 17:03 LebedevRI

So there is no longer a save button? How would one save the preset then?

The save button is still where it was.

Digitalone1 avatar Mar 22 '23 17:03 Digitalone1

Besides save and delete buttons have tooltips, so going with the pointer on them the user has suggestions on their meaning.

Digitalone1 avatar Mar 22 '23 17:03 Digitalone1

Thanks for taking a look!

The save button is still where it was.

Honestly, i did not even notice that those were two buttons, and not one big "load" button.

I understand that they have cool looks, names and tooltips, but what i'm looking for, is idiot-proofing. None of that shiny UX helps with misclicking.

LebedevRI avatar Mar 22 '23 17:03 LebedevRI

@LebedevRI Well, at least now you can't misclick the delete button since it's separated.

Digitalone1 avatar Mar 22 '23 17:03 Digitalone1

It's not that it's cool. Libadwaita has this class named destructive-action and I though it was a good idea to use on something that deletes the preset.

Digitalone1 avatar Mar 22 '23 17:03 Digitalone1

wwmm @LebedevRI what do you think?

I think it is fine.

Honestly, i did not even notice that those were two buttons, and not one big "load" button.

Ideally I would like to not have a "load" button and have the click on the preset row as way to activate the preset. But I am not sure if people will consider this confusing.

wwmm avatar Mar 22 '23 21:03 wwmm

Today while using chatgpt on my phone web browser I've payed attention to how they are handling the history entries removal confirmation. In the list they have for each entry a delete button similar to ours. When we click on it the whole line is replaced by another one where there is a text asking if you want to delete and 2 new buttons. One for confirmation and another to cancel.

I think this is something doable on EasyEffects. We could for example use an overlay that would be shown only over the row where the button was clicked. This way we still can click on the buttons of the other rows as usual and deleting multiple presets would not be so annoying as it would with a dialog window hiding everything. And we would also avoid the current gtk4 bugs related to dialog windows. What do you think @Digitalone1 and @LebedevRI ?

wwmm avatar Apr 27 '23 14:04 wwmm

It's a nice idea but I wonder what to use with the overlay. I don't remember very well how to use it, but it should be something different from the toasts because toasts do not have full opacity and you can see behind.

Digitalone1 avatar Apr 27 '23 15:04 Digitalone1

It's a nice idea but I wonder what to use with the overlay. I don't remember very well how to use it, but it should be something different from the toasts because toasts do not have full opacity and you can see behind.

Looking at how things are done in https://github.com/wwmm/easyeffects/blob/master/data/ui/apps_box.ui I think that inside <child type="overlay"> we can put a GtkBox with a label and the 2 confirmation buttons. And in the same place where <object class="GtkScrolledWindow"> is we could put the current row widgets. I think it will work. I will do some tests in the next days.

wwmm avatar Apr 27 '23 15:04 wwmm

The overlay opacity is indeed an annoyance. I can see what is behind it =/...

wwmm avatar Apr 27 '23 22:04 wwmm

So far the easiest workaround is hiding the row widgets that were being shown in the background through

<property name="visible" bind-source="overlay" bind-property="visible" bind-flags="sync-create|invert-boolean" />

wwmm avatar Apr 27 '23 23:04 wwmm

What do you think @Digitalone1 and @LebedevRI ?

I think that would be an improvement in the right direction, thank you for looking into it!

LebedevRI avatar Apr 27 '23 23:04 LebedevRI

I have updated the master branch with the new approach to preset saving/removal. Now it has to be tested and improved where necessary. This is an example image Screenshot from 2023-04-29 12-24-25 With the confirmation menu I think there is no need for the delete button to be so "ominous". So I brought it back to how it was before.

wwmm avatar Apr 29 '23 15:04 wwmm

It's nice, but I think the question should have a different styling because it can be confused with the other presets in the list. It's better to highlight them somehow.

Look here: https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/named-colors.html

Maybe accent for both save and delete. Or warning for save and destructive for delete?

Digitalone1 avatar Apr 29 '23 18:04 Digitalone1

but I think the question should have a different styling because it can be confused with the other presets in the list.

Yes. After some time I thought the same thing.

Maybe accent for both save and delete. Or warning for save and destructive for delete?

Definitely destructive for delete. I am not sure about the other yet.

wwmm avatar Apr 29 '23 20:04 wwmm

For some reason the text in the gtklabel does not get red when using the destructive-action class. Maybe it works only for buttons.

wwmm avatar Apr 29 '23 21:04 wwmm

This is how it looks with the error and warning classes Screenshot from 2023-04-29 18-03-35 I have updated the master branch with this.

wwmm avatar Apr 29 '23 21:04 wwmm

I think we can finally close this issue :-)

wwmm avatar Apr 30 '23 14:04 wwmm

@wwmm I think it's good to make another minor release. Not only to push this, but also to fix the reset issue.

Digitalone1 avatar Apr 30 '23 14:04 Digitalone1

I think it's good to make another minor release. Not only to push this, but also to fix the reset issue.

Ok. Do you want some time to translate the new strings?

wwmm avatar Apr 30 '23 15:04 wwmm