Pass theme info to Widget Preview + support auth frame bouncing#5715
Pass theme info to Widget Preview + support auth frame bouncing#5715
Conversation
|
@codex review |
There was a problem hiding this comment.
Pull Request Overview
This PR adds theme information support to the Flutter Widget Preview and implements authentication frame bouncing functionality. The changes enable proper theme synchronization between VS Code and the widget preview iframe while providing authentication handling for DevTools connections.
- Refactored widget preview to accept WebViewUrls instead of simple strings for enhanced URL handling
- Added theme detection and transmission functionality to pass VS Code theme information to widget preview
- Implemented authentication URL handling to support DTD connections
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/extension/sdk/dev_tools/embedded_view.ts | Removed extra blank line for code cleanup |
| src/extension/flutter/widget_preview/widget_preview_manager.ts | Updated to use WebViewUrls structure and include DTD authentication URLs |
| src/extension/flutter/widget_preview/webviews.ts | Added comprehensive theme handling, URL authentication, and dynamic iframe source management |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request enhances the Flutter Widget Preview by passing theme information (like dark/light mode and colors) from VS Code to the preview, allowing it to adapt to the editor's theme. It also introduces a mechanism for handling authentication by "bouncing" through auth URLs in hidden iframes, which is useful in certain environments. The changes are well-structured, introducing a shared WebViewUrls type and helper functions. My review includes a couple of minor suggestions for improving code quality and debug logging in the webview script.
There was a problem hiding this comment.
Codex Review: Here are some suggestions.
Reply with @codex fix comments to fix any unresolved comments.
About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you open a pull request for review, mark a draft as ready, or comment "@codex review". If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex fix this CI failure" or "@codex address that feedback".
Fixes #5702