-
Notifications
You must be signed in to change notification settings - Fork 129
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
expand the inspector if its previous version was expanded #1475
Conversation
this should be revised more thoroughly when we fix observablehq/inspector#12 closes #1458
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should avoid using delete
and instead represent inspector state consistently by initializing it when the root node is attached (i.e., in define
).
Also, we should handle the multiple displayed items case better — we should err towards collapsing rather than expanding.
(I think technically we could avoid storing any additional state on the root
because it could be part of the display
closure, but that’s just an optimization I guess.)
my
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
We save the current inspector's expansion state in root.inspectorExpanded, and restore it when we create a new inspector, by passing a div that contains a span with the expected "observablehq--expanded" class.
for now inspectorExpanded is true if defined — this should be revised more thoroughly when we fix observablehq/inspector#12
closes #1458