-
Notifications
You must be signed in to change notification settings - Fork 391
Show debug-mode message for widget rebuilds in profile mode #9755
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
base: master
Are you sure you want to change the base?
Changes from all commits
e7dfd10
e1c52f3
23d9d05
a9febdd
0879481
808bf1a
d6ff5d2
2b176c3
05507a2
560df3a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,7 @@ Copyright 2025 The Flutter Authors | |
| Use of this source code is governed by a BSD-style license that can be | ||
| found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd. | ||
| --> | ||
|
|
||
| This is a draft for future release notes that are going to land on | ||
| [the Flutter website](https://docs.flutter.dev/tools/devtools/release-notes). | ||
|
|
||
|
|
@@ -11,24 +12,20 @@ This is a draft for future release notes that are going to land on | |
| The 2.58.0 release of the Dart and Flutter DevTools | ||
| 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). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please revert this change. This link is intentionally relative because these notes are copied to the Flutter website |
||
|
|
||
| ## General updates | ||
|
|
||
| TODO: Remove this section if there are not any updates. | ||
|
|
||
| ## Inspector updates | ||
|
|
||
| - Deleted the option to use the legacy inspector. | ||
| [#9782](https://github.com/flutter/devtools/pull/9782) | ||
| - 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. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. revert all local changes to this file other than the entry you want to add. thanks! |
||
|
|
||
| ## Performance updates | ||
|
|
||
| - Fixed an issue where 'More Debug Options' showed options as unselected in | ||
| profile mode even when selected. [#9813](https://github.com/flutter/devtools/issues/9813) | ||
| - Show a message in the Performance panel when widget rebuild tracking is | ||
| unavailable because the app is running in profile mode. [#9755](https://github.com/flutter/devtools/pull/9755) | ||
|
|
||
| ## CPU profiler updates | ||
|
|
||
|
|
@@ -44,25 +41,19 @@ TODO: Remove this section if there are not any updates. | |
|
|
||
| ## Network profiler updates | ||
|
|
||
| - Added response size column to the Network tab and displayed response size in the request inspector overview. | ||
| [#9744](https://github.com/flutter/devtools/pull/9744) | ||
|
|
||
| - Improved HTTP request status classification in the Network tab to better distinguish cancelled, completed, and in-flight requests (for example, avoiding some cases where cancelled requests appeared as pending). [#9683](https://github.com/flutter/devtools/pull/9683) | ||
| TODO: Remove this section if there are not any updates. | ||
|
|
||
| - Added a filter setting to hide HTTP-profiler socket data. | ||
| [#9698](https://github.com/flutter/devtools/pull/9698) | ||
|
|
||
| ## Logging updates | ||
|
|
||
| - Fixed an issue where log messages containing newline characters were incorrectly split into multiple separate entries in the Logging screen. [#9757](https://github.com/flutter/devtools/pull/9757) | ||
| TODO: Remove this section if there are not any updates. | ||
|
|
||
| ## App size tool updates | ||
|
|
||
| TODO: Remove this section if there are not any updates. | ||
|
|
||
| ## Deep links tool updates | ||
|
|
||
| - Pluralized "domain" and "path" in the validation summary notification titles when multiple errors are present. [#9790](https://github.com/flutter/devtools/pull/9790) | ||
| TODO: Remove this section if there are not any updates. | ||
|
|
||
| ## VS Code sidebar updates | ||
|
|
||
|
|
@@ -79,4 +70,4 @@ TODO: Remove this section if there are not any updates. | |
| ## Full commit history | ||
|
|
||
| To find a complete list of changes in this release, check out the | ||
| [DevTools git log](https://github.com/flutter/devtools/tree/v2.58.0). | ||
| [DevTools git log](https://github.com/flutter/devtools/tree/v2.58.0). | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import 'dart:async'; | |
|
|
||
| import 'package:devtools_app/devtools_app.dart'; | ||
| import 'package:devtools_app/src/screens/performance/panes/controls/performance_controls.dart'; | ||
| import 'package:devtools_app/src/screens/performance/panes/rebuild_stats/rebuild_stats.dart'; | ||
| import 'package:devtools_app/src/screens/performance/panes/timeline_events/timeline_events_view.dart'; | ||
| import 'package:devtools_app/src/screens/performance/tabbed_performance_view.dart'; | ||
| import 'package:devtools_app/src/shared/feature_flags.dart'; | ||
|
|
@@ -218,7 +219,6 @@ void main() { | |
| await tester.runAsync(() async { | ||
| await pumpPerformanceScreen(tester, runAsync: true); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| final chartButtonFinder = find.byType(VisibilityButton); | ||
| expect(chartButtonFinder, findsOneWidget); | ||
|
|
||
|
|
@@ -231,7 +231,6 @@ void main() { | |
|
|
||
| await tester.tap(chartButtonFinder); | ||
| await tester.pumpAndSettle(); | ||
|
|
||
| // The flutter frames chart should no longer be visible. | ||
| expect(find.byType(FramesChartControls), findsNothing); | ||
| expect( | ||
|
|
@@ -252,46 +251,6 @@ void main() { | |
| }, | ||
| ); | ||
|
|
||
| // testWidgetsWithWindowSize( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 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. |
||
| // 'clears timeline on clear', | ||
| // windowSize, | ||
| // (WidgetTester tester) async { | ||
| // await tester.runAsync(() async { | ||
| // await pumpPerformanceScreen(tester, runAsync: true); | ||
| // await tester.pumpAndSettle(); | ||
|
|
||
| // // Ensure the Timeline Events tab is selected. | ||
| // final timelineEventsTabFinder = find.text('Timeline Events'); | ||
| // expect(timelineEventsTabFinder, findsOneWidget); | ||
| // await tester.tap(timelineEventsTabFinder); | ||
| // await tester.pumpAndSettle(); | ||
|
|
||
| // expect( | ||
| // controller.timelineEventsController.allTraceEvents, | ||
| // isNotEmpty, | ||
| // ); | ||
| // expect(find.byType(FlutterFramesChart), findsOneWidget); | ||
| // expect(find.byType(TimelineFlameChart), findsOneWidget); | ||
| // expect( | ||
| // find.byKey(TimelineEventsView.emptyTimelineKey), | ||
| // findsNothing, | ||
| // ); | ||
| // expect(find.byType(EventDetails), findsOneWidget); | ||
|
|
||
| // await tester.tap(find.byIcon(Icons.block)); | ||
| // await tester.pumpAndSettle(); | ||
| // expect(controller.timelineEventsController.allTraceEvents, isEmpty); | ||
| // expect(find.byType(FlutterFramesChart), findsOneWidget); | ||
| // expect(find.byType(TimelineFlameChart), findsNothing); | ||
| // expect( | ||
| // find.byKey(TimelineEventsView.emptyTimelineKey), | ||
| // findsOneWidget, | ||
| // ); | ||
| // expect(find.byType(EventDetails), findsNothing); | ||
| // }); | ||
| // }, | ||
| // ); | ||
|
|
||
| testWidgetsWithWindowSize('opens enhance tracing overlay', windowSize, ( | ||
| WidgetTester tester, | ||
| ) async { | ||
|
|
@@ -395,6 +354,69 @@ void main() { | |
| }, | ||
| ); | ||
| }); | ||
|
|
||
| group('RebuildStatsView', () { | ||
| late FakeServiceConnectionManager fakeServiceConnection; | ||
| late RebuildCountModel model; | ||
| late ValueNotifier<FlutterFrame?> selectedFrame; | ||
|
|
||
| setUp(() { | ||
| fakeServiceConnection = FakeServiceConnectionManager(); | ||
| final app = fakeServiceConnection.serviceManager.connectedApp!; | ||
| when(app.initialized).thenReturn(Completer()..complete(true)); | ||
| 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); | ||
|
Comment on lines
+367
to
+371
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of doing this, use the |
||
| setGlobal(ServiceConnectionManager, fakeServiceConnection); | ||
| setGlobal(IdeTheme, IdeTheme()); | ||
| setGlobal(NotificationService, NotificationService()); | ||
| setGlobal(BannerMessagesController, BannerMessagesController()); | ||
| setGlobal(PreferencesController, PreferencesController()); | ||
| setGlobal(OfflineDataController, OfflineDataController()); | ||
| model = RebuildCountModel(); | ||
| selectedFrame = ValueNotifier<FlutterFrame?>(null); | ||
| }); | ||
|
|
||
| testWidgets('shows message when running in profile mode', ( | ||
| WidgetTester tester, | ||
| ) async { | ||
| final app = fakeServiceConnection.serviceManager.connectedApp!; | ||
| when(app.isProfileBuildNow).thenReturn(true); | ||
|
|
||
| await tester.pumpWidget( | ||
| wrapWithControllers( | ||
| RebuildStatsView(model: model, selectedFrame: selectedFrame), | ||
| ), | ||
| ); | ||
| await tester.pump(); | ||
|
|
||
| expect( | ||
| find.textContaining('Widget rebuild counts are only available'), | ||
| findsOneWidget, | ||
| ); | ||
| }); | ||
|
|
||
| testWidgets('shows normal UI when running in debug mode', ( | ||
| WidgetTester tester, | ||
| ) async { | ||
| final app = fakeServiceConnection.serviceManager.connectedApp!; | ||
| when(app.isProfileBuildNow).thenReturn(false); | ||
|
|
||
| await tester.pumpWidget( | ||
| wrapWithControllers( | ||
| RebuildStatsView(model: model, selectedFrame: selectedFrame), | ||
| ), | ||
| ); | ||
| await tester.pump(); | ||
|
|
||
| expect( | ||
| find.textContaining('Widget rebuild counts are only available'), | ||
| findsNothing, | ||
| ); | ||
| }); | ||
| }); | ||
| }); | ||
| } | ||
|
|
||
|
|
||
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.
Use CenteredMessage instead