Open jsoref opened 14 hours ago
I will look into this.
One alternative - show two arrows on the same line, where the left one collapses - and the right one collapses command (or similar). I think an empty line with just - is not that visually appealing and it's not a display style I've seen anywhere for Yaml.
Summary
Currently the collapse behavior of something like this is bad:
There's a collapse widget to the left of
- command:
but it's ambiguous as to what it should collapse, it could collapse the array element, or it could collapse thecommand
key.If the yaml was automatically presented like this, then one could independently and unambiguously collapse the
-
orcommand:
:Motivation
Typically the first item in
containers:
is something that would itself be collapsible, and it's incredibly frustrating to end up collapsing the entire container instead of just the first property for thecontainer
.If the yaml was automatically presented like this, then one could easily collapse the various keys of the container without collapsing the entire container
https://cd.apps.argoproj.io/applications/argo-cd?resource=kind%3APod&node=apps%2FDeployment%2Fargocd%2Fargocd-dex-server%2F0 before:
after:
Proposal
When encountering an array where the first item in the array is itself collapsible, put the first item on its own line.