Warn when adding duplicate entities in card editors #11205
Replies: 8 comments
-
I think filtering makes sense. If you want a duplicate you can still type it out |
Beta Was this translation helpful? Give feedback.
-
I don't think this is really an issue? The user can just remove an entity? |
Beta Was this translation helpful? Give feedback.
-
I would classify this as a minor issue, since I feel it should be smart enough to warn in advance rather than allowing the user to add a dupe accidentally and then go through the hassle of removing it. If you don't realize it right away it's like six clicks to remove the entity (Lovelace menu -> Edit dashboard -> Edit Card -> Remove entity -> Save card -> Exit configure UI mode). Which all could be avoided with a small warning saying hey there's a duplicate. Here is how Spotify handles this scenario for example: |
Beta Was this translation helpful? Give feedback.
-
The difference there is that you are adding to something you cant currently see. The playlist is not what is behind that modal. |
Beta Was this translation helpful? Give feedback.
-
That is true, but depending on your device and resolution you might not be able to (easily) see things anyway. Here is the card editor on my iPhone for example: Due to the limited width of a mobile device, it cuts off the final characters (only unique part) of the entity ID, so it's difficult to determine based on this screen whether I just added a duplicate entity to the card or not. Especially since on mobile you don't get to see the live preview on the same screen side-by-side. It requires scrolling all the way to the bottom to see the preview, then back up to remove the entity (which as described above is hard to even see). |
Beta Was this translation helpful? Give feedback.
-
We could maybe do it with a dialog when you add the entity, I think that would be cleaner than the message in the picker itself. |
Beta Was this translation helpful? Give feedback.
-
I agree, we could help the user by adding a dialog like Spotify |
Beta Was this translation helpful? Give feedback.
-
One thing to consider: In the "Entities" card you actually might want to have an entity in there multiple times, because you want to use them as attribute rows and show different attributes each time. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently the Lovelace card editors do not prevent adding duplicate entities to a card, nor do they warn the user when this happens. This applies to the following cards: Entity, Glance, History Graph, Map.
Here's a scenario - someone has three dozen lights inside of an Entity card titled "My Lights" and then they want to add two brand new lights to that card. So they edit the card, but instead of seeing just their two new lights they see 38 lights that can be added, even though 36 exist in the card already! Now the user has to hunt for a needle in a haystack to find two lights.
For comparison, the Person editor prevents things like this. After you add a device tracker to a person, it's gone from the entity dropdown list. Dropdown list will only show devices that have not been assigned to that user.
I think same behavior as Person would make sense here. I don't see the use case for wanting to add a duplicate entity to a Lovelace card. It would make more sense to filter out already added entities.
Another option would be to maybe show already added entities in a "disabled" state in the dropdown list. That would allow to easily distinguish between added/not added.
Another possible option would be to allow the user to add a dupe (just like today) but show a warning afterwards, like so:
Beta Was this translation helpful? Give feedback.
All reactions