Skip to content

Commit 227fc2d

Browse files
committed
fix(webapp): Make spans fluid again while task is executing
1 parent 06cbe6e commit 227fc2d

File tree

1 file changed

+17
-14
lines changed
  • apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam

1 file changed

+17
-14
lines changed

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.runs.$runParam/route.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,7 @@ function TimelineView({
959959
const initialTimelineDimensions = useInitialDimensions(timelineContainerRef);
960960
const minTimelineWidth = initialTimelineDimensions?.width ?? 300;
961961
const maxTimelineWidth = minTimelineWidth * 10;
962+
const disableSpansAnimations = rootSpanStatus === "executing";
962963

963964
//we want to live-update the duration if the root span is still executing
964965
const [duration, setDuration] = useState(queueAdjustedNs(totalDuration, queuedDuration));
@@ -1130,8 +1131,8 @@ function TimelineView({
11301131
"-ml-[0.5px] h-[0.5625rem] w-px rounded-none",
11311132
eventBackgroundClassName(node.data)
11321133
)}
1133-
layoutId={node.data.isPartial ? `${node.id}-${event.name}` : undefined}
1134-
animate={!node.data.isPartial ? false : undefined}
1134+
layoutId={disableSpansAnimations ? `${node.id}-${event.name}` : undefined}
1135+
animate={disableSpansAnimations ? undefined : false}
11351136
/>
11361137
)}
11371138
</Timeline.Point>
@@ -1149,8 +1150,8 @@ function TimelineView({
11491150
"-ml-[0.1562rem] size-[0.3125rem] rounded-full border bg-background-bright",
11501151
eventBorderClassName(node.data)
11511152
)}
1152-
layoutId={node.data.isPartial ? `${node.id}-${event.name}` : undefined}
1153-
animate={!node.data.isPartial ? false : undefined}
1153+
layoutId={disableSpansAnimations ? `${node.id}-${event.name}` : undefined}
1154+
animate={disableSpansAnimations ? undefined : false}
11541155
/>
11551156
)}
11561157
</Timeline.Point>
@@ -1169,8 +1170,8 @@ function TimelineView({
11691170
>
11701171
<motion.div
11711172
className={cn("h-px w-full", eventBackgroundClassName(node.data))}
1172-
layoutId={node.data.isPartial ? `mark-${node.id}` : undefined}
1173-
animate={!node.data.isPartial ? false : undefined}
1173+
layoutId={disableSpansAnimations ? `mark-${node.id}` : undefined}
1174+
animate={disableSpansAnimations ? undefined : false}
11741175
/>
11751176
</Timeline.Span>
11761177
) : null}
@@ -1193,6 +1194,7 @@ function TimelineView({
11931194
}
11941195
node={node}
11951196
fadeLeft={isTopSpan && queuedDuration !== undefined}
1197+
disableAnimations={disableSpansAnimations}
11961198
/>
11971199
</>
11981200
) : (
@@ -1207,8 +1209,8 @@ function TimelineView({
12071209
"-ml-0.5 size-3 rounded-full border-2 border-background-bright",
12081210
eventBackgroundClassName(node.data)
12091211
)}
1210-
layoutId={node.data.isPartial ? node.id : undefined}
1211-
animate={!node.data.isPartial ? false : undefined}
1212+
layoutId={disableSpansAnimations ? node.id : undefined}
1213+
animate={disableSpansAnimations ? undefined : false}
12121214
/>
12131215
)}
12141216
</Timeline.Point>
@@ -1440,8 +1442,9 @@ function SpanWithDuration({
14401442
showDuration,
14411443
node,
14421444
fadeLeft,
1445+
disableAnimations,
14431446
...props
1444-
}: Timeline.SpanProps & { node: TraceEvent; showDuration: boolean; fadeLeft: boolean }) {
1447+
}: Timeline.SpanProps & { node: TraceEvent; showDuration: boolean; fadeLeft: boolean; disableAnimations?: boolean }) {
14451448
return (
14461449
<Timeline.Span {...props}>
14471450
<motion.div
@@ -1451,8 +1454,8 @@ function SpanWithDuration({
14511454
fadeLeft ? "rounded-r-sm bg-gradient-to-r from-black/50 to-transparent" : "rounded-sm"
14521455
)}
14531456
style={{ backgroundSize: "20px 100%", backgroundRepeat: "no-repeat" }}
1454-
layoutId={node.data.isPartial ? node.id : undefined}
1455-
animate={!node.data.isPartial ? false : undefined}
1457+
layoutId={disableAnimations ? node.id : undefined}
1458+
animate={disableAnimations ? undefined : false}
14561459
>
14571460
{node.data.isPartial && (
14581461
<div
@@ -1465,12 +1468,12 @@ function SpanWithDuration({
14651468
"sticky left-0 z-10 transition-opacity group-hover:opacity-100",
14661469
!showDuration && "opacity-0"
14671470
)}
1468-
animate={!node.data.isPartial ? false : undefined}
1471+
animate={disableAnimations ? undefined : false}
14691472
>
14701473
<motion.div
14711474
className="whitespace-nowrap rounded-sm px-1 py-0.5 text-xxs text-text-bright text-shadow-custom"
1472-
layout={node.data.isPartial ? "position" : undefined}
1473-
animate={!node.data.isPartial ? false : undefined}
1475+
layout={disableAnimations ? "position" : undefined}
1476+
animate={disableAnimations ? undefined : false}
14741477
>
14751478
{formatDurationMilliseconds(props.durationMs, {
14761479
style: "short",

0 commit comments

Comments
 (0)