-
Notifications
You must be signed in to change notification settings - Fork 5.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat(ui): split arrays in yaml to fix ambiguous collapse when array items have nested objects #21064
base: master
Are you sure you want to change the base?
Conversation
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note also that the user can edit the yaml and put the item on the same line as the dash.
Did you check if the formatting will affect the diff?
}); | ||
|
||
// Add newline after dash for nested objects | ||
yaml = yaml.replace(/^(\s*)-\s+(\w+):/gm, '$1-\n$1 $2:'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it'll be nicer if only the first item (which is a sub-array) is placed on the next line. As an example, from your screenshot, if you look at the element env
starting at line 123, if you collapse them all, then each item will be 'blank' and it's not very meaningful. Something like this:

It'll be good if we can keep these items all on the same line, like before, so it'll be something like this:

What do you think about using these search and replace strings instead, respectively?
:(\s*)\n(\s*)-(\s+)(\w+):(\s*)\n(\s*)-
and
:$1\n$2-\n$2 $4:$5\n$6-
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsoref, please review this for me. |
/bns:deploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems good. I'm hoping to play with it, but that'd require someone to poke bunny
4f09c2d
to
f564f6e
Compare
@jsoref PING! |
/bns:start |
2b5c729
to
1f6cb4c
Compare
eefc34d
to
0e9262b
Compare
My.Movie.mp4@jsoref, how about now? |
Signed-off-by: Atif Ali <atali@redhat.com>
…nline Signed-off-by: Atif Ali <atali@redhat.com>
Signed-off-by: Atif Ali <atali@redhat.com>
Fixes: #20905
Checklist:
Motivation
see link
Description of the change
Improve YAML array formatting in the UI to avoid ambiguous collapse behavior. When an array item contains nested objects, the dash (
-
) is now placed on its own line, making it clear which elements can be collapsed independently.