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

API: Prevent the webview tab from being replaced #66051

Closed
agentcooper opened this issue Jan 4, 2019 · 3 comments
Closed

API: Prevent the webview tab from being replaced #66051

agentcooper opened this issue Jan 4, 2019 · 3 comments
Assignees
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code webview Webview issues

Comments

@agentcooper
Copy link

I didn't find any way to prevent the webview tab from being replaced.

Context: I'm developing an extension with a preview pane that you can interact with. The typical workflow is: open a file, interact with a preview, open a different file. If the user tries to open a different file while the preview is focused, the preview tab will be replaced.

I propose a new option on WebviewPanelOptions:

vscode.window.createWebviewPanel(
  "preview",
  "Preview",
  { viewColumn: vscode.ViewColumn.Beside, preserveFocus: true },
  {
    /** Prevent the tab from being replaced */
    preventFromReplace: true
  },
);

What do you think?

@vscodebot vscodebot bot assigned mjbvz Jan 4, 2019
@vscodebot vscodebot bot added the markdown Markdown support issues label Jan 4, 2019
@agentcooper agentcooper changed the title Prevent the webview tab from being replaced API: Prevent the webview tab from being replaced Jan 4, 2019
@mjbvz mjbvz added feature-request Request for new features or functionality api webview Webview issues and removed markdown Markdown support issues labels Jan 4, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Jan 8, 2019

I'm not in favor of supporting editors that can't be replaced since it would let webviews behave differently from how all other editors in VS Code currently work.

Would placing the webview in a sidebar cover your use case, either #46585 or #43049. There's also this request for modal webviews: #47899

@agentcooper
Copy link
Author

@mjbvz #46585 will definitely solve things for my case.

@mjbvz
Copy link
Collaborator

mjbvz commented Jan 8, 2019

Thanks, please upvote #46585. I'm going to close this feature request as out of scope since I do not think it something we would want to enable

@mjbvz mjbvz closed this as completed Jan 8, 2019
@mjbvz mjbvz added the *out-of-scope Posted issue is not in scope of VS Code label Jan 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code webview Webview issues
Projects
None yet
Development

No branches or pull requests

3 participants
@agentcooper @mjbvz and others