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

Allow to reopen closed webviews #97285

Closed
miguelsolorio opened this issue May 8, 2020 · 5 comments · Fixed by #100979
Closed

Allow to reopen closed webviews #97285

miguelsolorio opened this issue May 8, 2020 · 5 comments · Fixed by #100979
Assignees
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded webview Webview issues workbench-history History item issues
Milestone

Comments

@miguelsolorio
Copy link
Contributor

Webviews appear to not restore via Cmd+Shift+T or running the Reopen Closed Editor command:

  1. Open a webview, like a PR/welcome page/release notes
  2. Close tab
  3. Restore tab
  4. 🐛 tab is skipped and goes to next

This is also affected by pinned tabs but I assume it's related to the reopen command.

@miguelsolorio miguelsolorio added bug Issue identified by VS Code Team member as probable bug webview Webview issues workbench-tabs VS Code editor tab issues labels May 8, 2020
@bpasero
Copy link
Member

bpasero commented May 9, 2020

This is intentional because there is no way currently a non-file based editor can signal that it can simply be restored. Check is here:

const supportsReopen = resource && this.fileService.canHandleResource(resource); // we only support file'ish things to reopen

However this could possibly be improved by simply asking the editor input factory to serialize the editor and then bring it back, I can play around with that approach.

@mjbvz not sure that makes sense to you, is it safe to serialize any webview via its factory and bring it back from that state?

@bpasero bpasero added the info-needed Issue requires more information from poster label May 9, 2020
@bpasero
Copy link
Member

bpasero commented May 11, 2020

Upon second thought, I think my proposed idea is also not good because when an editor closes, assuming that you can serialize it may be risky. I think we would need some new infrastructure to support this scenario.

@bpasero bpasero added feature-request Request for new features or functionality workbench-editors Managing of editor widgets in workbench window and removed bug Issue identified by VS Code Team member as probable bug info-needed Issue requires more information from poster webview Webview issues workbench-tabs VS Code editor tab issues labels May 11, 2020
@bpasero bpasero added this to the Backlog milestone May 11, 2020
@bpasero bpasero added the webview Webview issues label May 11, 2020
@bpasero bpasero changed the title Webviews do not restore via Reopen Closed Editor Allow to reopen closed webviews May 11, 2020
@bpasero bpasero removed their assignment Jun 2, 2020
@bpasero
Copy link
Member

bpasero commented Jun 9, 2020

@mjbvz with the change in 1eac96d, we are now asking the editor input factory to serialise an editor when it closes to support for opening it again. However it looks like webviews are not being serialized when they got closed, which maybe is for a good reason.

If we cannot support this easily, then I suggest to close this feature, otherwise please try it out and see what is missing.

@bpasero bpasero added workbench-history History item issues and removed workbench-editors Managing of editor widgets in workbench window labels Jun 9, 2020
@rlabrecque
Copy link

rlabrecque commented Jun 28, 2020

Just want to throw my two cents in/use case in.

I came here because I updated to 1.47.0-insider from 1.46.0-insider, the initial launch opened the Release Notes: 1.47.0-insider tab, I closed it by accident, then tried to open it again with Ctrl+Shift+T.
Presumably that page is a webview and suffers from this.

Easy enough to get it back via Help -> Release Notes, but the expected actions did not work.

Edit: #86864 Seems release notes are a different problem, my bad!

@mjbvz mjbvz modified the milestones: Backlog, July 2020 Jul 7, 2020
@mjbvz mjbvz added the verification-needed Verification of issue is requested label Jul 7, 2020
@mjbvz
Copy link
Collaborator

mjbvz commented Jul 7, 2020

Not enabled for the release notes at the moment but should now work for markdown previews

@alexr00 alexr00 added the verified Verification succeeded label Aug 5, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded webview Webview issues workbench-history History item issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants
@bpasero @rlabrecque @mjbvz @miguelsolorio @alexr00 and others