From 042fdef671e5a94a19cf0299d14308a89cf2cf49 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 21 Sep 2026 00:43:41 +1000 Subject: [PATCH] fix(webui): settle the run page head around the attempt pager The head strip breaks into a full-width control row -- Back, Refresh, and Start a new run on the left, the forge coordinates pushed to the far edge -- and the meta row pairs the lifecycle badge with the attempt pager, which rides in from TaskMetaBar's slot. TaskMetaBar narrows to the served status badge; the forge links move out of it into the control row where the other navigation lives. --- ui/src/tasks/AttemptSelector.vue | 45 ++++++++++++++------------------ ui/src/tasks/StartNewRun.vue | 3 ++- ui/src/tasks/TaskDetailPage.vue | 8 +++--- ui/src/tasks/TaskHeader.vue | 35 ++++++++++++++++++++++--- ui/src/tasks/TaskMetaBar.vue | 34 +++--------------------- 5 files changed, 61 insertions(+), 64 deletions(-) diff --git a/ui/src/tasks/AttemptSelector.vue b/ui/src/tasks/AttemptSelector.vue index a3ef3ecba..d31fe4702 100644 --- a/ui/src/tasks/AttemptSelector.vue +++ b/ui/src/tasks/AttemptSelector.vue @@ -9,7 +9,6 @@ import { PaginationNext, PaginationPrevious, } from "@/components/ui/pagination"; - import { useTaskRun } from "./use-task-run"; /** @@ -19,22 +18,20 @@ import { useTaskRun } from "./use-task-run"; * rail reads the same response, so the two views of the same task's attempts * can never disagree about which one is on screen. * - * One attempt renders the rail anyway, disabled: the control states "there is - * exactly one run" by being inert rather than by disappearing, which is what - * the old text fact ("attempt 1 of 1") said without saying it as navigation. + * Hidden for zero or one attempt: a one-page pager is the text fact wearing + * extra chrome. The URL names the attempt either way, and the panels show + * which attempt is on screen. */ const run = useTaskRun(); const attempts = computed(() => run.attempts?.attempts ?? []); + const selected = computed(() => attempts.value.findIndex((a) => Number(a.attempt) === Number(run.attemptNumber)), ); -// Hidden for zero or one attempt: a one-page pager is the text fact with -// extra chrome. The URL names an attempt either way, and the panels below -// show which attempt is on screen. -const loaded = computed(() => (run.attempts?.attempts ?? []).length > 1); -const total = computed(() => (run.attempts?.attempts ?? []).length); +const loaded = computed(() => attempts.value.length > 1); +const total = computed(() => attempts.value.length); // reka's pagination counts pages over items; one attempt per page makes the // page number an index into the run history. The controlled page keeps the @@ -55,25 +52,23 @@ function select(p: number): void { :page="page" :sibling-count="1" aria-label="Attempts of this task" - class="mx-0" + class="mx-0 w-auto" @update:page="select" > - + - - - + diff --git a/ui/src/tasks/StartNewRun.vue b/ui/src/tasks/StartNewRun.vue index d6fec5c99..0f27b1c84 100644 --- a/ui/src/tasks/StartNewRun.vue +++ b/ui/src/tasks/StartNewRun.vue @@ -33,7 +33,7 @@ import { useTaskRun } from "./use-task-run"; * `compact` renders the bare control for the header's action row; on its own * the component also renders the disabled reason. */ -const props = defineProps<{ id?: string; compact?: boolean }>(); +const props = defineProps<{ id?: string; compact?: boolean; class?: string }>(); const run = useTaskRun(); @@ -59,6 +59,7 @@ const errorText = computed(() => { - + + + {{ run.task.owner }}/{{ run.task.repo }} + + + Issue #{{ run.task.issue_number }} + + + PR #{{ run.task.pr_number }} + \ No newline at end of file diff --git a/ui/src/tasks/TaskMetaBar.vue b/ui/src/tasks/TaskMetaBar.vue index 9797111b1..6d9029ffd 100644 --- a/ui/src/tasks/TaskMetaBar.vue +++ b/ui/src/tasks/TaskMetaBar.vue @@ -8,9 +8,9 @@ import { statusKind, statusLabel } from "@/lib/task-meta"; import { useTaskRun } from "./use-task-run"; /** - * One meta line under the title: lifecycle status, the attempt on screen, and - * the forge coordinates. Everything comes from reads the page already holds, - * so the bar costs no request of its own. + * The task's lifecycle status, plus whatever the page parks on the same row + * (the attempt pager rides here, pushed right). Everything comes from reads + * the page already holds, so the bar costs no request of its own. * * "Not read" and "loading" are kept apart from "no status": the task list is * a list of the 100 most recently updated, so a task outside it is a fact @@ -30,32 +30,6 @@ const taskStatusLabel = computed(() => statusLabel(run.task?.status ?? "")); - - {{ run.task.owner }}/{{ run.task.repo }} - - - Issue #{{ run.task.issue_number }} - - - PR #{{ run.task.pr_number }} - + \ No newline at end of file