-
Notifications
You must be signed in to change notification settings - Fork 199
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
Use the Webview UI Toolkit for Visual Studio Code for webview UI #2661
Comments
Thank you for contacting us! Any issue or feedback from you is quite important to us. We will do our best to fully respond to your issue as soon as possible. Sometimes additional investigations may be needed, we will usually get back to you within 2 days by adding comments to this issue. Please stay tuned. |
Following on this topic, and ideally, we adapt the VSCode Getting started API to replace our own webview. Rather than changing it incrementally, it would make sense to change the quickstart to the given API at once when we update the content of it. |
@jaeyonglee8687 @1openwindow For the getting started page, let's adapt the VSCode Getting started API later. For the sample gallery page, I can replace the buttons and tags with Webview UI Toolkit first. |
Currently VSC webview UI toolkit doesn't support React, there's already a pr raised microsoft/vscode-webview-ui-toolkit#300. Will update once supported |
@daviddossett @hawkticehurst @misolori please check Huihui's previous comment that the toolkit doesn't support React, and this is something critical blocking us to implement. Do you have any plan to support React in the toolkit? |
@jaeyonglee8687 @HuihuiWu-Microsoft Yes, we are currently working on it right now! We currently have an in-progress PR that will expose/publish a set of toolkit React components that can be easily imported and used in React-based webview extensions. We are also working on a sample extension that will demonstrate the usage of these components and generally how to configure a React-based webview extension (although I expect this latter part will be less important to all of you). In both, cases we're almost done with this work but are just waiting on an upstream issue to be resolved that is blocking us. So with all that said, we hope to have this work finished and published by early January since the holidays are coming up and myself and others will be OOF for a few weeks. |
Hi @hawkticehurst, I see the blocking issue you mentioned has been closed. The PR which will support React framework is still in progress. From the comments in the PR, I guess you're working on the typescript issue. Is it possible to estimate how long it will takes before getting this ready? Since we're going to improve the experience of sample gallery, we'd like to include the webview UI toolkit in the work if the time is ok or maybe we can do the enhancement first and update later when React support is ready. |
Hey @HuihuiWu-Microsoft, yes the blocking issue has been closed now, so we're good to go on that front! Also, with that work finished, support for React is technically complete now! This PR simply represents an effort to make the process of using/importing React-based toolkit components easier for extension authors but does not represent a blocker on being able to use the toolkit in React itself. This comment provides a summary of how you can use the toolkit in React if you really want to get started on the sample gallery experience (and then once the PR I mentioned above is finished it should be pretty simple to switch over). In fact, this comment is basically what the PR contains, so it's literally just a case of us doing the work of wrapping toolkit components instead of you doing the work––but again doesn't represent an actual issue with being able to use the toolkit in React. Also, the typescript issue is the result of an issue that lives two repos upstream from the toolkit, so I don't have a lot of insights into how long it will take for that problem to be fixed. However, this shouldn't actually be a problem for your extension because, as far as I can tell, it looks like you're using TypeScript I hope that all makes sense and helps clear things up a bit. If you have any other questions I'd be more than happy to answer them! |
Hi @hawkticehurst , thanks for your quick reply and that's much clear. So I'll need to wrap the used React component in our project using fast-react-wrapper and maybe update later once the wrapping is done in webview ui toolkit layer. I think that works for us. I'll have a try with the quick guide and let you know if any problems. Thanks! |
Of course! Happy it was helpful. Also, yes that is correct, you can manually wrap web components now and then update them later when we finish our PR. Finally, sounds great, please do let us know if you run into any issues! |
For our existing sample gallery design, I've adapted vscode Webview UI toolkit in this pr. In later sample gallery enhancement, I'll also leverage the toolkit for existing controls. |
Great to hear @HuihuiWu-Microsoft! Do let us know if you have any feedback along the way 🙏 |
+1 to what @daviddossett said! |
@HuihuiWu-Microsoft Hey! Just wanted to give a heads up that as of You should be able to remove the file that wraps components (and uninstall the import { VSCodeButton, VSCodeDropdown } from '@vscode/webview-ui-toolkit/react'; Let me know if you have any questions! |
Thanks @hawkticehurst! Good news to hear. I'll try latest version and cleanup the codes to import the React components directly. Will let you know if I meet any problem. |
Sounds great! |
close as solved |
Proposal
Hi all! 👋
As of today, some of the webview UI (some examples pictured below) in the Teams Toolkit extension appears to users as visually and functionally distant from the native VS Code UI itself.
Now that the Webview UI Toolkit for Visual Studio Code has been released, I think some of the webviews in the extension could benefit from swapping out their custom components for those provided by the toolkit. Specifically, buttons, links, and tags as a starting point. There may be other views I haven't come across yet.
You can view the components in a Storybook environment here.
References
While we don't currently provide the cards themselves in the Webview UI Toolkit, the tags and buttons could be replaced in this view:
Here, while it probably makes sense to adopt the new getting started API from VS Code itself, these views could also use buttons and links to at minimum solve the issues surrounding behavior, theming, and more in the near term:
cc @jaeyonglee8687 @hawkticehurst @misolori
The text was updated successfully, but these errors were encountered: