Skip to content

Commit 2f56638

Browse files
feat(scouts): show scout finding tags on the emission card (#2871)
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent ec4ea41 commit 2f56638

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

packages/api-client/src/posthog-client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,8 @@ export interface ScoutEmission {
327327
weight: number;
328328
confidence: number;
329329
severity: string | null;
330+
/** Slug tags the scout attached to this finding (lowercase kebab-case, e.g. `cost-spike`). */
331+
tags?: string[];
330332
source_id: string;
331333
emitted_at: string;
332334
}

packages/ui/src/features/scouts/components/ScoutEmissionCard.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { ANALYTICS_EVENTS } from "@posthog/shared";
77
import { MarkdownRenderer } from "@posthog/ui/features/editor/components/MarkdownRenderer";
88
import { RelativeTimestamp } from "@posthog/ui/primitives/RelativeTimestamp";
99
import { track } from "@posthog/ui/shell/analytics";
10-
import { Box, Flex, Text } from "@radix-ui/themes";
10+
import { Badge, Box, Flex, Text } from "@radix-ui/themes";
1111
import { type ReactNode, useEffect, useRef, useState } from "react";
1212
import { SeverityBadge } from "./ScoutBadges";
1313
import { ScoutLinkedReportChip } from "./ScoutLinkedReportChip";
@@ -91,6 +91,21 @@ export function ScoutEmissionCard({
9191
>
9292
<MarkdownRenderer content={emission.description} />
9393
</Box>
94+
{emission.tags?.length ? (
95+
<Flex gap="1" mt="2" wrap="wrap">
96+
{emission.tags.map((tag) => (
97+
<Badge
98+
key={tag}
99+
variant="soft"
100+
color="gray"
101+
size="1"
102+
className="text-[11px]"
103+
>
104+
{tag}
105+
</Badge>
106+
))}
107+
</Flex>
108+
) : null}
94109
{expanded ? (
95110
<Flex
96111
align="center"

0 commit comments

Comments
 (0)