Show debug-mode message for widget rebuilds in profile mode
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 debugOnRebuildDirtyWidget which is only
available in debug mode.
Solution
- Removes the checkbox when running in profile mode
- Replaces it with a clear message:
"Rebuild information is not available for this frame. Widget rebuild counts are only available when running an app in debug-mode."
Tests
Added rebuild_stats_view_test.dart with two widget tests:
- Verifies the message appears in profile mode
- Verifies the normal UI appears in debug mode
@elliette can you review this?
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.
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.
@srawlins Rebased. can we try again to re-run the tests?
Yay!, DCM test passed. Thanks @srawlins and @elliette for the guidance and help.
@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.
If you still intend to land this, @crackedhandle , please address these comments. Otherwise we can close it.
@kenzieschmoll @srawlins Thanks for the feedback! I've addressed all the review comments:
- Replaced
Center+TextwithCenteredMessageinrebuild_stats.dart - Reverted the DevTools overview link back to the relative path
/tools/devtools - Reverted the commented-out
testWidgetsWithWindowSizeline (unrelated to this PR) - Replaced manual
when()mocking with themockConnectedApptest helper
Let me know if there's anything else needed!