You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gate: Tasks 12, 13, 14 merged. Vuex account module is now a near-empty shell — all state has been moved to Pinia, checkState delegates everything to Pinia stores.
15.1 — Move checkState fully to account-auth
The Vuex checkState action is now mostly delegation calls to Pinia. Move the whole thing into account-auth.js as the checkState action. Remove it from Vuex.
15.2 — Finalise logout in account-auth
Replace the Vuex logout with the full Pinia version. With the skipReset plugin, call $reset() uniformly on every store:
// account-auth.js — final logoutasynclogout(){awaituserApi.logout()useAccountAuthStore().$reset()useAccountTeamStore().$reset()useAccountSettingsStore().$reset()// skipReset: ['settings', 'features'] preserves themuseContextStore().$reset()useUxDialogStore().$reset()useUxToursStore().$reset()useUxNavigationStore().$reset()useUxDrawersStore().$reset()useProductTablesStore().$reset()useProductBrokersStore().$reset()useProductAssistantStore().$reset()useProductExpertInsightsAgentStore().$reset()useProductExpertOperatorAgentStore().$reset()useProductExpertStore().$reset()}
15.3 — Clean up api/client.js
During Task 11, api/client.js was changed to lazily require('../store/index.js') to break a circular dependency chain:
With Vuex gone, the cycle is broken permanently. Replace the lazy require with direct Pinia store calls:
// Before (workaround from Task 11):conststore=require('../store/index.js').defaultstore.dispatch('account/setOffline',true)store.dispatch('account/logout')// After:import{useAccountAuthStore}from'@/stores/account-auth.js'useAccountAuthStore().setOffline(true)useAccountAuthStore().logout()
15.4 — Update route guards
routes.js uses useStore() from Vuex to read user state in ensureAdmin and ensurePermission. Replace with Pinia and swap the Vuex store watcher for watch() on Pinia reactive state.
15.5 — Update App.vue
The root component reads from account, ux, and drawers. The ux and drawers stores are already on Pinia. Update the remaining account reads to use useAccountAuthStore, useAccountTeamStore, useAccountSettingsStore.
15.6 — Update bootstrap.service.js
Replace store.dispatch('account/checkIfAuthenticated') with useAccountAuthStore().checkIfAuthenticated(). Remove waitForStoreHydration() entirely — Pinia persistence is synchronous and Vuex is gone.
Eagerly call the account stores before checkUser() so persisted state is restored from localStorage before any auth checks run:
// bootstrap.service.js — final formasyncinit(){returnthis.waitForAppMount().then(()=>{// Eagerly create account stores — restores persisted state from localStorage instantlyuseAccountAuthStore()useAccountTeamStore()useAccountSettingsStore()}).then(()=>this.checkUser()).then(()=>this.mountApp()).then(()=>this.waitForRouterReady()).then(()=>this.markAsReady())}
15.7 — Delete Vuex and all migration scaffolding
Once all consumers are updated:
Delete the entire frontend/src/store/ directory (Vuex store root, all modules, and the storage plugin)
Remove app.use(store) and store.commit('initializeStore') from main.js
Delete _account_bridge.js from frontend/src/stores/
Run npm uninstall vuex
15.8 — Final verification
grep -r "from 'vuex'" frontend/src/ # should return nothing
grep -r "this\.\$store" frontend/src/ # should return nothing
grep -r "_account.bridge" frontend/src/ # should return nothing
PR 2 ux-dialog: store created, mixins/Dialog.js updated, Vuex module deleted, store tests written
PR 3 ux-tours: store created, markRaw on tour instance, Vuex module deleted, store tests written
PR 4 ux-navigation: store created, account bridge created, Vuex module deleted, store tests written
PR 5 ux-drawers: store created, markRaw on components, useUxNavigationStore imported (not require()), Vuex module deleted, store tests written
PR 6 context: store created, bridge reads in expert getter, Vuex module deleted, store tests written
PR 7 product-tables: store created, clearState bridge in Vuex account, Vuex module deleted, store tests written
PR 8 product-brokers: store created, clearUns bridge in Vuex account, Vuex module deleted, store tests written
PR 9 product-assistant: store created, context.js expert getter partially updated, Vuex module deleted, store tests written
PR 10 product-expert-ff-agent: store created, markRaw on timer, store tests written
PR 11 product-expert-operator-agent: store created, markRaw on timer, store tests written
PR 12 product-expert: store created, useProductAssistantStore imported, sub-module access pattern updated, context.js expert getter finalised, all expert Vuex modules deleted, product Vuex root module deleted, store tests written
PR 13 account-auth: store created, auth actions ported, Vuex checkState delegates auth to Pinia, _account_bridge.js updated, ~25 consumers updated, store tests written
PR 14 account-team: store created, team actions ported, Vuex checkState delegates team to Pinia, _account_bridge.js updated, ~40 consumers updated, store tests written
PR 15 account-settings: store created, featuresCheck ported line-by-line, Vuex checkState delegates settings to Pinia, _account_bridge.js updated (no longer reads from Vuex), ~50 consumers updated, store tests written
PR 16 Teardown: checkState moved fully to account-auth, final logout action with all $reset() calls, api/client.js lazy require removed, route guards updated, App.vue updated, bootstrap.service.js finalised (waitForStoreHydration removed, account stores eagerly initialised), frontend/src/store/ deleted, _account_bridge.js deleted, npm uninstall vuex, final grep verification passes
Task 15 — Teardown (PR 16)
Gate: Tasks 12, 13, 14 merged. Vuex account module is now a near-empty shell — all state has been moved to Pinia,
checkStatedelegates everything to Pinia stores.15.1 — Move
checkStatefully toaccount-authThe Vuex
checkStateaction is now mostly delegation calls to Pinia. Move the whole thing intoaccount-auth.jsas thecheckStateaction. Remove it from Vuex.15.2 — Finalise
logoutinaccount-authReplace the Vuex
logoutwith the full Pinia version. With theskipResetplugin, call$reset()uniformly on every store:15.3 — Clean up
api/client.jsDuring Task 11,
api/client.jswas changed to lazilyrequire('../store/index.js')to break a circular dependency chain:With Vuex gone, the cycle is broken permanently. Replace the lazy require with direct Pinia store calls:
15.4 — Update route guards
routes.jsusesuseStore()from Vuex to read user state inensureAdminandensurePermission. Replace with Pinia and swap the Vuex store watcher forwatch()on Pinia reactive state.15.5 — Update
App.vueThe root component reads from
account,ux, anddrawers. Theuxanddrawersstores are already on Pinia. Update the remaining account reads to useuseAccountAuthStore,useAccountTeamStore,useAccountSettingsStore.15.6 — Update
bootstrap.service.jsReplace
store.dispatch('account/checkIfAuthenticated')withuseAccountAuthStore().checkIfAuthenticated(). RemovewaitForStoreHydration()entirely — Pinia persistence is synchronous and Vuex is gone.Eagerly call the account stores before
checkUser()so persisted state is restored from localStorage before any auth checks run:15.7 — Delete Vuex and all migration scaffolding
Once all consumers are updated:
frontend/src/store/directory (Vuex store root, all modules, and the storage plugin)app.use(store)andstore.commit('initializeStore')frommain.js_account_bridge.jsfromfrontend/src/stores/npm uninstall vuex15.8 — Final verification
Full Completion Checklist
pinia-plugin-persistedstate@4+@pinia/testinginstalled,skipResetplugin created and registered,bootstrap.service.jsupdated, logout bridge scaffolded, service-layer Vuex access auditedux-dialog: store created,mixins/Dialog.jsupdated, Vuex module deleted, store tests writtenux-tours: store created,markRawon tour instance, Vuex module deleted, store tests writtenux-navigation: store created, account bridge created, Vuex module deleted, store tests writtenux-drawers: store created,markRawon components,useUxNavigationStoreimported (notrequire()), Vuex module deleted, store tests writtencontext: store created, bridge reads inexpertgetter, Vuex module deleted, store tests writtenproduct-tables: store created,clearStatebridge in Vuex account, Vuex module deleted, store tests writtenproduct-brokers: store created,clearUnsbridge in Vuex account, Vuex module deleted, store tests writtenproduct-assistant: store created,context.jsexpert getter partially updated, Vuex module deleted, store tests writtenproduct-expert-ff-agent: store created,markRawon timer, store tests writtenproduct-expert-operator-agent: store created,markRawon timer, store tests writtenproduct-expert: store created,useProductAssistantStoreimported, sub-module access pattern updated,context.jsexpert getter finalised, all expert Vuex modules deleted,productVuex root module deleted, store tests writtenaccount-auth: store created, auth actions ported, VuexcheckStatedelegates auth to Pinia,_account_bridge.jsupdated, ~25 consumers updated, store tests writtenaccount-team: store created, team actions ported, VuexcheckStatedelegates team to Pinia,_account_bridge.jsupdated, ~40 consumers updated, store tests writtenaccount-settings: store created,featuresCheckported line-by-line, VuexcheckStatedelegates settings to Pinia,_account_bridge.jsupdated (no longer reads from Vuex), ~50 consumers updated, store tests writtencheckStatemoved fully toaccount-auth, finallogoutaction with all$reset()calls,api/client.jslazy require removed, route guards updated,App.vueupdated,bootstrap.service.jsfinalised (waitForStoreHydrationremoved, account stores eagerly initialised),frontend/src/store/deleted,_account_bridge.jsdeleted,npm uninstall vuex, final grep verification passes