Clear stale localStorage state when deleting or recreating a run#654
Merged
Merged
Conversation
cristian-tamblay
approved these changes
May 28, 2026
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.
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
Changes (by file)
DashAI/front/src/components/models/RunCard.jsx: clearresults-visibleandactive-tablocalStorage keys on delete confirmation; default card to closed whenrun.status === 0.DashAI/front/src/components/models/RunResults.jsx: ignore saved visible state whenrun.status === 0; ignore saved tab index > 0 whenrun.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
Repeat with Predictions tab and with the card closed before deleting.