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 { Spinner } from "@/components/ui/spinner" ;
47import { Paragraph , Text } from "@/components/ui/typography" ;
@@ -13,7 +16,10 @@ import {
1316 isStatusComplete ,
1417 isStatusInProgress ,
1518} from "@/services/executionService" ;
19+ import { componentSpecToText } from "@/utils/yaml" ;
1620
21+ import TooltipButton from "../shared/Buttons/TooltipButton" ;
22+ import { CodeViewer } from "../shared/CodeViewer" ;
1723import {
1824 ActionBlock ,
1925 type ActionOrReactNode ,
@@ -24,7 +30,6 @@ import { TextBlock } from "../shared/ContextPanel/Blocks/TextBlock";
2430import PipelineIO from "../shared/Execution/PipelineIO" ;
2531import { InfoBox } from "../shared/InfoBox" ;
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 : "" ;
@@ -95,11 +102,13 @@ export const RunDetails = () => {
95102 const actions : ActionOrReactNode [ ] = [ ] ;
96103
97104 actions . push (
98- < TaskImplementation
99- displayName = { componentSpec . name ?? "Pipeline" }
100- componentSpec = { componentSpec }
101- showInlineContent = { false }
102- /> ,
105+ < TooltipButton
106+ variant = "outline"
107+ tooltip = "View YAML"
108+ onClick = { ( ) => setIsYamlFullscreen ( true ) }
109+ >
110+ < Icon name = "FileCodeCorner" />
111+ </ TooltipButton > ,
103112 ) ;
104113
105114 if ( canAccessEditorSpec && componentSpec . name ) {
@@ -123,57 +132,68 @@ export const RunDetails = () => {
123132 }
124133
125134 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"
135+ < >
136+ < BlockStack gap = "6" className = "p-2 h-full" >
137+ < CopyText className = "text-lg font-semibold" >
138+ { componentSpec . name ?? "Unnamed Pipeline" }
139+ </ CopyText >
140+
141+ < ActionBlock actions = { actions } />
142+
143+ { metadata && (
144+ < ListBlock
145+ title = "Run Info"
146+ items = { [
147+ { label : "Run Id" , value : metadata . id } ,
148+ { label : "Execution Id" , value : metadata . root_execution_id } ,
149+ { label : "Created by" , value : metadata . created_by ?? undefined } ,
150+ {
151+ label : "Created at" ,
152+ value : metadata . created_at
153+ ? new Date ( metadata . created_at ) . toLocaleString ( )
154+ : undefined ,
155+ } ,
156+ ] }
157+ marker = "none"
158+ />
159+ ) }
160+
161+ { componentSpec . description && (
162+ < TextBlock title = "Description" text = { componentSpec . description } />
163+ ) }
164+
165+ < ContentBlock title = "Status" >
166+ < InlineStack gap = "2" blockAlign = "center" className = "mb-1" >
167+ < Text size = "sm" weight = "semibold" >
168+ { runStatus }
169+ </ Text >
170+ < StatusText statusCounts = { statusCounts } />
171+ </ InlineStack >
172+ < StatusBar statusCounts = { statusCounts } />
173+ </ ContentBlock >
174+
175+ { Object . keys ( annotations ) . length > 0 && (
176+ < ListBlock
177+ title = "Annotations"
178+ items = { Object . entries ( annotations ) . map ( ( [ key , value ] ) => ( {
179+ label : key ,
180+ value : String ( value ) ,
181+ } ) ) }
182+ marker = "none"
183+ />
184+ ) }
185+
186+ < PipelineIO readOnly />
187+ </ BlockStack >
188+ { isYamlFullscreen && (
189+ < CodeViewer
190+ code = { componentSpecToText ( componentSpec ) }
191+ language = "yaml"
192+ filename = { componentSpec . name ?? "pipeline.yaml" }
193+ isFullscreen = { isYamlFullscreen }
194+ onClose = { ( ) => setIsYamlFullscreen ( false ) }
173195 />
174196 ) }
175-
176- < PipelineIO readOnly />
177- </ BlockStack >
197+ </ >
178198 ) ;
179199} ;
0 commit comments