Skip to content

WebviewPanel.reveal won't reveals to SIDE_GROUP if the specified group does not exist #71608

Closed
@Vigilans

Description

@Vigilans
  • Existing issues searched: true
  • Tested under insider edition: true
  • Does this issue occur when all extensions are disabled?: true
  • VS Code version: Code 1.32.3 (a3db5be, 2019-03-14T23:43:35.476Z)
  • OS version: Windows_NT x64 10.0.18362

Bug Report

Steps to reproduce

  1. Create a webview panel with viewColumn set to One
  2. Call reveal on the panel with viewColumn set to Two (not exists yet)
  3. The panel only reveals to Column One.

Workaround to make it right

  1. Create a webview panel with viewColumn set to One
  2. Execute workbench.action.focusSecondEditorGroup command to ensure Group Two exists
  3. Call reveal on the panel with viewColumn set to Two (exists now)
  4. The panel reveals to Column Two.

Contrast Example

showTextDocument

Designed behavior

  • When clicking Code Now, a doc will be called by showTextDocument in Column 3.

demo2
So:

  1. If I have 3 Columns, then doc will be open in Column 3.
  2. If I have 2 Columns, but Column 2 is empty, the doc will be open in Column 2.
  3. If I have 1 non-empty Column, then doc will be open in Column 2.

This behavior is as by design.

reveal

Designed behavior

  • When creating the webview, the panel will be called by reveal to Column 3.
  • When clicking Code Now, the panel will be called by reveal to Column 2.

demo1
↑ Here, if all 3 columns exists, the panel will be created to Column 3 and moved to Column 2, as by design.

demo2
↑ Here, what happened?:

  1. If I have 2 non-empty Columns, and creating a new webview, the panel get revealed to Column 2, which should have been in Column 3.
  2. If I have 2 non-empty Columns, and clicking Code Now, the panel get revealed to Column 2, which is as by design.
  3. If I have 1 non-empty Columns, and creating a new webview, the panel get revealed to Column 1, which should have been in Column 2.
  4. If I have 1 non-empty Columns, and clicking Code Now, the panel get revealed to Column 1, which should have been in Column 2.

we only allow revealing text documents in the group one greater than the current number of groups.

So, for WebviewPanel.reveal, it's not one greater than, it's equal to, which is not by design.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bughelp wantedIssues identified as good community contribution opportunitiesverifiedVerification succeededwebviewWebview issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions