fix(ui): keep trace expansion stable during refresh - #11278
fix(ui): keep trace expansion stable during refresh#11278localai-org-maint-bot wants to merge 2 commits 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 Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Keep ID-based expansion stable across refreshes while falling back to the row index for backend trace summaries that do not carry an ID. Assisted-by: Codex:gpt-5 [systematic-debugging] Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
|
Review pass. The fix is right and both tables are converted symmetrically, which is the sibling path that usually gets missed. Two small things. Nit that matters:
Concrete failure: if any trace carries Worth a rebase check before merge. The flat diff no longer applies ( Undescribed but correct: Note DCO: no |
70f1eb3 to
781b4b4
Compare
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