From f42a515629027945abd4185d756b4498ad03b337 Mon Sep 17 00:00:00 2001 From: pyr0ball Date: Sun, 3 May 2026 01:34:06 -0700 Subject: [PATCH] fix: wizard step numbering and loadDbPairs race on mount MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Insert Training at step 4 in WIZARD_STEPS (7→8), STEP_LABELS, and STEP_ROUTES. Bump Identity→5, Inference→6, Search→7, Integrations→8 in their respective saveStep calls. Cap resumeAt at 8. Await loadStatus() before loadDbPairs() in FineTuneView onMounted so optedIn is set before the early-exit guard runs. --- web/src/stores/wizard.ts | 9 +++++---- web/src/views/settings/FineTuneView.vue | 1 + web/src/views/wizard/WizardIdentityStep.vue | 2 +- web/src/views/wizard/WizardInferenceStep.vue | 2 +- web/src/views/wizard/WizardIntegrationsStep.vue | 2 +- web/src/views/wizard/WizardSearchStep.vue | 2 +- 6 files changed, 10 insertions(+), 8 deletions(-) diff --git a/web/src/stores/wizard.ts b/web/src/stores/wizard.ts index 1824a60..86ec7f8 100644 --- a/web/src/stores/wizard.ts +++ b/web/src/stores/wizard.ts @@ -43,13 +43,14 @@ export interface WizardInferenceData { testMessage: string } -// Total mandatory steps (integrations step 7 is optional/skip-able) -export const WIZARD_STEPS = 7 -export const STEP_LABELS = ['Hardware', 'Tier', 'Resume', 'Identity', 'Inference', 'Search', 'Integrations'] +// Total mandatory steps (integrations step 8 is optional/skip-able) +export const WIZARD_STEPS = 8 +export const STEP_LABELS = ['Hardware', 'Tier', 'Resume', 'Training', 'Identity', 'Inference', 'Search', 'Integrations'] export const STEP_ROUTES = [ '/setup/hardware', '/setup/tier', '/setup/resume', + '/setup/training', '/setup/identity', '/setup/inference', '/setup/search', @@ -163,7 +164,7 @@ export const useWizardStore = defineStore('wizard', () => { } // Resume at next step after last completed - const resumeAt = Math.max(1, Math.min(data.wizard_step + 1, 7)) + const resumeAt = Math.max(1, Math.min(data.wizard_step + 1, 8)) currentStep.value = resumeAt return routeForStep(resumeAt) } finally { diff --git a/web/src/views/settings/FineTuneView.vue b/web/src/views/settings/FineTuneView.vue index 0086f1e..d77ee27 100644 --- a/web/src/views/settings/FineTuneView.vue +++ b/web/src/views/settings/FineTuneView.vue @@ -60,6 +60,7 @@ async function checkLocalModel() { onMounted(async () => { store.startPolling() + await store.loadStatus() await store.loadPairs() await store.loadDbPairs() if (store.step === 3 && !config.isCloud) await checkLocalModel() diff --git a/web/src/views/wizard/WizardIdentityStep.vue b/web/src/views/wizard/WizardIdentityStep.vue index 907f7e4..46ee6bc 100644 --- a/web/src/views/wizard/WizardIdentityStep.vue +++ b/web/src/views/wizard/WizardIdentityStep.vue @@ -92,7 +92,7 @@ async function next() { } wizard.identity = { ...form } - const ok = await wizard.saveStep(4, { + const ok = await wizard.saveStep(5, { name: form.name, email: form.email, phone: form.phone, diff --git a/web/src/views/wizard/WizardInferenceStep.vue b/web/src/views/wizard/WizardInferenceStep.vue index 893cc52..a59a711 100644 --- a/web/src/views/wizard/WizardInferenceStep.vue +++ b/web/src/views/wizard/WizardInferenceStep.vue @@ -127,7 +127,7 @@ async function next() { }) wizard.inference.services = svcMap - const ok = await wizard.saveStep(5, { + const ok = await wizard.saveStep(6, { anthropic_key: form.anthropicKey, openai_url: form.openaiUrl, openai_key: form.openaiKey, diff --git a/web/src/views/wizard/WizardIntegrationsStep.vue b/web/src/views/wizard/WizardIntegrationsStep.vue index fcae2f8..7e032ff 100644 --- a/web/src/views/wizard/WizardIntegrationsStep.vue +++ b/web/src/views/wizard/WizardIntegrationsStep.vue @@ -85,7 +85,7 @@ function back() { router.push('/setup/search') } async function finish() { // Save integration selections (step 7) then mark wizard complete - await wizard.saveStep(7, { integrations: [...checkedIds.value] }) + await wizard.saveStep(8, { integrations: [...checkedIds.value] }) const ok = await wizard.complete() if (ok) router.replace('/') } diff --git a/web/src/views/wizard/WizardSearchStep.vue b/web/src/views/wizard/WizardSearchStep.vue index 00327b7..f3689da 100644 --- a/web/src/views/wizard/WizardSearchStep.vue +++ b/web/src/views/wizard/WizardSearchStep.vue @@ -143,7 +143,7 @@ async function next() { wizard.search.titles = [...form.titles] wizard.search.locations = [...form.locations] - const ok = await wizard.saveStep(6, { + const ok = await wizard.saveStep(7, { search: { titles: form.titles, locations: form.locations,