fix(ui): keep trace expansion stable during refresh - #11278
Open
localai-org-maint-bot wants to merge 1 commit into
Open
fix(ui): keep trace expansion stable during refresh#11278localai-org-maint-bot wants to merge 1 commit into
localai-org-maint-bot wants to merge 1 commit into
Conversation
Track expanded traces by their stable IDs instead of table indexes so polling cannot move an open detail panel to a newly inserted row. Use the same IDs for React keys and cover the prepend-on-refresh case in Playwright. Fixes #11277 Assisted-by: Codex:gpt-5
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.
Description
This PR fixes #11277.
The Traces page stored its expanded row by array index and also keyed React fragments by that index. When the five-second poll prepended a new trace, the same index referred to a different record, so the open detail panel moved. This change tracks expansion and reconciliation by stable trace ID instead.
A focused Playwright regression prepends a trace during manual refresh and asserts that the original trace remains expanded.
Notes for Reviewers
Validation performed:
npx eslint src/pages/Traces.jsx e2e/traces-pagination.spec.js(0 errors; 11 pre-existing warnings inTraces.jsx)npm run lint:inline-styles(624, at baseline)npm run buildPW_WORKERS=1 npx playwright test e2e/traces-pagination.spec.js --list(4 tests discovered)git diff --checkBrowser execution could not run on this NixOS host: the cached Playwright Chromium requires
libglib-2.0.so.0, and no system Chromium or Nix development shell is available in this cron environment. CI should execute the regression in the repository-supported browser environment.Signed commits