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

Webview reveal api has no method for just making visible. #67691

Closed
rchiodo opened this issue Jan 31, 2019 · 3 comments
Closed

Webview reveal api has no method for just making visible. #67691

rchiodo opened this issue Jan 31, 2019 · 3 comments
Assignees
Labels
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded webview Webview issues
Milestone

Comments

@rchiodo
Copy link
Contributor

rchiodo commented Jan 31, 2019

The webview reveal API is what we use to display a webview when a user adds new content to it. However the only way we can present it is to force it to move to a specific ViewColumn (either the same as the active editor, or a hardcoded value).

We'd really love a way to just have it activate wherever it happens to be.

Maybe something like:

    /**
     * Makes the webviewpanel show up.
     * @return A Promise that can be waited on
     */
    show(): Promise<void>;

Here's an example of reveal not working the way a customer needs:
https://github.com/Microsoft/vscode-python/issues/4237

@mjbvz mjbvz assigned mjbvz and unassigned jrieken Feb 1, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Feb 1, 2019

The WebviewPanel.reveal signature is:

reveal(viewColumn?: ViewColumn, preserveFocus?: boolean): void;

If you pass no arguments, the webview should show in its current column. Is this not what you see?

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Feb 1, 2019
@rchiodo
Copy link
Contributor Author

rchiodo commented Feb 1, 2019

Nope. If I pass no arguments, it activates next to the window that currently has focus.

So if the webview was in view column 2, the active editor is view column 1 and I call 'reveal()' it activates the webview in view column 1. Additionally it steals the focus. Although since it covers the active editor, it kinda has to steal the focus.

What we'd like is to have reveal(undefined, true) just bring the webview to the front of the list of windows in whatever column it's already in.

@mjbvz mjbvz added bug Issue identified by VS Code Team member as probable bug and removed info-needed Issue requires more information from poster labels Feb 12, 2019
@mjbvz mjbvz added this to the February 2019 milestone Feb 12, 2019
@mjbvz
Copy link
Contributor

mjbvz commented Feb 12, 2019

As a workaround until this is fixed, pass webview.viewColumn as the first argument

@mjbvz mjbvz added api webview Webview issues labels Feb 12, 2019
@mjbvz mjbvz closed this as completed in b735cd1 Feb 12, 2019
@jrieken jrieken added the verified Verification succeeded label Feb 26, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded webview Webview issues
Projects
None yet
Development

No branches or pull requests

3 participants