feat: add option to require user confirmation for certain actions
Adds a new setting that allows users to require user confirmation before bulk actions
Screenshot / video of UI
What issues does this PR fix or reference?
Closes https://github.com/containers/podman-desktop/issues/7832
How to test this PR?
- [x] Tests are covering the bug fix or the new feature
IMHO this is too broad and should at least be scoped to deletion. As a user I don't know what 'certain actions' are and what this setting would do, and if we had certain actions that aren't deletion (things that require root/admin access?) I'd probably want it to be a separate setting.
aren't deletion (things that require root/admin access?)
in that case you're always prompted as you need to either set the admin password or the fingerprint
replace "certain confirmation" by either just 'confirmation' or we use 'bulk modifications'
That's exactly why it should be renamed, I thought 'certain actions' was implying single deletions as well. ;-)
I'd also recommend using an id like 'preferences.confirmation.bulk', since we've had others requested and if we do them then things like 'preferences.confirmation.delete' or 'preferences.confirmation.prune' would be similar.
@deboer-tim I've seen that in other settings, the id of the entire configuration node is something like preferences.userConfirmation, and then the ids of the properties are more like userConfirmation.bulk. is this okay for this setting?
Node is ok, it's the property that's saved to file which I would change. With the current PR the settings file would have:
"preferences.userConfirmation": false
which makes it harder to add peer preferences.
@benoitf I've added a unit test for this setting (used plugin/open-devtools-init.spec.ts as a template). Since the file I added is just the setting itself, without any usage or actions yet, I didn't know what else I can test except for the fields' values. If you have any other suggestions as to what I can check or change, please lmk.
from english POV, should it be
modificationsorchanges?
From a natural language point of view both read fine, but if you google what the actual difference is you get variations of: Both refer to altering something. However, 'modify' refers to slight changes for improvements, whereas, 'change' indicates transforming the nature of something to something completely new.
Since we're mostly talking about delete here, 'change' is more correct. IMHO 'operations' or 'actions' would also be fine, and maybe 'actions' is slightly better? Or since we're adding this for delete we could just limit it to 'delete' for now.
FWIW, I'd just take modifications out of the preference userConfirmation.bulkModifications (i.e. just end in .bulk, or .bulk.delete if we limit the scope) vs changing it to match the text, since we never know if we'd change the text again in the future.
@benoitf @deboer-tim I've changed the property id to .bulk, so now the title of the setting is just Bulk
Is this okay, or should it be something more specific/descriptive for the users?
I'm fine with it