fix: persist workflow step across browser sessions via localStorage#16
Open
savinay1986 wants to merge 1 commit intonikmcfly:mainfrom
Open
fix: persist workflow step across browser sessions via localStorage#16savinay1986 wants to merge 1 commit intonikmcfly:mainfrom
savinay1986 wants to merge 1 commit intonikmcfly:mainfrom
Conversation
Closing and reopening the browser tab reset the 5-step workflow to
Step 1, losing the user's progress even though all project data was
safely persisted on the backend.
Root cause: `currentStep` in MainView.vue was a plain in-memory Vue
ref (ref(1)) with no persistence layer. loadProject() correctly
restored currentPhase from the backend project status but never
restored currentStep.
Fix:
- Add a watch() on currentStep that writes to localStorage under
key `mirofish_step_{projectId}` on every change
- In loadProject(), read back from localStorage after restoring
phase — so the user returns to exactly the step they left
- In updatePhaseByStatus(), advance currentStep to 2 when status
is graph_completed (fallback for first-time reload with no
localStorage entry, avoids landing on Step 1 with a built graph)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Bug
Closing and reopening the browser tab resets the 5-step workflow back to Step 1, losing all visible progress — even though the project data (graph, ontology, etc.) is safely persisted on the backend.
Steps to reproduce:
http://localhost:3000/process/<project_id>Root Cause
currentStepinMainView.vueis a plain in-memory Vueref(1). WhenloadProject()runs on mount, it correctly restorescurrentPhasefrom the backend project status — but never restorescurrentStep. The two values are independently tracked and onlycurrentPhasewas wired to the backend.Fix
Three targeted changes to
MainView.vue:watch(currentStep)writes tolocalStorageunder keymirofish_step_{projectId}on every changeloadProject()reads back fromlocalStorageafter callingupdatePhaseByStatus(), restoring the exact step the user left onupdatePhaseByStatus()advancescurrentStepto2when status isgraph_completed, so even a first-time reload with no localStorage entry correctly skips Step 1Test Plan
/process/new) — watcher does not write until real project ID is assigned🤖 Generated with Claude Code