json-editor icon indicating copy to clipboard operation
json-editor copied to clipboard

Soft collapse of degenerate and nested tree

Open ccancellieri opened this issue 4 years ago • 2 comments

General information

  • json-editor version: master

Expected behavior

Would be great to be able to collapse degenerate tree to a single item with a label (the leaf).

This could be applicable as soft collapse where we can collapse all but the leaf (if not empty).

Actual behavior

image

What do you think is this functionality already available? Would it be doable? Where to start looking? Thank you!

ccancellieri avatar Nov 04 '21 16:11 ccancellieri

Hmm, not sure how to do this in a generic way.

Actually you can collapse the tree anywhere, but - if I understood correctly - you want the last item (leaf) to stay open?

schmunk42 avatar Nov 16 '21 14:11 schmunk42

Yes! I know it could be tricky to implement and show all the options available along the tree… but the final result of the form will look a lot more readable in cases like this. I can also understand that this could be very hard to implement and this is why I’m asking. If you think it’s a mission impossible (due how the collapse is currently implemented) I’ll not go further. Thank you!

Il giorno mar 16 nov 2021 alle 15:34 Tobias Munk @.***> ha scritto:

Hmm, not sure how to do this in a generic way.

Actually you can collapse the tree anywhere, but - if I understood correctly - you want the last item (leaf) to stay open?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/json-editor/json-editor/issues/1064#issuecomment-970332939, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG5WW27DOOXFZ7TLECEGZDUMJTVVANCNFSM5HL47PSQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

-- Carlo Cancellieri Skype: ccancellieri Twitter: @cancellieric LinkedIn: http://it.linkedin.com/in/ccancellieri/

ccancellieri avatar Nov 16 '21 16:11 ccancellieri