-
Notifications
You must be signed in to change notification settings - Fork 946
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
We should save the (minimal) widget state in the notebook file by default #3108
Comments
One corner case at least: If you use |
That is a good point, that means we cannot 'prune' (close) the seemingly stale widgets, since a live kernel can always include hidden connections. |
@maartenbreddels is this related to #3007 where in jupyter lab, if we set the "automatically save state" option, then the notebook size balloons as state always seems to be appended? |
@stevejpurves indeed, see #3114 (comment) |
@vidartf |
This PR does pick up jslink, btw. |
This PR helps me understand how to workaround this for my widget library, thanks for pushing this. I can use what you have here to patch my widget library in the meantime. Any chance this will ever be merged? |
Problem
People just want to save a notebook with widgets, and the state should be embedded, they by default should not have to worry about saving the widget state, nor do they want the state of 'stale' (unused) widgets in the notebook output.
Proposed Solution
Similar to what we do on the Python side in
ipywidgets/ipywidgets/embed.py
Line 116 in 671fd0f
Maybe there are edge cases where we cannot detect the children, to protect for that we should have a method in WidgetModel to override finding the children, but I think in 99.99% I can find them.
Related #2598
cc @martinRenou
The text was updated successfully, but these errors were encountered: