fix(webui): task page drops filler copy, the unattributed-events note and the New run tooltip

This commit is contained in:
sam committed 2026-10-13 17:16:25 +11:00
1 parent 4fd6efb7f0
commit 20cb2fd99d
9 files changed
+81 -117

No files matched your search

+11 -18
View File
@@ -32,12 +32,8 @@ type taskAttemptsView struct {
TaskID int64 `json:"task_id"`
// CurrentAttempt is the task's own attempt, echoed so the page can show
// which run the daemon is on even when that attempt has no events yet.
CurrentAttempt int `json:"current_attempt"`
// UnattributedEvents counts events whose attempt is 0. It exists so the
// page can say honestly that older activity cannot be attributed instead
// of presenting it as a first run.
UnattributedEvents int `json:"unattributed_events"`
Attempts []taskAttemptView `json:"attempts"`
CurrentAttempt int `json:"current_attempt"`
Attempts []taskAttemptView `json:"attempts"`
// Inputs are what the task was started with; Outputs what its current
// attempt wrote; CalledBy the task whose workflow.call started it.
Inputs map[string]any `json:"inputs,omitempty"`
@@ -104,15 +100,14 @@ func (s *Server) handleTaskAttempts(w http.ResponseWriter, r *http.Request) {
return
}
}
attempts, unattributed := attemptsFromEvents(evs, steps, t.Status, t.Attempt)
attempts := attemptsFromEvents(evs, steps, t.Status, t.Attempt)
writeJSON(w, taskAttemptsView{
TaskID: t.ID,
CurrentAttempt: t.Attempt,
UnattributedEvents: unattributed,
Attempts: attempts,
Inputs: t.Inputs,
Outputs: t.Outputs,
CalledBy: t.CallParentTaskID,
TaskID: t.ID,
CurrentAttempt: t.Attempt,
Attempts: attempts,
Inputs: t.Inputs,
Outputs: t.Outputs,
CalledBy: t.CallParentTaskID,
})
}
@@ -163,13 +158,11 @@ func (s *Server) taskAttemptTarget(w http.ResponseWriter, r *http.Request) (*tas
// attemptsFromEvents groups a task's events by attempt and counts events with
// no attempt.
func attemptsFromEvents(evs []events.Event, steps []task.StepExecution, taskStatus string, currentAttempt int) ([]taskAttemptView, int) {
func attemptsFromEvents(evs []events.Event, steps []task.StepExecution, taskStatus string, currentAttempt int) []taskAttemptView {
grouped := make(map[int][]events.Event)
numbers := make([]int, 0, 4)
unattributed := 0
for _, e := range evs {
if e.Attempt == 0 {
unattributed++
continue
}
if _, seen := grouped[e.Attempt]; !seen {
@@ -183,7 +176,7 @@ func attemptsFromEvents(evs []events.Event, steps []task.StepExecution, taskStat
for _, number := range numbers {
attempts = append(attempts, attemptRail(number, grouped[number], stepsForAttempt(steps, number), taskStatus, currentAttempt))
}
return attempts, unattributed
return attempts
}
// stepsForAttempt filters ListSteps' full-execution result to one attempt's