feat(workflow): persist view tab state to URL search params

Use nuqs to sync graph/skill view selection to URL, enabling
shareable links and browser history navigation. Hoists
SkillEditorProvider to maintain state across view switches.
This commit is contained in:
yyh
2026-01-15 15:09:24 +08:00
parent ce9ed88b03
commit ff632bf9b8

View File

@@ -0,0 +1,11 @@
import { parseAsStringEnum } from 'nuqs'
import { ViewType } from '@/app/components/workflow/types'
export const parseAsViewType = parseAsStringEnum<ViewType>(Object.values(ViewType))
.withDefault(ViewType.graph)
.withOptions({
history: 'replace',
clearOnDefault: true,
})
export const WORKFLOW_VIEW_PARAM_KEY = 'view'