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

feature request for clearing widget state on Jupyter Lab #2565

Open
cornhundred opened this issue Sep 25, 2019 · 4 comments
Open

feature request for clearing widget state on Jupyter Lab #2565

cornhundred opened this issue Sep 25, 2019 · 4 comments
Milestone

Comments

@cornhundred
Copy link
Contributor

I would like to have a button on Jupyter Lab that clears widget state. Checking the "Save Widget State Automatically" option on Jupyter Lab saves widget state, but I often end up with widget state remaining from previously overwritten widgets (e.g. deleting the widget cell without properly closing the widget).

This issue originated on a previous issue: #2563

@jasongrout
Copy link
Member

jasongrout commented Sep 25, 2019

Such a command would I think just need to call the widget manager's clear_state method

async clear_state(): Promise<void> {
await super.clear_state();
this._modelsSync = new Map();
this.setDirty();
}

@jasongrout jasongrout modified the milestones: 8.0, Future Sep 25, 2019
@vidartf
Copy link
Member

vidartf commented Sep 26, 2019

What happens if you have live widgets (in kernel, and with views on page), and clear the state, let syncing happen, then save state?

@cornhundred
Copy link
Contributor Author

Hi @vidartf, what do you mean by

clear the state

Do you mean properly closing the widget?

@vidartf
Copy link
Member

vidartf commented Sep 26, 2019

My question was kind of multiple questions in one:

  1. What actually happens in this case when the widget manager's clear_state method is called?
  2. What happens in classic notebook if you use the "clear state" menu entry when widgets are live (if you then save the state, is there anything in it)?
  3. What would you expect to happen with state / live widgets in these cases (when a menu entry "Clear widget state" is clicked)?

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

3 participants