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

[inspect] Use new stack-based view mode #880

Merged
merged 3 commits into from
Jun 2, 2024

Conversation

alexander-yakushev
Copy link
Member

@alexander-yakushev alexander-yakushev commented May 31, 2024

After using the new view-mode functionality locally for some time, I concluded that in 99% of cases you only want to toggle :object view mode for the currently inspected value. When you subsequently click on one of the fields to inspect further, you'd rather see the normal view mode again. So, in my experience, it looked like v, click the field with usually a recognizable data structure, v again to toggle back to normal view mode.

I propose to make this behavior the default one. When the user navigates away from the current view, the view-mode will reset. For that, I've introduced a concept of "transient config values".

In this PR, any action other than toggle-view-mode will reset the view-mode back to :normal. Now that I think of it, some actions make sense to preserve the view mode, e.g. next-prev/sibling (if you are viewing the value in :object view, it's likely you want to see its sibling in that view too). prev/next page don't make sense for object view, so it's whatever there. So, perhaps, the resetting logic should only exist for down/up ops. Maybe maintain it as another stack (this will be neat but require the most work)?

WDYT?

EDIT

It was decided to implement :view-mode switching on the Orchard side and keep a stack of modes for the history of inspected values. That way, when the user downs to another value, the :view-mode is reset to :normal. When they go back up, the :view-mode is restored from the stack.

@alexander-yakushev alexander-yakushev changed the title [inspect] Introduce transient config values, make :view-mode transient [inspect] Use new stack-based view-mode Jun 1, 2024
@alexander-yakushev alexander-yakushev changed the title [inspect] Use new stack-based view-mode [inspect] Use new stack-based view mode Jun 1, 2024
@alexander-yakushev alexander-yakushev merged commit b59594e into master Jun 2, 2024
55 checks passed
@alexander-yakushev alexander-yakushev deleted the transient-view-mode branch June 2, 2024 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants