home-assistant / frontend

:lollipop: Frontend for Home Assistant
https://demo.home-assistant.io
Other
3.8k stars 2.6k forks source link

Inconsistent dialog when deleting tag #21240

Closed SeanPM5 closed 2 days ago

SeanPM5 commented 6 days ago

Checklist

Describe the issue you are experiencing

When deleting a tag, it has red "Delete" button at first (good)

Screen Shot 2024-07-01 at 3 05 55 AM

But then confirmation prompt shows it as "Remove" button and without red text

Screen Shot 2024-07-01 at 3 06 01 AM

Describe the behavior you expected

Consistent wording (Delete), and red text on confirmation prompt

Steps to reproduce the issue

  1. Go to Configuration → Tags
  2. Create a test tag, then click the cog to delete it

What version of Home Assistant Core has the issue?

2024.7.0b6

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

No response

Which operating system are you using to run this browser?

No response

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

matthiasdebaat commented 6 days ago

As the tag would still exist after you remove it from Home Assistant, we should change the button tot Remove.

silamon commented 5 days ago

So we should use "remove" because the tag still physically exists or did I misunderstand that?

matthiasdebaat commented 5 days ago

Correct

silamon commented 2 days ago

I'm not sure if I would follow for that reason to make it "remove". It still deletes the tag from Home Assistant in a non recoverable way. "remove" mentions it is kept in existence, which means it's still somewhere around but no longer associated or referenced. We also use "delete" for floors and areas for example, which also exist physically, which is sort of the same example. I think the line should be crossed to say that "delete" and "remove" apply for things in Home Assistant.

matthiasdebaat commented 2 days ago

I've researched it a bit more and come to the following conclusion:

Added this to our design docs https://github.com/home-assistant/frontend/pull/21297

In this case, you can add the tag again. It's recoverable, so it can be Remove. At the same time when removing a tag, you will break automations. That is a non-recoverable action, so it can be Delete.

I can live with both.

silamon commented 2 days ago

I've opened a pull request for "delete" if you don't mind. Reading the design doc, I still interpret "delete" as delete everything that is known to the tag while "remove" to me is clear the associations, but keep the tag present in Home Assistant.
In fact, everything is recoverable, depending on how much time you want to spend.

silamon commented 2 days ago

After reading these resources below, it follows your previous/current design documentation with the addition that "remove" can also be used if you delete something to the trash can, which means it can be undone and thus recoverable.