devtools icon indicating copy to clipboard operation
devtools copied to clipboard

Show debug-mode message for widget rebuilds in profile mode

Open crackedhandle opened this issue 7 months ago • 8 comments

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

crackedhandle avatar Apr 03 '26 00:04 crackedhandle

@elliette can you review this?

crackedhandle avatar Apr 07 '26 15:04 crackedhandle

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

crackedhandle avatar Apr 17 '26 22:04 crackedhandle

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.

srawlins avatar Apr 17 '26 23:04 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.

crackedhandle avatar Apr 18 '26 16:04 crackedhandle

@srawlins Rebased. can we try again to re-run the tests?

crackedhandle avatar Apr 20 '26 22:04 crackedhandle

Yay!, DCM test passed. Thanks @srawlins and @elliette for the guidance and help.

crackedhandle avatar Apr 20 '26 22:04 crackedhandle

@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.

crackedhandle avatar Apr 22 '26 16:04 crackedhandle

If you still intend to land this, @crackedhandle , please address these comments. Otherwise we can close it.

srawlins avatar Jun 22 '26 19:06 srawlins

@kenzieschmoll @srawlins Thanks for the feedback! I've addressed all the review comments:

  1. Replaced Center + Text with CenteredMessage in rebuild_stats.dart
  2. Reverted the DevTools overview link back to the relative path /tools/devtools
  3. Reverted the commented-out testWidgetsWithWindowSize line (unrelated to this PR)
  4. Replaced manual when() mocking with the mockConnectedApp test helper

Let me know if there's anything else needed!

crackedhandle avatar Aug 04 '26 05:08 crackedhandle