Skip to content

Clear stale localStorage state when deleting or recreating a run#654

Merged
cristian-tamblay merged 1 commit into
developfrom
fix/run-card-stale-localstorage-state
May 28, 2026
Merged

Clear stale localStorage state when deleting or recreating a run#654
cristian-tamblay merged 1 commit into
developfrom
fix/run-card-stale-localstorage-state

Conversation

@Creylay
Copy link
Copy Markdown
Collaborator

@Creylay Creylay commented May 28, 2026

Summary

SQLite reuses primary key IDs when records are deleted. Combined with localStorage persisting tab selection and card visibility per run.id, a newly created run could inherit the UI state of a previously deleted run with the same ID — opening expanded or showing the Explainability/Predictions tab instead of Live Metrics.

Fixed by cleaning up localStorage on delete and ignoring saved state for runs that haven't started yet (status === 0) or haven't finished (status !== 3).


Type of Change

  • Backend change
  • Frontend change
  • CI / Workflow change
  • Build / Packaging change
  • Bug fix
  • Documentation

Changes (by file)

  • DashAI/front/src/components/models/RunCard.jsx: clear results-visible and active-tab localStorage keys on delete confirmation; default card to closed when run.status === 0.
  • DashAI/front/src/components/models/RunResults.jsx: ignore saved visible state when run.status === 0; ignore saved tab index > 0 when run.status !== 3 (tabs requiring a finished run).
  • DashAI/front/src/components/models/modelSession/runButtons/DeleteRun.jsx: clean up localStorage keys after a successful delete API call.

Testing

  1. Create a run, train it, open the results card and switch to the Explainability tab.
  2. Delete the run.
  3. Add the same model again — the new run card should be collapsed and default to the Live Metrics tab.

Repeat with Predictions tab and with the card closed before deleting.

@cristian-tamblay cristian-tamblay merged commit 25894bf into develop May 28, 2026
19 checks passed
@cristian-tamblay cristian-tamblay deleted the fix/run-card-stale-localstorage-state branch May 28, 2026 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants