-
Notifications
You must be signed in to change notification settings - Fork 720
Move filters into a menu, add a remove all filters button #8123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move filters into a menu, add a remove all filters button #8123
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the filter UI on the Structured Logs page by moving filters into a Fluent menu and adding a “remove all filters” option.
- Introduces a new helper method (GetFilterMenuItems) to generate menu items for existing filters and the clear-all option.
- Adds a new DisableIcon parameter to the AspireMenuButton to allow conditional rendering of the icon.
- Updates the StructuredLogs view to wrap the new menu button in a counter badge indicating the number of active filters.
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Aspire.Dashboard/Components/Pages/StructuredLogs.razor.cs | Added GetFilterMenuItems method to generate filter menu items, including a clear-all option. |
| src/Aspire.Dashboard/Components/Controls/AspireMenuButton.razor.cs | Introduced DisableIcon parameter to offer control over icon rendering. |
| src/Aspire.Dashboard/Components/Controls/AspireMenuButton.razor | Updated rendering logic to conditionally include the icon based on DisableIcon. |
| src/Aspire.Dashboard/Components/Pages/StructuredLogs.razor | Replaced inline filtering buttons with a counter badge wrapping a menu button. |
Files not reviewed (1)
- src/Aspire.Dashboard/wwwroot/css/app.css: Language not supported
Comments suppressed due to low confidence (1)
src/Aspire.Dashboard/Components/Pages/StructuredLogs.razor:80
- Consider adding unit tests to cover the new filter menu functionality and its interactions, ensuring that the filtering and clear-all behavior work as expected.
<AspireMenuButton DisableIcon="true" Text="@FilterLoc[nameof(StructuredFiltering.Filters)]" Items="@GetFilterMenuItems()" />
| <FluentButton slot="end" Appearance="Appearance.Outline" OnClick="() => OpenFilterAsync(filter)" class="telemetry-filter-button" title="@filter.GetDisplayText(FilterLoc)">@filter.GetDisplayText(FilterLoc)</FluentButton> | ||
| } | ||
| <div slot="end"> | ||
| <FluentCounterBadge HorizontalPosition="70" Count="@(ViewModel.Filters.Count)" Appearance="Appearance.Accent"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setting slot=end onto counter badge doesn't work, maybe a bug in the component? I can check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this is a bug in that component
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
The placement of Filters and No filters seems strange to me. I think maybe its the fact that it changes from Filters to No filters that is putting me off. I wonder if when no filters are set it still says Filters, but doesn't have the badge. I'm no UX expert though. |
|
Actually, the fact that a badge is being used is also a bit odd I think. Perhaps changing the colour of the button itself? |
|
Traces page has the same filters. They're not updated. |
src/Aspire.Dashboard/Components/Controls/AspireMenuButton.razor.cs
Outdated
Show resolved
Hide resolved
I think it's ok. Lets you know how many filters there are. |
|
| if (i > 0) | ||
| { | ||
| await Task.Delay((i + 1) * (i + 1) * 10); | ||
| await Task.Delay((i + 1) * (i + 1) * 10 * 5); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What caused this to timeout?
I think it is Good Enough(tm) to merge. Nothing stops it changing later. People can use and give feedback. |







Description
This PR removes the current horizontal filter view, moving the filters into a fluent menu with a counter badge to hint at the number of filters set.
Inside the menu, set filters are presented first, then a divider and a clear all filters item. Maybe we could think of icons to set for each of the filter types?

If no filters are present, "No filters" continues to be shown.

Fixes #5673
Checklist
<remarks />and<code />elements on your triple slash comments?breaking-changetemplate):doc-ideatemplate):