feat: make kind chip clickable to filter logs by kind#9802
feat: make kind chip clickable to filter logs by kind#9802crackedhandle wants to merge 11 commits intoflutter:masterfrom
Conversation
When running in profile mode, the Performance panel showed a disabled 'Count widget builds' checkbox which was misleading. Widget rebuild counts rely on debugOnRebuildDirtyWidget which is only available in debug mode. This change: - Removes the checkbox when running in profile mode - Shows a clear message: 'Rebuild information is not available for this frame. Widget rebuild counts are only available when running an app in debug-mode.' - Adds widget tests for both profile mode and debug mode behavior Fixes flutter#9730
Per reviewer feedback, moved the profile mode widget tests from a separate test file into the existing performance_screen_test.dart. Also added required imports for RebuildStatsView, RebuildCountModel, FlutterFrame and foundation.
There was a problem hiding this comment.
Code Review
This pull request introduces a message in the Performance Rebuild Stats view to notify users when rebuild tracking is unavailable due to the app running in profile mode. It also updates the release notes and adds relevant tests. Feedback indicates that the UI string should be defined as a named constant rather than a raw value, per the style guide, and suggests a minor correction to the terminology used.
| 'Rebuild information is not available for this frame.\n' | ||
| 'Widget rebuild counts are only available when running ' | ||
| 'an app in debug-mode.', |
There was a problem hiding this comment.
[CONCERN] The warning message is hardcoded as a raw string. According to the repository style guide (line 48), raw values in the UI should be avoided in favor of named constants. Additionally, "debug-mode" should be "debug mode" (no hyphen) to stay consistent with Flutter's standard terminology.
| 'Rebuild information is not available for this frame.\n' | |
| 'Widget rebuild counts are only available when running ' | |
| 'an app in debug-mode.', | |
| 'Rebuild information is not available for this frame.\\n'\n 'Widget rebuild counts are only available when running '\n 'an app in debug mode.', |
References
- Strict avoidance of raw values in UI (use named constants). (link)
Fixes #9558
Problem
Users reported (via the 2025 DevTools user survey) that clicking on tags
in the log event rows had no effect. There was no way to quickly filter
logs by a specific kind (e.g.
stderr,flutter.error) by clicking onthe kind chip directly.
Solution
Made the kind chip in the log event rows clickable. When a user clicks
on a kind chip, it automatically applies a
k:<kind>filter to the logstable, showing only logs of that kind.
Changes
onKindTappedcallback parameter toMetadataChipswidget in
metadata.dartonTapcallback to the baseMetadataChipclassGestureDetectorandMouseRegionwhenonTapis provided, showing a pointer cursor on hover to indicate it is clickable
_message_column.dart, passed anonKindTappedcallback toMetadataChipsthat callscontroller.setActiveFilter(query: 'k:$kind')when the kind chip is tapped