diff --git a/dashboard/e2e/data-sources.spec.ts b/dashboard/e2e/data-sources.spec.ts index 3fb6dd70..a7f902ec 100644 --- a/dashboard/e2e/data-sources.spec.ts +++ b/dashboard/e2e/data-sources.spec.ts @@ -175,7 +175,7 @@ test("hub: empty state", async ({ page }) => { await mockApi(page); await page.goto("/data-sources"); - await expect(page.getByRole("heading", { level: 1, name: "Let the reviewer check facts against your real systems" })).toBeVisible(); + await expect(page.getByRole("heading", { level: 1, name: "Let Coderhelm check facts against your real systems" })).toBeVisible(); await expect(page.getByRole("link", { name: /An API/ })).toBeVisible(); await expect(page.getByText("Coming next")).toHaveCount(2); await expect(page.getByRole("link", { name: /A database/ })).toHaveCount(0); @@ -441,6 +441,7 @@ test("a source in error status says the reviewer is not using it, and activity e { at: now, source_id: "ds_1", source_name: "api.yourcompany.com", actor: "reviewer", repo: "your-team/backend", pr: 123, summary: "Checked the fields of an order", detail: "", ok: true, outcome: "ok", ms: 210 }, { at: now, source_id: "ds_1", source_name: "api.yourcompany.com", actor: "admin@example.com", summary: "A write was attempted", detail: REFUSAL, ok: false, outcome: "refused", ms: 2 }, { at: now, source_id: "ds_1", source_name: "api.yourcompany.com", actor: "reviewer", repo: "your-team/web", pr: 7, summary: "Looked up a setting", detail: "Your API did not answer in time.", ok: false, outcome: "failed", ms: 10000 }, + { at: now, source_id: "ds_1", source_name: "api.yourcompany.com", actor: "planner", repo: "your-team/backend", pr: 0, summary: "Checked which fields an order has", detail: "", ok: true, outcome: "ok", ms: 160 }, ], }); await page.goto("/data-sources"); @@ -454,6 +455,7 @@ test("a source in error status says the reviewer is not using it, and activity e const activity = page.locator("#activity"); await expect(activity.getByText("Reviewer on your-team/backend #123")).toBeVisible(); + await expect(activity.getByText("Planner on your-team/backend", { exact: true })).toBeVisible(); await expect(activity.getByText("admin@example.com")).toBeVisible(); await expect(activity.getByText(REFUSAL)).toBeVisible(); await expect(activity.getByText("Your API did not answer in time.")).toBeVisible(); diff --git a/dashboard/src/app/data-sources/page.tsx b/dashboard/src/app/data-sources/page.tsx index ee0ef58f..83cced24 100644 --- a/dashboard/src/app/data-sources/page.tsx +++ b/dashboard/src/app/data-sources/page.tsx @@ -5,7 +5,8 @@ import { useCallback, useEffect, useMemo, useState, type ReactNode } from "react import { api, type DataSource, type DataSourceActivityEvent } from "@/lib/api"; import { DEFAULT_HIDDEN_FIELDS, errorMessage, formatDuration, readSetupHint, clearSetupHint, - runningChecks, timeAgo, toCheckItems, + runningChecks, actorLabel, + timeAgo, toCheckItems, } from "@/lib/data-sources"; import { RoleGuard } from "@/components/role-guard"; import { useToast } from "@/components/toast"; @@ -65,10 +66,10 @@ function DataSourcesPage() { return (

- Let the reviewer check facts against your real systems + Let Coderhelm check facts against your real systems

- Connect a source and the reviewer can look things up while it reviews, like whether a field really exists or a + Connect a source and Coderhelm can look things up while it plans, writes code and reviews, like whether a field really exists or a setting is live. It can only read. It can never change your data.

{anyOn && ( @@ -558,9 +559,7 @@ function Activity({ events, error, loading }: { events: DataSourceActivityEvent[ )}

- {ev.actor === "reviewer" - ? ev.repo ? `Reviewer on ${ev.repo}${ev.pr ? ` #${ev.pr}` : ""}` : "Reviewer" - : ev.actor} + {actorLabel(ev)} {ev.source_name} diff --git a/dashboard/src/lib/data-sources.ts b/dashboard/src/lib/data-sources.ts index f0e6755b..4f371d30 100644 --- a/dashboard/src/lib/data-sources.ts +++ b/dashboard/src/lib/data-sources.ts @@ -119,3 +119,18 @@ export function prettyJson(text: string): string { export function errorMessage(e: unknown, fallback: string): string { return e instanceof Error && e.message ? e.message : fallback; } + +/** Agents that look things up, by the name the activity log records. */ +const AGENT_NAMES: Record = { + reviewer: "Reviewer", + planner: "Planner", + coder: "Coding agent", +}; + +/** Who ran a lookup: an agent and where it was working, or a person's email. */ +export function actorLabel(ev: { actor: string; repo?: string; pr?: number }): string { + const agent = AGENT_NAMES[ev.actor]; + if (!agent) return ev.actor; + if (!ev.repo) return agent; + return `${agent} on ${ev.repo}${ev.pr ? ` #${ev.pr}` : ""}`; +}