hackworthltd / primer-app

Primer's React frontend application.
GNU Affero General Public License v3.0
3 stars 0 forks source link

"Code folding" in trees #49

Open dhess opened 3 years ago

dhess commented 3 years ago

By "code folding," I mean this:

https://en.wikipedia.org/wiki/Code_folding

We'll want to work out a way to do this for trees.

We previously considered some folding ideas in Viz. There are Figma sketches here:

https://www.figma.com/file/CIZdrV2zzo1jcnltVifDGG/Viz?node-id=21%3A52

(It appears we called it "collapsing" in Viz's trees. That might be a better term, to avoid aliasing with fold operations on trees.)

brprice commented 3 years ago

This could be done with a projection?

dhess commented 3 years ago

Yeah, we have discussed this feature before and I believe it was a justification for the original projection system, but would implementing folding as a projection still be possible if we move "views" (tree/text, tuple/split) out of the AST metadata?