Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow code-folding of JSON response bodies #398

Open
anussel5559 opened this issue Oct 3, 2024 · 3 comments
Open

Allow code-folding of JSON response bodies #398

anussel5559 opened this issue Oct 3, 2024 · 3 comments
Labels
qol Improvements that make usage smoother, without introducing new functionality

Comments

@anussel5559
Copy link
Contributor

Did you search for existing issues already?
yup!

Is your feature request related to a problem? Please describe.
Not an issue - purely a QoL enhancement

Describe the solution you'd like
Right now, it's pretty easy for a response body to overflow the length of the response pane in the main slumber view. Scrolling is easy as is filtering, but code folding might be a nice way for users to move about the response.

Describe alternatives you've considered
None outside of piping the result of a singular slumber request to something like otree

Additional context
Maybe there's a way to leverage otree inside the response pane? 🤷

@LucasPickering
Copy link
Owner

This is a good idea, I'd find it useful. I'm not sure exactly what the interaction would look like. Typically for folding you'd use left and right arrows to close/open, but the response pane already uses those to switch needs. Needs some messing around.

As far as implementation, I'd love to use a 3rd party library for this, but I'm not sure how hard it would be to integrate with. Maybe there's already a ratatui widget for it?

@LucasPickering LucasPickering added the qol Improvements that make usage smoother, without introducing new functionality label Oct 8, 2024
@anussel5559
Copy link
Contributor Author

maybe tui-rs-tree-widget?

@LucasPickering
Copy link
Owner

I had originally looked into tui-rs-tree-widget when adding the tree view to the left Recipes pane. I decided not to use it because the amount of glue code required to make it work with Slumber's data structures was about the same complexity as just reimplementing it myself. We could reuse the tree code from that for a JSON explorer. In terms of a third party library, I was thinking of something more all-inclusive, where you just give it a serde_json::Value and it makes it all pretty and foldable for you. Probably doesn't exist though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qol Improvements that make usage smoother, without introducing new functionality
Projects
None yet
Development

No branches or pull requests

2 participants