From 0fdcfa2e81372a140c61da881c2fe9e6d3980df9 Mon Sep 17 00:00:00 2001 From: Kenzie Davisson Date: Mon, 9 Mar 2026 16:00:33 -0700 Subject: [PATCH 1/4] Fix todo in memory tracing data --- .../screens/memory/panes/tracing/tracing_data.dart | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/devtools_app/lib/src/screens/memory/panes/tracing/tracing_data.dart b/packages/devtools_app/lib/src/screens/memory/panes/tracing/tracing_data.dart index 10c6937e12d..2fe270ce549 100644 --- a/packages/devtools_app/lib/src/screens/memory/panes/tracing/tracing_data.dart +++ b/packages/devtools_app/lib/src/screens/memory/panes/tracing/tracing_data.dart @@ -89,9 +89,8 @@ class TracedClass with PinnableListEntry, Serializable { '${clazz.name} instances: $instances trace: $traceAllocations'; } -// TODO(kenz): include the selected class in the toJson and fromJson methods. @visibleForTesting -enum TracingIsolateStateJson { isolate, classes, profiles } +enum TracingIsolateStateJson { isolate, classes, profiles, selectedClass } /// Contains allocation tracing state for a single isolate. /// @@ -107,6 +106,9 @@ class TracingIsolateState with Serializable { this.classes = classes ?? []; classesById = {for (final e in this.classes) e.clazz.id!: e}; this.profiles = profiles ?? {}; + if (selectedClass != null) { + this.selectedClass.value = classesById[selectedClass]; + } } TracingIsolateState.empty() : this(isolate: IsolateRef()); @@ -125,6 +127,8 @@ class TracingIsolateState with Serializable { classes: (json[TracingIsolateStateJson.classes.name] as List) .map((e) => deserialize(e, TracedClass.fromJson)) .toList(), + selectedClass: + json[TracingIsolateStateJson.selectedClass.name] as String?, ); } @@ -134,6 +138,9 @@ class TracingIsolateState with Serializable { TracingIsolateStateJson.isolate.name: isolate, TracingIsolateStateJson.classes.name: classesById.values.toList(), TracingIsolateStateJson.profiles.name: profiles, + if (selectedClass.value != null) + TracingIsolateStateJson.selectedClass.name: + selectedClass.value!.clazz.id!, }; } From 3ba43210912e0172b1ed997f7dac9e0d49b6a6d9 Mon Sep 17 00:00:00 2001 From: Kenzie Davisson Date: Mon, 9 Mar 2026 16:21:33 -0700 Subject: [PATCH 2/4] Fix another TODO --- .../lib/src/screens/debugger/codeview_controller.dart | 6 +++--- packages/devtools_app/lib/src/shared/primitives/utils.dart | 2 -- packages/devtools_app/lib/src/shared/ui/search.dart | 3 +-- .../devtools_app/lib/src/shared/ui/vm_flag_widgets.dart | 6 ++++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/packages/devtools_app/lib/src/screens/debugger/codeview_controller.dart b/packages/devtools_app/lib/src/screens/debugger/codeview_controller.dart index a937cf826e1..53362558278 100644 --- a/packages/devtools_app/lib/src/screens/debugger/codeview_controller.dart +++ b/packages/devtools_app/lib/src/screens/debugger/codeview_controller.dart @@ -19,6 +19,7 @@ import '../../shared/framework/routing.dart'; import '../../shared/globals.dart'; import '../../shared/managers/notifications.dart'; import '../../shared/primitives/history_manager.dart'; +import '../../shared/primitives/utils.dart'; import '../../shared/ui/search.dart'; import '../../shared/utils/utils.dart'; import '../vm_developer/vm_service_private_extensions.dart'; @@ -419,12 +420,11 @@ class CodeViewController extends DisposableController return []; } final matches = []; - final caseInsensitiveSearch = search.toLowerCase(); final currentScript = parsedScript.value!; for (int i = 0; i < currentScript.lines.length; i++) { - final line = currentScript.lines[i].toLowerCase(); - final matchesForLine = caseInsensitiveSearch.allMatches(line); + final line = currentScript.lines[i]; + final matchesForLine = search.caseInsensitiveAllMatches(line); if (matchesForLine.isNotEmpty) { matches.addAll( matchesForLine.map( diff --git a/packages/devtools_app/lib/src/shared/primitives/utils.dart b/packages/devtools_app/lib/src/shared/primitives/utils.dart index 3da354092a5..a1073e882a6 100644 --- a/packages/devtools_app/lib/src/shared/primitives/utils.dart +++ b/packages/devtools_app/lib/src/shared/primitives/utils.dart @@ -945,8 +945,6 @@ extension NullableStringExtension on String? { } // TODO(kenz): consider moving other String helpers into this extension. -// TODO(kenz): replace other uses of toLowerCase() for string matching with -// this extension method. extension StringExtension on String { bool caseInsensitiveContains(Pattern? pattern) { if (pattern is RegExp) { diff --git a/packages/devtools_app/lib/src/shared/ui/search.dart b/packages/devtools_app/lib/src/shared/ui/search.dart index af947d5922f..cce643767ff 100644 --- a/packages/devtools_app/lib/src/shared/ui/search.dart +++ b/packages/devtools_app/lib/src/shared/ui/search.dart @@ -1248,10 +1248,9 @@ class _AutoCompleteSearchFieldState extends State String? foundExact; // What the user has typed in so far. - final searchToMatch = widget.controller.search.toLowerCase(); // Find exact match in autocomplete list - use that as our search value. for (final autoEntry in widget.controller.searchAutoComplete.value) { - if (searchToMatch == autoEntry.text.toLowerCase()) { + if (autoEntry.text.caseInsensitiveEquals(widget.controller.search)) { foundExact = autoEntry.text; break; } diff --git a/packages/devtools_app/lib/src/shared/ui/vm_flag_widgets.dart b/packages/devtools_app/lib/src/shared/ui/vm_flag_widgets.dart index f04b40bbe83..187ebff1f04 100644 --- a/packages/devtools_app/lib/src/shared/ui/vm_flag_widgets.dart +++ b/packages/devtools_app/lib/src/shared/ui/vm_flag_widgets.dart @@ -183,11 +183,13 @@ class _VMFlagsDialogState extends State with AutoDisposeMixin { } void _refilter() { - final filter = filterController.text.trim().toLowerCase(); + final filter = filterController.text.trim(); filteredFlags = filter.isEmpty ? flags - : flags.where((flag) => flag.filterText.contains(filter)).toList(); + : flags + .where((flag) => flag.filterText.caseInsensitiveContains(filter)) + .toList(); } @override From bad7f5157adbed70a656c427751ac245c63d4f3c Mon Sep 17 00:00:00 2001 From: Kenzie Davisson Date: Mon, 9 Mar 2026 16:23:18 -0700 Subject: [PATCH 3/4] Remove stale todo --- packages/devtools_shared/lib/src/server/server_api.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/devtools_shared/lib/src/server/server_api.dart b/packages/devtools_shared/lib/src/server/server_api.dart index 5254041f3e5..6d27c66fda3 100644 --- a/packages/devtools_shared/lib/src/server/server_api.dart +++ b/packages/devtools_shared/lib/src/server/server_api.dart @@ -26,8 +26,6 @@ import 'devtools_store.dart'; import 'file_system.dart'; import 'flutter_store.dart'; -// TODO(kenz): consider using Dart augmentation libraries instead of part files -// if there is a clear benefit. part 'handlers/_app_size.dart'; part 'handlers/_deeplink.dart'; part 'handlers/_devtools_extensions.dart'; From 15a298a0de6a121ce8d7af460bf1d4eacd960cbe Mon Sep 17 00:00:00 2001 From: Kenzie Davisson Date: Mon, 9 Mar 2026 16:23:42 -0700 Subject: [PATCH 4/4] Remove another TODO --- .../_simulated_devtools_environment.dart | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/devtools_extensions/lib/src/template/_simulated_devtools_environment/_simulated_devtools_environment.dart b/packages/devtools_extensions/lib/src/template/_simulated_devtools_environment/_simulated_devtools_environment.dart index d2bd958b8ba..1305aaba9f4 100644 --- a/packages/devtools_extensions/lib/src/template/_simulated_devtools_environment/_simulated_devtools_environment.dart +++ b/packages/devtools_extensions/lib/src/template/_simulated_devtools_environment/_simulated_devtools_environment.dart @@ -207,8 +207,6 @@ class _SimulatedApi extends StatelessWidget { label: 'FORCE RELOAD', onPressed: simController.forceReload, ), - // TODO(kenz): add buttons for other simulated events as the extension - // API expands. ], ), const SizedBox(height: defaultSpacing),