mirror of
https://github.com/langgenius/dify.git
synced 2026-02-09 23:20:12 -05:00
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:
11
web/app/components/workflow-app/search-params.ts
Normal file
11
web/app/components/workflow-app/search-params.ts
Normal 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'
|
||||
Reference in New Issue
Block a user