Run card mini-map and stage strip; graph edge hover highlight

The show_run card carries the run's graph and per-stage progress (bounded by
the graph, not the run length) and draws a still mini-map with the run graph
plus a stage strip with status, visits and time. Hovering or tapping an edge
in the pipeline and run graphs highlights it, its label and endpoints, with a
tooltip naming from -> to, the outcome and, for runs, how often it was taken.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-12-03 12:56:51 +00:00
parent c4de1de27b
commit 7872e57d40
17 changed files with 1709 additions and 51 deletions
+31
View File
@@ -97,6 +97,37 @@ type ChatShownRunBody struct {
Workspace string `json:"workspace,omitempty"`
StartedAt int64 `json:"started_at,omitempty"`
FinishedAt int64 `json:"finished_at,omitempty"`
// Map is the run's graph and per-stage progress for the card's mini-map
// and stage strip; nil when the server could not read it or the graph has
// more than ChatShownRunMapStages stages.
Map *ChatShownRunMap `json:"map,omitempty"`
}
// ChatShownRunMapStages bounds the graph a run card carries.
const ChatShownRunMapStages = 48
// ChatShownRunMap is a run's graph reduced to what a card draws: each
// declared stage's routes and progress, and the compact route evidence (the
// latest visit of every stage and of every taken route, in sequence order,
// as RunGraphEvidence). Its size is bounded by the graph, not by the run's
// length, so a long loop does not grow it.
type ChatShownRunMap struct {
Stages []ChatShownRunStage `json:"stages"`
Visits []RunGraphVisit `json:"visits"`
}
// ChatShownRunStage is one declared stage with its progress in the run.
// Seconds totals its finished visits; RunningSince (epoch milliseconds) is the
// start of a visit still running, so a client can add the live part.
type ChatShownRunStage struct {
Key string `json:"key"`
Type string `json:"type,omitempty"`
Edges map[string]string `json:"edges,omitempty"`
FallbackError bool `json:"fallback_error,omitempty"`
Visits int `json:"visits,omitempty"`
Status string `json:"status,omitempty"`
Seconds int64 `json:"seconds,omitempty"`
RunningSince int64 `json:"running_since,omitempty"`
}
// ChatShownDiffBody is one Git comparison a chat's model showed: the work tree