Skip to content

Commit 1ee1eb5

Browse files
committed
make loop run history rows open the run detail
1 parent 67785e6 commit 1ee1eb5

1 file changed

Lines changed: 27 additions & 24 deletions

File tree

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import type { LoopSchemas } from "@posthog/api-client/loops";
22
import { Badge } from "@posthog/ui/primitives/Badge";
3+
import { navigateToTaskDetail } from "@posthog/ui/router/navigationBridge";
34
import { Flex, Text } from "@radix-ui/themes";
45

56
function statusColor(
@@ -28,32 +29,34 @@ function formatRelativeDate(iso: string | null): string {
2829

2930
export function LoopRunRow({ run }: { run: LoopSchemas.LoopRun }) {
3031
return (
31-
<Flex
32-
align="center"
33-
justify="between"
34-
gap="3"
35-
className="rounded-(--radius-2) border border-border bg-(--color-panel-solid) px-3 py-2.5"
32+
<button
33+
type="button"
34+
onClick={() => navigateToTaskDetail(run.task_id)}
35+
title="Open this run to see the agent's activity"
36+
className="w-full rounded-(--radius-2) border border-border bg-(--color-panel-solid) px-3 py-2.5 text-left transition-colors hover:bg-(--gray-3)"
3637
>
37-
<Flex direction="column" className="min-w-0 gap-0.5">
38-
<Flex align="center" gap="2">
39-
<Badge color={statusColor(run.status)}>{run.status}</Badge>
40-
<Text className="text-[12px] text-gray-11">
41-
{formatRelativeDate(run.created_at)}
42-
</Text>
38+
<Flex align="center" justify="between" gap="3">
39+
<Flex direction="column" className="min-w-0 gap-0.5">
40+
<Flex align="center" gap="2">
41+
<Badge color={statusColor(run.status)}>{run.status}</Badge>
42+
<Text className="text-[12px] text-gray-11">
43+
{formatRelativeDate(run.created_at)}
44+
</Text>
45+
</Flex>
46+
{run.error_message ? (
47+
<Text className="truncate text-(--red-11) text-[11.5px]">
48+
{run.error_message}
49+
</Text>
50+
) : run.branch ? (
51+
<Text className="truncate text-[11.5px] text-gray-10 [font-family:var(--font-mono)]">
52+
{run.branch}
53+
</Text>
54+
) : null}
4355
</Flex>
44-
{run.error_message ? (
45-
<Text className="truncate text-(--red-11) text-[11.5px]">
46-
{run.error_message}
47-
</Text>
48-
) : run.branch ? (
49-
<Text className="truncate text-[11.5px] text-gray-10 [font-family:var(--font-mono)]">
50-
{run.branch}
51-
</Text>
52-
) : null}
56+
<Text className="shrink-0 text-[11px] text-gray-10 uppercase">
57+
{run.environment}
58+
</Text>
5359
</Flex>
54-
<Text className="shrink-0 text-[11px] text-gray-10 uppercase">
55-
{run.environment}
56-
</Text>
57-
</Flex>
60+
</button>
5861
);
5962
}

0 commit comments

Comments
 (0)