Files
dify/web/app/components/workflow-app/search-params.ts
yyh ff632bf9b8 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.
2026-01-15 15:09:36 +08:00

12 lines
335 B
TypeScript

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'