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

Option for "Clear Widget State" in JupyterLab #3887

Closed
kolibril13 opened this issue Feb 21, 2024 · 2 comments
Closed

Option for "Clear Widget State" in JupyterLab #3887

kolibril13 opened this issue Feb 21, 2024 · 2 comments

Comments

@kolibril13
Copy link

It's great that there's an option to save a widget state in JupyterLab.
It would be nice if there was an option to clear a widget state as well, as saved widget states can drastically increase the notebook size. Not ideal for version control.

In the past, I had the assumption that "Clear all notebook outputs" would also clear the stored widget states, but that's not the case.

When working on a notebook where "Save widget state automatically" is activated, I realized that it's only possible to remove the state data by making a fresh notebook and copying the notebook content cell by cell.

@jtpio mentioned such an option here jtpio/ipylab#137 (comment), together with the idea of a new Save Widget State, next to the already existing Save Widget State Automatically (toggle)

Thinking of version control, it might be also worth considering saving the widget state not in the notebook itself, but instead in an external widget_state.json file. I remember in the past there was an option to Download Widget State in the classic jupyter notebook https://ipywidgets.readthedocs.io/en/8.1.2/embedding.html#widget-state-json
Keeping a widget_state.json with all the widget state data in a gitignore would keep the notebook small in size without losing the state.

@jtpio
Copy link
Member

jtpio commented Feb 21, 2024

Isn't this a duplicate of #3672? (linked in jtpio/ipylab#137 (comment))

@kolibril13
Copy link
Author

It is, sorry for the dublicate.

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

No branches or pull requests

2 participants