custom widgets support for notebook outputs #13517
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
this adds support for other ipywidget types like ipydatagrid and ipyleaflets.
Also fixes focusing of notebook editor widget after its shown and updating associated notebooks for extensions after the workspace was granted trust.
To explain overwriting the append child of head in
output-webview.internal.ts
a bit more:Vscode has a single endpoint all webviews can downlaod script files from, in theia though every webview can only download files from its own host address as the endpoint.
There is a
asWebviewURL
function in the extension API which we don't know for which webview the webviewUri is for. In VScode thsts no problem because the endpoint is always the same but in theia its dependent on the webview.So what im doing is adding a placeholder to the url which is replaced when a script is added to the head to generate the correct URL and make downloading the script work.
How to test
pip install ipydatagrid
in your used python environmentCreate or open a notebook and add the following cell.
Follow-ups
Review checklist
Reminder for reviewers