Skip to content

fix(explore): Always show selected metric first in metric selector#111448

Merged
nsdeschenes merged 2 commits intomasterfrom
nd/LOGS-634/fix-tracemetrics-selected-metric-not-first
Mar 25, 2026
Merged

fix(explore): Always show selected metric first in metric selector#111448
nsdeschenes merged 2 commits intomasterfrom
nd/LOGS-634/fix-tracemetrics-selected-metric-not-first

Conversation

@nsdeschenes
Copy link
Contributor

@nsdeschenes nsdeschenes commented Mar 24, 2026

Update the metrics selector so that the selected option is always at the top of the list. With the refactor to the new dropdown with this was not happening as expected.

Refs LOGS-634

When reopening the metric selector dropdown, the selected metric now
always appears at the top of the list. Previously it only appeared
first on page refresh when the API hadn't returned it yet; otherwise
it stayed in its alphabetical position.

Refs LOGS-634
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear-code
Copy link

linear-code bot commented Mar 24, 2026

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Mar 24, 2026
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Align selectedMetricValue computation with the rest of the file by
conditionally stripping the unit field when hasMetricUnitsUI is false.
Without this, the find and filter comparisons against API option values
would fail to match, causing the selected metric to appear twice.

Refs LOGS-634
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nsdeschenes nsdeschenes marked this pull request as ready for review March 24, 2026 20:13
@nsdeschenes nsdeschenes requested a review from a team as a code owner March 24, 2026 20:13
@nsdeschenes nsdeschenes merged commit 436805b into master Mar 25, 2026
71 of 72 checks passed
@nsdeschenes nsdeschenes deleted the nd/LOGS-634/fix-tracemetrics-selected-metric-not-first branch March 25, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants