From 39ad75ac22660cf3b481bee4cb4895813b81f2da Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Wed, 23 Sep 2026 11:20:45 +1000 Subject: [PATCH] feat(webui): split the task run page into a master-detail pane The five tabs gave the stage rail less than a third of the screen and disconnected the log stream from the stage that produced it. The stage rail is now the page's master pane, always visible; the four context panels are the inspector and own the tab bar. Selecting a stage commands the inspector to the log tab with that stage's filter set; clicking the selected stage clears it. Selection is a command, not a binding -- the operator can change the filter afterwards. No endpoint, RPC or contract changed. tab=stages still resolves, to the log tab; every inspector tab and attempt deep-link survives a reload. Below the shell's 900px frame breakpoint the rail stacks above the inspector. Design of record: docs/prds/task-run-master-detail.md (Draft, per-run panel contracts unchanged from task-run-detail.md). --- docs/data/generated/dev-docs.json | 10 ++++ docs/prds/task-run-master-detail.md | 57 +++++++++++++++++++++++ ui/src/tasks/StageRail.vue | 22 ++++++++- ui/src/tasks/StageRow.vue | 22 +++++++-- ui/src/tasks/TaskDetailPage.vue | 39 +++++++++++----- ui/src/tasks/TaskRunPanels.vue | 72 +++++++++++++---------------- ui/src/tasks/task-run.ts | 12 ++++- 7 files changed, 178 insertions(+), 56 deletions(-) create mode 100644 docs/prds/task-run-master-detail.md diff --git a/docs/data/generated/dev-docs.json b/docs/data/generated/dev-docs.json index 028d59606..1659ae3d8 100644 --- a/docs/data/generated/dev-docs.json +++ b/docs/data/generated/dev-docs.json @@ -414,6 +414,12 @@ "section": "PRDs", "body": "# Per-run task detail: attempts, stages, changes, config, debug\n\n**Status:** Approved\n**Authority:** the surface contract itself is\n`docs/architecture/observability.md`.\n**Date:** 2026-09-18\n**Compounds with:** `docs/prds/task-logs-pagination.md` (a bounded read says\nwhat it does not show), `docs/prds/status-health-surface.md` (no surface that\nanswers something already answered elsewhere).\n\n## Decision\n\nA task gets one detail page that answers \"what did this run actually do?\" per\n**attempt**: an ordered stage rail, the change each commit/push produced, the\neffective configuration the attempt ran under, the attempt's log, and the raw\nrecord behind all of it.\n\nThe single organising idea is **attempt attribution**. The dashboard\nrenders a task's whole event stream as one flat timeline, so a retried task\nreads as one long run with two of everything. Every new panel is scoped to one\nattempt and says which one.\n\nThe second organising idea is **provenance, not re-derivation**. What a run\nproduced is captured at the producer, while the evidence exists, and persisted\ndurably. Nothing in this surface tries to reconstruct a past run from state\nthat has since moved on.\n\n## The requirement set\n\n| # | Requirement | Mechanism |\n| --- | --- | --- |\n| R1 | Per-attempt stage rail: stages with name, start, duration, terminal status and error, ordered within one attempt | `GET /api/tasks/{id}/attempts` reads the task's events and groups them by `attempt` |\n| R2 | Events carry an attempt, migrated safely and carried on the wire | `events.attempt` column + presence-gated migrator arm; `Event.attempt = 11` |\n| R3 | Changed files captured at commit/push, persisted per task, exposed, shown with repo/PR links | `changes_captured` durable event written by the commit/push steps; `GET /api/tasks/{id}/changes` |\n| R4 | The effective configuration an attempt ran under, secrets redacted, shown | `config_captured` durable event written once per attempt; read from the events response the page already holds |\n| R5 | Log pane filters by attempt, stage and level; absence stays distinct from an unreadable deployment | `logging.Query.Stage` + `ReadTaskLogRequest.stage = 9`; the pane keeps `disabled` and `found=false` apart |\n| R6 | Retry is reachable from the run view and produces a new attempt shown as a new run | Existing retry action, labelled as a NEW run whose confirm states the previous attempt's commits are discarded |\n| R7 | Raw JSON of the task record and its events for the selected attempt | `GET /api/tasks/{id}/debug` |\n| R8 | Deep-linkable, reload-safe per-task detail page that keeps existing URLs working | `/tasks/{id}` route beside the existing `/tasks?task=N` and `/tasks?status=...` |\n| R9 | Design polish: hierarchy, tokens, both themes, responsive rail, a11y, loading/empty/error states | UI lane; measured at 480px and 700px in both themes |\n| R10 | Documentation of record | This document plus `docs/architecture/observability.md` |\n| R11 | Red-first tests for every new behaviour, full gate, `task ui`, forced `go build ./...`, `go test -race` on touched packages | Per lane; the anti-cost-cutting requirement lives here |\n\n## Attempt attribution: a column, not a guess\n\n`events.Event.Attempt`, persisted by `internal/store` as the `events.attempt`\ncolumn (`internal/store/events.go`, `eventsSchema`), is a real column,\n`NOT NULL DEFAULT 0`. It was chosen over segmenting the stream on `task_queued` /\n`task_retried` because a fold would have to guess which side of a boundary an\nevent belongs to when the daemon restarts mid-attempt, when `RecoverStale`\nrequeues, or when two attempts interleave across a crash. A guess rendered as\nstructure is exactly the false fidelity this surface exists to avoid; a column\nis durable, queryable and ordered by construction.\n\n**`0` means \"not attributable\".** It is every row written before this change\nplus the deliberately task-agnostic producers. It is not an attempt number and\nis never rendered as one. The attempts endpoint reports the count of\nunattributed events so the page can say so instead of presenting old history as\nattempt 1.\n\n## Migration against an existing `archie.db`\n\nThe store's migrator (`migrateTasks` in `internal/store/store.go`) already reads\n`PRAGMA table_info` through `tableColumns` and applies a presence-gated\n`ALTER TABLE ... ADD COLUMN` list. This change adds an `events` arm: a\n`tableColumns(ctx, tx, \"events\")` read beside the other two, and the entry\n`ALTER TABLE events ADD COLUMN attempt INTEGER NOT NULL DEFAULT 0`.\n\nThree consequences a future maintainer must not get wrong:\n\n- `eventsSchema` is `CREATE TABLE IF NOT EXISTS` (`internal/store/events.go`),\n so on an existing database it is a **no-op**. The migrator arm is the only\n thing that adds the column there. This is why the red test builds a raw\n SQLite file with the pre-change `events` DDL and must fail before the arm\n exists: every temp-database test passes either way.\n- **`user_version` stays 3.** The loop is presence-gated, not version-gated;\n bumping it would force an edit to the test that exists to prove a newer\n schema is refused.\n- **No backfill, ever.** Existing rows keep `attempt = 0`. Inferring an attempt\n number for them would be fabrication.\n\n## Changed files: captured at the producer\n\nThe measurement is taken inside the shared step library immediately after a\nsuccessful commit and after a successful push (`StageCommit` and\n`StageCommitPush` in `internal/domain/workflow/steps.go`) — the one place\nwhere the worktree, the branch, the base, the task and the store are all in\nscope, and the only place that knows a push actually happened.\n\nBoth alternatives were rejected on evidence, not taste:\n\n- **Reading the diff on demand** is impossible. The worktree is deleted on\n merge, close and no-PR terminal states (`internal/worktree.(*Manager).Cleanup`,\n called from the daemon's terminal paths) and a retry resets the branch onto\n its base (`internal/worktree.(*Manager).refresh` → `resetOnto`). There is\n nothing left to read.\n- **Reading it from the forge** is impossible. The forge contract exposes\n no changed-file capability, and adding one would cost three implementations\n plus an RPC and would still fail for chat-sourced tasks with no PR.\n\nBinding consequences:\n\n- Capture **degrades, never parks**. A `Trees` implementation without the\n capture seam captures nothing, logs, and lets the run continue. A reporting\n failure must never fail a task.\n- The value types live in `internal/domain/workflow/task` (`changes.go`), not in\n package `workflow` and not in `internal/worktree`. Package `workflow` has no\n import of `internal/worktree`, and this subpackage is not projected into the\n interpreted-stage symbol table, so declaring the types here widens nothing and\n needs no symbol-table regeneration. The capture method stays off that surface\n entirely.\n- `files` is capped at 200 entries because an event's `data` is not\n length-limited by the store. `totals` always covers the **full** set and\n `truncated: true` says when entries were dropped.\n- `binary` means \"no textual hunks\", not \"a binary file\". Rename pairing is\n go-git behaviour the lane pins with a test; where the repository records a\n rename as add + delete, the surface reports what was recorded.\n\n## Per-run configuration: a durable event, not a table\n\n**Decision.** The effective configuration an attempt ran under is persisted as a\n`config_captured` durable event (`internal/events.KindConfigCaptured`), on the\nsame attempt key R2 adds — not in a table, and not behind new RPCs.\n\n**Why.** Three reasons, in order of weight:\n\n1. Events are already this system's durable per-attempt provenance stream, and\n they demonstrably carry aggregation (`StageStats`, `TokensByDay` both\n aggregate over persisted events). R3 puts its diffstat there in this same\n change. A table plus two RPCs would have given one feature **two provenance\n mechanisms for one purpose**.\n2. It adds no RPC, so the ratified state-store surface is untouched and nothing\n in `docs/prds/state-store-contract.md` (rev 2c) changes.\n3. The page already fetches the task's events to build the rail (R1) and to read\n the diffstat (R3), so the document arrives in a fetch it already makes. There\n is nothing to join.\n\nThe single-row `config_snapshot` table is deliberately **left alone**. It\nanswers \"what is the running configuration now\", is replaced on every publish,\nand is pinned to one row by a test. It could not answer \"what did attempt 2 run\nunder\" in any case.\n\n**Payload.** The result of `config.Config.ForTask()` — the non-secret\ntask-runtime subset — plus the schema constant `archie/task-config@1`. Not the\ndashboard's configuration view: that is a larger projection carrying the full\nschema catalog, and it is the wrong object for this. Stored shape and the tab's\nread rule are in `docs/architecture/observability.md`.\n\n**Binding conditions.** It is emitted through the durable path, never the\nlossy bus; it is written once per attempt, not once per stage; redaction is\nproven **positively** by a canary-secrets test rather than assumed from the\nproducer's contract; the timeline gains one human line for it rather than\ndumping a JSON blob; and an attempt with no such event renders \"not captured for\nthis run\", never an empty table implying defaults applied.\n\n**Documented residual — the honest trust claim.** A task-scoped grant may insert\nevents on its own task ID; that is how `tool_call` and `agent_finish` already\nwork, so a task can in principle write its own `config_captured` event. This\n**widens no capability** — the grant could already insert arbitrary events on\nitself — but it does mean this provenance is exactly as trustworthy as the rest\nof that task's event stream, and no more. It is not tamper-proofing and must\nnever be described as such.\n\n## No new RPC and no new table\n\nThe entire wire change is two fields on existing messages:\n\n```proto\n// proto/state/v1/state.proto\nmessage Event { int64 attempt = 11; }\nmessage ReadTaskLogRequest { string stage = 9; }\n```\n\nNo RPC was added, no store table was added, and no new configuration field was\nintroduced. `docs/prds/state-store-contract.md` is unchanged because no ratified\ncontract changed; the JSON document rides an existing `data` column over an\nexisting RPC.\n\nBoth fields are tolerant in both directions, and the degrade is stated rather\nthan hidden: an old server makes `attempt` read as `0` and `stage` match\nnothing, so the page must say the deployment cannot attribute events to attempts\nrather than show one run labelled \"attempt 1\". An old client shows\n`config_captured` as an unknown kind, and the Config tab must then say \"this\ndeployment cannot read per-run configuration\" — a different claim from \"not\ncaptured for this attempt\".\n\n## Retry is a new run\n\nThe retry action is reachable from the run view and produces a new attempt that\nappears as a new run. It is a **fresh** run: it resets the branch onto\n`origin/\u003cbase\u003e` (`internal/worktree.(*Manager).refresh` → `resetOnto`) and\n**discards the previous attempt's commits**. Labelling it \"restart\" would imply\nresumption that does not happen, so the control and its confirm copy say so.\n\n## Honest limits the surface carries\n\nThese are the claims that would otherwise be overstated. Each is a copy or\nrendering rule, not a caveat in a comment:\n\n- **There is no exit code, so no stage shows pass/fail.** `stage_finish` carries\n a duration and an optional error string and nothing else. A stage `ok` means\n \"returned without error\", not \"the work was correct\". The agent's own verdict\n is shown separately from the rail. A stage that parks after finishing cleanly\n leaves that stage `ok` on a failed task, so attempt status is read together\n with task status.\n- **The log stage filter only matches lines the workflow bound a stage to.**\n Agent and tool output carries no stage and never matches. The pane states that\n coverage limit next to the control rather than presenting a filtered view as\n the whole story.\n- **Absence and unreadability are different answers.** A deployment that cannot\n read task logs says so; an attempt whose log does not exist says that. They\n are never collapsed, in either direction, for logs or for configuration.\n- **An empty changed-files view never means \"nothing changed\".** No capture\n exists for runs predating this change and the forge cannot supply one, so the\n empty state reads \"not captured for this run\".\n- **No run-duration figure is shown.** Per-stage durations only: a run can spend\n days in `waiting_human`, and one number would understate wall time.\n- **No duration is invented** for a stage with no `stage_start`; it reads \"not\n recorded\".\n- **Unattributed history is never presented as an attempt.** Events with\n `attempt = 0` are reported as a count, not guessed into a run.\n- **The configuration shown is the attempt's non-secret task-runtime subset** —\n bot identity, models, limits, budgets, dispatch, diff cap, notifications,\n forge host, tool policy. It is not the full dashboard configuration and must\n never imply it contains providers, repositories, identities or credentials.\n\n## Route and compatibility\n\n`/tasks/{id}` is the detail route; it is deep-linkable and reload-safe.\n`/tasks?task=N` and `/tasks?status=...` keep working and keep their existing\nbehaviour, including the nav highlight. The debug view is why the raw view\nexists at all: the task list response is capped, so a client-side join has no\nrow for an older task, and a debug view that silently hid events would be worse\nthan useless.\n\n## What this deliberately does not do\n\n- **No new RPC, table, store interface or configuration field.** Nothing here\n needed one, and each would have widened a ratified surface.\n- **No exit status, no pass/fail gate badge, no \"steps\" in the CI sense.** The\n reference layout is a CI pipeline; archie's stages are agent runs and the page\n must not borrow CI's claims.\n- **No backfill** of attempts, change captures or configurations onto runs that\n predate the change.\n- **No client-side join for configuration.** It arrives in the events response\n the page already fetches; there is nothing to join.\n- **No change to `docs/prds/state-store-contract.md`.** No ratified contract\n moved.\n\n## Files this change touches\n\n- `internal/store/`: the `events.attempt` column, its migrator arm, and the\n schema-presence test.\n- `internal/events/`: `Event.Attempt`, `KindChangesCaptured`,\n `KindConfigCaptured`, `ConfigCapturedSchema`.\n- `internal/domain/workflow/task/changes.go`: the change value types.\n- `internal/worktree/` + `internal/app/agentworker/`: the capture primitive and\n its production forwarding.\n- `internal/domain/workflow/steps.go`: the capture at commit and push.\n- `internal/daemon/`: the per-attempt configuration emit at dispatch.\n- `internal/logging/`: `Query.Stage`.\n- `internal/webui/`: the three read endpoints and the `stage` log parameter.\n- `proto/state/v1/state.proto` + generated stubs: the two field additions.\n- `ui/src/`: the detail page, the tab primitive, the rail, and the panel copy.\n- `docs/`: this document and `docs/architecture/observability.md`.\n\n## Acceptance\n\n1. Two attempts of one task render as two runs, and attempt 1's rail excludes\n attempt 2's stages.\n2. A task with no stages renders \"no stages recorded\", never an unexplained\n empty rail.\n3. A pre-change `archie.db` gains the `attempt` column with `user_version`\n still 3, and its old events are reported as unattributed.\n4. An attempt with a capture shows per-file added/deleted counts, status, repo\n and PR links; an attempt without one says so and never says \"no changes\".\n5. The Config tab shows the attempt's document for the selected attempt only,\n with no secret value present in the serialized document.\n6. Retry from the run view produces a new attempt shown as a new run, with copy\n stating the previous attempt's commits are discarded.\n7. The log stage filter narrows to stage-bound lines and the pane states the\n coverage limit; `disabled` and `found=false` remain distinguishable.\n8. `/tasks/{id}` survives reload, and `/tasks?task=N` / `/tasks?status=...`\n are unchanged.\n9. The debug view returns the task record and its unfiltered events, each\n carrying `attempt`.\n10. Run the gate and the dashboard build: `task check` passes clean, `task ui`\n has been run so `ui/dist` matches the sources, and every touched package\n builds and passes under `-race`.\n" }, + { + "url": "/dev/prds/task-run-master-detail/", + "title": "Task run detail as a master-detail split pane", + "section": "PRDs", + "body": "# Task run detail as a master-detail split pane\n\n**Status:** Draft\n**Authority:** the panel contracts stay as ratified in\n`docs/prds/task-run-detail.md`; this document changes only the run page's\narrangement of them.\n**Compounds with:** `docs/prds/task-run-detail.md` (attempt attribution, the\nlog stage filter, the per-panel honesty rules).\n\n## Decision\n\nThe run page's five tabs become two panes. The stage rail is the **master**,\nalways visible on the left. The four context panels — log, changed files,\nconfiguration, debug — are the **inspector** on the right, and their tab bar\nmoves into the inspector. The \"Stages\" tab stops existing: the rail is not a\nview of the page, it is the page's spine.\n\nSelecting a stage in the rail is a command, not a binding: it switches the\ninspector to the log tab and sets the log pane's stage filter to that stage.\nChanging the filter afterwards is the operator's choice and is not overridden.\nClearing the selection returns the filter to \"all stages\". Changed files,\nconfiguration and debug stay attempt-scoped; a stage selection never pretends\nto scope them.\n\n## What does not change\n\n- No new endpoint, RPC, table or configuration field. Every read is one the\n page already makes.\n- The URL contract: `tab` and `attempt` ride in the query string and every\n view survives a reload. `tab=stages` stays a valid URL and renders the\n inspector with the log tab; the page never generates it again.\n- Attempt attribution, the log stage filter's coverage limit, and every\n honesty rule in `task-run-detail.md`. Each pane states what it cannot show\n under the same rendering rules that document defines.\n- The attempt selector and the task header stay pinned above both panes.\n\n## Arrangement\n\n- Left pane: fixed-width rail (~320px) with the attempt's stage rows. Status,\n duration, error and per-stage events render in the rail; the rail scrolls\n independently.\n- Right pane: the inspector's tab bar plus the selected panel, filling the\n remaining width.\n- Below 900px (the shell's existing frame breakpoint) the rail stacks above\n the inspector; neither pane is hidden.\n- Keyboard: the rail keeps its list semantics; the inspector keeps the\n WAI-ARIA tabs pattern the tab bar already provides.\n\n## Acceptance\n\n1. The rail is visible without opening any tab, and no \"Stages\" trigger exists.\n2. Clicking a stage opens the log filtered to that stage; clearing the\n selection shows all stages.\n3. `tab=stages` loads and renders the log tab.\n4. Every inspector tab and attempt deep-link survives a reload.\n5. Below 900px the rail stacks above the inspector.\n6. `task check` passes clean and `ui/dist` matches the sources." + }, { "url": "/dev/prds/ui-service-boundary/", "title": "UI Service boundary and configuration ownership", @@ -715,6 +721,10 @@ "title": "Per-run task detail: attempts, stages, changes, config, debug", "url": "/dev/prds/task-run-detail/" }, + { + "title": "Task run detail as a master-detail split pane", + "url": "/dev/prds/task-run-master-detail/" + }, { "title": "UI Service boundary and configuration ownership", "url": "/dev/prds/ui-service-boundary/" diff --git a/docs/prds/task-run-master-detail.md b/docs/prds/task-run-master-detail.md new file mode 100644 index 000000000..c0e307ba0 --- /dev/null +++ b/docs/prds/task-run-master-detail.md @@ -0,0 +1,57 @@ +# Task run detail as a master-detail split pane + +**Status:** Draft +**Authority:** the panel contracts stay as ratified in +`docs/prds/task-run-detail.md`; this document changes only the run page's +arrangement of them. +**Compounds with:** `docs/prds/task-run-detail.md` (attempt attribution, the +log stage filter, the per-panel honesty rules). + +## Decision + +The run page's five tabs become two panes. The stage rail is the **master**, +always visible on the left. The four context panels — log, changed files, +configuration, debug — are the **inspector** on the right, and their tab bar +moves into the inspector. The "Stages" tab stops existing: the rail is not a +view of the page, it is the page's spine. + +Selecting a stage in the rail is a command, not a binding: it switches the +inspector to the log tab and sets the log pane's stage filter to that stage. +Changing the filter afterwards is the operator's choice and is not overridden. +Clearing the selection returns the filter to "all stages". Changed files, +configuration and debug stay attempt-scoped; a stage selection never pretends +to scope them. + +## What does not change + +- No new endpoint, RPC, table or configuration field. Every read is one the + page already makes. +- The URL contract: `tab` and `attempt` ride in the query string and every + view survives a reload. `tab=stages` stays a valid URL and renders the + inspector with the log tab; the page never generates it again. +- Attempt attribution, the log stage filter's coverage limit, and every + honesty rule in `task-run-detail.md`. Each pane states what it cannot show + under the same rendering rules that document defines. +- The attempt selector and the task header stay pinned above both panes. + +## Arrangement + +- Left pane: fixed-width rail (~320px) with the attempt's stage rows. Status, + duration, error and per-stage events render in the rail; the rail scrolls + independently. +- Right pane: the inspector's tab bar plus the selected panel, filling the + remaining width. +- Below 900px (the shell's existing frame breakpoint) the rail stacks above + the inspector; neither pane is hidden. +- Keyboard: the rail keeps its list semantics; the inspector keeps the + WAI-ARIA tabs pattern the tab bar already provides. + +## Acceptance + +1. The rail is visible without opening any tab, and no "Stages" trigger exists. +2. Clicking a stage opens the log filtered to that stage; clearing the + selection shows all stages. +3. `tab=stages` loads and renders the log tab. +4. Every inspector tab and attempt deep-link survives a reload. +5. Below 900px the rail stacks above the inspector. +6. `task check` passes clean and `ui/dist` matches the sources. \ No newline at end of file diff --git a/ui/src/tasks/StageRail.vue b/ui/src/tasks/StageRail.vue index bc37b4c9b..21b83fd61 100644 --- a/ui/src/tasks/StageRail.vue +++ b/ui/src/tasks/StageRail.vue @@ -9,7 +9,7 @@ import PanelLoading from "./PanelLoading.vue"; import StageRow from "./StageRow.vue"; import { stageStatusMeta } from "./stage-rail"; import { useTaskRun } from "./use-task-run"; -import type { AttemptsState } from "./task-run"; +import type { AttemptsState, Stage } from "./task-run"; /** * The per-attempt stage rail. @@ -35,6 +35,24 @@ const attempt = computed(() => attempts.value.find((a) => Number(a.attempt) === const meta = computed(() => stageStatusMeta(attempt.value?.status)); const stages = computed(() => attempt.value?.stages || []); +/** + * Master-detail selection (docs/prds/task-run-master-detail.md): clicking a + * stage commands the inspector to the log tab with this stage's filter set. + * Clicking the selected stage clears the filter back to all stages. The + * selection is a command, not a binding: the operator can change the filter + * afterwards and the rail does not fight them. A stage with no name has + * nothing to filter on and is not selectable. + */ +function selectedStage(stage: Stage): boolean { + return run.tab === "log" && Boolean(stage.name) && run.filters.stage === stage.name; +} + +function selectStage(stage: Stage): void { + if (!stage.name) return; + run.setFilters({ stage: selectedStage(stage) ? "" : stage.name, level: run.filters.level }); + run.setTab("log"); +} + /** An attempt's start is rendered as an absolute instant, never as "started 2 * days ago": on a still-running attempt a relative stamp reads as two days of * work, which is exactly the elapsed-time claim the design forbids. */ @@ -81,6 +99,8 @@ const startedAt = computed(() => { :stage="stage" :attempt-number="attempt.attempt" :events="run.events" + :selected="selectedStage(stage)" + @select="selectStage(stage)" /> diff --git a/ui/src/tasks/StageRow.vue b/ui/src/tasks/StageRow.vue index 761665134..0f9af51c5 100644 --- a/ui/src/tasks/StageRow.vue +++ b/ui/src/tasks/StageRow.vue @@ -19,8 +19,11 @@ const props = defineProps<{ stage: Stage; attemptNumber: number; events: TaskEvent[] | null | undefined; + selected?: boolean; }>(); +const emit = defineEmits<{ select: [] }>(); + const meta = computed(() => stageStatusMeta(props.stage.status)); const ran = computed(() => duration(props.stage.duration_ms)); const reports = computed(() => agentReports(props.events, props.attemptNumber, props.stage.name)); @@ -47,17 +50,28 @@ const nodeClass = computed(() => diff --git a/ui/src/tasks/TaskRunPanels.vue b/ui/src/tasks/TaskRunPanels.vue index a21be7df7..049bc80a8 100644 --- a/ui/src/tasks/TaskRunPanels.vue +++ b/ui/src/tasks/TaskRunPanels.vue @@ -7,19 +7,18 @@ import ChangedFiles from "./ChangedFiles.vue"; import DebugView from "./DebugView.vue"; import PanelError from "./PanelError.vue"; import PanelLoading from "./PanelLoading.vue"; -import StageRail from "./StageRail.vue"; import TaskLogs from "./TaskLogs.vue"; import { RUN_TABS } from "./task-run"; import { useTaskRun } from "./use-task-run"; /** - * The run page's panel area: one panel per tab, each reading the attempt the - * page has selected. + * The run page's inspector panels: one panel per tab, each reading the attempt + * the page has selected. The stage rail lives in the page's master pane and is + * not one of these tabs. * - * The rail owns its own loading, failure and empty states. Every other panel is - * scoped to one attempt, and "no attempt" is a claim only a successful read of - * the run history can make -- a read still in flight is not a verdict either, - * and a failed read is reported as a failed read. + * Every panel is scoped to one attempt, and "no attempt" is a claim only a + * successful read of the run history can make -- a read still in flight is not + * a verdict either, and a failed read is reported as a failed read. */ const props = defineProps<{ id: string }>(); @@ -28,42 +27,37 @@ const run = useTaskRun(); diff --git a/ui/src/tasks/task-run.ts b/ui/src/tasks/task-run.ts index 3cae3e0ab..015194626 100644 --- a/ui/src/tasks/task-run.ts +++ b/ui/src/tasks/task-run.ts @@ -21,8 +21,12 @@ export interface TaskRunTab { label: string; } +/** + * The inspector's tabs. The stage rail is not one of them: it is the page's + * master pane, always visible, and selecting a stage commands the inspector + * to the log tab with that stage's filter set (docs/prds/task-run-master-detail.md). + */ export const RUN_TABS: TaskRunTab[] = [ - { id: "stages", label: "Stages" }, { id: "log", label: "Log" }, { id: "changes", label: "Changed files" }, { id: "config", label: "Configuration" }, @@ -31,6 +35,9 @@ export const RUN_TABS: TaskRunTab[] = [ const TAB_IDS = new Set(RUN_TABS.map((tab) => tab.id)); +/** URL ids from before the split-pane layout that must keep resolving. */ +const LEGACY_TAB_IDS = new Set(["stages"]); + /** The task record as the task list serves it. */ export interface TaskRecord { id: number | string; @@ -149,6 +156,9 @@ export function parseTaskId(raw: unknown): number | null { export function initialTab(query: LocationQuery | undefined): string { const requested = String(query?.tab ?? ""); + // tab=stages named the rail before the split pane; the rail is now always + // visible, so the URL resolves to the inspector's first tab. + if (LEGACY_TAB_IDS.has(requested)) return "log"; return TAB_IDS.has(requested) ? requested : RUN_TABS[0].id; }