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:
parent
6212a3232c
commit
58dcb03420
3 changed files with 130 additions and 19 deletions
|
|
@ -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 () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue