ref(metrics): Refactor AggregateDropdown to use CompositeSelect#111296
Merged
nsdeschenes merged 3 commits intomasterfrom Mar 24, 2026
Merged
Conversation
narsaynorath
approved these changes
Mar 23, 2026
…iteSelect Replace the flat multi-select CompactSelect (with manual group-filtering logic) with CompositeSelect, where each option group becomes its own Region. Groups with key 'percentiles' or 'stats' are multi-select; 'rate' and 'math' groups are single-select. Cross-group enforcement is automatic: handleChange always replaces the full visualizes array, so selecting from a new group clears the previous group's selections on re-render. The findGroupKey helper is removed as it is no longer needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ropdown trigger CompositeSelect does not inject a trigger label the way CompactSelect does, so replicate the same pattern manually: show the first selected name in a TriggerLabel span and append a muted Badge with the overflow count (+N) when more than one aggregate is active. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…etric selected AggregateDropdown had no disabled state, so it stayed enabled while other toolbar controls were disabled. GroupBySelector was disabled until API attribute keys loaded, causing it to enable later than the aggregate dropdown. Disable AggregateDropdown when no metric type is available (groups.length === 0). Disable GroupBySelector based on whether a metric is selected (!traceMetricFilter) rather than waiting for attribute options to load — the loading spinner already communicates that data is pending. Co-Authored-By: Claude Sonnet 4 <noreply@example.com>
6120b38 to
0661102
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replaces the
CompactSelectinAggregateDropdownwithCompositeSelect, where each option group gets its ownRegion. This removes the manualfindGroupKeyhelper and the hand-rolled cross-group filtering logic that lived in theonChangehandler.Group modes:
percentilesandstats→ multi-select regions (users commonly compare e.g. p50 + p75 + p90)rateandmath→ single-select regionsCross-group enforcement is now automatic:
handleChangealways replaces the fullvisualizesarray, so selecting from a new group clears the previous group's selections on re-render without any explicit filtering.The trigger label is manually constructed to match
CompactSelect's built-in behaviour — first selected name in aTriggerLabelspan, with a muted+Nbadge when more than one aggregate is active (CompositeSelectdoes not inject a trigger label the wayCompactSelectdoes).Ticket: LOGS-628
Example:
