@@ -13,7 +13,6 @@ import {
1313 isStatusComplete ,
1414 isStatusInProgress ,
1515} from "@/services/executionService" ;
16-
1716import {
1817 ActionBlock ,
1918 type ActionOrReactNode ,
@@ -24,11 +23,15 @@ import { TextBlock } from "../shared/ContextPanel/Blocks/TextBlock";
2423import PipelineIO from "../shared/Execution/PipelineIO" ;
2524import { InfoBox } from "../shared/InfoBox" ;
2625import { StatusBar , StatusText } from "../shared/Status" ;
27- import { TaskImplementation } from "../shared/TaskDetails" ;
2826import { CancelPipelineRunButton } from "./components/CancelPipelineRunButton" ;
2927import { ClonePipelineButton } from "./components/ClonePipelineButton" ;
3028import { InspectPipelineButton } from "./components/InspectPipelineButton" ;
3129import { RerunPipelineButton } from "./components/RerunPipelineButton" ;
30+ import { useState } from "react" ;
31+ import { componentSpecToText } from "@/utils/yaml" ;
32+ import { CodeViewer } from "../shared/CodeViewer" ;
33+ import TooltipButton from "../shared/Buttons/TooltipButton" ;
34+ import { Icon } from "../ui/icon" ;
3235
3336export const RunDetails = ( ) => {
3437 const { configured } = useBackend ( ) ;
@@ -43,6 +46,8 @@ export const RunDetails = () => {
4346 } = useExecutionData ( ) ;
4447 const { data : currentUserDetails } = useUserDetails ( ) ;
4548
49+ const [ isYamlFullscreen , setIsYamlFullscreen ] = useState ( false ) ;
50+
4651 const editorRoute = componentSpec . name
4752 ? `/editor/${ encodeURIComponent ( componentSpec . name ) } `
4853 : "" ;
@@ -95,11 +100,13 @@ export const RunDetails = () => {
95100 const actions : ActionOrReactNode [ ] = [ ] ;
96101
97102 actions . push (
98- < TaskImplementation
99- displayName = { componentSpec . name ?? "Pipeline" }
100- componentSpec = { componentSpec }
101- showInlineContent = { false }
102- /> ,
103+ < TooltipButton
104+ variant = "outline"
105+ tooltip = "View YAML"
106+ onClick = { ( ) => setIsYamlFullscreen ( true ) }
107+ >
108+ < Icon name = "FileCodeCorner" />
109+ </ TooltipButton > ,
103110 ) ;
104111
105112 if ( canAccessEditorSpec && componentSpec . name ) {
@@ -123,57 +130,68 @@ export const RunDetails = () => {
123130 }
124131
125132 return (
126- < BlockStack gap = "6" className = "p-2 h-full" >
127- < CopyText className = "text-lg font-semibold" >
128- { componentSpec . name ?? "Unnamed Pipeline" }
129- </ CopyText >
130-
131- < ActionBlock actions = { actions } />
132-
133- { metadata && (
134- < ListBlock
135- title = "Run Info"
136- items = { [
137- { label : "Run Id" , value : metadata . id } ,
138- { label : "Execution Id" , value : metadata . root_execution_id } ,
139- { label : "Created by" , value : metadata . created_by ?? undefined } ,
140- {
141- label : "Created at" ,
142- value : metadata . created_at
143- ? new Date ( metadata . created_at ) . toLocaleString ( )
144- : undefined ,
145- } ,
146- ] }
147- marker = "none"
148- />
149- ) }
150-
151- { componentSpec . description && (
152- < TextBlock title = "Description" text = { componentSpec . description } />
153- ) }
154-
155- < ContentBlock title = "Status" >
156- < InlineStack gap = "2" blockAlign = "center" className = "mb-1" >
157- < Text size = "sm" weight = "semibold" >
158- { runStatus }
159- </ Text >
160- < StatusText statusCounts = { statusCounts } />
161- </ InlineStack >
162- < StatusBar statusCounts = { statusCounts } />
163- </ ContentBlock >
164-
165- { Object . keys ( annotations ) . length > 0 && (
166- < ListBlock
167- title = "Annotations"
168- items = { Object . entries ( annotations ) . map ( ( [ key , value ] ) => ( {
169- label : key ,
170- value : String ( value ) ,
171- } ) ) }
172- marker = "none"
133+ < >
134+ < BlockStack gap = "6" className = "p-2 h-full" >
135+ < CopyText className = "text-lg font-semibold" >
136+ { componentSpec . name ?? "Unnamed Pipeline" }
137+ </ CopyText >
138+
139+ < ActionBlock actions = { actions } />
140+
141+ { metadata && (
142+ < ListBlock
143+ title = "Run Info"
144+ items = { [
145+ { label : "Run Id" , value : metadata . id } ,
146+ { label : "Execution Id" , value : metadata . root_execution_id } ,
147+ { label : "Created by" , value : metadata . created_by ?? undefined } ,
148+ {
149+ label : "Created at" ,
150+ value : metadata . created_at
151+ ? new Date ( metadata . created_at ) . toLocaleString ( )
152+ : undefined ,
153+ } ,
154+ ] }
155+ marker = "none"
156+ />
157+ ) }
158+
159+ { componentSpec . description && (
160+ < TextBlock title = "Description" text = { componentSpec . description } />
161+ ) }
162+
163+ < ContentBlock title = "Status" >
164+ < InlineStack gap = "2" blockAlign = "center" className = "mb-1" >
165+ < Text size = "sm" weight = "semibold" >
166+ { runStatus }
167+ </ Text >
168+ < StatusText statusCounts = { statusCounts } />
169+ </ InlineStack >
170+ < StatusBar statusCounts = { statusCounts } />
171+ </ ContentBlock >
172+
173+ { Object . keys ( annotations ) . length > 0 && (
174+ < ListBlock
175+ title = "Annotations"
176+ items = { Object . entries ( annotations ) . map ( ( [ key , value ] ) => ( {
177+ label : key ,
178+ value : String ( value ) ,
179+ } ) ) }
180+ marker = "none"
181+ />
182+ ) }
183+
184+ < PipelineIO readOnly />
185+ </ BlockStack >
186+ { isYamlFullscreen && (
187+ < CodeViewer
188+ code = { componentSpecToText ( componentSpec ) }
189+ language = "yaml"
190+ filename = { componentSpec . name ?? "pipeline.yaml" }
191+ isFullscreen = { isYamlFullscreen }
192+ onClose = { ( ) => setIsYamlFullscreen ( false ) }
173193 />
174194 ) }
175-
176- < PipelineIO readOnly />
177- </ BlockStack >
195+ </ >
178196 ) ;
179197} ;
0 commit comments