@@ -3,6 +3,7 @@ import { useEffect, useState } from "react";
33
44import { PipelineValidationList } from "@/components/Editor/components/PipelineValidationList/PipelineValidationList" ;
55import { useValidationIssueNavigation } from "@/components/Editor/hooks/useValidationIssueNavigation" ;
6+ import { ArtifactsList } from "@/components/shared/ArtifactsList/ArtifactsList" ;
67import { CopyText } from "@/components/shared/CopyText/CopyText" ;
78import { Button } from "@/components/ui/button" ;
89import { Icon } from "@/components/ui/icon" ;
@@ -98,18 +99,6 @@ const PipelineDetails = () => {
9899 ) ;
99100 } ;
100101
101- const handleInputCopy = ( input : InputSpec ) => {
102- const value = input . value ?? input . default ;
103-
104- if ( ! value ) {
105- notify ( "Copy failed: Input has no value" , "error" ) ;
106- return ;
107- }
108-
109- void navigator . clipboard . writeText ( value ) ;
110- notify ( "Input value copied to clipboard" , "success" ) ;
111- } ;
112-
113102 const handleDigestCopy = ( ) => {
114103 navigator . clipboard . writeText ( digest ) ;
115104 notify ( "Digest copied to clipboard" , "success" ) ;
@@ -134,7 +123,7 @@ const PipelineDetails = () => {
134123 className = "p-2 h-full"
135124 data-context-panel = "pipeline-details"
136125 >
137- < CopyText className = "text-lg font-semibold" showButton = { false } >
126+ < CopyText className = "text-lg font-semibold" >
138127 { componentSpec . name ?? "Unnamed Pipeline" }
139128 </ CopyText >
140129 < InlineStack gap = "2" >
@@ -233,111 +222,46 @@ const PipelineDetails = () => {
233222 ) }
234223
235224 { /* Artifacts (Inputs & Outputs) */ }
236- < BlockStack >
237- < Text as = "h3" size = "md" weight = "semibold" className = "mb-1" >
238- Artifacts
239- </ Text >
240- < BlockStack gap = "4" >
241- < BlockStack >
242- < Text as = "h4" size = "sm" weight = "semibold" className = "mb-1" >
243- Inputs
244- </ Text >
245- { componentSpec . inputs && componentSpec . inputs . length > 0 ? (
246- < div className = "flex flex-col" >
247- { componentSpec . inputs . map ( ( input ) => {
248- return (
249- < div
250- className = "flex flex-row justify-between even:bg-white odd:bg-gray-100 gap-1 px-2 py-1 rounded-xs items-center"
251- key = { input . name }
252- >
253- < div className = "text-xs flex-1 truncate max-w-[200px]" >
254- < span className = "font-semibold" > { input . name } :</ span > { " " }
255- { input . value || input . default || "No value" }
256- </ div >
257-
258- < div className = "text-xs flex-1 font-mono truncate max-w-[100px]" >
259- < span className = "font-semibold" > Type:</ span > { " " }
260- { typeSpecToString ( input ?. type ) }
261- </ div >
262- < InlineStack
263- className = "min-w-24"
264- align = "end"
265- blockAlign = "center"
266- >
267- < Button
268- type = "button"
269- variant = "ghost"
270- size = "min"
271- onClick = { ( ) => handleInputCopy ( input ) }
272- className = "text-muted-foreground hover:text-foreground"
273- >
274- < Icon name = "Copy" className = "size-3" />
275- </ Button >
276-
277- < Button
278- type = "button"
279- variant = "ghost"
280- className = "text-xs text-muted-foreground cursor-pointer hover:bg-transparent"
281- size = "sm"
282- onClick = { ( ) => handleInputEdit ( input ) }
283- >
284- Edit
285- </ Button >
286- </ InlineStack >
287- </ div >
288- ) ;
289- } ) }
290- </ div >
291- ) : (
292- < div className = "text-xs text-muted-foreground" > No inputs</ div >
293- ) }
294- </ BlockStack >
295- < BlockStack >
296- < Text as = "h4" size = "sm" weight = "semibold" className = "mb-1" >
297- Outputs
298- </ Text >
299- { componentSpec . outputs && componentSpec . outputs . length > 0 ? (
300- < div className = "flex flex-col" >
301- { componentSpec . outputs . map ( ( output ) => (
302- < div
303- className = "flex flex-row justify-between even:bg-white odd:bg-gray-100 gap-1 px-2 py-1 rounded-xs items-center"
304- key = { output . name }
305- >
306- < div className = "text-xs flex-1 truncate max-w-[200px]" >
307- < span className = "font-semibold" > { output . name } :</ span > { " " }
308- {
309- getOutputConnectedDetails ( graphSpec , output . name )
310- . outputName
311- }
312- </ div >
313- < div className = "text-xs" >
314- < span className = "font-semibold" > Type:</ span > { " " }
315- { typeSpecToString (
316- getOutputConnectedDetails ( graphSpec , output . name )
317- . outputType ,
318- ) }
319- </ div >
320-
321- < InlineStack className = "min-w-24" align = { "end" } >
322- < Button
323- type = "button"
324- variant = "ghost"
325- className = "text-xs text-muted-foreground cursor-pointer hover:bg-transparent"
326- size = "sm"
327- onClick = { ( ) => handleOutputEdit ( output ) }
328- >
329- Edit
330- </ Button >
331- </ InlineStack >
332- </ div >
333- ) ) }
334- </ div >
335- ) : (
336- < div className = "text-xs text-muted-foreground" > No outputs</ div >
337- ) }
338- </ BlockStack >
339- </ BlockStack >
340- </ BlockStack >
225+ < ArtifactsList
226+ inputs = { ( componentSpec . inputs ?? [ ] ) . map ( ( input ) => ( {
227+ name : input . name ,
228+ type : typeSpecToString ( input ?. type ) ,
229+ value : input . value || input . default ,
230+ actions : (
231+ < Button
232+ type = "button"
233+ variant = "ghost"
234+ size = "min"
235+ onClick = { ( ) => handleInputEdit ( input ) }
236+ className = "text-muted-foreground hover:text-foreground h-4 w-4"
237+ >
238+ < Icon name = "Pencil" className = "size-2.5" />
239+ </ Button >
240+ ) ,
241+ } ) ) }
242+ outputs = { ( componentSpec . outputs ?? [ ] ) . map ( ( output ) => {
243+ const connectedDetails = getOutputConnectedDetails (
244+ graphSpec ,
245+ output . name ,
246+ ) ;
247+ return {
248+ name : output . name ,
249+ type : typeSpecToString ( connectedDetails . outputType ) ,
250+ value : connectedDetails . outputName ,
251+ actions : (
252+ < Button
253+ type = "button"
254+ variant = "ghost"
255+ size = "min"
256+ onClick = { ( ) => handleOutputEdit ( output ) }
257+ className = "text-muted-foreground hover:text-foreground h-4 w-4"
258+ >
259+ < Icon name = "Pencil" className = "size-2.5" />
260+ </ Button >
261+ ) ,
262+ } ;
263+ } ) }
264+ />
341265
342266 { /* Validations */ }
343267 < BlockStack >
0 commit comments