From 7102c7e6a254cee407fb87b4c6779ebe0cc8ada0 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 21 Sep 2026 00:27:19 +1000 Subject: [PATCH] fix(webui): hide the attempt pager for zero or one attempt A one-page pager is the old text fact wearing extra chrome. The URL still names the attempt and the panels show it. --- ui/src/tasks/AttemptSelector.vue | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ui/src/tasks/AttemptSelector.vue b/ui/src/tasks/AttemptSelector.vue index 0a729c74c..a3ef3ecba 100644 --- a/ui/src/tasks/AttemptSelector.vue +++ b/ui/src/tasks/AttemptSelector.vue @@ -30,10 +30,16 @@ 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); + // 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 // URL (`?attempt=N`) the single source of truth. -const page = computed(() => (selected.value >= 0 ? selected.value + 1 : undefined)); +const page = computed(() => (selected.value >= 0 ? selected.value + 1 : 1)); function select(p: number): void { const attempt = attempts.value[p - 1]; @@ -43,9 +49,9 @@ function select(p: number): void {