feat(PBI-76): migration helper v2 — handle legacy cookies

Bumps marker version to 'v2'. buildMigrationPatch now also scans
document.cookie for `sp:*` (split-pane positions) and
`active_sprint_*` (active sprint per product) and lifts them into
layout.splitPanePositions / layout.activeSprints. clearLegacyStorage
replaces clearLegacyLocalStorage and clears both keys and cookies.
clearLegacyLocalStorage stays as a deprecated alias so the bridge
upgrade is a single rename.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Janpeter Visser 2026-05-10 15:25:46 +02:00
parent 6212a3232c
commit 58dcb03420
3 changed files with 130 additions and 19 deletions

View file

@ -6,7 +6,7 @@ import { useUserSettingsStore } from '@/stores/user-settings/store'
import type { UserSettings } from '@/lib/user-settings'
import {
buildMigrationPatch,
clearLegacyLocalStorage,
clearLegacyStorage,
} from '@/lib/user-settings-migration'
interface Props {
@ -34,7 +34,7 @@ export function UserSettingsBridge({ initial, isDemo }: Props) {
if (isDemo) return
const result = buildMigrationPatch()
if (!result.hasData) {
clearLegacyLocalStorage([])
clearLegacyStorage([], [])
return
}
let cancelled = false
@ -43,7 +43,7 @@ export function UserSettingsBridge({ initial, isDemo }: Props) {
if (cancelled) return
if ('success' in res && res.success) {
applyServerPatch(result.patch)
clearLegacyLocalStorage(result.legacyKeys)
clearLegacyStorage(result.legacyKeys, result.legacyCookies)
}
})()
return () => {