From ff632bf9b83a75e1ea742ba320894f0d2d1a1788 Mon Sep 17 00:00:00 2001 From: yyh Date: Thu, 15 Jan 2026 15:09:24 +0800 Subject: [PATCH] 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. --- web/app/components/workflow-app/search-params.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 web/app/components/workflow-app/search-params.ts diff --git a/web/app/components/workflow-app/search-params.ts b/web/app/components/workflow-app/search-params.ts new file mode 100644 index 0000000000..c9b814e3b9 --- /dev/null +++ b/web/app/components/workflow-app/search-params.ts @@ -0,0 +1,11 @@ +import { parseAsStringEnum } from 'nuqs' +import { ViewType } from '@/app/components/workflow/types' + +export const parseAsViewType = parseAsStringEnum(Object.values(ViewType)) + .withDefault(ViewType.graph) + .withOptions({ + history: 'replace', + clearOnDefault: true, + }) + +export const WORKFLOW_VIEW_PARAM_KEY = 'view'