Skip to content

Commit 075175f

Browse files
committed
in run page added timestamp filtering when jumping to view logs
reduced spinner delay removed execution time column removed metadata from side panel
1 parent 6100b2d commit 075175f

File tree

3 files changed

+31
-79
lines changed

3 files changed

+31
-79
lines changed

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

Lines changed: 2 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -312,26 +312,18 @@ export function LogDetailView({ logId, initialLog, onClose, searchTerm }: LogDet
312312

313313
function DetailsTab({ log, runPath, searchTerm }: { log: LogEntry; runPath: string; searchTerm?: string }) {
314314
const logWithExtras = log as LogEntry & {
315-
metadata?: Record<string, unknown>;
316315
attributes?: Record<string, unknown>;
317316
};
318317

319318

320-
let metadata: Record<string, unknown> | null = null;
321-
let beautifiedMetadata: string | null = null;
322319
let beautifiedAttributes: string | null = null;
323320

324-
if (logWithExtras.metadata) {
325-
beautifiedMetadata = JSON.stringify(logWithExtras.metadata, null, 2);
326-
beautifiedMetadata = formatStringJSON(beautifiedMetadata);
327-
}
328-
329321
if (logWithExtras.attributes) {
330322
beautifiedAttributes = JSON.stringify(logWithExtras.attributes, null, 2);
331323
beautifiedAttributes = formatStringJSON(beautifiedAttributes);
332324
}
333325

334-
const showMetadata = beautifiedMetadata && beautifiedMetadata !== "{}";
326+
// const showMetadata = beautifiedMetadata && beautifiedMetadata !== "{}";
335327
const showAttributes = beautifiedAttributes && beautifiedAttributes !== "{}";
336328

337329
return (
@@ -412,18 +404,6 @@ function DetailsTab({ log, runPath, searchTerm }: { log: LogEntry; runPath: stri
412404
</Property.Table>
413405
</div>
414406

415-
{/* Metadata - only available in full log detail */}
416-
{showMetadata && beautifiedMetadata && (
417-
<div className="mb-6">
418-
<PacketDisplay
419-
data={beautifiedMetadata}
420-
dataType="application/json"
421-
title="Metadata"
422-
searchTerm={searchTerm}
423-
/>
424-
</div>
425-
)}
426-
427407
{/* Attributes - only available in full log detail */}
428408
{showAttributes && beautifiedAttributes && (
429409
<div className="mb-6">
@@ -519,7 +499,7 @@ function RunTab({ log, runPath }: { log: LogEntry; runPath: string }) {
519499

520500
{runData.rootRun && (
521501
<Property.Item>
522-
<Property.Label>Root run</Property.Label>
502+
<Property.Label>Root and parent run</Property.Label>
523503
<Property.Value>
524504
<SimpleTooltip
525505
button={
@@ -550,39 +530,6 @@ function RunTab({ log, runPath }: { log: LogEntry; runPath: string }) {
550530
</Property.Item>
551531
)}
552532

553-
{runData.parentRun && (
554-
<Property.Item>
555-
<Property.Label>Parent run</Property.Label>
556-
<Property.Value>
557-
<SimpleTooltip
558-
button={
559-
<TextLink
560-
to={v3RunPath(organization, project, environment, {
561-
friendlyId: runData.parentRun.friendlyId,
562-
})}
563-
className="group flex flex-wrap items-center gap-x-1 gap-y-0"
564-
>
565-
<CopyableText
566-
value={runData.parentRun.taskIdentifier}
567-
copyValue={runData.parentRun.taskIdentifier}
568-
asChild
569-
/>
570-
<span className="break-all text-text-dimmed transition-colors group-hover:text-text-bright/80">
571-
<CopyableText
572-
value={runData.parentRun.friendlyId}
573-
copyValue={runData.parentRun.friendlyId}
574-
asChild
575-
/>
576-
</span>
577-
</TextLink>
578-
}
579-
content={`Jump to parent run`}
580-
disableHoverableContent
581-
/>
582-
</Property.Value>
583-
</Property.Item>
584-
)}
585-
586533
{runData.batch && (
587534
<Property.Item>
588535
<Property.Label>Batch</Property.Label>

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

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export function LogsTable({
117117
const loadMoreRef = useRef<HTMLDivElement>(null);
118118
const [showLoadMoreSpinner, setShowLoadMoreSpinner] = useState(false);
119119

120-
// Show load more spinner only after 0.5 seconds of loading time
120+
// Show load more spinner only after 0.2 seconds of loading time
121121
useEffect(() => {
122122
if (!isLoadingMore) {
123123
setShowLoadMoreSpinner(false);
@@ -126,7 +126,7 @@ export function LogsTable({
126126

127127
const timer = setTimeout(() => {
128128
setShowLoadMoreSpinner(true);
129-
}, 500);
129+
}, 200);
130130

131131
return () => clearTimeout(timer);
132132
}, [isLoadingMore]);
@@ -165,7 +165,6 @@ export function LogsTable({
165165
<TableHeaderCell className="w-24 whitespace-nowrap">Run</TableHeaderCell>
166166
<TableHeaderCell className="w-32 whitespace-nowrap">Task</TableHeaderCell>
167167
<TableHeaderCell className="whitespace-nowrap">Level</TableHeaderCell>
168-
<TableHeaderCell className="whitespace-nowrap">Duration</TableHeaderCell>
169168
<TableHeaderCell className="w-full min-w-0">Message</TableHeaderCell>
170169
</TableRow>
171170
</TableHeader>
@@ -222,15 +221,6 @@ export function LogsTable({
222221
{log.level}
223222
</span>
224223
</TableCell>
225-
<TableCell
226-
className="whitespace-nowrap tabular-nums text-text-dimmed"
227-
onClick={handleRowClick}
228-
hasAction
229-
>
230-
{log.duration > 0
231-
? formatDurationNanoseconds(log.duration, { style: "short" })
232-
: "–"}
233-
</TableCell>
234224
<TableCell className="max-w-0 truncate" onClick={handleRowClick} hasAction>
235225
<span className="block truncate font-mono text-xs" title={log.message}>
236226
{highlightText(log.message, searchTerm)}

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

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import {
7171
docsPath,
7272
v3BatchPath,
7373
v3DeploymentVersionPath,
74+
v3LogsPath,
7475
v3RunDownloadLogsPath,
7576
v3RunIdempotencyKeyResetPath,
7677
v3RunPath,
@@ -572,7 +573,9 @@ function RunBody({
572573
<Property.Value>
573574
<div className="flex items-start justify-between gap-2">
574575
<div className="flex-1">
575-
<div className="break-all">{run.idempotencyKey ? run.idempotencyKey : "–"}</div>
576+
<div className="break-all">
577+
{run.idempotencyKey ? run.idempotencyKey : "–"}
578+
</div>
576579
{run.idempotencyKey && (
577580
<div>
578581
Expires:{" "}
@@ -587,7 +590,9 @@ function RunBody({
587590
{run.idempotencyKey && (
588591
<resetFetcher.Form
589592
method="post"
590-
action={v3RunIdempotencyKeyResetPath(organization, project, environment, { friendlyId: runParam })}
593+
action={v3RunIdempotencyKeyResetPath(organization, project, environment, {
594+
friendlyId: runParam,
595+
})}
591596
>
592597
<input type="hidden" name="taskIdentifier" value={run.taskIdentifier} />
593598
<Button
@@ -942,17 +947,27 @@ function RunBody({
942947
</div>
943948
<div className="flex items-center gap-4">
944949
{run.logsDeletedAt === null ? (
945-
<LinkButton
946-
to={v3RunDownloadLogsPath({ friendlyId: runParam })}
947-
LeadingIcon={CloudArrowDownIcon}
948-
leadingIconClassName="text-indigo-400"
949-
variant="secondary/medium"
950-
target="_blank"
951-
download
952-
>
953-
Download logs
954-
</LinkButton>
950+
<>
951+
<LinkButton
952+
to={`${v3LogsPath(organization, project, environment)}?runId=${runParam}&from=${new Date(run.createdAt).getTime() - 60000}`}
953+
variant="secondary/medium"
954+
>
955+
View logs
956+
</LinkButton>
957+
<LinkButton
958+
to={v3RunDownloadLogsPath({ friendlyId: runParam })}
959+
LeadingIcon={CloudArrowDownIcon}
960+
leadingIconClassName="text-indigo-400"
961+
variant="secondary/medium"
962+
target="_blank"
963+
download
964+
>
965+
Download logs
966+
</LinkButton>
967+
</>
955968
) : null}
969+
970+
956971
</div>
957972
</div>
958973
</div>

0 commit comments

Comments
 (0)