-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Test: Webview persistence APIs #50696
Comments
I have a react app (which is basically a tree view) running in the webview, tried to save/restore the state of tree expand/collapse state when the webview become visible/invisbile. Below are my attempts and findings
|
Removed my name from the task but will revisit this item tomorrow when more fixes come in. |
Test for #49022 #48542
Complexity: 3
Summary
A new api for webview serialization has been added. This allows webviews to both save their state between becoming hidden and visible, as well as saving their state when VS Code restarts
Test
Try adding the two types of persistence to the new webview (you can use the cat coding example for this)
Visibility persistence is implemented using a
getState
andsetState
method inside the webview itself:Serialization uses
WebviewPanelSerializer
andregisterWebviewPanelSerializer
to register a handler in the extension that can revive a webview from its state.Things to test:
The text was updated successfully, but these errors were encountered: