Skip to content

Commit 2d78dde

Browse files
committed
more information cleanup
1 parent 9663a05 commit 2d78dde

File tree

2 files changed

+17
-57
lines changed

2 files changed

+17
-57
lines changed

apps/webapp/app/components/code/CodeBlock.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ export const CodeBlock = forwardRef<HTMLDivElement, CodeBlockProps>(
242242
[code]
243243
);
244244

245-
code = code.trim();
245+
code = code?.trim() ?? "";
246246
const lineCount = code.split("\n").length;
247247
const maxLineWidth = lineCount.toString().length;
248248
let maxHeight: string | undefined = undefined;

apps/webapp/app/components/logs/LogDetailView.tsx

Lines changed: 16 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
type MachinePresetName,
55
formatDurationMilliseconds,
66
} from "@trigger.dev/core/v3";
7-
import { useEffect, useState } from "react";
7+
import { useEffect, useState, type ReactNode } from "react";
88
import { useTypedFetcher } from "remix-typedjson";
99
import { cn } from "~/utils/cn";
1010
import { Button } from "~/components/primitives/Buttons";
@@ -30,7 +30,6 @@ import { RunTag } from "~/components/runs/v3/RunTag";
3030
import { formatCurrencyAccurate } from "~/utils/numberFormatter";
3131
import type { TaskRunStatus } from "@trigger.dev/database";
3232
import { PacketDisplay } from "~/components/runs/v3/PacketDisplay";
33-
import type { ReactNode } from "react";
3433

3534
// Types for the run context endpoint response
3635
type RunContextData = {
@@ -338,20 +337,20 @@ function DetailsTab({ log, runPath, searchTerm }: { log: LogEntry; runPath: stri
338337
<>
339338
{/* Time */}
340339
<div className="mb-6">
341-
<Header3 className="mb-2">Time</Header3>
340+
<Header3 className="mb-2">Timestamp</Header3>
342341
<div className="text-sm text-text-dimmed">
343342
<DateTime date={log.startTime} />
344343
</div>
345344
</div>
346345

347346
{/* Message */}
348347
<div className="mb-6">
349-
<Header3 className="mb-2">Message</Header3>
350-
<div className="rounded-md border border-grid-dimmed bg-charcoal-850 p-3">
351-
<div className="whitespace-pre-wrap break-words font-mono text-sm text-text-bright">
352-
{highlightJsonWithSearch(message, searchTerm)}
353-
</div>
354-
</div>
348+
<PacketDisplay
349+
data={message}
350+
dataType="application/json"
351+
title="Message"
352+
searchTerm={searchTerm}
353+
/>
355354
</div>
356355

357356
{/* Attributes - only available in full log detail */}
@@ -399,13 +398,6 @@ function RunTab({ log, runPath }: { log: LogEntry; runPath: string }) {
399398
return (
400399
<div className="flex flex-col items-center justify-center py-8">
401400
<Paragraph className="text-text-dimmed">Run not found in database.</Paragraph>
402-
<div className="mt-4">
403-
<Link to={runPath} target="_blank" rel="noopener noreferrer">
404-
<Button variant="primary/small" LeadingIcon={ArrowTopRightOnSquareIcon}>
405-
View Run Page
406-
</Button>
407-
</Link>
408-
</div>
409401
</div>
410402
);
411403
}
@@ -446,30 +438,10 @@ function RunTab({ log, runPath }: { log: LogEntry; runPath: string }) {
446438
<Property.Item>
447439
<Property.Label>Root and parent run</Property.Label>
448440
<Property.Value>
449-
<SimpleTooltip
450-
button={
451-
<TextLink
452-
to={v3RunPath(organization, project, environment, {
453-
friendlyId: runData.rootRun.friendlyId,
454-
})}
455-
className="group flex flex-wrap items-center gap-x-1 gap-y-0"
456-
>
457-
<CopyableText
458-
value={runData.rootRun.taskIdentifier}
459-
copyValue={runData.rootRun.taskIdentifier}
460-
asChild
461-
/>
462-
<span className="break-all text-text-dimmed transition-colors group-hover:text-text-bright/80">
463-
<CopyableText
464-
value={runData.rootRun.friendlyId}
465-
copyValue={runData.rootRun.friendlyId}
466-
asChild
467-
/>
468-
</span>
469-
</TextLink>
470-
}
471-
content={`Jump to root run`}
472-
disableHoverableContent
441+
<CopyableText
442+
value={runData.rootRun.taskIdentifier}
443+
copyValue={runData.rootRun.taskIdentifier}
444+
asChild
473445
/>
474446
</Property.Value>
475447
</Property.Item>
@@ -479,22 +451,10 @@ function RunTab({ log, runPath }: { log: LogEntry; runPath: string }) {
479451
<Property.Item>
480452
<Property.Label>Batch</Property.Label>
481453
<Property.Value>
482-
<SimpleTooltip
483-
button={
484-
<TextLink
485-
to={v3BatchPath(organization, project, environment, {
486-
friendlyId: runData.batch.friendlyId,
487-
})}
488-
>
489-
<CopyableText
490-
value={runData.batch.friendlyId}
491-
copyValue={runData.batch.friendlyId}
492-
asChild
493-
/>
494-
</TextLink>
495-
}
496-
content={`View batch ${runData.batch.friendlyId}`}
497-
disableHoverableContent
454+
<CopyableText
455+
value={runData.batch.friendlyId}
456+
copyValue={runData.batch.friendlyId}
457+
asChild
498458
/>
499459
</Property.Value>
500460
</Property.Item>

0 commit comments

Comments
 (0)