-
Notifications
You must be signed in to change notification settings - Fork 29.7k
[ Widget Preview ] Add --machine mode
#173654
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
Currently only outputs a single event with information about where the
widget preview environment is served from:
`[{"event":"widget_preview.started","params":{"url":"http://localhost:61383"}}]`
Fixes #173545
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 adds a --machine mode to the widget-preview command, allowing it to output structured JSON events. The changes involve adding a new WidgetPreviewMachineAwareLogger to handle the conditional logging, updating the command to accept the --machine flag, and adding an integration test for the new mode.
My review focuses on the implementation of WidgetPreviewMachineAwareLogger. I've found a critical syntax error that would prevent compilation and suggested a refactoring to simplify the class and improve maintainability by better leveraging its superclass.
DanTup
left a comment
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.
Some nits that you're free to ignore, but lgtm - thanks!
| bool useWebServer = false, | ||
| }) async { | ||
| expect(expectedEvents, isNotEmpty); | ||
| var i = 0; |
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.
nit: given the distance to where this variable is used is more than a few lines, maybe make the name more descriptive?
|
|
||
| group('flutter widget-preview start --machine', () { | ||
| testWithoutContext('launches in browser', () async { | ||
| await runWidgetPreviewMachineMode(expectedEvents: launchEvents); |
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.
It might be worth checking the event definitely has a valid URL in the args.
jyameo
left a comment
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.
lgtm!
|
The tree is red on this PR and it doesn't look like a flake: |
|
I think because the other change (1eb2f68) removed the import for I thought the merge queue would've prevented this kind of issue by running the bots on each change based on the parent they'll be merged with? Does it not work that way? |
|
Correct. There was some unfortunate timing between two PRs landing as one
of them removed the import and landed after this PR pass it's presubmits. I
have a fix in process of landing here:
#173731 (review)
…On Wed, Aug 13, 2025, 5:12 p.m. Danny Tuppeny ***@***.***> wrote:
*DanTup* left a comment (flutter/flutter#173654)
<#173654 (comment)>
I think because the other change (1eb2f68
<1eb2f68>)
removed the import for ../runner/flutter_command_runner.dart.
I thought the merge queue would've prevented this kind of issue by running
the bots on each change based on the parent they'll be merged with? Does it
not work that way?
—
Reply to this email directly, view it on GitHub
<#173654 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFYWZYHXPPNNH5J6A7VEW2D3NOS5RAVCNFSM6AAAAACDXXMEN6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTCOBVHA2TAMJZGY>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
|
|
I thought this was what the merge queue was intended to solve, but I found
I guess that explains why it wasn't caught, though it makes me wonder why the queue is so slow if it's not running tests 🤔 |
We definitely run some checks... I think? @jtmcdole, is the merge queue documentation up to date? |
flutter/flutter@34c2a3b...f4334d2 2025-08-14 [email protected] Roll Dart SDK from 9b4691f35139 to 214a7f829913 (2 revisions) (flutter/flutter#173769) 2025-08-14 [email protected] Roll Skia from b3e86773dae1 to dca5f05fee87 (4 revisions) (flutter/flutter#173763) 2025-08-14 [email protected] Roll Dart SDK from 73153bdc1459 to 9b4691f35139 (3 revisions) (flutter/flutter#173755) 2025-08-14 [email protected] Roll Skia from 5852eddfd404 to b3e86773dae1 (1 revision) (flutter/flutter#173750) 2025-08-14 [email protected] Allow empty initial time when using text input mode in showTimePicker dialog (flutter/flutter#172847) 2025-08-13 [email protected] Roll Skia from 525e2bf80559 to 5852eddfd404 (2 revisions) (flutter/flutter#173740) 2025-08-13 [email protected] [web] Popping a nameless route should preserve the correct route name (flutter/flutter#173652) 2025-08-13 [email protected] Make sure that a ChoiceChip doesn't crash in 0x0 environment (flutter/flutter#173322) 2025-08-13 [email protected] [ Tool ] Fix missing import for widget_preview.dart (flutter/flutter#173731) 2025-08-13 [email protected] Roll Skia from f7fdda3cd0e6 to 525e2bf80559 (7 revisions) (flutter/flutter#173727) 2025-08-13 [email protected] Do not include `:unittests` unless `enable_unittests` (flutter/flutter#173729) 2025-08-13 [email protected] Roll Packages from 08a9b2c to 6cb9113 (1 revision) (flutter/flutter#173726) 2025-08-13 [email protected] fix: selected date decorator renders outside PageView in `DatePickerDialog` dialog (flutter/flutter#171718) 2025-08-13 [email protected] [ Widget Preview ] Add `--machine` mode (flutter/flutter#173654) 2025-08-13 [email protected] Make sure that a Chip doesn't crash in 0x0 environment (flutter/flutter#173245) 2025-08-13 [email protected] feat: Cupertino sheet implement upward stretch on full sheet (flutter/flutter#168547) 2025-08-13 [email protected] Fix visual overlap of transparent routes barrier when using FadeForwardsPageTransitionsBuilder (flutter/flutter#167032) 2025-08-13 [email protected] Fix `ChipThemeData` lerp for `BorderSide` (flutter/flutter#173160) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Currently only outputs a single event with information about where the
widget preview environment is served from:
`[{"event":"widget_preview.started","params":{"url":"http://localhost:61383"}}]`
Fixes flutter#173545
Currently only outputs a single event with information about where the
widget preview environment is served from:
`[{"event":"widget_preview.started","params":{"url":"http://localhost:61383"}}]`
Fixes flutter#173545
…r#9807) flutter/flutter@34c2a3b...f4334d2 2025-08-14 [email protected] Roll Dart SDK from 9b4691f35139 to 214a7f829913 (2 revisions) (flutter/flutter#173769) 2025-08-14 [email protected] Roll Skia from b3e86773dae1 to dca5f05fee87 (4 revisions) (flutter/flutter#173763) 2025-08-14 [email protected] Roll Dart SDK from 73153bdc1459 to 9b4691f35139 (3 revisions) (flutter/flutter#173755) 2025-08-14 [email protected] Roll Skia from 5852eddfd404 to b3e86773dae1 (1 revision) (flutter/flutter#173750) 2025-08-14 [email protected] Allow empty initial time when using text input mode in showTimePicker dialog (flutter/flutter#172847) 2025-08-13 [email protected] Roll Skia from 525e2bf80559 to 5852eddfd404 (2 revisions) (flutter/flutter#173740) 2025-08-13 [email protected] [web] Popping a nameless route should preserve the correct route name (flutter/flutter#173652) 2025-08-13 [email protected] Make sure that a ChoiceChip doesn't crash in 0x0 environment (flutter/flutter#173322) 2025-08-13 [email protected] [ Tool ] Fix missing import for widget_preview.dart (flutter/flutter#173731) 2025-08-13 [email protected] Roll Skia from f7fdda3cd0e6 to 525e2bf80559 (7 revisions) (flutter/flutter#173727) 2025-08-13 [email protected] Do not include `:unittests` unless `enable_unittests` (flutter/flutter#173729) 2025-08-13 [email protected] Roll Packages from 08a9b2c to 6cb9113 (1 revision) (flutter/flutter#173726) 2025-08-13 [email protected] fix: selected date decorator renders outside PageView in `DatePickerDialog` dialog (flutter/flutter#171718) 2025-08-13 [email protected] [ Widget Preview ] Add `--machine` mode (flutter/flutter#173654) 2025-08-13 [email protected] Make sure that a Chip doesn't crash in 0x0 environment (flutter/flutter#173245) 2025-08-13 [email protected] feat: Cupertino sheet implement upward stretch on full sheet (flutter/flutter#168547) 2025-08-13 [email protected] Fix visual overlap of transparent routes barrier when using FadeForwardsPageTransitionsBuilder (flutter/flutter#167032) 2025-08-13 [email protected] Fix `ChipThemeData` lerp for `BorderSide` (flutter/flutter#173160) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Currently only outputs a single event with information about where the
widget preview environment is served from:
`[{"event":"widget_preview.started","params":{"url":"http://localhost:61383"}}]`
Fixes flutter#173545
Currently only outputs a single event with information about where the
widget preview environment is served from:
`[{"event":"widget_preview.started","params":{"url":"http://localhost:61383"}}]`
Fixes flutter#173545
Currently only outputs a single event with information about where the
widget preview environment is served from:
`[{"event":"widget_preview.started","params":{"url":"http://localhost:61383"}}]`
Fixes flutter#173545
Currently only outputs a single event with information about where the widget preview environment is served from:
[{"event":"widget_preview.started","params":{"url":"http://localhost:61383"}}]Fixes #173545