Summary:
Please add code folding on indent to the native yaml/text editor in home assistant “CME”. Here is an example of how it can be (relatively) easily implemented.
Long Story:
Home assistant uses CodeMirrorEditor (CME) for displaying the “raw” yaml files (ie. when you are configuring the picture-elements card), I myself also find it easier to write automations in yaml instead of through the UI so this editor is used a lot. Basically this text editor is used by Home Assistant any time editable ‘raw’ yaml is shown on screen.
However when cards/automations/scripts get big the respective .yaml file can become hard to navigate with the standard editor. Many IDE ‘solve’ this problem by enabling code folding. Basically whenever you have an indent it adds a little arrow on the left that can hide all text lines that have more indents than the line above. If you are unfamiliar with how this works, the example I shared above has an interactive demonstration/example on the right pane (or see pictures below). All IDE’s I have worked with, text editors like Atom and also the popular Add-on ‘File Editor’ all have this feature already, please also add it to the default home assistant text editor.
(My guess is most Devs don’t actually use the native yaml editor in home assistant and aren’t even aware this is not an available feature). Please vote
-
Full Text Example
-
Subsections Collapsed Text Example
-
Fully Collapsed Text Example
Backstory:
(I just spent 2 hours trying to get the front end developer environment to load myself, but only succeeded in crashing my docker/VSstudio dev build of home assistant.) As I don’t see a reason why this could not be easily implemented by someone who has this already set up I am hoping this feature request can get enough votes that a front end developer sees it.
Also looking at the github code I see no reason why adding Code Folding to the home assistant “raw” yaml editor (CME) should be a problem.
(Please someone let me know if there is an obv reason I overlooked why this has not yet been implemented and I’ll close this request. I don’t want to look stupid )