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

WIP - Inspector component #316

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

Gozala
Copy link
Contributor

@Gozala Gozala commented Oct 31, 2019

Draft of inspector widget (based on #311) that I would like to make into a built-in view for poking around arbitrary documents in the system. At the moment there is no good way to open a document you'd like to inspect other than copying the URI of the document and pasting it back with modified content type e.g.

hypermerge:/EWHzebDoLHfNnR5QPH4n82Ms9tASAiFLn8XAkah2DAsn?pushpinContentType=text
hypermerge:/EWHzebDoLHfNnR5QPH4n82Ms9tASAiFLn8XAkah2DAsn?pushpinContentType=inspect

Which should give you something like this

image

I also would like add a way to edit fields, but observablehq does not support modifications & I'm not in the mood of rewriting it.

Alternative might be to provide little console like input for JS repl kind of execution but that probably should be a separate widget.

@pvh
Copy link
Member

pvh commented Oct 31, 2019

So if you want to try this out in more depth you could try doing some kind of a URL rewrite with parseDocumentLink/createDocumentLink when a user holds certain keys.

@Gozala
Copy link
Contributor Author

Gozala commented Oct 31, 2019

@pvh after thinking a bit more about it, I'm thinking loading arbitrary document into Inspector view isn't the best option, as inspector needs to maintain it's own state e.g. which parts have being unfolded, additionally I wanted to add a field to type in jq expressions so only relevant data can be displayed. All this state needs to go somewhere and dumping it into document itself doesn't seem right. I'm considering to use {target: Doc, ...state} doc structure for inspectors. Does that sound reasonable ?

For opening I'm thinking something like long option key should surface inspect button over cards to open new inspectors cards for those.

- Inspector document at the moment just contains `targetURL` field of the
document being inspected, but in the future it will be extended to store
state like (un)folded substructures and possibly more.
- At the moment view initially renders title editor to enter `targetURL`
but ideally it would possibly have dropdown like omnibar to just
choose document from the active board. I also would like to have
long press on Option/Alt key to activate overlay over widgets with a
button to launch an inspector for any of the widgets.
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