fix(cron): clarify no-delivery previews

This commit is contained in:
Peter Steinberger
2026-05-03 22:49:03 +01:00
parent 545a7e5590
commit 0872b505b0
15 changed files with 105 additions and 13 deletions

View File

@@ -2404,6 +2404,11 @@
background: rgba(59, 130, 246, 0.1);
}
.data-table-badge--cron {
color: var(--success);
background: rgba(34, 197, 94, 0.1);
}
.data-table-badge--global {
color: var(--warn);
background: var(--warn-subtle);

View File

@@ -118,7 +118,11 @@ function hasOwn(record: Record<string, unknown>, key: string): boolean {
}
function normalizeSessionKind(value: unknown): GatewaySessionRow["kind"] | undefined {
return value === "direct" || value === "group" || value === "global" || value === "unknown"
return value === "cron" ||
value === "direct" ||
value === "group" ||
value === "global" ||
value === "unknown"
? value
: undefined;
}

View File

@@ -417,7 +417,7 @@ export type SessionCompactionCheckpointPreview = Pick<
export type GatewaySessionRow = {
key: string;
spawnedBy?: string;
kind: "direct" | "group" | "global" | "unknown";
kind: "cron" | "direct" | "group" | "global" | "unknown";
label?: string;
displayName?: string;
surface?: string;

View File

@@ -220,6 +220,26 @@ describe("sessions view", () => {
expect(keyCell?.getAttribute("title")).toBe("agent:unknown-agent:telegram:abc123");
});
it("renders cron session kind distinctly", async () => {
const container = document.createElement("div");
render(
renderSessions(
buildProps(
buildResult({
key: "agent:main:cron:daily-digest",
kind: "cron",
updatedAt: Date.now(),
}),
),
),
container,
);
await Promise.resolve();
const badge = container.querySelector(".data-table-badge--cron");
expect(badge?.textContent?.trim()).toBe("cron");
});
it("keeps raw keys for inherited identity object properties", async () => {
const container = document.createElement("div");
render(

View File

@@ -519,13 +519,15 @@ function renderRows(row: GatewaySessionRow, props: SessionsProps) {
? `${pathForTab("chat", props.basePath)}?session=${encodeURIComponent(row.key)}`
: null;
const badgeClass =
row.kind === "direct"
? "data-table-badge--direct"
: row.kind === "group"
? "data-table-badge--group"
: row.kind === "global"
? "data-table-badge--global"
: "data-table-badge--unknown";
row.kind === "cron"
? "data-table-badge--cron"
: row.kind === "direct"
? "data-table-badge--direct"
: row.kind === "group"
? "data-table-badge--group"
: row.kind === "global"
? "data-table-badge--global"
: "data-table-badge--unknown";
return [
html`<tr>