From 09e0942844c546e526790d73333c7ebebd92000b Mon Sep 17 00:00:00 2001 From: Ishaq Hassan Date: Mon, 15 Jun 2026 07:54:16 +0000 Subject: [PATCH 1/3] fix: keep network search field enabled after clearing calls The Network screen search field was gated on whether any requests were present, so clearing all calls left the field disabled and the query could no longer be edited. Drop the hasRequests gate so the field stays enabled at all times, matching the default search field behavior used elsewhere in DevTools. Fixes #9853 --- .../src/screens/network/network_screen.dart | 2 - .../network/network_profiler_test.dart | 42 +++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/packages/devtools_app/lib/src/screens/network/network_screen.dart b/packages/devtools_app/lib/src/screens/network/network_screen.dart index 66843cf09b0..1b43b860310 100644 --- a/packages/devtools_app/lib/src/screens/network/network_screen.dart +++ b/packages/devtools_app/lib/src/screens/network/network_screen.dart @@ -205,7 +205,6 @@ class _NetworkProfilerControlsState extends State<_NetworkProfilerControls> } final screenWidth = ScreenSize(context).width; - final hasRequests = controller.filteredData.value.isNotEmpty; return Column( children: [ Row( @@ -233,7 +232,6 @@ class _NetworkProfilerControlsState extends State<_NetworkProfilerControls> Expanded( child: SearchField( searchController: controller, - searchFieldEnabled: hasRequests, searchFieldWidth: screenWidth <= MediaSize.xs ? defaultSearchFieldWidth : wideSearchFieldWidth, diff --git a/packages/devtools_app/test/screens/network/network_profiler_test.dart b/packages/devtools_app/test/screens/network/network_profiler_test.dart index ff469552771..4e967e6e5a9 100644 --- a/packages/devtools_app/test/screens/network/network_profiler_test.dart +++ b/packages/devtools_app/test/screens/network/network_profiler_test.dart @@ -338,6 +338,48 @@ void main() { // Wait to ensure all the timers have been cancelled. await tester.pumpAndSettle(const Duration(seconds: 2)); }); + + testWidgetsWithWindowSize( + 'search field stays enabled after clearing', + windowSize, + (WidgetTester tester) async { + // Load the network profiler screen. + controller = NetworkController(); + await pumpNetworkScreen(tester); + + // Populate the screen with requests. + await loadRequestsAndCheck(tester); + + Finder searchFieldTextField() => find.descendant( + of: find.byType(SearchField), + matching: find.byType(TextField), + ); + + // The search field is enabled while requests are present. + expect( + tester.widget(searchFieldTextField()).enabled, + isTrue, + ); + + // Pause the profiler so polling does not repopulate the requests after + // they are cleared below. + await tester.tap(find.byType(StartStopRecordingButton)); + await tester.pumpAndSettle(); + + // Clear the results. + await tester.tap(find.byType(ClearButton)); + await tester.pumpAndSettle(const Duration(seconds: 2)); + expect(controller.requests.value, isEmpty); + + // The search field must stay enabled even with no requests present, so + // the query can still be edited before the next batch of requests + // arrives. + expect( + tester.widget(searchFieldTextField()).enabled, + isTrue, + ); + }, + ); }); group('NetworkRequestOverviewView', () { From 063ec1d1b112342117da4e5bc352f5a3107b33d3 Mon Sep 17 00:00:00 2001 From: Ishaq Hassan Date: Mon, 15 Jun 2026 07:56:45 +0000 Subject: [PATCH 2/3] Add release note entry for network search field fix (#9855) --- packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md b/packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md index 2cd2c928fe0..1b2bf4e5e43 100644 --- a/packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md +++ b/packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md @@ -39,7 +39,9 @@ TODO: Remove this section if there are not any updates. ## Network profiler updates -TODO: Remove this section if there are not any updates. +* Fixed the Network tab search field becoming disabled after clearing all + requests, so the search query can now be edited at any time. - + [#9855](https://github.com/flutter/devtools/pull/9855) ## Logging updates From 912b2e1795957e869eed3da79ff0b73fbdfcd283 Mon Sep 17 00:00:00 2001 From: Ishaq Hassan Date: Mon, 15 Jun 2026 15:10:06 +0500 Subject: [PATCH 3/3] refactor: drop redundant filteredData listener in network controls The network search field is now always enabled and no longer reads controller.filteredData in build, so this listener only forced needless rebuilds of the controls row on every filter change. --- .../devtools_app/lib/src/screens/network/network_screen.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/devtools_app/lib/src/screens/network/network_screen.dart b/packages/devtools_app/lib/src/screens/network/network_screen.dart index 1b43b860310..81202fb34e6 100644 --- a/packages/devtools_app/lib/src/screens/network/network_screen.dart +++ b/packages/devtools_app/lib/src/screens/network/network_screen.dart @@ -194,8 +194,6 @@ class _NetworkProfilerControlsState extends State<_NetworkProfilerControls> _recording = controller.recordingNotifier.value; }); }); - - addAutoDisposeListener(controller.filteredData); } @override