fix: keep network search field enabled after clearing calls#9855
Open
ishaquehassan wants to merge 3 commits into
Open
fix: keep network search field enabled after clearing calls#9855ishaquehassan wants to merge 3 commits into
ishaquehassan wants to merge 3 commits into
Conversation
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 flutter#9853
Contributor
There was a problem hiding this comment.
Code Review
This pull request ensures that the network search field remains enabled even when there are no active requests, allowing users to modify their search query in advance. A corresponding widget test has been added to verify this behavior. The reviewer noted that because controller.filteredData is no longer used in the build method, the listener on it in initState is now redundant and should be removed to avoid unnecessary rebuilds.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9853.
The Network tab search field was tied to whether any requests were currently present.
_NetworkProfilerControlsState.buildcomputedhasRequestsfromcontroller.filteredDataand passed it toSearchFieldassearchFieldEnabled, so the moment all calls were cleared the field went disabled and the query could no longer be edited.This drops the
hasRequestsgate.SearchField.searchFieldEnabledalready defaults totrue, so removing the argument keeps the field enabled at all times. That matches how search fields behave elsewhere in DevTools and lets users prepare or adjust a query before the next batch of requests arrives, without needing live traffic first.Tests
Added
search field stays enabled after clearingtonetwork_profiler_test.dart, inside the existingNetwork Profilergroup. It loads the screen with requests, confirms the search fieldTextFieldis enabled, pauses recording, taps the Clear button socontroller.requestsis emptied, then asserts theTextFieldis still enabled. Before this change the field was gated onhasRequests, so it would be disabled in that state and the assertion would fail.dart analyzeanddart formatare clean on both changed files. Running the widget test against my locally installed Flutter SDK currently fails to compile because of an unrelated, pre-existing framework error (isSizedToContentgetter missing onWindowingOwnerLinuxinflutter/lib/src/widgets/_window_linux.dart), which reproduces without this change. CI compiles against the pinned SDK.Pre-launch Checklist
General checklist
///).Issues checklist
contributions-welcomeorgood-first-issuelabel.contributions-welcomeorgood-first-issuelabel. I understand this means my PR might take longer to be reviewed.Tests checklist
AI-tooling checklist
Feature-change checklist
release-notes-not-requiredlabel or left a comment requesting the label be added.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.If you need help, consider asking for help on Discord.