mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
feat(lens): show investigation names in findings table (#44753)
This commit is contained in:
parent
655baa50be
commit
4cc442f5ee
2 changed files with 18 additions and 0 deletions
|
|
@ -29,6 +29,12 @@ it("deduplicates findings across investigations and applies feedback to every so
|
|||
renderWithLens(<FindingsView />, { searchParams: "?tab=findings", onUrlUpdate });
|
||||
const rows = await screen.findAllByRole("row", { name: issue.title });
|
||||
expect(rows).toHaveLength(1);
|
||||
expect(screen.getByRole("columnheader", { name: "Investigation", exact: true })).toBeVisible();
|
||||
const investigations = `${support.settings.name}, ${twin.settings.name}`;
|
||||
expect(within(rows[0]).getByRole("cell", { name: investigations, exact: true })).toHaveAttribute(
|
||||
"title",
|
||||
investigations,
|
||||
);
|
||||
expect(within(rows[0]).getByRole("cell", { name: "2", exact: true })).toBeVisible();
|
||||
await user.click(rows[0]);
|
||||
const panel = await screen.findByRole("complementary", { name: "Finding details" });
|
||||
|
|
@ -101,6 +107,7 @@ it("reviews only the selected check when two findings have the same title", asyn
|
|||
renderWithLens(<FindingsView />, { searchParams: "?tab=findings" });
|
||||
const rows = await screen.findAllByRole("row", { name: issue.title });
|
||||
expect(rows).toHaveLength(2);
|
||||
expect(within(rows[0]).getByRole("cell", { name: support.settings.name, exact: true })).toBeVisible();
|
||||
await user.click(rows[0]);
|
||||
await user.click(await screen.findByRole("button", { name: "Mark resolved" }));
|
||||
await waitFor(() => expect(proxy.patch).toHaveBeenCalledTimes(1));
|
||||
|
|
|
|||
|
|
@ -37,6 +37,15 @@ const PRIORITIES: { value: Priority | "all"; label: string }[] = [
|
|||
{ value: "low", label: "Low" },
|
||||
];
|
||||
|
||||
function InvestigationCell({ sources }: Pick<InboxRow, "sources">) {
|
||||
const names = [...new Set(sources.map(({ lens }) => lens.settings.name))].join(", ");
|
||||
return (
|
||||
<td className="hidden truncate px-3 text-muted-foreground lg:table-cell" title={names}>
|
||||
{names}
|
||||
</td>
|
||||
);
|
||||
}
|
||||
|
||||
function FilterSelect<T extends string>({
|
||||
label,
|
||||
value,
|
||||
|
|
@ -167,6 +176,7 @@ export function FindingsView({ readOnly = false }: { readOnly?: boolean }) {
|
|||
<tr className="h-8 border-b text-xs tracking-wider text-muted-foreground uppercase">
|
||||
<th className="w-20 px-3 font-medium">Priority</th>
|
||||
<th className="px-3 font-medium">Finding</th>
|
||||
<th className="hidden w-48 px-3 font-medium lg:table-cell">Investigation</th>
|
||||
<th className="hidden w-40 px-3 font-medium md:table-cell">Agent</th>
|
||||
<th className="hidden w-16 px-3 text-right font-medium sm:table-cell">Runs</th>
|
||||
<th className="hidden w-24 px-3 font-medium lg:table-cell">Last seen</th>
|
||||
|
|
@ -200,6 +210,7 @@ export function FindingsView({ readOnly = false }: { readOnly?: boolean }) {
|
|||
{row.agents.join(", ")} · {row.runs} {row.runs === 1 ? "run" : "runs"}
|
||||
</span>
|
||||
</td>
|
||||
<InvestigationCell sources={row.sources} />
|
||||
<td
|
||||
className="hidden truncate px-3 text-muted-foreground md:table-cell"
|
||||
title={row.agents.join(", ")}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue