Page MenuHomePhabricator

Preserve folded YAML sections in the config editor

Authored by bengotow on Oct 4 2019, 10:55 PM.


Group Reviewers
Restricted Project

This diff stores the currently collapsed / folded segments of YAML into local storage and restores them. Folding is saved per-pipeline, so collapsing the "solids" section of one pipeline in the config editor won't collapse it for other pipelines, but will collapse it in all the tabs of the current one. To make it fairly robust, the collapsed state refers to YAML paths (eg: "resources.config.db_info") not line numbers.

Test Plan

Run tests

Diff Detail

R1 dagster
Lint OK
No Unit Test Coverage

Event Timeline

bengotow created this revision.Oct 4 2019, 10:55 PM

how does this work with multiple tabs open?



this feels very complex for the utility it buys


make sure to test changes on a long document.

this feels off to keep in as a comment - is this a note to yourself for this diff?

max added a subscriber: max.Oct 7 2019, 8:25 PM

What happens when two pipelines in different repositories share the same name?

Hey folks! re: complexity I sort of agree - I could move this to a separate file / plugin type of thing, but it's definitely less straightforward than I'd hoped. We could switch to just storing line numbers that are folded instead of YAML paths, but I think being able to move between tabs and have your folding preserved is kind of nice, and with just indexes we might apply the folding incorrectly and not know. (eg: "fold line 12" might result in something being incorrectly folded if the YAML had changed.)

Re: same pipeline in different repos, the two pipelines with the same name would share folding state. Not sure if that's worth fixing. I'd debating just making the whole app use a single folded state but I imagined folks would be interested in different chunks for different pipelines.

Re: multiple tabs, the last tab in which you folded/unfold part of the document "wins" and determines the folding state on reload / new page.

Anyway—just let me know about this one! I'm totally fine abandoning if we think the code surface area just isn't worth it.


Ahh I just left this for future-me. Basically if you edit this function you need to use a YAML document that is more than 40 lines long or it might appear to be working fine when it's really not.

max added a comment.Oct 24 2019, 11:22 PM

I think this is an important utility, @alangenfeld if your worries about complexity are allayed at all I think we should merge

alangenfeld requested changes to this revision.Oct 25 2019, 2:52 PM

lets add some tests then ill feel fine

This revision now requires changes to proceed.Oct 25 2019, 2:52 PM
bengotow abandoned this revision.Nov 29 2019, 9:13 PM

Going to abandon this—I think we decided not to move forward with preserving folding.