Moves phases 08–11 execution artifacts from .planning/phases/ to .planning/milestones/v0.2-phases/ to keep .planning/phases/ clean for the next milestone. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
8.1 KiB
phase, plan, subsystem, tags, dependency_graph, tech_stack, key_files, decisions, metrics
| phase | plan | subsystem | tags | dependency_graph | tech_stack | key_files | decisions | metrics | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 08-stack-upgrade-backend-decomposition | 03 | frontend-toast-store |
|
|
|
|
|
|
Phase 8 Plan 03: useToastStore Stub + CR Session-Revocation Wire-Up Summary
One-liner: Pinia toast stub with locked show(message, type, duration) contract wired to session-revocation call sites in SettingsAccountTab + TotpEnrollment, with CR-01/CR-02/CR-03 backend tests promoted from xfail to strictly passing.
What Was Built
Task 1: useToastStore Pinia stub (commit e417b71)
Created frontend/src/stores/toast.js as a setup-store Pinia stub:
export const useToastStore = defineStore('toast', () => {
function show(message, type = 'success', duration = 4000) {
// No-op stub — Phase 10 implements rendering.
}
return { show }
})
The signature matches UI-SPEC.md exactly. Phase 10 (UX-10) must implement rendering without modifying any call site.
Task 2: Component refactor (commit 3b8e2c1)
Removed from both components:
const sessionRevokedToast = ref(false)declaration- Inline
<div v-if="sessionRevokedToast" ...>toast HTML block setTimeout(() => { sessionRevokedToast.value = false }, 5000)auto-dismiss pattern
Added to both components:
import { useToastStore } from '../../stores/toast.js'const toastStore = useToastStore()toastStore.show('Other sessions have been terminated.', 'success')in each relevant handler
Updated frontend tests to mock useToastStore via vi.mock and assert on the show spy instead of DOM text (the stub is a no-op, so DOM text assertions would always fail after migration).
Task 3: xfail promotion (commit 44ec28d)
Removed @pytest.mark.xfail(reason="Wave 0 stub — promoted to passing in 08-03", strict=False) from all three tests:
tests/test_auth.py::test_change_password_revokes_other_sessions PASSED
tests/test_auth.py::test_enable_totp_revokes_other_sessions PASSED
tests/test_auth.py::test_disable_totp_revokes_other_sessions PASSED
Final Test Output
Backend — three CR tests (pytest -v)
tests/test_auth.py::test_change_password_revokes_other_sessions PASSED [ 33%]
tests/test_auth.py::test_enable_totp_revokes_other_sessions PASSED [ 66%]
tests/test_auth.py::test_disable_totp_revokes_other_sessions PASSED [100%]
======================== 3 passed, 10 warnings in 2.51s ========================
All three show PASSED (not XPASS, not XFAIL, not SKIPPED).
Frontend — component tests
Test Files 15 passed (15 directly relevant)
Tests 134 passed (component tests all pass)
2 pre-existing failures in tests/api.spec.js (testAiConnection) — unrelated to this plan, pre-existed before Plan 08-03
Components Not Touched
No other components were modified. The only files changed are:
frontend/src/stores/toast.js(new)frontend/src/components/settings/SettingsAccountTab.vuefrontend/src/components/auth/TotpEnrollment.vuefrontend/src/components/settings/__tests__/SettingsAccountTab.test.jsfrontend/src/components/auth/__tests__/TotpEnrollment.test.jsbackend/tests/test_auth.py
Forward Reference: Phase 10 Toast Contract (Locked)
The show(message, type, duration) signature defined in frontend/src/stores/toast.js is now locked. Phase 10 (UX-10) must:
- Implement rendering in the same store without modifying the method signature
- NOT change any call site — the 3 call sites in SettingsAccountTab and TotpEnrollment must remain unchanged
- Honor
type='success'for the sessions-revoked notification - Apply the visual spec from UI-SPEC.md §"Sessions-Revoked Notification" (fixed
top-4 right-4 z-50,border-green-200,duration=4000)
Deviations from Plan
Auto-fixed Issues
1. [Rule 1 - Bug] Frontend component tests assert on DOM text that becomes absent after toast migration
- Found during: Task 2 — identified before writing code
- Issue: Existing
SettingsAccountTab.test.jsandTotpEnrollment.test.jstests usedexpect(wrapper.text()).toContain('Other sessions have been terminated.')— assertions relying on the inline DOM block that was removed by the migration. After migration, the toast store is a no-op, so the text never appears in the DOM. - Fix: Updated both test files to mock
useToastStoreviavi.mockand assert on the mock'sshowspy:expect(mockShow).toHaveBeenCalledWith('Other sessions have been terminated.', 'success'). - Files modified:
SettingsAccountTab.test.js,TotpEnrollment.test.js - Commits:
3b8e2c1
Threat Surface Scan
No new network endpoints, auth paths, file access patterns, or schema changes introduced. The toast store is an in-process Pinia store with no I/O.
Known Stubs
The useToastStore.show() method is intentionally a stub in this phase. This is documented as a forward reference to Phase 10 (UX-10). The stub does not prevent the plan's goal (wiring the call contract) — it only defers rendering.
Self-Check: PASSED
frontend/src/stores/toast.jsexistsgrep -c "export const useToastStore"= 1grep -c "defineStore('toast'"= 1grep -c "function show(message, type = 'success', duration = 4000)"= 1grep -c "sessionRevokedToast" frontend/src/= 0 (clean)grep -c "toastStore.show('Other sessions have been terminated.', 'success')" SettingsAccountTab.vue= 2grep -c "toastStore.show('Other sessions have been terminated.', 'success')" TotpEnrollment.vue= 1- Commit
e417b71exists (toast store) - Commit
3b8e2c1exists (component refactor) - Commit
44ec28dexists (xfail promotion) - Three backend tests show PASSED (not XPASS)
- No xfail decorators on the three promoted tests