1+ import { useState } from "react" ;
2+
13import { CopyText } from "@/components/shared/CopyText/CopyText" ;
4+ import { Icon } from "@/components/ui/icon" ;
25import { BlockStack , InlineStack } from "@/components/ui/layout" ;
36import { Text } from "@/components/ui/typography" ;
47import { useCheckComponentSpecFromPath } from "@/hooks/useCheckComponentSpecFromPath" ;
@@ -12,7 +15,10 @@ import {
1215 isStatusComplete ,
1316 isStatusInProgress ,
1417} from "@/services/executionService" ;
18+ import { componentSpecToText } from "@/utils/yaml" ;
1519
20+ import TooltipButton from "../shared/Buttons/TooltipButton" ;
21+ import { CodeViewer } from "../shared/CodeViewer" ;
1622import {
1723 ActionBlock ,
1824 type ActionOrReactNode ,
@@ -24,7 +30,6 @@ import PipelineIO from "../shared/Execution/PipelineIO";
2430import { InfoBox } from "../shared/InfoBox" ;
2531import { LoadingScreen } from "../shared/LoadingScreen" ;
2632import { StatusBar , StatusText } from "../shared/Status" ;
27- import { TaskImplementation } from "../shared/TaskDetails" ;
2833import { CancelPipelineRunButton } from "./components/CancelPipelineRunButton" ;
2934import { ClonePipelineButton } from "./components/ClonePipelineButton" ;
3035import { InspectPipelineButton } from "./components/InspectPipelineButton" ;
@@ -43,6 +48,8 @@ export const RunDetails = () => {
4348 } = useExecutionData ( ) ;
4449 const { data : currentUserDetails } = useUserDetails ( ) ;
4550
51+ const [ isYamlFullscreen , setIsYamlFullscreen ] = useState ( false ) ;
52+
4653 const editorRoute = componentSpec . name
4754 ? `/editor/${ encodeURIComponent ( componentSpec . name ) } `
4855 : "" ;
@@ -90,11 +97,13 @@ export const RunDetails = () => {
9097 const actions : ActionOrReactNode [ ] = [ ] ;
9198
9299 actions . push (
93- < TaskImplementation
94- displayName = { componentSpec . name ?? "Pipeline" }
95- componentSpec = { componentSpec }
96- showInlineContent = { false }
97- /> ,
100+ < TooltipButton
101+ variant = "outline"
102+ tooltip = "View YAML"
103+ onClick = { ( ) => setIsYamlFullscreen ( true ) }
104+ >
105+ < Icon name = "FileCodeCorner" />
106+ </ TooltipButton > ,
98107 ) ;
99108
100109 if ( canAccessEditorSpec && componentSpec . name ) {
@@ -122,57 +131,68 @@ export const RunDetails = () => {
122131 }
123132
124133 return (
125- < BlockStack gap = "6" className = "p-2 h-full" >
126- < CopyText className = "text-lg font-semibold" >
127- { componentSpec . name ?? "Unnamed Pipeline" }
128- </ CopyText >
129-
130- < ActionBlock actions = { actions } />
131-
132- { metadata && (
133- < ListBlock
134- title = "Run Info"
135- items = { [
136- { label : "Run Id" , value : metadata . id } ,
137- { label : "Execution Id" , value : metadata . root_execution_id } ,
138- { label : "Created by" , value : metadata . created_by ?? undefined } ,
139- {
140- label : "Created at" ,
141- value : metadata . created_at
142- ? new Date ( metadata . created_at ) . toLocaleString ( )
143- : undefined ,
144- } ,
145- ] }
146- marker = "none"
147- />
148- ) }
149-
150- { componentSpec . description && (
151- < TextBlock title = "Description" text = { componentSpec . description } />
152- ) }
153-
154- < ContentBlock title = "Status" >
155- < InlineStack gap = "2" blockAlign = "center" className = "mb-1" >
156- < Text size = "sm" weight = "semibold" >
157- { runStatus }
158- </ Text >
159- < StatusText statusCounts = { statusCounts } />
160- </ InlineStack >
161- < StatusBar statusCounts = { statusCounts } />
162- </ ContentBlock >
163-
164- { Object . keys ( annotations ) . length > 0 && (
165- < ListBlock
166- title = "Annotations"
167- items = { Object . entries ( annotations ) . map ( ( [ key , value ] ) => ( {
168- label : key ,
169- value : String ( value ) ,
170- } ) ) }
171- marker = "none"
134+ < >
135+ < BlockStack gap = "6" className = "p-2 h-full" >
136+ < CopyText className = "text-lg font-semibold" >
137+ { componentSpec . name ?? "Unnamed Pipeline" }
138+ </ CopyText >
139+
140+ < ActionBlock actions = { actions } />
141+
142+ { metadata && (
143+ < ListBlock
144+ title = "Run Info"
145+ items = { [
146+ { label : "Run Id" , value : metadata . id } ,
147+ { label : "Execution Id" , value : metadata . root_execution_id } ,
148+ { label : "Created by" , value : metadata . created_by ?? undefined } ,
149+ {
150+ label : "Created at" ,
151+ value : metadata . created_at
152+ ? new Date ( metadata . created_at ) . toLocaleString ( )
153+ : undefined ,
154+ } ,
155+ ] }
156+ marker = "none"
157+ />
158+ ) }
159+
160+ { componentSpec . description && (
161+ < TextBlock title = "Description" text = { componentSpec . description } />
162+ ) }
163+
164+ < ContentBlock title = "Status" >
165+ < InlineStack gap = "2" blockAlign = "center" className = "mb-1" >
166+ < Text size = "sm" weight = "semibold" >
167+ { runStatus }
168+ </ Text >
169+ < StatusText statusCounts = { statusCounts } />
170+ </ InlineStack >
171+ < StatusBar statusCounts = { statusCounts } />
172+ </ ContentBlock >
173+
174+ { Object . keys ( annotations ) . length > 0 && (
175+ < ListBlock
176+ title = "Annotations"
177+ items = { Object . entries ( annotations ) . map ( ( [ key , value ] ) => ( {
178+ label : key ,
179+ value : String ( value ) ,
180+ } ) ) }
181+ marker = "none"
182+ />
183+ ) }
184+
185+ < PipelineIO readOnly />
186+ </ BlockStack >
187+ { isYamlFullscreen && (
188+ < CodeViewer
189+ code = { componentSpecToText ( componentSpec ) }
190+ language = "yaml"
191+ filename = { componentSpec . name ?? "pipeline.yaml" }
192+ isFullscreen = { isYamlFullscreen }
193+ onClose = { ( ) => setIsYamlFullscreen ( false ) }
172194 />
173195 ) }
174-
175- < PipelineIO readOnly />
176- </ BlockStack >
196+ </ >
177197 ) ;
178198} ;
0 commit comments