Workflow-Centric UI refactor#10
Merged
tsmarvin merged 13 commits intobugfix/workflow-expectationsfrom Mar 14, 2026
Merged
Conversation
- Bump packages to the latest versions
There was a problem hiding this comment.
Copilot reviewed 126 out of 214 changed files in this pull request and generated no comments.
Files not reviewed (2)
- src/Werkr.Data/Migrations/Postgres/20260314004316_InitialCreate.Designer.cs: Language not supported
- src/Werkr.Data/Migrations/Sqlite/20260314004323_InitialCreate.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Workflow UI & Interactive DAG Editor
This PR delivers a complete UI refactor: a TypeScript/Node.js build pipeline, real-time run monitoring via SignalR, a vis-timeline Gantt view, and a full AntV X6-based DAG renderer and interactive workflow editor - replacing the previous server-rendered SVG
DagView.razorentirely.Interactive Visual Workflow Editor
Why: The form-based step/dependency management was not intuitive or visually appealing. The best visual workflow editors share a common set of critical UX patterns: composable architecture (separating mapping, operations, layout, and traversal concerns), connection-drop-to-node-creator, undo/redo with grouped history, node dirtiness tracking, fixed connection points with visual feedback state machines (green/blue port indicators), and searchable, categorized shape palettes.
The editor uses a batch-save architecture: all mutations modify local X6 graph state and an in-memory changeset. An explicit "Save" syncs to the API. Undo/redo operates purely on local state - avoiding the complexity of reversing per-action API calls.
/workflows/{Id}/dag-editor. Three-column layout:StepPalette|DagEditorCanvas|NodeConfigPanel. Manages draft restore, metadata editing, DAG validation. Authorized for Admin/Operator roles.InitEditorAsync,LoadGraphAsync,AddNodeAsync,UpdateNodeDataAsync,GetChangesetJsonAsync,UndoAsync/RedoAsync,SetLayoutDirectionAsync,ZoomToAsync/ZoomToFitAsync. JS→.NET callbacks:OnNodeSelected,OnNodeDropped,OnSaveRequested,OnCycleDetected,OnGraphDirtyChanged.beforeunloadwarning for unsaved changes.graph.toSVG()/graph.toPNG()AntV X6 DAG Renderer - Replacing Server-Rendered SVG
Why: The previous
DagView.razorwas a server-rendered SVG using Kahn's algorithm with fixed-size nodes (160x52) and click-to-select only. SVG + foreignObject rendering with Dagre layout is the proven approach for rich node content (full HTML/CSS) while maintaining SVG coordinates for pan, zoom, and edges. AntV X6 provides all visual interactions client-side at 0ms latency, with built-in undo/redo, clipboard, drag-from-toolbar, minimap, and snapline alignment.GraphJsInteropBase. Methods:CreateGraphAsync,LoadGraphAsync,ZoomToFitAsync,ApplyStatusOverlayAsync. No scatteredIJSRuntime.InvokeAsync("eval", ...)calls.tight-treeranker was chosen overnetwork-simplexfor dramatically better performance at scale (minutes → seconds for large graphs).cell.setData(). Consistent color language: Green=Success, Red=Failed, Amber=Running, Purple=Pending, Gray=Skipped.Real-Time Run Monitoring & Execution Views
Why: The workflow debugging experience is the primary functionality for the product - building workflows happens once; debugging them happens daily.
Workflow event types in
Werkr.Core/Communication/:StepStartedEvent,StepCompletedEvent,StepFailedEvent,StepSkippedEvent,RunCompletedEvent,LogAppendedEventSystem.Threading.Channels. Published from gRPC service handlers (JobReportingGrpcService,OutputStreamingService,VariableService) when agents report execution progress.Real-time data pipeline:
/hubs/workflow-run. Authorized clients join groups keyed by run ID to receiveStepStatusChanged,RunCompleted, andLogAppendedevents.BackgroundService+IHealthCheckthat opens a long-lived SSE connection toGET /api/events/workflow-runsvia the"ApiServiceSse"namedHttpClient, deserializes events, and relays them to the hub viaIHubContext<WorkflowRunHub>. Auto-reconnects with exponential backoff (1s → 30s). Tracks active run subscriptions in aConcurrentDictionary. Registered as health check ("sse-relay") for operational visibility into SSE connection status.FilterField,FilterDefinition,FilterCriteria,FilterFieldType,SavedFilterViewinWerkr.Common/Models/.StepStatusDto,RunStatusDto,LogLineDtoinWorkflowRunHubDtos.cs- typed payloads for each hub broadcast methodRunSparklineDto,StepStatusSummaryDto,AnnotationDto,DagValidationResultinWerkr.Common/Models/HttpClient("ApiServiceSse") configured with infinite timeout and no resilience handlers in Program.csAPI Endpoints & Batch Operations
Batch save endpoint - The server-side contract for the editor's batch-save architecture:
POST /api/workflows/{workflowId}/steps/batch- Atomic batch operations for editor save. Accepts aWorkflowStepBatchRequestcontaining ordered step operations.StepId= temp ID (new nodes created in the editor), positive = real ID (existing nodes). The response includesStepIdMapping[]for temp→real ID resolution after save.WorkflowStepBatchRequest,StepBatchOperation,DependencyBatchItem,WorkflowStepBatchResponse,StepIdMappingRun management:
POST /api/workflows/{id}/runs/{runId}/retry-from/{stepId}- Retry from a failed step with optional variable overrides viaRetryFromFailedRequestSSE event streams:
GET /api/events/workflow-runs- Dedicated SSE stream for workflow run events (consumed byJobEventRelayService)GET /api/workflows/runs/{runId}/events- Per-run filtered event streamGET /api/events/jobs- Existing job event stream (backward-compatible)Saved filter persistence:
/api/filters/{pageKey}(GET list, POST create, PUT update, DELETE) with page keys for runs, workflows, jobs, agents, schedules, tasks. Admin-only share toggle.Consistent Color Standard & Theme System
Why: A consistent color language across all views - where the same semantic colors map to the same states throughout the entire UI - is essential for quick visual parsing.
--werkr-success(#28a745),--werkr-failed(#dc3545),--werkr-running(#ffc107),--werkr-pending(#6f42c1),--werkr-skipped(#6c757d),--werkr-not-run--werkr-node-default,--werkr-node-conditional,--werkr-node-fallback,--werkr-node-loop--werkr-edge-color,--werkr-node-stroke,--werkr-parallel-group-bg,--werkr-snaplineJS/TS Build Infrastructure
Why: The X6 graph engine, vis-timeline, and Dagre layout all require a proper JS/TS build pipeline. Keeping all drag, zoom, pan, and connection drawing in the browser while reserving SignalR round-trips for state commits.
src/Werkr.Server/graph-ui/wwwroot/js/dist/:dag-readonly.js,dag-editor.js,timeline-view.js, plus shared vendor chunks. Editor bundle lazy-loaded only when entering edit mode.EnsureNode→NpmInstall→BuildGraphUitargets fire automatically duringdotnet build. No separate npm steps needed during development.GraphJsInteropBase<T>managesIJSObjectReference+DotNetObjectReferencelifecycle withIAsyncDisposable. Three derived classes:DagJsInterop(read-only),DagEditorJsInterop(editor),TimelineJsInterop(Gantt)..nvmrcpins Node.js 22..gitignoreexcludesnode_modules/andwwwroot/js/dist/.CI/CD & Dependency Updates
npm ci→ Vitest →npm run build:prod→ bundle size check via check-bundle-size.mjs (250 KB gzipped budget)RelativeUrl_Rejectedtest now handles Unix vs. Windows URI parsing differencesSystem.Text.Jsontransitive dependency update in installer projectNew Dependencies
@antv/x6dagrevis-timelinevis-datatypescriptesbuildvitestNo new NuGet packages - all required .NET packages already existed in Directory.Packages.props.
New Prerequisite