Skip to content

feat: make kind chip clickable to filter logs by kind#9802

Closed
crackedhandle wants to merge 11 commits intoflutter:masterfrom
crackedhandle:fix-clickable-log-kind-filter
Closed

feat: make kind chip clickable to filter logs by kind#9802
crackedhandle wants to merge 11 commits intoflutter:masterfrom
crackedhandle:fix-clickable-log-kind-filter

Conversation

@crackedhandle
Copy link
Copy Markdown

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 on
the 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 logs
table, showing only logs of that kind.

Changes

  • Added an optional onKindTapped callback parameter to MetadataChips
    widget in metadata.dart
  • Added an optional onTap callback to the base MetadataChip class
  • Wrapped the chip with GestureDetector and MouseRegion when onTap
    is provided, showing a pointer cursor on hover to indicate it is clickable
  • In _message_column.dart, passed an onKindTapped callback to
    MetadataChips that calls controller.setActiveFilter(query: 'k:$kind')
    when the kind chip is tapped

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.
@crackedhandle crackedhandle requested review from a team and kenzieschmoll as code owners April 23, 2026 04:59
@crackedhandle crackedhandle requested review from bkonyi and removed request for a team April 23, 2026 04:59
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +101 to +103
'Rebuild information is not available for this frame.\n'
'Widget rebuild counts are only available when running '
'an app in debug-mode.',
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

[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.

Suggested change
'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
  1. Strict avoidance of raw values in UI (use named constants). (link)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[User reported] Click on tags in the log events rows to filter by those tags

1 participant