Skip to content

Commit b7b9a35

Browse files
committed
feat: Add data queried.
1 parent 43f7ebf commit b7b9a35

1 file changed

Lines changed: 48 additions & 0 deletions

File tree

apps/code/src/renderer/features/inbox/components/SignalCard.tsx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,11 +276,13 @@ function GitHubIssueSignalCard({
276276
extra,
277277
verified,
278278
codePaths,
279+
dataQueried,
279280
}: {
280281
signal: Signal;
281282
extra: GitHubIssueExtra;
282283
verified?: boolean;
283284
codePaths?: string[];
285+
dataQueried?: string;
284286
}) {
285287
const labels = resolveLabels(extra.labels);
286288
const issueUrl = extra.html_url ?? null;
@@ -345,6 +347,7 @@ function GitHubIssueSignalCard({
345347
</Text>
346348
)}
347349
<CodePathsCollapsible paths={codePaths ?? []} />
350+
<DataQueriedCollapsible text={dataQueried ?? ""} />
348351
</Box>
349352
);
350353
}
@@ -354,11 +357,13 @@ function ZendeskTicketSignalCard({
354357
extra,
355358
verified,
356359
codePaths,
360+
dataQueried,
357361
}: {
358362
signal: Signal;
359363
extra: ZendeskTicketExtra;
360364
verified?: boolean;
361365
codePaths?: string[];
366+
dataQueried?: string;
362367
}) {
363368
return (
364369
<Box className="min-w-0 overflow-hidden rounded-lg border border-gray-6 bg-gray-1 p-3">
@@ -407,6 +412,7 @@ function ZendeskTicketSignalCard({
407412
)}
408413
</Flex>
409414
<CodePathsCollapsible paths={codePaths ?? []} />
415+
<DataQueriedCollapsible text={dataQueried ?? ""} />
410416
</Box>
411417
);
412418
}
@@ -416,11 +422,13 @@ function LlmEvalSignalCard({
416422
extra,
417423
verified,
418424
codePaths,
425+
dataQueried,
419426
}: {
420427
signal: Signal;
421428
extra: LlmEvalExtra;
422429
verified?: boolean;
423430
codePaths?: string[];
431+
dataQueried?: string;
424432
}) {
425433
return (
426434
<Box className="min-w-0 overflow-hidden rounded-lg border border-gray-6 bg-gray-1 p-3">
@@ -448,6 +456,7 @@ function LlmEvalSignalCard({
448456
</Text>
449457
)}
450458
<CodePathsCollapsible paths={codePaths ?? []} />
459+
<DataQueriedCollapsible text={dataQueried ?? ""} />
451460
</Box>
452461
);
453462
}
@@ -457,11 +466,13 @@ function ErrorTrackingSignalCard({
457466
extra,
458467
verified,
459468
codePaths,
469+
dataQueried,
460470
}: {
461471
signal: Signal;
462472
extra: ErrorTrackingExtra;
463473
verified?: boolean;
464474
codePaths?: string[];
475+
dataQueried?: string;
465476
}) {
466477
const fingerprint = extra.fingerprint ?? "";
467478
const fingerprintShort =
@@ -501,6 +512,7 @@ function ErrorTrackingSignalCard({
501512
{/* No "View issue" link in Code — error tracking lives in Cloud */}
502513
</Flex>
503514
<CodePathsCollapsible paths={codePaths ?? []} />
515+
<DataQueriedCollapsible text={dataQueried ?? ""} />
504516
</Box>
505517
);
506518
}
@@ -509,10 +521,12 @@ function GenericSignalCard({
509521
signal,
510522
verified,
511523
codePaths,
524+
dataQueried,
512525
}: {
513526
signal: Signal;
514527
verified?: boolean;
515528
codePaths?: string[];
529+
dataQueried?: string;
516530
}) {
517531
return (
518532
<Box className="min-w-0 overflow-hidden rounded-lg border border-gray-6 bg-gray-1 p-3">
@@ -526,6 +540,7 @@ function GenericSignalCard({
526540
{new Date(signal.timestamp).toLocaleString()}
527541
</Text>
528542
<CodePathsCollapsible paths={codePaths ?? []} />
543+
<DataQueriedCollapsible text={dataQueried ?? ""} />
529544
</Box>
530545
);
531546
}
@@ -572,6 +587,34 @@ function CodePathsCollapsible({ paths }: { paths: string[] }) {
572587
);
573588
}
574589

590+
function DataQueriedCollapsible({ text }: { text: string }) {
591+
const [expanded, setExpanded] = useState(false);
592+
593+
if (!text) return null;
594+
595+
return (
596+
<Box mt="2" style={{ borderTop: "1px solid var(--gray-5)" }} pt="2">
597+
<button
598+
type="button"
599+
onClick={() => setExpanded((v) => !v)}
600+
className="flex items-center gap-1 rounded px-1 py-0.5 font-medium text-[11px] text-gray-10 hover:bg-gray-3 hover:text-gray-12"
601+
>
602+
{expanded ? <CaretDownIcon size={10} /> : <CaretRightIcon size={10} />}
603+
Data queried
604+
</button>
605+
{expanded && (
606+
<Text
607+
size="1"
608+
color="gray"
609+
className="mt-1 block whitespace-pre-wrap text-pretty pl-[18px] text-[11px] leading-relaxed"
610+
>
611+
{text}
612+
</Text>
613+
)}
614+
</Box>
615+
);
616+
}
617+
575618
// ── Main export ──────────────────────────────────────────────────────────────
576619

577620
export function SignalCard({
@@ -584,6 +627,7 @@ export function SignalCard({
584627
const extra = parseExtra(signal.extra);
585628
const verified = finding?.verified;
586629
const codePaths = finding?.relevant_code_paths ?? [];
630+
const dataQueried = finding?.data_queried ?? "";
587631

588632
if (
589633
signal.source_product === "error_tracking" &&
@@ -595,6 +639,7 @@ export function SignalCard({
595639
extra={extra}
596640
verified={verified}
597641
codePaths={codePaths}
642+
dataQueried={dataQueried}
598643
/>
599644
);
600645
}
@@ -605,6 +650,7 @@ export function SignalCard({
605650
extra={extra}
606651
verified={verified}
607652
codePaths={codePaths}
653+
dataQueried={dataQueried}
608654
/>
609655
);
610656
}
@@ -615,6 +661,7 @@ export function SignalCard({
615661
extra={extra}
616662
verified={verified}
617663
codePaths={codePaths}
664+
dataQueried={dataQueried}
618665
/>
619666
);
620667
}
@@ -625,6 +672,7 @@ export function SignalCard({
625672
extra={extra}
626673
verified={verified}
627674
codePaths={codePaths}
675+
dataQueried={dataQueried}
628676
/>
629677
);
630678
}

0 commit comments

Comments
 (0)