@@ -6,6 +6,7 @@ import { useRouter } from 'next/navigation'
66import {
77 Badge ,
88 Button ,
9+ Code ,
910 Input ,
1011 Label ,
1112 Table ,
@@ -155,14 +156,54 @@ function getBlockNameFromSnapshot(
155156 const parsed = JSON . parse ( executionSnapshot . snapshot )
156157 const workflowState = parsed ?. workflow
157158 if ( ! workflowState ?. blocks || ! Array . isArray ( workflowState . blocks ) ) return null
158- // Blocks are stored as an array of serialized blocks with id and metadata.name
159159 const block = workflowState . blocks . find ( ( b : { id : string } ) => b . id === blockId )
160160 return block ?. metadata ?. name || null
161161 } catch {
162162 return null
163163 }
164164}
165165
166+ function renderStructuredValuePreview ( value : any ) {
167+ if ( value === null || value === undefined ) {
168+ return < span style = { { fontSize : '12px' , color : 'var(--text-muted)' } } > —</ span >
169+ }
170+
171+ if ( typeof value === 'object' ) {
172+ return (
173+ < div style = { { minWidth : '220px' } } >
174+ < Code . Viewer
175+ code = { JSON . stringify ( value , null , 2 ) }
176+ language = 'json'
177+ wrapText
178+ className = 'max-h-[220px]'
179+ />
180+ </ div >
181+ )
182+ }
183+
184+ const stringValue = String ( value )
185+ return (
186+ < div
187+ style = { {
188+ display : 'inline-flex' ,
189+ maxWidth : '100%' ,
190+ borderRadius : '6px' ,
191+ border : '1px solid var(--border)' ,
192+ background : 'var(--surface-5)' ,
193+ padding : '4px 8px' ,
194+ whiteSpace : 'pre-wrap' ,
195+ wordBreak : 'break-word' ,
196+ fontFamily : 'var(--font-mono, monospace)' ,
197+ fontSize : '12px' ,
198+ lineHeight : '16px' ,
199+ color : 'var(--text-primary)' ,
200+ } }
201+ >
202+ { stringValue }
203+ </ div >
204+ )
205+ }
206+
166207export default function ResumeExecutionPage ( {
167208 params,
168209 initialExecutionDetail,
@@ -874,8 +915,11 @@ export default function ResumeExecutionPage({
874915 < Tooltip . Trigger asChild >
875916 < Button
876917 variant = 'outline'
918+ size = 'sm'
877919 onClick = { refreshExecutionDetail }
878920 disabled = { refreshingExecution }
921+ className = 'gap-1.5 px-2.5'
922+ aria-label = 'Refresh execution details'
879923 >
880924 < RefreshCw
881925 style = { {
@@ -884,6 +928,7 @@ export default function ResumeExecutionPage({
884928 animation : refreshingExecution ? 'spin 1s linear infinite' : undefined ,
885929 } }
886930 />
931+ Refresh
887932 </ Button >
888933 </ Tooltip . Trigger >
889934 < Tooltip . Content > Refresh</ Tooltip . Content >
@@ -1123,11 +1168,7 @@ export default function ResumeExecutionPage({
11231168 < TableRow key = { row . id } >
11241169 < TableCell > { row . name } </ TableCell >
11251170 < TableCell > { row . type } </ TableCell >
1126- < TableCell >
1127- < code style = { { fontSize : '12px' } } >
1128- { formatStructureValue ( row . value ) }
1129- </ code >
1130- </ TableCell >
1171+ < TableCell > { renderStructuredValuePreview ( row . value ) } </ TableCell >
11311172 </ TableRow >
11321173 ) ) }
11331174 </ TableBody >
@@ -1243,6 +1284,8 @@ export default function ResumeExecutionPage({
12431284 } }
12441285 placeholder = '{"example": "value"}'
12451286 rows = { 6 }
1287+ spellCheck = { false }
1288+ className = 'min-h-[180px] border-[var(--border-1)] bg-[var(--surface-3)] font-mono text-[12px] leading-5'
12461289 />
12471290 </ div >
12481291 </ div >
@@ -1267,10 +1310,10 @@ export default function ResumeExecutionPage({
12671310 { /* Footer */ }
12681311 < div
12691312 style = { {
1270- marginTop : '32px' ,
1271- padding : '16px' ,
1313+ maxWidth : '1200px' ,
1314+ margin : '24px auto 0' ,
1315+ padding : '0 24px 24px' ,
12721316 textAlign : 'center' ,
1273- borderTop : '1px solid var(--border)' ,
12741317 fontSize : '13px' ,
12751318 color : 'var(--text-muted)' ,
12761319 } }
0 commit comments