@@ -4,13 +4,13 @@ import {
4
4
EnvelopeIcon ,
5
5
QueueListIcon ,
6
6
} from "@heroicons/react/20/solid" ;
7
- import { Link } from "@remix-run/react" ;
8
7
import { type LoaderFunctionArgs } from "@remix-run/server-runtime" ;
9
8
import {
10
9
formatDurationMilliseconds ,
11
10
type TaskRunError ,
12
11
taskRunErrorEnhancer ,
13
12
} from "@trigger.dev/core/v3" ;
13
+ import { assertNever } from "assert-never" ;
14
14
import { useEffect } from "react" ;
15
15
import { typedjson , useTypedFetcher } from "remix-typedjson" ;
16
16
import { ExitIcon } from "~/assets/icons/ExitIcon" ;
@@ -37,20 +37,23 @@ import { TabButton, TabContainer } from "~/components/primitives/Tabs";
37
37
import { TextLink } from "~/components/primitives/TextLink" ;
38
38
import { InfoIconTooltip , SimpleTooltip } from "~/components/primitives/Tooltip" ;
39
39
import { RunTimeline , RunTimelineEvent , SpanTimeline } from "~/components/run/RunTimeline" ;
40
+ import { PacketDisplay } from "~/components/runs/v3/PacketDisplay" ;
40
41
import { RunIcon } from "~/components/runs/v3/RunIcon" ;
41
42
import { RunTag } from "~/components/runs/v3/RunTag" ;
42
43
import { SpanEvents } from "~/components/runs/v3/SpanEvents" ;
43
44
import { SpanTitle } from "~/components/runs/v3/SpanTitle" ;
44
45
import { TaskRunAttemptStatusCombo } from "~/components/runs/v3/TaskRunAttemptStatus" ;
45
46
import { TaskRunStatusCombo , TaskRunStatusReason } from "~/components/runs/v3/TaskRunStatus" ;
47
+ import { WaitpointDetailTable } from "~/components/runs/v3/WaitpointDetails" ;
48
+ import { WarmStartCombo } from "~/components/WarmStarts" ;
49
+ import { useEnvironment } from "~/hooks/useEnvironment" ;
46
50
import { useOrganization } from "~/hooks/useOrganizations" ;
47
51
import { useProject } from "~/hooks/useProject" ;
48
52
import { useSearchParams } from "~/hooks/useSearchParam" ;
49
53
import { useHasAdminAccess } from "~/hooks/useUser" ;
50
54
import { redirectWithErrorMessage } from "~/models/message.server" ;
51
55
import { type Span , SpanPresenter , type SpanRun } from "~/presenters/v3/SpanPresenter.server" ;
52
56
import { logger } from "~/services/logger.server" ;
53
- import { requireUserId } from "~/services/session.server" ;
54
57
import { cn } from "~/utils/cn" ;
55
58
import { formatCurrencyAccurate } from "~/utils/numberFormatter" ;
56
59
import {
@@ -63,15 +66,8 @@ import {
63
66
v3SchedulePath ,
64
67
v3SpanParamsSchema ,
65
68
} from "~/utils/pathBuilder" ;
66
- import {
67
- CompleteWaitpointForm ,
68
- ForceTimeout ,
69
- } from "../resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.$waitpointFriendlyId.complete/route" ;
70
- import { useEnvironment } from "~/hooks/useEnvironment" ;
71
- import { WaitpointStatusCombo } from "~/components/runs/v3/WaitpointStatus" ;
72
- import { PacketDisplay } from "~/components/runs/v3/PacketDisplay" ;
73
- import { WaitpointDetailTable } from "~/components/runs/v3/WaitpointDetails" ;
74
69
import { createTimelineSpanEventsFromSpanEvents } from "~/utils/timelineSpanEvents" ;
70
+ import { CompleteWaitpointForm } from "../resources.orgs.$organizationSlug.projects.$projectParam.env.$envParam.waitpoints.$waitpointFriendlyId.complete/route" ;
75
71
76
72
export const loader = async ( { request, params } : LoaderFunctionArgs ) => {
77
73
const { projectParam, organizationSlug, envParam, runParam, spanParam } =
@@ -935,6 +931,40 @@ function SpanEntity({ span }: { span: Span }) {
935
931
}
936
932
937
933
switch ( span . entity . type ) {
934
+ case "attempt" : {
935
+ return (
936
+ < div className = "flex flex-col gap-4 p-3" >
937
+ < div className = "border-b border-grid-bright pb-3" >
938
+ < TaskRunAttemptStatusCombo
939
+ status = {
940
+ span . isCancelled
941
+ ? "CANCELED"
942
+ : span . isError
943
+ ? "FAILED"
944
+ : span . isPartial
945
+ ? "EXECUTING"
946
+ : "COMPLETED"
947
+ }
948
+ className = "text-sm"
949
+ />
950
+ </ div >
951
+ < SpanTimeline
952
+ startTime = { new Date ( span . startTime ) }
953
+ duration = { span . duration }
954
+ inProgress = { span . isPartial }
955
+ isError = { span . isError }
956
+ events = { createTimelineSpanEventsFromSpanEvents ( span . events , isAdmin ) }
957
+ />
958
+ { span . entity . object . isWarmStart !== undefined ? (
959
+ < WarmStartCombo
960
+ isWarmStart = { span . entity . object . isWarmStart }
961
+ showTooltip
962
+ className = "mt-3"
963
+ />
964
+ ) : null }
965
+ </ div >
966
+ ) ;
967
+ }
938
968
case "waitpoint" : {
939
969
return (
940
970
< div className = "grid h-full grid-rows-[1fr_auto]" >
@@ -957,7 +987,7 @@ function SpanEntity({ span }: { span: Span }) {
957
987
) ;
958
988
}
959
989
default : {
960
- return < Paragraph variant = "small" > No span for { span . entity . type } </ Paragraph > ;
990
+ assertNever ( span . entity ) ;
961
991
}
962
992
}
963
993
}
0 commit comments