[9.3] [Discover] [Metrics] Fix: metrics grid titles do not update on order change (#250963)#250988
Merged
kibanamachine merged 1 commit intoelastic:9.3from Jan 29, 2026
Merged
Conversation
…change (elastic#250963) ## Summary Resolves elastic#250687. We are using the index of the items in the list for the grid. This is not specific enough for a `key` value, because when the list is reordered, or items are eliminated, the `index` can remain the same (the 0th item is different, but its index is unchanged), and React will choose not to unmount the existing component. This change reuses the existing `id` value we already generate, which is a composite of the index and the metric's name. This makes the list's render process resilient to item changes where the index value remains the same. ## Verification The linked issue lists several cases where this is broken, and I believe the fix addresses all of them. I have included some recordings. The issue has detailed repro instructions, so I recommend you review it for testing. But essentially, if you load any metrics data and perform filtering or narrowing your ES|QL query to cause the list to re-order without re-rendering the parent content, you should be able to verify the fix against `main`. ### Narrowing ES|QL via WHERE clause  ### Searching for title  ### Checking breakdown -> details matches title  (cherry picked from commit ddeb3ec)
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.
Backport
This will backport the following commits from
mainto9.3:Questions ?
Please refer to the Backport tool documentation