11import { XMarkIcon , ArrowTopRightOnSquareIcon , CheckIcon , ClockIcon } from "@heroicons/react/20/solid" ;
22import { Link } from "@remix-run/react" ;
33import {
4- formatDurationNanoseconds ,
54 type MachinePresetName ,
65 formatDurationMilliseconds ,
76} from "@trigger.dev/core/v3" ;
@@ -267,16 +266,14 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
267266 >
268267 { log . level }
269268 </ span >
270- < span className = "text-text-dimmed" > ·</ span >
271- < DateTime date = { log . startTime } />
272269 </ div >
273270 < Button variant = "minimal/small" onClick = { onClose } shortcut = { { key : "esc" } } >
274271 < XMarkIcon className = "size-5" />
275272 </ Button >
276273 </ div >
277274
278275 { /* Tabs */ }
279- < div className = "border-b border-grid-dimmed px-4" >
276+ < div className = "flex items-center justify-between border-b border-grid-dimmed px-4" >
280277 < TabContainer >
281278 < TabButton
282279 isActive = { activeTab === "details" }
@@ -295,6 +292,11 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
295292 Run
296293 </ TabButton >
297294 </ TabContainer >
295+ < Link to = { runPath } target = "_blank" rel = "noopener noreferrer" >
296+ < Button variant = "secondary/small" LeadingIcon = { ArrowTopRightOnSquareIcon } >
297+ View Full Run
298+ </ Button >
299+ </ Link >
298300 </ div >
299301
300302 { /* Content */ }
@@ -323,87 +325,35 @@ function DetailsTab({ log, runPath, searchTerm }: { log: LogEntry; runPath: stri
323325 beautifiedAttributes = formatStringJSON ( beautifiedAttributes ) ;
324326 }
325327
326- // const showMetadata = beautifiedMetadata && beautifiedMetadata !== "{}";
327328 const showAttributes = beautifiedAttributes && beautifiedAttributes !== "{}" ;
328329
330+ // Determine message to show
331+ let message = log . message ;
332+
333+ if ( log . status === 'ERROR' ) {
334+ message = ( logWithExtras ?. attributes ?. error as any ) ?. message ;
335+ }
336+
329337 return (
330338 < >
339+ { /* Time */ }
340+ < div className = "mb-6" >
341+ < Header3 className = "mb-2" > Time</ Header3 >
342+ < div className = "text-sm text-text-dimmed" >
343+ < DateTime date = { log . startTime } />
344+ </ div >
345+ </ div >
346+
331347 { /* Message */ }
332348 < div className = "mb-6" >
333349 < Header3 className = "mb-2" > Message</ Header3 >
334350 < div className = "rounded-md border border-grid-dimmed bg-charcoal-850 p-3" >
335351 < div className = "whitespace-pre-wrap break-words font-mono text-sm text-text-bright" >
336- { highlightJsonWithSearch ( log . message , searchTerm ) }
352+ { highlightJsonWithSearch ( message , searchTerm ) }
337353 </ div >
338354 </ div >
339355 </ div >
340356
341- { /* Run Link */ }
342- < div className = "mb-6" >
343- < Header3 className = "mb-2" > Run</ Header3 >
344- < div className = "flex items-center gap-3" >
345- < span className = "font-mono text-sm text-text-bright" > { log . runId } </ span >
346- < Link to = { runPath } target = "_blank" rel = "noopener noreferrer" >
347- < Button variant = "tertiary/small" LeadingIcon = { ArrowTopRightOnSquareIcon } >
348- View in Run
349- </ Button >
350- </ Link >
351- </ div >
352- </ div >
353-
354- { /* Details */ }
355- < div className = "mb-6" >
356- < Header3 className = "mb-2" > Details</ Header3 >
357- < Property . Table >
358- < Property . Item >
359- < Property . Label > Task</ Property . Label >
360- < Property . Value >
361- < span className = "font-mono" > { log . taskIdentifier } </ span >
362- </ Property . Value >
363- </ Property . Item >
364-
365- < Property . Item >
366- < Property . Label > Kind</ Property . Label >
367- < Property . Value > { log . kind } </ Property . Value >
368- </ Property . Item >
369-
370- < Property . Item >
371- < Property . Label > Duration</ Property . Label >
372- < Property . Value className = "flex items-center gap-1" >
373- < ClockIcon className = "size-4 text-text-dimmed" />
374- < span >
375- { log . duration > 0
376- ? formatDurationNanoseconds ( log . duration , { style : "short" } )
377- : "–" }
378- </ span >
379- </ Property . Value >
380- </ Property . Item >
381-
382- < Property . Item >
383- < Property . Label > Trace ID</ Property . Label >
384- < Property . Value >
385- < span className = "font-mono text-xs" > { log . traceId } </ span >
386- </ Property . Value >
387- </ Property . Item >
388-
389- < Property . Item >
390- < Property . Label > Span ID</ Property . Label >
391- < Property . Value >
392- < span className = "font-mono text-xs" > { log . spanId } </ span >
393- </ Property . Value >
394- </ Property . Item >
395-
396- { log . parentSpanId && (
397- < Property . Item >
398- < Property . Label > Parent Span ID</ Property . Label >
399- < Property . Value >
400- < span className = "font-mono text-xs" > { log . parentSpanId } </ span >
401- </ Property . Value >
402- </ Property . Item >
403- ) }
404- </ Property . Table >
405- </ div >
406-
407357 { /* Attributes - only available in full log detail */ }
408358 { showAttributes && beautifiedAttributes && (
409359 < div className = "mb-6" >
@@ -463,6 +413,13 @@ function RunTab({ log, runPath }: { log: LogEntry; runPath: string }) {
463413 return (
464414 < div className = "flex flex-col gap-4 py-3" >
465415 < Property . Table >
416+ < Property . Item >
417+ < Property . Label > Run ID</ Property . Label >
418+ < Property . Value >
419+ < CopyableText value = { runData . friendlyId } copyValue = { runData . friendlyId } asChild />
420+ </ Property . Value >
421+ </ Property . Item >
422+
466423 < Property . Item >
467424 < Property . Label > Status</ Property . Label >
468425 < Property . Value >
@@ -477,22 +434,10 @@ function RunTab({ log, runPath }: { log: LogEntry; runPath: string }) {
477434 < Property . Item >
478435 < Property . Label > Task</ Property . Label >
479436 < Property . Value >
480- < SimpleTooltip
481- button = {
482- < TextLink
483- to = { v3RunsPath ( organization , project , environment , {
484- tasks : [ runData . taskIdentifier ] ,
485- } ) }
486- >
487- < CopyableText
488- value = { runData . taskIdentifier }
489- copyValue = { runData . taskIdentifier }
490- asChild
491- />
492- </ TextLink >
493- }
494- content = { `View runs filtered by ${ runData . taskIdentifier } ` }
495- disableHoverableContent
437+ < CopyableText
438+ value = { runData . taskIdentifier }
439+ copyValue = { runData . taskIdentifier }
440+ asChild
496441 />
497442 </ Property . Value >
498443 </ Property . Item >
@@ -673,22 +618,7 @@ function RunTab({ log, runPath }: { log: LogEntry; runPath: string }) {
673618 : "–" }
674619 </ Property . Value >
675620 </ Property . Item >
676-
677- < Property . Item >
678- < Property . Label > Run ID</ Property . Label >
679- < Property . Value >
680- < CopyableText value = { runData . friendlyId } copyValue = { runData . friendlyId } asChild />
681- </ Property . Value >
682- </ Property . Item >
683621 </ Property . Table >
684-
685- < div className = "flex justify-end gap-2 pt-2" >
686- < Link to = { runPath } target = "_blank" rel = "noopener noreferrer" >
687- < Button variant = "secondary/small" LeadingIcon = { ArrowTopRightOnSquareIcon } >
688- View Full Run
689- </ Button >
690- </ Link >
691- </ div >
692622 </ div >
693623 ) ;
694624}
0 commit comments