Show debug-mode message for widget rebuilds in profile mode#9755
Show debug-mode message for widget rebuilds in profile mode#9755crackedhandle wants to merge 10 commits intoflutter:masterfrom
Conversation
|
@elliette can you review this? |
| selectedFrame = ValueNotifier<FlutterFrame?>(null); | ||
| }); | ||
|
|
||
| testWidgets( |
There was a problem hiding this comment.
Could we add these tests cases to the performance_screen_test instead of creating a new test suite? Thanks!
There was a problem hiding this comment.
Please review the required changes @elliette ! thanks
|
I see CI is failing due to lint warnings in DevTools files that I haven’t modified. Should I address these as part of this PR, or is there a preferred way to handle them? @srawlins |
|
I think those are the result of a new version of analyzer... or Dart... or even DCM I guess. So we just have to fix them out-of-band. Probably someone should fix them and land that fix before landing other PRs. |
Got it, thanks for the clarification. I’ll wait for the lint fixes to land and re-run CI afterward. |
96a4f70 to
788a58e
Compare
When running in profile mode, the Performance panel showed a disabled 'Count widget builds' checkbox which was misleading. Widget rebuild counts rely on debugOnRebuildDirtyWidget which is only available in debug mode. This change: - Removes the checkbox when running in profile mode - Shows a clear message: 'Rebuild information is not available for this frame. Widget rebuild counts are only available when running an app in debug-mode.' - Adds widget tests for both profile mode and debug mode behavior Fixes flutter#9730
Per reviewer feedback, moved the profile mode widget tests from a separate test file into the existing performance_screen_test.dart. Also added required imports for RebuildStatsView, RebuildCountModel, FlutterFrame and foundation.
788a58e to
05507a2
Compare
|
@srawlins Rebased. can we try again to re-run the tests? |
|
@srawlins all checks are passing now. Please let me know if there’s anything else I should address, otherwise this should be ready for merge. |
93b76d4 to
05507a2
Compare
| return const Center( | ||
| child: Text( |
There was a problem hiding this comment.
Use CenteredMessage instead
| includes the following changes among other general improvements. | ||
| To learn more about DevTools, check out the | ||
| [DevTools overview](/tools/devtools). | ||
| [DevTools overview](https://docs.flutter.dev/tools/devtools). |
There was a problem hiding this comment.
please revert this change. This link is intentionally relative because these notes are copied to the Flutter website
| - Fixed an issue where navigating the Inspector widget tree with the keyboard arrow keys did not update the selected widget in the connected Flutter app. [#9810](https://github.com/flutter/devtools/pull/9810) | ||
| - Fixed an issue where clicking a widget row after collapsing a subtree with the left arrow key unexpectedly re-expanded the subtree. [#9810](https://github.com/flutter/devtools/pull/9810) | ||
| - Fixed an issue where collapsing the Inspector widget tree to a single row with the left arrow key caused a loading spinner to appear instead of showing the root node. [#9810](https://github.com/flutter/devtools/pull/9810) | ||
| TODO: Remove this section if there are not any updates. |
There was a problem hiding this comment.
revert all local changes to this file other than the entry you want to add. thanks!
| }, | ||
| ); | ||
|
|
||
| // testWidgetsWithWindowSize( |
There was a problem hiding this comment.
please revert this change since it is unrelated to this PR. I'm not sure why this test was commented out, but we can address this separately.
| when(app.isDartWebAppNow).thenReturn(false); | ||
| when(app.isFlutterAppNow).thenReturn(true); | ||
| when(app.isDartCliAppNow).thenReturn(false); | ||
| when(app.isDartWebApp).thenAnswer((_) async => false); | ||
| when(app.isProfileBuild).thenAnswer((_) async => false); |
There was a problem hiding this comment.
instead of doing this, use the mockConnectedApp test helper
Fixes #9730
Problem
When running in profile mode, the Performance panel showed a
disabled "Count widget builds" checkbox which was misleading -
it implies the feature could work if enabled. In reality, widget
rebuild counts rely on
debugOnRebuildDirtyWidgetwhich is onlyavailable in debug mode.
Solution
Tests
Added
rebuild_stats_view_test.dartwith two widget tests: