Conversation
|
Can we get a Gif of the process when you get it to a good point. |
|
fixes #1960 |
src/panels/lovelace/editor/config-elements/hui-entities-card-editor.ts
Outdated
Show resolved
Hide resolved
| <h3>Pick the card you want to add:</h3> | ||
| <div class="cards-container"> | ||
| ${ | ||
| cards.map((card) => { |
There was a problem hiding this comment.
Idea: In the future we can add a global window object where custom cards can register so they can be shown in this list too.
There was a problem hiding this comment.
Yeah! I had that in mind!
| private _configValue?: ConfigValue; | ||
| private _configState?: string; | ||
| private _loading?: boolean; | ||
| private _isToggleAvailable?: boolean; |
There was a problem hiding this comment.
Do we need to store this as an instance variable or can this be derived from other instance values?
There was a problem hiding this comment.
We should aim to store as little instance variables as possible, all values that can be derived from others, should not be stored. If used at multiple places consider adding a getter that computes it on the fly.
The main reason for this is single source of truth. What if isToggleAvailable goes out of sync with the values it was computed off, what happens then? By computing it on the fly we don't have this problem.
| } | ||
|
|
||
| private async _loadConfigElement(conf: LovelaceCardConfig): Promise<void> { | ||
| private async _loadConfigElement(conf: LovelaceCardConfig): Promise<boolean> { |
There was a problem hiding this comment.
For a future PR, we should look if we can split out the editor piece from the editor dialog/data handling piece. A card editor can take a CardConfig and PreferredUI (YAML/UI). All the async loading of elements and which editor to show can just be in that element. The dialog element can still show the toggle YAML button to control the editor, or that can be moved into the editor element too (under a … menu)
|
🎉 🎉 🎉 🎉 🎉 |
|
Please also add strings to translation to we can start working on translating. |
|
Please add to option add card also option to set ID. Now ID will be generate automatical. |
|
This is not a place for feature requests or support. You can create an issue for that. You can change the ID in the YAML editor for cards. |
|
Yes but when we add editor UI better will be edit in UI. |
Very much WIP, dirty and buggy.

Closes: #1960