diff --git a/apps/web/src/frontend/App.tsx b/apps/web/src/frontend/App.tsx index 7d92457a..a08831d9 100644 --- a/apps/web/src/frontend/App.tsx +++ b/apps/web/src/frontend/App.tsx @@ -110,7 +110,7 @@ const Workspace: React.FC = () => { ) : ( - }> + }> diff --git a/apps/web/src/frontend/app/shell/LoadingScreen.tsx b/apps/web/src/frontend/app/shell/LoadingScreen.tsx index 142d86de..5827e540 100644 --- a/apps/web/src/frontend/app/shell/LoadingScreen.tsx +++ b/apps/web/src/frontend/app/shell/LoadingScreen.tsx @@ -8,8 +8,12 @@ import { Wordmark } from '@/shared/components/Brand'; * synchronously before awaiting resolveApiBase(), so there's * never a blank frame while the server starts or the API base resolves. */ -export const LoadingScreen: React.FC = () => ( -
+export const LoadingScreen: React.FC<{ embedded?: boolean }> = ({ embedded = false }) => ( +
+
+ {rowContent} + + ) : ( +
+ {rowContent} +
+ )} {expanded && hasMore && (
diff --git a/apps/web/src/frontend/features/workflow/components/CredentialsPanel.tsx b/apps/web/src/frontend/features/workflow/components/CredentialsPanel.tsx index 7b9b384b..d82f4acc 100644 --- a/apps/web/src/frontend/features/workflow/components/CredentialsPanel.tsx +++ b/apps/web/src/frontend/features/workflow/components/CredentialsPanel.tsx @@ -19,6 +19,7 @@ import { X, } from 'lucide-react'; import { useEffect, useRef, useState, type FormEvent } from 'react'; +import { createPortal } from 'react-dom'; import { linkedConnectionId } from '@foxschema/shared'; import type { CredentialKind, CredentialSource } from '@foxschema/workflow-engine/definitions'; import { useAuthStore } from '@/platform/authStore'; @@ -755,11 +756,12 @@ export function CredentialsPanel({ )} - {confirmTarget && ( -
setConfirmTarget(null)} - > + {confirmTarget && + createPortal( +
setConfirmTarget(null)} + >
-
+
, + document.body, )}
); diff --git a/apps/web/src/frontend/features/workflow/components/EnginePanel.tsx b/apps/web/src/frontend/features/workflow/components/EnginePanel.tsx index 30d8ebdc..3ec1edb5 100644 --- a/apps/web/src/frontend/features/workflow/components/EnginePanel.tsx +++ b/apps/web/src/frontend/features/workflow/components/EnginePanel.tsx @@ -7,6 +7,7 @@ * indicator, concurrency limits, overlap policy, and run event sinks. */ import React, { useCallback, useEffect, useRef, useState } from 'react'; +import { createPortal } from 'react-dom'; import { AlertTriangle, CheckCircle2, @@ -502,11 +503,12 @@ export function EnginePanel(): React.ReactElement {
- {pendingState && ( -
setPendingState(null)} - > + {pendingState && + createPortal( +
setPendingState(null)} + >
-
+
, + document.body, )}
); diff --git a/apps/web/src/frontend/features/workflow/components/ExecutionPanel.tsx b/apps/web/src/frontend/features/workflow/components/ExecutionPanel.tsx index 08821a70..a73d3f69 100644 --- a/apps/web/src/frontend/features/workflow/components/ExecutionPanel.tsx +++ b/apps/web/src/frontend/features/workflow/components/ExecutionPanel.tsx @@ -207,7 +207,7 @@ export function ExecutionPanel({ INPUT ({pipeLabel(focused)}) {focusedInSamples[0] - ? `${focusedInSamples[0].recordCount} record(s)` + ? `${focusedInSamples[0].recordCount} ${focusedInSamples[0].recordCount === 1 ? 'record' : 'records'}` : focused.data.role === 'trigger' || focused.data.type.startsWith('source.trigger') ? 'Trigger root' : '0 records'} @@ -224,7 +224,7 @@ export function ExecutionPanel({ OUTPUT ({pipeLabel(focused)}) {focusedOutSamples[0] - ? `${focusedOutSamples[0].recordCount} record(s)` + ? `${focusedOutSamples[0].recordCount} ${focusedOutSamples[0].recordCount === 1 ? 'record' : 'records'}` : '0 records'} @@ -243,7 +243,8 @@ export function ExecutionPanel({
- {nodes.length} pipes · {edges.length} connections + {nodes.length} {nodes.length === 1 ? 'pipe' : 'pipes'} · {edges.length}{' '} + {edges.length === 1 ? 'connection' : 'connections'}
@@ -317,7 +318,7 @@ export function ExecutionPanel({ {idle ? 'Local worker' - : `${totals.records} records · ${totals.batches} batches`} + : `${totals.records} ${totals.records === 1 ? 'record' : 'records'} · ${totals.batches} ${totals.batches === 1 ? 'batch' : 'batches'}`}
diff --git a/apps/web/src/frontend/features/workflow/components/RunsPanel.tsx b/apps/web/src/frontend/features/workflow/components/RunsPanel.tsx index 275b28aa..dea42fe7 100644 --- a/apps/web/src/frontend/features/workflow/components/RunsPanel.tsx +++ b/apps/web/src/frontend/features/workflow/components/RunsPanel.tsx @@ -290,13 +290,15 @@ export function RunsPanel({ - {sortedRuns.length === runs.length ? `${runs.length} runs` : `${sortedRuns.length} of ${runs.length} runs`} + {sortedRuns.length === runs.length + ? `${runs.length} ${runs.length === 1 ? 'run' : 'runs'}` + : `${sortedRuns.length} of ${runs.length} ${runs.length === 1 ? 'run' : 'runs'}`}
{runs.length === 0 ? (
No runs yet — open a workflow in the designer and press Test run.
) : ( -
+
@@ -414,8 +416,12 @@ export function RunsPanel({ {detail.pipes.map((pipe) => (
  • pipe/{pipe.pipelineId}/{pipe.pipeId}: {pipe.status} - {pipe.processedBatches ? ` · ${pipe.processedBatches} batches` : ''} - {pipe.processedRecords ? ` · ${pipe.processedRecords} rows` : ''} + {pipe.processedBatches + ? ` · ${pipe.processedBatches} ${pipe.processedBatches === 1 ? 'batch' : 'batches'}` + : ''} + {pipe.processedRecords + ? ` · ${pipe.processedRecords} ${pipe.processedRecords === 1 ? 'row' : 'rows'}` + : ''} {pipe.error ? ` (${pipe.error})` : ''}
  • ))} diff --git a/apps/web/src/frontend/features/workflow/components/TriggerConfigurationDialog.tsx b/apps/web/src/frontend/features/workflow/components/TriggerConfigurationDialog.tsx index eb5f0288..170539e2 100644 --- a/apps/web/src/frontend/features/workflow/components/TriggerConfigurationDialog.tsx +++ b/apps/web/src/frontend/features/workflow/components/TriggerConfigurationDialog.tsx @@ -350,7 +350,7 @@ export function TriggerConfigurationDialog({ ))} -
    +
    {!trigger ? (
    No trigger selected.
    ) : ( @@ -717,7 +717,7 @@ export function TriggerConfigurationDialog({ )} -
    + diff --git a/apps/web/src/frontend/features/workflow/components/WorkflowDesigner.dialogs.test.tsx b/apps/web/src/frontend/features/workflow/components/WorkflowDesigner.dialogs.test.tsx index 3e85e153..155264f4 100644 --- a/apps/web/src/frontend/features/workflow/components/WorkflowDesigner.dialogs.test.tsx +++ b/apps/web/src/frontend/features/workflow/components/WorkflowDesigner.dialogs.test.tsx @@ -3,20 +3,29 @@ * Copyright 2024-2026 Huy Phan * SPDX-License-Identifier: Apache-2.0 */ -import { fireEvent, render, screen } from '@testing-library/react'; +import { fireEvent, render, screen, waitFor } from '@testing-library/react'; import { beforeEach, describe, expect, it, vi } from 'vitest'; import { useState } from 'react'; import { DEFAULT_ROLE_PERMISSIONS } from '@foxschema/shared'; import { useAuthStore } from '@/platform/authStore'; +import { api } from '../api/engineClient'; import { useWorkflowUiStore } from '../store/workflowUiStore'; import { WorkflowDesigner } from './WorkflowDesigner'; +vi.mock('../api/engineClient', () => ({ + api: { + getWorkflow: vi.fn(), + }, +})); + vi.mock('@xyflow/react', () => ({ ReactFlowProvider: ({ children }: { children: React.ReactNode }) => <>{children}, - ReactFlow: () =>
    , + ReactFlow: ({ children }: { children?: React.ReactNode }) => ( +
    {children}
    + ), Background: () => null, Controls: () => null, - MiniMap: () => null, + MiniMap: () =>
    , addEdge: vi.fn((edge, list) => [...list, edge]), ConnectionLineType: { SmoothStep: 'smoothstep' }, MarkerType: { ArrowClosed: 'arrowclosed' }, @@ -74,7 +83,13 @@ beforeEach(() => { busy: false, refreshMe: vi.fn(async () => {}), }); - useWorkflowUiStore.setState({ view: 'designer', busy: false, workflowId: 'demo-wf' }); + useWorkflowUiStore.setState({ + view: 'designer', + busy: false, + workflowId: 'demo-wf', + designerDraft: null, + }); + vi.clearAllMocks(); }); describe('WorkflowDesigner stage confirmation dialogs', () => { @@ -104,4 +119,58 @@ describe('WorkflowDesigner stage confirmation dialogs', () => { expect(screen.queryByTestId('workflow-delete-stage-dialog')).toBeNull(); expect(stageSelect.options).toHaveLength(1); }); + + it('preserves loaded workflow graph and unsaved stage edits across unmount and remount', async () => { + vi.mocked(api.getWorkflow).mockResolvedValue({ + id: 'demo-schema-drift-guard', + name: 'Schema Drift Guard', + pipelines: [ + { + id: 'drift-check', + name: 'Drift Check', + pipes: [ + { id: 'compare_1', name: 'Compare DBs', type: 'source.foxschema.compare', config: {} }, + { id: 'notify_1', name: 'Notify Slack', type: 'sink.notify.chat', config: {}, dependsOn: ['compare_1'] }, + ], + }, + ], + triggers: [ + { id: 'manual', kind: 'manual', enabled: true }, + { id: 'nightly', kind: 'cron', enabled: true, schedule: '0 2 * * *' }, + ], + } as never); + + useWorkflowUiStore.setState({ + view: 'designer', + busy: false, + workflowId: 'demo-schema-drift-guard', + designerDraft: null, + }); + + const first = render(); + + // Load saved workflow into the designer. + fireEvent.click(screen.getByTestId('workflow-designer-load')); + await waitFor(() => { + const select = screen.getByTestId('workflow-designer-stage-select') as HTMLSelectElement; + expect(select.options[0]?.textContent).toContain('Drift Check · 2 pipes'); + }); + expect(screen.getByTestId('workflow-designer-triggers').textContent).toContain('2'); + + // Make an unsaved edit (add a second stage) before switching away. + fireEvent.click(screen.getByTestId('workflow-designer-add-stage')); + expect((screen.getByTestId('workflow-designer-stage-select') as HTMLSelectElement).options).toHaveLength(2); + + // Simulate navigating away (Workflow -> Utilities -> Workflow): unmount then remount. + first.unmount(); + render(); + + const restoredSelect = screen.getByTestId('workflow-designer-stage-select') as HTMLSelectElement; + expect(restoredSelect.options).toHaveLength(2); + expect(restoredSelect.options[0]?.textContent).toContain('Drift Check · 2 pipes'); + expect(screen.getByTestId('workflow-designer-triggers').textContent).toContain('2'); + expect((screen.getByTestId('workflow-designer-id') as HTMLInputElement).value).toBe( + 'demo-schema-drift-guard', + ); + }); }); diff --git a/apps/web/src/frontend/features/workflow/components/WorkflowDesigner.tsx b/apps/web/src/frontend/features/workflow/components/WorkflowDesigner.tsx index 0434d0af..2b85c483 100644 --- a/apps/web/src/frontend/features/workflow/components/WorkflowDesigner.tsx +++ b/apps/web/src/frontend/features/workflow/components/WorkflowDesigner.tsx @@ -39,6 +39,7 @@ import { X, } from 'lucide-react'; import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { createPortal } from 'react-dom'; import { useAuthStore } from '@/platform/authStore'; import { useUiStore } from '@/platform/uiStore'; import { toast } from '../lib/notify'; @@ -156,6 +157,8 @@ const DEFAULT_EDGE_OPTIONS = edgePresentation(); // draws a selection box (React Flow's default). Module-level for one identity. const MULTI_SELECT_KEYS = ['Meta', 'Control', 'Shift']; const DELETE_KEYS = ['Backspace', 'Delete']; +const FIT_VIEW_OPTIONS = { padding: 0.2 }; +const MINIMAP_STYLE = { width: 150, height: 100 }; const DEFAULT_PIPE_CONFIGS: Record> = { 'source.db.sql': { @@ -506,12 +509,6 @@ function settingsOf(workflow: SavedWorkflow): WorkflowSettings { } function Designer() { - const [nodes, setNodes, onNodesChange] = useNodesState([]); - const [edges, setEdges, onEdgesChange] = useEdgesState([]); - const [selectedId, setSelectedId] = useState(null); - const [canvasReady, setCanvasReady] = useState(false); - const canvasElementRef = useRef(null); - const view = useWorkflowUiStore((s) => s.view); const setView = useWorkflowUiStore((s) => s.setView); const logsWorkflowId = useWorkflowUiStore((s) => s.logsWorkflowId); @@ -520,6 +517,22 @@ function Designer() { const setBusy = useWorkflowUiStore((s) => s.setBusy); const workflowId = useWorkflowUiStore((s) => s.workflowId); const setWorkflowId = useWorkflowUiStore((s) => s.setWorkflowId); + // Restore the last canvas draft when remounting after switching top-level views + // (e.g. Workflow → Utilities → Workflow) so loaded graphs and unsaved edits survive. + const initialDraftRef = useRef( + (() => { + const cached = useWorkflowUiStore.getState().designerDraft; + return cached && cached.workflowId === workflowId ? cached : null; + })(), + ); + const initialDraft = initialDraftRef.current; + + const [nodes, setNodes, onNodesChange] = useNodesState(initialDraft?.nodes ?? []); + const [edges, setEdges, onEdgesChange] = useEdgesState(initialDraft?.edges ?? []); + const [selectedId, setSelectedId] = useState(null); + const [canvasReady, setCanvasReady] = useState(false); + const canvasElementRef = useRef(null); + const colorMode = useUiStore((s) => s.resolvedMode); // The proxy enforces these; the buttons only say so before a click would fail. const canDesign = useAuthStore((s) => s.can('workflow.design')); @@ -528,14 +541,20 @@ function Designer() { const inspectorPane = usePaneResize({ initial: 320, min: 270, max: 560, axis: 'x', invert: true }); const executionPane = usePaneResize({ initial: 220, min: 120, max: 480, axis: 'y', invert: true }); - const [pipelines, setPipelines] = useState(DEFAULT_PIPELINES); + const [pipelines, setPipelines] = useState( + initialDraft?.pipelines.length ? initialDraft.pipelines : DEFAULT_PIPELINES, + ); const [activePipelineId, setActivePipelineId] = useState( - DEFAULT_PIPELINES[0]!.id, + initialDraft?.activePipelineId ?? DEFAULT_PIPELINES[0]!.id, + ); + const [dependencies, setDependencies] = useState(initialDraft?.dependencies ?? []); + const [triggers, setTriggers] = useState( + initialDraft?.triggers ?? DEFAULT_TRIGGERS, ); - const [dependencies, setDependencies] = useState([]); - const [triggers, setTriggers] = useState(DEFAULT_TRIGGERS); - const [overlapPolicy, setOverlapPolicy] = useState('skip'); - const [carried, setCarried] = useState>({}); + const [overlapPolicy, setOverlapPolicy] = useState( + initialDraft?.overlapPolicy ?? 'skip', + ); + const [carried, setCarried] = useState>(initialDraft?.carried ?? {}); const [triggerSettingsOpen, setTriggerSettingsOpen] = useState(false); const [focusTriggerId, setFocusTriggerId] = useState(); const [workflowSettingsOpen, setWorkflowSettingsOpen] = useState(false); @@ -543,12 +562,14 @@ function Designer() { const [deleteStageOpen, setDeleteStageOpen] = useState(false); const [extractStageOpen, setExtractStageOpen] = useState(false); const [extractWorkflowId, setExtractWorkflowId] = useState(''); - const [executionCollapsed, setExecutionCollapsed] = useState(false); - const [workflowSettings, setWorkflowSettings] = useState({ - middleware: [], - }); + const [executionCollapsed, setExecutionCollapsed] = useState( + initialDraft?.executionCollapsed ?? false, + ); + const [workflowSettings, setWorkflowSettings] = useState( + initialDraft?.workflowSettings ?? { middleware: [] }, + ); /** Last Test run with debug capture — feeds Inspector Input/Output. */ - const [debugRunId, setDebugRunId] = useState(null); + const [debugRunId, setDebugRunId] = useState(initialDraft?.debugRunId ?? null); /** Pipes selected on the canvas (Shift/Cmd-click, or Shift-drag a box). */ const [selectionCount, setSelectionCount] = useState(0); /** The stage or pipe the last failed validation or save named. */ @@ -560,11 +581,45 @@ function Designer() { /** Stages not yet laid out with measured node sizes since the workflow opened. */ const [layoutPending, setLayoutPending] = useState>(() => new Set()); /** Serialized workflow snapshot from the last save or load; detects unsaved edits. */ - const [savedSnapshot, setSavedSnapshot] = useState(null); + const [savedSnapshot, setSavedSnapshot] = useState( + initialDraft?.savedSnapshot ?? null, + ); const pendingBaselineRef = useRef(false); /** Problems list keys the user closed; it reopens when the problems change. */ const [dismissedIssues, setDismissedIssues] = useState(''); + useEffect(() => { + useWorkflowUiStore.getState().setDesignerDraft({ + workflowId, + nodes, + edges, + pipelines, + activePipelineId, + dependencies, + triggers, + overlapPolicy, + carried, + workflowSettings, + savedSnapshot, + debugRunId, + executionCollapsed, + }); + }, [ + workflowId, + nodes, + edges, + pipelines, + activePipelineId, + dependencies, + triggers, + overlapPolicy, + carried, + workflowSettings, + savedSnapshot, + debugRunId, + executionCollapsed, + ]); + const { categories, catalog } = useCatalog(); const { credentials, refresh: refreshCredentials } = useCredentials(); const { runs, refresh: refreshRuns } = useRuns(view === 'runs'); @@ -964,7 +1019,7 @@ function Designer() { }); }); if (options.fit) { - requestAnimationFrame(() => void fitView({ duration: 250, padding: '6.5%' })); + requestAnimationFrame(() => void fitView({ duration: 250, padding: '14%' })); } }, [edges, fitView, setNodes], @@ -1560,9 +1615,9 @@ function Designer() { {deleteStageOpen && (() => { const activeStage = pipelines.find((p) => p.id === activePipelineId); const stagePipeCount = pipelineNodeCounts.get(activePipelineId) ?? 0; - return ( + return createPortal(
    { if (ev.target === ev.currentTarget) setDeleteStageOpen(false); @@ -1599,14 +1654,15 @@ function Designer() {
    -
    + , + document.body, ); })()} {extractStageOpen && (() => { const activeStage = pipelines.find((p) => p.id === activePipelineId); - return ( + return createPortal(
    { if (ev.target === ev.currentTarget) setExtractStageOpen(false); @@ -1656,7 +1712,8 @@ function Designer() {
    - + , + document.body, ); })()} @@ -1855,7 +1912,7 @@ function Designer() { )} -
    +
    {view === 'designer' && (
    - + {focusedNodes.length > 0 && ( + + )} )}
    @@ -2096,7 +2156,7 @@ function Designer() { )} {view === 'variables' && } {view === 'engine' && } -
    + ); } diff --git a/apps/web/src/frontend/features/workflow/components/WorkflowView.test.tsx b/apps/web/src/frontend/features/workflow/components/WorkflowView.test.tsx index a12c42e3..10b6a12f 100644 --- a/apps/web/src/frontend/features/workflow/components/WorkflowView.test.tsx +++ b/apps/web/src/frontend/features/workflow/components/WorkflowView.test.tsx @@ -35,12 +35,17 @@ beforeEach(() => { }); describe('WorkflowView pane RBAC', () => { - it('shows every pane for an owner', () => { + it('shows every pane for an owner with tablist/tab ARIA semantics', () => { seedRole('owner'); render(); - expect(screen.getByTestId('workflow-tab-designer')).toBeTruthy(); + expect(screen.getByRole('tablist', { name: 'Workflow sections' })).toBeTruthy(); + const designerTab = screen.getByTestId('workflow-tab-designer'); + const runsTab = screen.getByTestId('workflow-tab-runs'); + expect(designerTab.getAttribute('role')).toBe('tab'); + expect(designerTab.getAttribute('aria-selected')).toBe('true'); + expect(runsTab.getAttribute('role')).toBe('tab'); + expect(runsTab.getAttribute('aria-selected')).toBe('false'); expect(screen.getByTestId('workflow-tab-workflows')).toBeTruthy(); - expect(screen.getByTestId('workflow-tab-runs')).toBeTruthy(); expect(screen.getByTestId('workflow-tab-variables')).toBeTruthy(); expect(screen.getByTestId('workflow-tab-credentials')).toBeTruthy(); expect(screen.getByTestId('workflow-tab-engine')).toBeTruthy(); diff --git a/apps/web/src/frontend/features/workflow/components/WorkflowView.tsx b/apps/web/src/frontend/features/workflow/components/WorkflowView.tsx index 4a2cced8..cfd631d2 100644 --- a/apps/web/src/frontend/features/workflow/components/WorkflowView.tsx +++ b/apps/web/src/frontend/features/workflow/components/WorkflowView.tsx @@ -57,24 +57,28 @@ export const WorkflowView: React.FC = () => { data-testid="workflow-menu" > Workflow - {visiblePanes.map((p) => { - const active = (PANE_PARENT[pane] ?? pane) === p.id; - return ( - - ); - })} +
    + {visiblePanes.map((p) => { + const active = (PANE_PARENT[pane] ?? pane) === p.id; + return ( + + ); + })} +
    diff --git a/apps/web/src/frontend/features/workflow/store/workflowUiStore.ts b/apps/web/src/frontend/features/workflow/store/workflowUiStore.ts index e99ae816..dd9c7c7f 100644 --- a/apps/web/src/frontend/features/workflow/store/workflowUiStore.ts +++ b/apps/web/src/frontend/features/workflow/store/workflowUiStore.ts @@ -7,9 +7,36 @@ * whose log is open. */ import { create } from 'zustand'; +import type { Edge } from '@xyflow/react'; +import type { WorkflowDef } from '@foxschema/workflow-engine/definitions'; +import type { WorkflowDependency } from '../components/DependenciesDialog'; +import type { PipeNodeType } from '../components/PipeNode'; +import type { WorkflowSettings } from '../components/WorkflowSettingsDialog'; +import type { OverlapPolicy, WorkflowTrigger } from '../lib/triggers'; export type WorkflowPane = 'designer' | 'workflows' | 'runs' | 'variables' | 'credentials' | 'engine' | 'logs'; +/** + * In-memory snapshot of the designer canvas so switching top-level app views + * (e.g. Workflow → Utilities → Workflow) preserves both loaded workflows and + * unsaved edits instead of resetting the canvas to an empty Pipeline 1. + */ +export interface DesignerDraft { + workflowId: string; + nodes: PipeNodeType[]; + edges: Edge[]; + pipelines: Array<{ id: string; name: string; task?: string }>; + activePipelineId: string; + dependencies: WorkflowDependency[]; + triggers: WorkflowTrigger[]; + overlapPolicy: OverlapPolicy; + carried: Partial & { name?: string }>; + workflowSettings: WorkflowSettings; + savedSnapshot: string | null; + debugRunId: string | null; + executionCollapsed: boolean; +} + /** * Panes reached from another pane rather than the menu. The menu highlights, * and the permission check uses, the pane they belong to. @@ -22,11 +49,14 @@ interface WorkflowUiState { workflowId: string; /** The workflow the Logs pane shows. */ logsWorkflowId: string | null; + /** Last designer canvas state kept across top-level route switches. */ + designerDraft: DesignerDraft | null; setView: (view: WorkflowPane) => void; /** Open one workflow's log. */ openLogs: (workflowId: string) => void; setBusy: (busy: boolean) => void; setWorkflowId: (id: string) => void; + setDesignerDraft: (draft: DesignerDraft | null) => void; } export const useWorkflowUiStore = create((set) => ({ @@ -34,8 +64,10 @@ export const useWorkflowUiStore = create((set) => ({ busy: false, workflowId: 'my-workflow', logsWorkflowId: null, + designerDraft: null, setView: (view) => set({ view }), openLogs: (logsWorkflowId) => set({ view: 'logs', logsWorkflowId }), setBusy: (busy) => set({ busy }), setWorkflowId: (workflowId) => set({ workflowId }), + setDesignerDraft: (designerDraft) => set({ designerDraft }), })); diff --git a/apps/web/src/frontend/features/workflow/workflow.css b/apps/web/src/frontend/features/workflow/workflow.css index 61d61bf4..b2e8feb7 100644 --- a/apps/web/src/frontend/features/workflow/workflow.css +++ b/apps/web/src/frontend/features/workflow/workflow.css @@ -657,10 +657,13 @@ } .fox-workflow .runs-layout { display: grid; - grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr); + grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; } +.fox-workflow .runs-layout.has-detail { + grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr); +} .fox-workflow .runs table { width: 100%; border-collapse: collapse; @@ -790,7 +793,8 @@ } @media (max-width: 960px) { - .fox-workflow .runs-layout { grid-template-columns: 1fr; } + .fox-workflow .runs-layout, + .fox-workflow .runs-layout.has-detail { grid-template-columns: 1fr; } /* Stacked under the list, the detail scrolls with the page. */ .fox-workflow .run-detail { position: static; max-height: none; } } @@ -2626,10 +2630,11 @@ button.run-status { border-color: var(--border); color: var(--text); } +.fox-workflow.workflow-modal-backdrop, .fox-workflow .workflow-modal-backdrop { position: fixed; inset: 0; - z-index: 60; + z-index: 100; display: flex; align-items: center; justify-content: center;