Skip to content

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

Open
crackedhandle wants to merge 2 commits intoflutter:masterfrom
crackedhandle:fix-clickable-log-kind-filter-v2
Open

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

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

Behavior

  • Clicking a kind chip → applies a k:<kind> filter to the logs table
  • Clicking the row outside the tag → still selects the log as before
  • No breaking changesonKindTapped is optional, so existing
    usages of MetadataChips without the callback are unaffected

Testing

Manually tested by:

  1. Running a Flutter app connected to DevTools
  2. Opening the Logging screen
  3. Clicking on a kind chip (e.g. flutter.frame) in a log row
  4. Verified that the filter field updates to k:flutter.frame and only
    logs of that kind are shown
  5. Verified that clicking outside the chip still selects the log row

@crackedhandle crackedhandle requested a review from a team as a code owner April 23, 2026 06:05
@crackedhandle crackedhandle requested review from elliette and removed request for a team April 23, 2026 06:05
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 enables filtering of logs by their kind when tapping on the metadata chips in the logging screen. It introduces an onKindTapped callback to the MetadataChips and MetadataChip widgets, allowing the LoggingController to update the active filter. Feedback was provided to improve the robustness of the filter query by wrapping the kind in quotes to handle spaces and to refine the interactive area of the chips by moving the margin outside of the gesture detector.

Comment thread packages/devtools_app/lib/src/screens/logging/_message_column.dart Outdated
Comment thread packages/devtools_app/lib/src/screens/logging/metadata.dart
@crackedhandle
Copy link
Copy Markdown
Author

@kenzieschmoll can you please take a look, and suggest me if any corresponding changes needed.

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