From 53f3638b12a494aa47c4ac54a1656e39087fd04e Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Tue, 9 Jun 2026 00:27:51 -0700 Subject: [PATCH] FN-6037: open selected workflow editor on mobile Open the board workflow editor directly to the selected workflow, including on mobile. - pass the selected workflow id from the board toolbar through app modal state into the workflow editor - preselect the requested workflow when loading workflows, while preserving settings/create entry points and mobile fallback behavior - cover the new workflow targeting behavior in board, modal manager, and workflow editor tests and document the mobile editor flow Files changed: docs/dashboard-guide.md | 3 +- packages/dashboard/app/App.tsx | 4 +- packages/dashboard/app/components/AppModals.tsx | 1 + packages/dashboard/app/components/Board.tsx | 6 +- packages/dashboard/app/components/WorkflowNodeEditor.tsx | 13 ++++- packages/dashboard/app/components/__tests__/Board.test.tsx | 4 ++ packages/dashboard/app/components/__tests__/WorkflowNodeEditor.test.tsx | 68 ++++++++++++++++++++++ packages/dashboard/app/hooks/__tests__/useModalManager.test.ts | 42 +++++++++++++ packages/dashboard/app/hooks/useModalManager.ts | 16 +++-- Fusion-Task-Id: FN-6037 Fusion-Task-Lineage: e983e699-5376-434f-af03-39ce5a300029 --- docs/dashboard-guide.md | 3 +- packages/dashboard/app/App.tsx | 4 +- .../dashboard/app/components/AppModals.tsx | 1 + packages/dashboard/app/components/Board.tsx | 6 +- .../app/components/WorkflowNodeEditor.tsx | 13 +++- .../app/components/__tests__/Board.test.tsx | 4 ++ .../__tests__/WorkflowNodeEditor.test.tsx | 68 +++++++++++++++++++ .../hooks/__tests__/useModalManager.test.ts | 42 ++++++++++++ .../dashboard/app/hooks/useModalManager.ts | 16 +++-- 9 files changed, 145 insertions(+), 12 deletions(-) diff --git a/docs/dashboard-guide.md b/docs/dashboard-guide.md index eb50ffc2da..757629ed9e 100644 --- a/docs/dashboard-guide.md +++ b/docs/dashboard-guide.md @@ -104,6 +104,7 @@ The workflow editor opens as a full-screen modal editor for authoring custom wor Navigation: - Open a task or board surface that shows the workflow selector, then choose **Manage…** +- From the board workflow toolbar, use the edit workflow button beside the selector to open the currently selected workflow directly when one is selected. Behavior: - Opens a workflow node editor with a workflow list/sidebar, canvas, inspector, and settings/authoring panels @@ -111,7 +112,7 @@ Behavior: - The Settings panel is value-first for built-in workflows and groups workflow settings by Models, Review & Approval, Step Execution, and Advanced. Known workflow model values use the same model dropdown picker as **Settings → Project Models** so provider/model pairs are saved together; custom or non-model string values can still use typed inputs. Definitions remain available for custom workflow schema authoring. - The main Settings modal also exposes the default workflow's Plan/Triage, Executor, and Reviewer model lanes from **Project Models**; those dropdown controls write workflow setting values for the active default workflow. - On desktop, the editor uses a multi-panel layout for editing the graph and adjacent workflow metadata -- On viewports `<=768px`, the editor switches to a full-screen mobile sheet, opens to the workflow list with no workflow preselected, prompts users to select a workflow to edit, and uses larger workflow-editor touch targets so each section remains scrollable and usable on phones +- On viewports `<=768px`, the editor switches to a full-screen mobile sheet. Global workflow entry points open to the workflow list with no workflow preselected and prompt users to select a workflow to edit; the board workflow toolbar edit button opens directly to the selected workflow editor when that selected workflow is available. - The create-workflow dialog and workflow AI authoring popover follow the same mobile full-screen/sheet pattern so they are not clipped by the editor canvas on narrow screens ## Planning Mode diff --git a/packages/dashboard/app/App.tsx b/packages/dashboard/app/App.tsx index a83ae49dfa..1f820b06bd 100644 --- a/packages/dashboard/app/App.tsx +++ b/packages/dashboard/app/App.tsx @@ -1239,8 +1239,8 @@ function AppInner() { pushNav({ type: "modal", close: modalManager.closeScripts }); }, [modalManager, pushNav]); - const openWorkflowEditorWithNav = useCallback(() => { - modalManager.openWorkflowEditor(); + const openWorkflowEditorWithNav = useCallback((workflowId?: string) => { + modalManager.openWorkflowEditor(undefined, workflowId); pushNav({ type: "modal", close: modalManager.closeWorkflowEditor }); }, [modalManager, pushNav]); diff --git a/packages/dashboard/app/components/AppModals.tsx b/packages/dashboard/app/components/AppModals.tsx index ca2370ccf0..61805592a1 100644 --- a/packages/dashboard/app/components/AppModals.tsx +++ b/packages/dashboard/app/components/AppModals.tsx @@ -387,6 +387,7 @@ export function AppModals({ projectId={projectId} initialPanel={modalManager.workflowEditorInitialPanel} initialAction={modalManager.workflowEditorInitialAction} + initialWorkflowId={modalManager.workflowEditorInitialWorkflowId} /> diff --git a/packages/dashboard/app/components/Board.tsx b/packages/dashboard/app/components/Board.tsx index 82ddcc328a..a43b9ecbb5 100644 --- a/packages/dashboard/app/components/Board.tsx +++ b/packages/dashboard/app/components/Board.tsx @@ -67,8 +67,8 @@ interface BoardProps { lastFetchTimeMs?: number; /** Whether GitHub CLI auth is available for creating PRs from task cards. */ prAuthAvailable?: boolean; - /** Opens the workflow editor modal. */ - onOpenWorkflowEditor?: () => void; + /** Opens the workflow editor modal, optionally focused on a workflow id. */ + onOpenWorkflowEditor?: (workflowId?: string) => void; /** Opens the workflow editor to create a new workflow. */ onCreateWorkflow?: () => void; } @@ -460,7 +460,7 @@ export function Board({ tasks, projectId, maxConcurrent, onMoveTask, onPauseTask