diff --git a/packages/devtools_app/lib/src/screens/inspector_v2/inspector_controller.dart b/packages/devtools_app/lib/src/screens/inspector_v2/inspector_controller.dart index 13b43c5ea3b..61b9c127b08 100644 --- a/packages/devtools_app/lib/src/screens/inspector_v2/inspector_controller.dart +++ b/packages/devtools_app/lib/src/screens/inspector_v2/inspector_controller.dart @@ -247,7 +247,7 @@ class InspectorController extends DisposableController /// Whether the implementation widgets are hidden in the widget tree. ValueListenable get implementationWidgetsHidden => _implementationWidgetsHidden; - final _implementationWidgetsHidden = ValueNotifier(false); + final _implementationWidgetsHidden = ValueNotifier(true); InspectorTreeNode? lastExpanded; diff --git a/packages/devtools_app/test/screens/inspector_v2/inspector_integration_test.dart b/packages/devtools_app/test/screens/inspector_v2/inspector_integration_test.dart index 0de6195d718..81a96d298d3 100644 --- a/packages/devtools_app/test/screens/inspector_v2/inspector_integration_test.dart +++ b/packages/devtools_app/test/screens/inspector_v2/inspector_integration_test.dart @@ -156,6 +156,9 @@ void main() { (WidgetTester tester) async { await _loadInspectorUI(tester); + // Toggle implementation widgets on. + await _toggleImplementationWidgets(tester); + // Before hidden widgets are expanded, confirm the HeroControllerScope // is hidden: final hideableNodeFinder = findNodeMatching('HeroControllerScope'); @@ -207,6 +210,9 @@ void main() { ) async { await _loadInspectorUI(tester); + // Toggle implementation widgets on. + await _toggleImplementationWidgets(tester); + // Before searching, confirm the HeroControllerScope is hidden: final hideableNodeFinder = findNodeMatching('HeroControllerScope'); expect(hideableNodeFinder, findsNothing); @@ -239,21 +245,15 @@ void main() { ) async { await _loadInspectorUI(tester); - // Give time for the initial animation to complete. - await tester.pumpAndSettle(inspectorChangeSettleTime); + // Toggle implementation widgets on. + await _toggleImplementationWidgets(tester); // Confirm the hidden widgets are visible behind affordances like "X more // widgets". expect(find.richTextContaining('more widgets...'), findsWidgets); - // Tap the "Show Implementation Widgets" button (selected by default). - final showImplementationWidgetsButton = find.descendant( - of: find.byType(DevToolsToggleButton), - matching: find.text('Show Implementation Widgets'), - ); - expect(showImplementationWidgetsButton, findsOneWidget); - await tester.tap(showImplementationWidgetsButton); - await tester.pumpAndSettle(inspectorChangeSettleTime); + // Toggle implementation widgets off. + await _toggleImplementationWidgets(tester); // Confirm that the hidden widgets are no longer visible. expect(find.richTextContaining('more widgets...'), findsNothing); @@ -287,6 +287,10 @@ void main() { ) async { // Load the Inspector. await _loadInspectorUI(tester); + + // Toggle implementation widgets on. + await _toggleImplementationWidgets(tester); + await tester.pumpAndSettle(inspectorChangeSettleTime); final state = tester.state(find.byType(InspectorScreenBody)) @@ -300,14 +304,8 @@ void main() { diagnostics.firstWhere((d) => d?.description == 'Text')!; expect(textDiagnostic.isCreatedByLocalProject, isTrue); - // Tap the "Show Implementation Widgets" button (selected by default). - final showImplementationWidgetsButton = find.descendant( - of: find.byType(DevToolsToggleButton), - matching: find.text('Show Implementation Widgets'), - ); - expect(showImplementationWidgetsButton, findsOneWidget); - await tester.tap(showImplementationWidgetsButton); - await tester.pumpAndSettle(inspectorChangeSettleTime); + // Toggle implementation widgets off. + await _toggleImplementationWidgets(tester); // Verify the Text diagnostic node is still in the tree. final diagnosticsNow = state.controller.inspectorTree.rowsInTree.value.map( @@ -505,6 +503,9 @@ void main() { ) async { await _loadInspectorUI(tester); + // Toggle implementation widgets on. + await _toggleImplementationWidgets(tester); + // Give time for the initial animation to complete. await tester.pumpAndSettle(inspectorChangeSettleTime); @@ -596,6 +597,17 @@ void main() { }); } +Future _toggleImplementationWidgets(WidgetTester tester) async { + // Tap the "Show Implementation Widgets" button (selected by default). + final showImplementationWidgetsButton = find.descendant( + of: find.byType(DevToolsToggleButton), + matching: find.text('Show Implementation Widgets'), + ); + expect(showImplementationWidgetsButton, findsOneWidget); + await tester.tap(showImplementationWidgetsButton); + await tester.pumpAndSettle(inspectorChangeSettleTime); +} + Future _loadInspectorUI(WidgetTester tester) async { final screen = InspectorScreen(); await tester.pumpWidget( diff --git a/packages/devtools_app/test/test_infra/goldens/codeview_scrollbars.png b/packages/devtools_app/test/test_infra/goldens/codeview_scrollbars.png index acd1aa675b6..fff9944e87d 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/codeview_scrollbars.png and b/packages/devtools_app/test/test_infra/goldens/codeview_scrollbars.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_errors_1_initial_load.png b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_errors_1_initial_load.png index 66d5f32caae..aca4ff13036 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_errors_1_initial_load.png and b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_errors_1_initial_load.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_errors_2_error_selected.png b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_errors_2_error_selected.png index 16491442abe..06b74c5730e 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_errors_2_error_selected.png and b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_errors_2_error_selected.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_hideable_widget_selected.png b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_hideable_widget_selected.png index 655820a3692..82e857b675e 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_hideable_widget_selected.png and b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_hideable_widget_selected.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_hideable_widget_selected_from_search.png b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_hideable_widget_selected_from_search.png index 655820a3692..82e857b675e 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_hideable_widget_selected_from_search.png and b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_hideable_widget_selected_from_search.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_collapsed.png b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_collapsed.png index 21bdb63dd64..cac1347c759 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_collapsed.png and b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_collapsed.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_expanded.png b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_expanded.png index bf24dd7a0e6..43b8a0b2c3f 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_expanded.png and b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_expanded.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_hidden.png b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_hidden.png index 408c0c5d8e8..491c101de9e 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_hidden.png and b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_implementation_widgets_hidden.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_initial_load.png b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_initial_load.png index 0e25ffb06fc..4e642d8cd0b 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_initial_load.png and b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_initial_load.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_select_center.png b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_select_center.png index 0af558606be..8b466ac147c 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_select_center.png and b/packages/devtools_app/test/test_infra/goldens/integration_inspector_v2_select_center.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/memory/load_offline_data_profile_tab.png b/packages/devtools_app/test/test_infra/goldens/memory/load_offline_data_profile_tab.png index 2e2dffbbdab..7ee3a2273c5 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/memory/load_offline_data_profile_tab.png and b/packages/devtools_app/test/test_infra/goldens/memory/load_offline_data_profile_tab.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/memory_diff_empty1.png b/packages/devtools_app/test/test_infra/goldens/memory_diff_empty1.png index b12a8a8cb89..3952622201d 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/memory_diff_empty1.png and b/packages/devtools_app/test/test_infra/goldens/memory_diff_empty1.png differ diff --git a/packages/devtools_app/test/test_infra/goldens/memory_diff_empty2.png b/packages/devtools_app/test/test_infra/goldens/memory_diff_empty2.png index b12a8a8cb89..3952622201d 100644 Binary files a/packages/devtools_app/test/test_infra/goldens/memory_diff_empty2.png and b/packages/devtools_app/test/test_infra/goldens/memory_diff_empty2.png differ