-
Notifications
You must be signed in to change notification settings - Fork 340
Add basic (experimental) Flutter Widget Preview #5650
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
Conversation
|
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds experimental Flutter Widget Preview functionality that allows developers to preview Flutter widgets in VS Code through a web server interface. The feature can be displayed either in the sidebar or as an editor panel.
- Adds a new Flutter Widget Preview server implementation that communicates with Flutter's widget-preview command
- Implements webview-based preview functionality with both sidebar and embedded view options
- Integrates the feature into the extension's configuration and activation flow with experimental flags
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/shared/vscode/utils.ts | Refactors ProjectFinder to accept excluded folders function in constructor |
| src/shared/enums.ts | Adds new log category for Flutter Widget Preview |
| src/shared/constants.contexts.ts | Adds context constants for widget preview feature availability |
| src/shared/capabilities/flutter.ts | Adds capability check for widget preview support |
| src/extension/views/packages_view.ts | Updates to use refactored ProjectFinder API |
| src/extension/utils/log.ts | Adds widget preview to user-selectable log categories |
| src/extension/flutter/widget_preview_server.ts | Implements the Flutter widget preview server communication |
| src/extension/flutter/widget_preview/widget_preview_manager.ts | Manages widget preview lifecycle and commands |
| src/extension/flutter/widget_preview/webviews.ts | Implements webview components for displaying the preview |
| src/extension/extension.ts | Integrates widget preview into main extension activation |
| src/extension/config.ts | Adds configuration options for the experimental feature |
| src/extension/api/extension_api.ts | Updates API to use refactored ProjectFinder |
| package.json | Adds commands, configuration, and sidebar view definitions |
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces an experimental Flutter Widget Preview feature. The implementation includes a new server process to generate the preview, webviews to display it (either in the sidebar or beside the editor), and associated commands and settings. The changes are well-structured, adding new modules for the preview functionality.
My review includes a few suggestions:
- Correcting a potentially wrong icon path in
package.json. - Fixing an invalid Content-Security-Policy in the webview implementation to improve security and correctness.
- Improving type safety by changing
anyreturn types tovoidfordisposemethods.
0da5cb4 to
afcb58f
Compare
The basic preview works and can be shown in the sidebar or as an editor panel (default is currently sidebar).
See #2620
See #5649