Add copy entity ID/state/attributes menu button in dev tools/states#4259
Add copy entity ID/state/attributes menu button in dev tools/states#4259bramkragten merged 13 commits intohome-assistant:devfrom
Conversation
|
Hi Nicolas, Thanks for your PR! It is one click extra but a lot cleaner. |
But then you'd have to scroll up again after clicking on the entity to copy it. And if you want to copy several entities in a row you have to scroll up and down several times. |
Agreed, the goal was to really quickly copy the ID. Any other thoughts about the button placement ? |
|
Should we create an overflow menu where we place the items in? |
|
Sounds good. Especially does it create a space for more features in the future :) |
Are you talking about a paper menu button ? I'll give it a try ;) |
|
Hi @noxhirsch @bramkragten Your thoughts ? |
|
I love it! (especially the additional copy options you added) The only change I'd make, is to move the more-info icon into the menu as well :) |
|
Yes I was wondering also if I moved this button too! I'll try to include it as first button:
Might also remove |
|
You're right. |
modifié : src/panels/developer-tools/state/developer-tools-state.js
modifié : src/panels/developer-tools/state/developer-tools-state.js
|
This is pretty cool, nice job! I have two very minor suggestions:
|
|
@SeanPM5 Thanks for your feedback, I totally agree ! I have some trouble with the pre-commit hook, which re-indents the source file, which is nice but here it causes problem with the rendering. <td id="attributes-[[entity.entity_id]]">[[attributeString(entity)]]</td>But the auto formating hook changes it to this <td id="attributes-[[entity.entity_id]]">
[[attributeString(entity)]]
</td>Which should not cause any problem but when displaying the page, the cell with the attributes contains spaces before and after the content which is really ugly (I'll add a screenshot tonight), like if it is some non-breakable spaces. I don't understand why the spaces are rendered, and how can I change the formatting of the code so that the 'prettifier' doesn't cause this ? I tried many ways of opening and closing tags, with id property but still no luck. Can someone help or explain me why I have these behaviors ? |
|
So I did the little changes we talked about, that is much better this way, thanks for your feedback! I still have one minor problem: the drop down list of the menu keeps the previously selected item as you can see on the screen capture. But it seems to be always the case (see the menu to move or delete a card in the UI editor). |
| @@ -60,6 +63,10 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) { | |||
| height: 24px; | |||
There was a problem hiding this comment.
paper-icon-button is no longer used
There was a problem hiding this comment.
Don't we use paper-icon-button inside a paper-menu-button ?
Or was it about the paper-icon-buttons I replaced in the list as you suggested in your other comment ?
There was a problem hiding this comment.
Yeah you use it inside it, but this style rules are not necessary anymore I think?
There was a problem hiding this comment.
Actually there is a 8px padding that shifts the text and it is not aligned with the rest of the table. The height reduces the size of the icon that is too big otherwise.
|
I miss |
|
Hi @bramkragten |
use paper-icon-item instead of paper-icon-button and add yarn.lock
|
Glad to see the PR merged 😃 👍 |
|
What ever happened to this PR? It's so much more useful than just the 'info' icon... |
|
Yeah it almost made it to a release but it seems it had a big impact on performance with "large" amount of entities. I never took a second look at it as I am not a front-end expert, but I still wish to have it. |
|
Im just a user that could really use this!! copying this stuff is a pain on a mobile device. |


Hi
I added a functionality I wished I had numerous times : the ability to quickly copy the entity id without having to manually select text, etc...
For this I added a button next to the "More Info" that will store the ID in the clipboard.
I used the "copy-to-clipboard" package.
It look like this:

That's my first PR for HA so I don't really know the process, please tell me how I proceed now.
I'm not really a front-end developer so any feedback and improvement for a future merge in master are more than welcome.
Also I wasn't really sure how to deal with the new labels I use and their translation in Lokalize , so I only modified the file
en.json