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

Add support for dynamic view type - Allow to switch between tree and webview dynamically #136484

Closed
softmarshmallow opened this issue Nov 5, 2021 · 5 comments
Assignees
Labels
api feature-request Request for new features or functionality

Comments

@softmarshmallow
Copy link

Currently displaying a webview content on a activity bar registered view is allowed by

{
	"id": "grida-explorer-components-web",
	"name": "Components",
	"type": "webview",
	"contextualTitle": "Components"
},

And

  context.subscriptions.push(
    vscode.window.registerWebviewViewProvider(
      "grida-explorer-components-web",
      new MyWebviewProvider()
    )
  );

What i'de like to do is providing the ui as native tree view as default, and when user commands "switch to grid view", I'de like to show a grid view with image previews as webview.

This is possible with scripts, but won't get affected (registerWebviewViewProvider on non explicitly "webview" set view will be ignored)

@sandy081
Copy link
Member

sandy081 commented Nov 9, 2021

Cant this be possible by your extension by

  • having a context key say showGridView which is false by default
  • register tree and grid view by setting above context key in when condition
  • have a command that toggles this context key - which toggles the views?

@softmarshmallow
Copy link
Author

@sandy081 For webview, it should be pre-defined statically "type": "webview" in package.json

Sadly Can't do somehow by using when condition - AFAIK

@github-actions github-actions bot locked and limited conversation to collaborators Feb 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants
@joaomoreno @sandy081 @mjbvz @softmarshmallow and others