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

Support hover popup webview #175234

Open
samestep opened this issue Feb 23, 2023 · 2 comments
Open

Support hover popup webview #175234

samestep opened this issue Feb 23, 2023 · 2 comments
Assignees
Labels
api feature-request Request for new features or functionality webview Webview issues
Milestone

Comments

@samestep
Copy link
Contributor

samestep commented Feb 23, 2023

The Book of Shaders has some very cool widgets for picking scalars and vectors:

GIF of Book of Shaders widgets

These are great because they colocate the interaction with the source of truth for that quantity in the code itself. I propose that the VS Code extension API support such widgets, similar to the builtin color picker widget VS Code already has.

This proposal is a more concrete version of #66493, which was closed as a duplicate of #3220. I am opening this new issue because I do not believe that the original was actually a duplicate: a hover popup is fundamentally different from an inline peek widget, as (unless I am mistaken) there can only be one hover popup visible at a time.

Specifically, I would like to add a new extension API that combines the webview API with the hover API (and possibly the decoration API) to allow extensions to render custom interactive HTML content in popups, similar to the builtin color picker. At a high level, this should look the same as it currently does to provide a webview, except that the webview will be in a popup element floating above an existing editor, instead of in a separate pane.

I understand that the webview API docs mention that they are "resource heavy" and "should be used sparingly", which is why I believe the popup context is appropriate: since there can only be one at a time, this API should allow only a single webview to be created per extension, with that webview being shown on hover and hidden when the hover focus is lost, re-rendering with different content when hover focus reappears on a different item. Thus the resource costs of this proposal should be similar to those of existing webviews.

@mjbvz mjbvz added feature-request Request for new features or functionality api webview Webview issues labels Mar 1, 2023
@vscodenpa vscodenpa added this to the Backlog Candidates milestone Mar 1, 2023
@vscodenpa
Copy link

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

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 webview Webview issues
Projects
None yet
Development

No branches or pull requests

3 participants