Design review: Confirmation for toggles #8905
Replies: 9 comments 20 replies
-
Would just add a A toggle should toggle, you should not change that behavior. |
Beta Was this translation helpful? Give feedback.
-
Hi! Just saw your discord chat for feedback and I'm happy to help you with that. If I understand correctly you would like to to safeguard e.g. an AC switch, so that someone doesn't accidentally turn it on? I've made two small prototypes in Figma to get a better understanding what your proposal means. Form a UX designer point of view I think the user should always be able to toggle switches and gets immediate results. Same goes for checkboxes and radio buttons. Nielsen Norman Group has a great guideline about toggles. In my opinion it's better to safeguard this by replacing the toggle with a button that opens the If you would like to discuss this further we could always do a discord call. |
Beta Was this translation helpful? Give feedback.
-
But then you loose the benefit of having an easy and clear visualization of the state, as you have to carefully read the button text ("Turn On" vs "Turn Off"). So I don't think we want to loose that. Hence why I vote for toggle with optional confirmation dialog. |
Beta Was this translation helpful? Give feedback.
-
just as an additional link to my FR for lock/confirmation on covers please see: #8947 Covers are a special category imho, and would benefit greatly from being 'guarded' in the frontend, against accidental opening at least. |
Beta Was this translation helpful? Give feedback.
-
quite a while ago... but I want to add such a confirmation dialog to the switches I'm using to control my 3D printer to avoid turning it off accidentally (or shutting down a PC). Was there any progress in the meanwhile with official implementation? excuse, I'm relatively new to HA/ymal and not native english |
Beta Was this translation helpful? Give feedback.
-
Any news on this? Both from an end-user perspective and from the perspective of the lovelace maintainer, I would much prefer a native solution that works with a regular switch entity and has the same look & feel as other switches in the UI, just with the added confirmation dialog. I like the proposal with the "confirmation" directly on entity level. If you want to add a confirmation dialog to a switch, it is clear which action is meant (the toggling of the switch, of course). No need for users to learn about different actions that they don't want to mess with. |
Beta Was this translation helpful? Give feedback.
-
I think that if it's optional and has to be manually configured, the user would not expect a direct action anymore. I'd like to have a switch that asks me for a confirmation, not additional cards or whatnot. |
Beta Was this translation helpful? Give feedback.
-
the absence of the confirmation on the right side entities element, a Button in this case was also brought up here not sure whether that is the same issue from a design perspective, but UX remains identical: setting a confirmation on an entity, and not getting it on the main element of interaction: the Button itself. |
Beta Was this translation helpful? Give feedback.
-
A related pull: #21453 |
Beta Was this translation helpful? Give feedback.
-
I need some design guidance:
We have the concept of tap_action, hold_action and double_tap_action (docs). I am looking at it in the context of an Entities card.
sensor
, those actions are automatically tied to the whole row => they are executed when you interact with anything in the row (the icon, label or value display). All good ✔️.switch
orlight
, then the currently configurable actions only apply to the icon and the label of the row, not the interactive element. That means you currently cannot use any confirmation to guard accidental interaction with an element. I want to close that gap 🌉.type: button
rows. And that is where the "problem" comes intype: button
we tie the actions purely to the button. That makes sense if it is a pure "standalone" button row without any ties to an entity (so manually specified label, icon, etc.), since there is nothing that for example amore-info
call could show here. It gets a bit muddy already, if you use the button with a real entity (which the configuration allows so that the name and icon can be automatically taken from it). But also here, the entity itself is not the focus, but the button is (since otherwise you would not have used a row oftype: button
anyway). So still okay 👍.I thought about two config variants. Let's use the following as the base. Simple switch, where a tap opens the
more-info
(technically redundantly specified as this is the automatic default anyway).To now safeguard the switch we could add new config for (double) tap and hold with the prefix
interactive_
to indicate that this applies to switch (e.g. domainsswitch
,light
,fan
,humidifier
,automation
, ...) or the button (domainslock
,cover
,script
, ...).That however might be overkill since I am not sure if there are (many) use cases where for a switch toggle where we need to differentiate between tap, double tap and hold. So we could simplify to only use a confirmation section directly to safeguard and always leave the default tap = toggle behavior:
What do you think?
Beta Was this translation helpful? Give feedback.
All reactions