@@ -65,7 +65,7 @@ import { useProject } from "~/hooks/useProject";
65
65
import { useReplaceLocation } from "~/hooks/useReplaceLocation" ;
66
66
import { Shortcut , useShortcutKeys } from "~/hooks/useShortcutKeys" ;
67
67
import { useUser } from "~/hooks/useUser" ;
68
- import { RunPresenter } from "~/presenters/v3/RunPresenter.server" ;
68
+ import { Run , RunPresenter } from "~/presenters/v3/RunPresenter.server" ;
69
69
import { requireUserId } from "~/services/session.server" ;
70
70
import { cn } from "~/utils/cn" ;
71
71
import { lerp } from "~/utils/lerp" ;
@@ -316,6 +316,7 @@ function TraceView({ run, trace, maximumLiveReloadingSetting, resizable }: Loade
316
316
environmentType = { run . environment . type }
317
317
shouldLiveReload = { shouldLiveReload }
318
318
maximumLiveReloadingSetting = { maximumLiveReloadingSetting }
319
+ rootRun = { run . rootTaskRun }
319
320
/>
320
321
</ ResizablePanel >
321
322
< ResizableHandle id = { resizableSettings . parent . handleId } />
@@ -438,6 +439,11 @@ type TasksTreeViewProps = {
438
439
environmentType : RuntimeEnvironmentType ;
439
440
shouldLiveReload : boolean ;
440
441
maximumLiveReloadingSetting : number ;
442
+ rootRun : {
443
+ friendlyId : string ;
444
+ taskIdentifier : string ;
445
+ spanId : string ;
446
+ } | null ;
441
447
} ;
442
448
443
449
function TasksTreeView ( {
@@ -451,6 +457,7 @@ function TasksTreeView({
451
457
environmentType,
452
458
shouldLiveReload,
453
459
maximumLiveReloadingSetting,
460
+ rootRun,
454
461
} : TasksTreeViewProps ) {
455
462
const [ filterText , setFilterText ] = useState ( "" ) ;
456
463
const [ errorsOnly , setErrorsOnly ] = useState ( false ) ;
@@ -517,8 +524,14 @@ function TasksTreeView({
517
524
>
518
525
< div className = "grid h-full grid-rows-[2rem_1fr] overflow-hidden" >
519
526
< div className = "flex items-center pr-2" >
520
- { parentRunFriendlyId ? (
521
- < ShowParentLink runFriendlyId = { parentRunFriendlyId } />
527
+ { rootRun ? (
528
+ < ShowParentLink
529
+ runFriendlyId = { rootRun . friendlyId }
530
+ isRoot = { true }
531
+ spanId = { rootRun . spanId }
532
+ />
533
+ ) : parentRunFriendlyId ? (
534
+ < ShowParentLink runFriendlyId = { parentRunFriendlyId } isRoot = { false } />
522
535
) : (
523
536
< Paragraph variant = "small" className = "flex-1 text-charcoal-500" >
524
537
This is the root task
@@ -599,7 +612,9 @@ function TasksTreeView({
599
612
className = "h-4 min-h-4 w-4 min-w-4"
600
613
/>
601
614
< NodeText node = { node } />
602
- { node . data . isRoot && < Badge variant = "outline-rounded" > Root</ Badge > }
615
+ { node . data . isRoot && ! rootRun && (
616
+ < Badge variant = "outline-rounded" > Root</ Badge >
617
+ ) }
603
618
</ div >
604
619
< div className = "flex items-center gap-1" >
605
620
< NodeStatusIcon node = { node } />
@@ -954,24 +969,34 @@ function TaskLine({ isError, isSelected }: { isError: boolean; isSelected: boole
954
969
return < div className = { cn ( "h-8 w-2 border-r border-grid-bright" ) } /> ;
955
970
}
956
971
957
- function ShowParentLink ( { runFriendlyId } : { runFriendlyId : string } ) {
972
+ function ShowParentLink ( {
973
+ runFriendlyId,
974
+ spanId,
975
+ isRoot,
976
+ } : {
977
+ runFriendlyId : string ;
978
+ spanId ?: string ;
979
+ isRoot : boolean ;
980
+ } ) {
958
981
const [ mouseOver , setMouseOver ] = useState ( false ) ;
959
982
const organization = useOrganization ( ) ;
960
983
const project = useProject ( ) ;
961
984
const { spanParam } = useParams ( ) ;
962
985
986
+ const span = spanId ? spanId : spanParam ;
987
+
963
988
return (
964
989
< LinkButton
965
990
variant = "minimal/medium"
966
991
to = {
967
- spanParam
992
+ span
968
993
? v3RunSpanPath (
969
994
organization ,
970
995
project ,
971
996
{
972
997
friendlyId : runFriendlyId ,
973
998
} ,
974
- { spanId : spanParam }
999
+ { spanId : span }
975
1000
)
976
1001
: v3RunPath ( organization , project , {
977
1002
friendlyId : runFriendlyId ,
@@ -993,7 +1018,7 @@ function ShowParentLink({ runFriendlyId }: { runFriendlyId: string }) {
993
1018
variant = "small"
994
1019
className = { cn ( mouseOver ? "text-indigo-500" : "text-charcoal-500" ) }
995
1020
>
996
- Show parent items
1021
+ { isRoot ? " Show root run" : "Show parent run" }
997
1022
</ Paragraph >
998
1023
</ LinkButton >
999
1024
) ;
0 commit comments