mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:50:42 +00:00
fix(cron): clarify no-delivery previews
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user