feat(daemon): the timeline names and links the binding and capture that started a task

This commit is contained in:
sam committed 2026-10-05 20:39:26 +11:00
1 parent 8613d2564c
commit e16d06d588
8 files changed
+47 -25

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ const taskKinds = new Set([
"pr_merged",
"pr_rejected",
"pr_closed",
"binding_started",
"human_approved",
"human_rejected",
"human_rereviewed",
+9
View File
@@ -31,6 +31,15 @@ const line = computed(() => describeTimelineEvent(props.event));
<div v-if="line.detail" class="mt-0.5 text-xs text-fg-muted">
{{ line.detail }}
</div>
<div v-if="line.links?.length" class="mt-0.5 flex gap-3 text-xs">
<RouterLink
v-for="link in line.links"
:key="link.to"
:to="link.to"
class="text-fg-muted underline-offset-2 hover:text-foreground hover:underline"
>{{ link.label }}</RouterLink
>
</div>
<div class="mt-0.5 text-xs text-fg-subtle">{{ ago(event.at) }}</div>
</div>
</li>
+11 -6
View File
@@ -51,6 +51,8 @@ export interface TimelineLine {
detail: string;
/** Set for an event a reader must not skim past. */
tone?: "warn";
/** Records the event names, as dashboard paths. */
links?: { label: string; to: string }[];
}
export function describeTimelineEvent(ev: TaskEvent = {}): TimelineLine {
@@ -125,13 +127,16 @@ export function describeTimelineEvent(ev: TaskEvent = {}): TimelineLine {
detail: "The effective task-runtime configuration for this run.",
};
}
if (ev.kind === "unsigned_event") {
if (ev.kind === "binding_started") {
const source = text(data.source);
return {
title: "Started by an unsigned event",
detail: source ? `source ${source}` : "",
tone: "warn",
};
const capture = text(data.capture_id);
const links = [
{ label: `binding ${text(data.binding_name) || text(data.binding_id)}`, to: "/events?tab=bindings" },
...(capture ? [{ label: "captured event", to: `/events?tab=inspector&capture=${encodeURIComponent(capture)}` }] : []),
];
if (data.unsigned === true)
return { title: "Started by an unsigned event", detail: source ? `source ${source}` : "", tone: "warn", links };
return { title: "Started by an event", detail: source ? `source ${source}` : "", links };
}
if (ev.kind === "changes_captured") {
const totals = (data.totals ?? {}) as { files?: unknown };