Expose all task actions in the task detail header (archie) #1846

Merged
sam merged 1 commits from feat/1000000000000000-expose-all-task-actions-in-the-task-detail-header into main 2026-11-10 06:54:29 +00:00
Owner

Exposed all server-authorized task lifecycle actions in the task detail header (/tasks/:id) via TaskRowActions.vue instead of restricting the header to ["archive", "merge"] and rendering StartNewRun.vue.

What Changed

  • ui/src/tasks/task-actions.ts: Added headerActionIds(task) to return all server-authorized actions (shownActionIds(task?.actions)) while omitting approve/reject when TaskApproval is active (approval === "plan" with non-empty plan) and omitting approve/rereview/reject when TaskReviewGate is active (status === "waiting_approval" with an active reviewGateOffer).
  • ui/src/tasks/TaskHeader.vue: Replaced HEAD_ACTIONS (["archive", "merge"]) and <StartNewRun compact :id="id" /> with headerActionIds(run.task) passed to TaskRowActions.
  • ui/src/tasks/task-run.ts, ui/src/tasks/use-task-run.ts, ui/src/tasks/StartNewRun.vue: Added branch, retry_mode, and source to TaskRecord so TaskRowActions has the fields needed for retry worktree mode selection and issue links; reset requestedAttempt in refreshAll() so new attempts become current on action completion; removed StartNewRun.vue and its unused retry state in use-task-run.ts.
  • ui/test/task-actions.test.ts: Added unit tests covering headerActionIds across parked, queued, running, waiting_approval (budget, plan, and review gate states), pr_open, and terminal states.

Verification

  • Ran pnpm --dir ui test (104/104 passing) and pnpm --dir ui typecheck.
  • Ran task check (all gate commands passed).

workflow: implement · 23 iterations · 641528 tokens (110856 fresh + 530672 cached)

Exposed all server-authorized task lifecycle actions in the task detail header (`/tasks/:id`) via `TaskRowActions.vue` instead of restricting the header to `["archive", "merge"]` and rendering `StartNewRun.vue`. ### What Changed - `ui/src/tasks/task-actions.ts`: Added `headerActionIds(task)` to return all server-authorized actions (`shownActionIds(task?.actions)`) while omitting `approve`/`reject` when `TaskApproval` is active (`approval === "plan"` with non-empty `plan`) and omitting `approve`/`rereview`/`reject` when `TaskReviewGate` is active (`status === "waiting_approval"` with an active `reviewGateOffer`). - `ui/src/tasks/TaskHeader.vue`: Replaced `HEAD_ACTIONS` (`["archive", "merge"]`) and `<StartNewRun compact :id="id" />` with `headerActionIds(run.task)` passed to `TaskRowActions`. - `ui/src/tasks/task-run.ts`, `ui/src/tasks/use-task-run.ts`, `ui/src/tasks/StartNewRun.vue`: Added `branch`, `retry_mode`, and `source` to `TaskRecord` so `TaskRowActions` has the fields needed for retry worktree mode selection and issue links; reset `requestedAttempt` in `refreshAll()` so new attempts become current on action completion; removed `StartNewRun.vue` and its unused retry state in `use-task-run.ts`. - `ui/test/task-actions.test.ts`: Added unit tests covering `headerActionIds` across `parked`, `queued`, `running`, `waiting_approval` (`budget`, `plan`, and `review` gate states), `pr_open`, and terminal states. ### Verification - Ran `pnpm --dir ui test` (104/104 passing) and `pnpm --dir ui typecheck`. - Ran `task check` (all gate commands passed). --- *workflow: implement · 23 iterations · 641528 tokens (110856 fresh + 530672 cached)*
sam added 1 commit 2026-11-10 06:08:44 +00:00
Expose all task actions in the task detail header (archie)
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Successful in 13m0s
9a9629400e
sam left a comment
Author
Owner

Findings outside the diff:

  • ui/src/tasks/use-task-run.ts:188: In provideTaskRun, taskList is initialized to undefined (pending) and typed as TaskRecord[] | null | undefined, where null represents a failed read consumed by TaskNotes.vue (if (run.taskList === null) -> "The task list could not be read, so the current status and operator controls are unavailable.").

However, loadTaskList()'s .catch() handler does nothing at all, so taskList.value is never set to null even when the initial /api/tasks request fails before any list has been loaded. As a result, run.taskList === null is unreachable and the warning banner in TaskNotes.vue is never shown on an initial task-list read failure.

Only preserving taskList.value when a list was already loaded (if (taskList.value === undefined) taskList.value = null;) keeps the last known list across refresh failures while still reporting an initial read failure.

Findings outside the diff: - `ui/src/tasks/use-task-run.ts:188`: In `provideTaskRun`, `taskList` is initialized to `undefined` (pending) and typed as `TaskRecord[] | null | undefined`, where `null` represents a failed read consumed by `TaskNotes.vue` (`if (run.taskList === null)` -> `"The task list could not be read, so the current status and operator controls are unavailable."`). However, `loadTaskList()`'s `.catch()` handler does nothing at all, so `taskList.value` is never set to `null` even when the initial `/api/tasks` request fails before any list has been loaded. As a result, `run.taskList === null` is unreachable and the warning banner in `TaskNotes.vue` is never shown on an initial task-list read failure. Only preserving `taskList.value` when a list was already loaded (`if (taskList.value === undefined) taskList.value = null;`) keeps the last known list across refresh failures while still reporting an initial read failure.
sam merged commit 47e3d8d837 into main 2026-11-10 06:54:29 +00:00
sam deleted branch feat/1000000000000000-expose-all-task-actions-in-the-task-detail-header 2026-11-10 06:54:29 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1846