From d980b6de12c031a973a05f2bb8c4d4bf36bd280e Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Sat, 28 Feb 2026 15:27:01 -0500 Subject: [PATCH] Add collapsible code blocks and run workflow button to workflow detail Code blocks are now expandable/collapsible with a chevron toggle, line count, and LOC count in the header. TOML defaults collapsed, DOT expanded. Workflow detail header gets a circular play button and max-w-prose on the description for readability. Co-Authored-By: Claude Opus 4.6 --- .../app/routes/workflow-definition.tsx | 47 ++++++++++++++----- apps/arc-web/app/routes/workflow-detail.tsx | 21 +++++++-- 2 files changed, 50 insertions(+), 18 deletions(-) diff --git a/apps/arc-web/app/routes/workflow-definition.tsx b/apps/arc-web/app/routes/workflow-definition.tsx index 097451f55..eff7a9892 100644 --- a/apps/arc-web/app/routes/workflow-definition.tsx +++ b/apps/arc-web/app/routes/workflow-definition.tsx @@ -1,3 +1,4 @@ +import { ChevronRightIcon } from "@heroicons/react/20/solid"; import { useEffect, useRef, useState } from "react"; import { useParams } from "react-router"; import { workflowData } from "./workflow-detail"; @@ -7,13 +8,16 @@ function CodeBlock({ code, lang, filename, + defaultOpen = true, }: { code: string; lang: string; filename: string; + defaultOpen?: boolean; }) { const containerRef = useRef(null); const [ready, setReady] = useState(false); + const [open, setOpen] = useState(defaultOpen); useEffect(() => { let cancelled = false; @@ -45,22 +49,39 @@ function CodeBlock({ }; }, [code, lang]); + const lines = code.split("\n"); + const lineCount = lines.length; + const loc = lines.filter((l) => l.trim().length > 0).length; + return (
-
+ + +
+
+
+ + {!ready && ( +
+            {code}
+          
+ )}
- -
- - {!ready && ( -
-          {code}
-        
- )}
); } @@ -75,7 +96,7 @@ export default function WorkflowDefinition() { return (
- +
); diff --git a/apps/arc-web/app/routes/workflow-detail.tsx b/apps/arc-web/app/routes/workflow-detail.tsx index d8aa7624a..e1091dd56 100644 --- a/apps/arc-web/app/routes/workflow-detail.tsx +++ b/apps/arc-web/app/routes/workflow-detail.tsx @@ -275,12 +275,23 @@ export default function WorkflowDetail() { return (
-
-
-

{workflow.title}

- {workflow.filename} +
+
+
+

{workflow.title}

+ {workflow.filename} +
+

{workflow.description}

-

{workflow.description}

+