fix(webui): stop empty states re-deriving their own titles

A title that states the fact does not need a description that derives it:
the log, panels, lifecycle lists, dashboard cards, stages, skills and
captures empty states now say the fact once, and keep only the
descriptions that carry an action, a cause, or a distinct reading.
This commit is contained in:
sam committed 2026-09-21 00:56:24 +10:00
1 parent 578c0f5a2d
commit 050f833a23
43 files changed
+239 -315

No files matched your search

+2 -5
View File
@@ -19,8 +19,6 @@ const props = defineProps<{
attempt: number | null;
}>();
defineEmits<{ retry: [] }>();
const event = computed(() => selectConfigEvent(props.events, props.attempt));
// An unrecognised schema is shown verbatim with a note rather than
@@ -38,13 +36,12 @@ const recognised = computed(() => schema.value === CONFIG_SCHEMA);
<PanelError
v-else-if="events === null"
title="Could not load this task's events"
detail="The run configuration could not be read — retry, or check the daemon."
@retry="$emit('retry')"
detail="The run configuration could not be read. Live updates will try again when the daemon reconnects."
/>
<Empty v-else-if="!event">
<EmptyHeader>
<EmptyTitle>No configuration captured for attempt {{ attempt }}</EmptyTitle>
<EmptyTitle>No configuration captured</EmptyTitle>
</EmptyHeader>
</Empty>
+1 -4
View File
@@ -22,8 +22,6 @@ const props = defineProps<{
task: TaskRecord | null;
}>();
defineEmits<{ retry: [] }>();
const captures = computed(() => props.state?.captures || []);
// A capture event WAS recorded but its payload could not be read.
@@ -36,8 +34,7 @@ const nothingRecorded = computed(() => !props.state?.found || !captures.value.le
<PanelError
v-else-if="state === null"
title="Could not load this attempt's changed files"
detail="archied did not answer for this attempt. It may be restarting — retry, or check the daemon."
@retry="$emit('retry')"
detail="archied did not answer for this attempt. Live updates will try again when the daemon reconnects."
/>
<Empty v-else-if="undecodable">
+1 -3
View File
@@ -19,7 +19,6 @@ defineProps<{
attempt: number | null;
}>();
defineEmits<{ retry: [] }>();
</script>
<template>
@@ -27,8 +26,7 @@ defineEmits<{ retry: [] }>();
<PanelError
v-else-if="state === null"
title="Could not load the stored record"
detail="archied did not answer for this task's debug view. It may be restarting — retry, or check the daemon."
@retry="$emit('retry')"
detail="archied did not answer for this task's debug view. Live updates will try again when the daemon reconnects."
/>
<div v-else>
<p class="mb-3 text-sm text-fg-muted">The stored record and every event, verbatim.</p>
-4
View File
@@ -1,19 +1,15 @@
<script setup lang="ts">
import { Button } from "@/components/ui/button";
/**
* A panel whose read failed. A failed read is reported as a failed read: it is
* never dressed up as an empty result, which would be a claim about the run
* that nothing here can make.
*/
defineProps<{ title: string; detail: string }>();
defineEmits<{ retry: [] }>();
</script>
<template>
<div class="flex flex-col items-start gap-2 py-3">
<p class="font-medium">{{ title }}</p>
<p class="max-w-[60ch] text-sm text-fg-muted">{{ detail }}</p>
<Button variant="outline" @click="$emit('retry')">Retry</Button>
</div>
</template>
+1 -4
View File
@@ -25,7 +25,6 @@ import type { AttemptsState } from "./task-run";
* per-stage durations exist and only those are shown.
*/
const props = defineProps<{ state: AttemptsState | null | undefined }>();
defineEmits<{ retry: [] }>();
const run = useTaskRun();
@@ -53,8 +52,7 @@ const startedAt = computed(() => {
<PanelError
v-else-if="state === null"
title="Could not load this task's attempts"
detail="archied did not answer for this task's run history. It may be restarting — retry, or check the daemon."
@retry="$emit('retry')"
detail="archied did not answer for this task's run history. Live updates will try again when the daemon reconnects."
/>
<template v-else>
<Empty v-if="!attempts.length">
@@ -88,7 +86,6 @@ const startedAt = computed(() => {
<Empty v-else>
<EmptyHeader>
<EmptyTitle>No stages recorded for this attempt</EmptyTitle>
<EmptyDescription>The attempt exists, but nothing recorded a stage for it.</EmptyDescription>
</EmptyHeader>
</Empty>
<p class="mt-3 max-w-[70ch] text-xs text-fg-muted">
+2 -2
View File
@@ -49,7 +49,7 @@ const unavailable = computed(() => {
const errorText = computed(() => {
const err = run.retryError;
if (!err) return "";
if (err.kind === "session-expired") return "Your session has expired. Reload to sign in.";
if (err.kind === "session-expired") return "Dashboard authentication is required.";
if (err.kind === "refused") return `${err.message} — this run cannot be restarted from here.`;
return `${err.message} — try again, or check the daemon.`;
});
@@ -85,4 +85,4 @@ const errorText = computed(() => {
<Alert v-if="errorText" variant="destructive" class="mt-2">
<AlertDescription>{{ errorText }}</AlertDescription>
</Alert>
</template>
</template>
+3 -7
View File
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ArrowLeft, RefreshCw } from "@lucide/vue";
import { ArrowLeft } from "@lucide/vue";
import { computed } from "vue";
import { RouterLink } from "vue-router";
@@ -10,7 +10,7 @@ import { useTaskRun } from "./use-task-run";
/**
* The run page's head, one strip: the task, its workflow line, and the
* actions. Back and Refresh are page chrome; Start a new run lives here too,
* actions. Back is page chrome; Start a new run lives here too,
* since a restart is the page's one decision. The commit-discard consequence
* is stated in the confirm dialog, not beside the button. The forge
* coordinates (repo, issue, PR) sit at the row's far end: context, not
@@ -37,10 +37,6 @@ const workflow = computed(() => (run.task?.workflow ? `${run.task.workflow} work
Back to tasks
</RouterLink>
</Button>
<Button variant="outline" @click="run.refreshAll">
<RefreshCw data-icon="inline-start" />
Refresh
</Button>
<StartNewRun compact :id="id" class="mr-auto" />
<a
v-if="run.task?.repo_url"
@@ -71,4 +67,4 @@ const workflow = computed(() => (run.task?.workflow ? `${run.task.workflow} work
</a>
</div>
</div>
</template>
</template>
+5 -7
View File
@@ -46,7 +46,7 @@ const props = withDefaults(
},
);
defineEmits<{ retry: []; filter: [next: LogFilters] }>();
defineEmits<{ filter: [next: LogFilters] }>();
const resolvedAttempt = computed(() => Number(props.attempt) || Number(props.state?.attempt) || 0);
@@ -106,8 +106,9 @@ const download = computed(() =>
<PanelLoading v-if="view.kind === 'loading'" label="Loading attempt log…" />
<div v-else-if="view.kind === 'failed'" class="flex flex-col items-start gap-2 py-3">
<p class="text-sm text-fg-muted">Could not load this attempt's log.</p>
<Button variant="outline" @click="$emit('retry')">Retry</Button>
<p class="text-sm text-fg-muted">
Could not load this attempt's log. Live updates will try again when the daemon reconnects.
</p>
</div>
<Empty v-else-if="view.kind === 'nolog'">
@@ -120,16 +121,13 @@ const download = computed(() =>
<Empty v-else-if="view.kind === 'disabled'">
<EmptyHeader>
<EmptyTitle>No persisted log for this attempt</EmptyTitle>
<EmptyDescription>
This dashboard cannot read task logs. The service that owns the log files is not reporting a log reader.
</EmptyDescription>
<EmptyDescription>The log service is not reporting a reader, so the file cannot be read.</EmptyDescription>
</EmptyHeader>
</Empty>
<Empty v-else-if="view.kind === 'empty'">
<EmptyHeader>
<EmptyTitle>Nothing recorded</EmptyTitle>
<EmptyDescription>This attempt's log has no entries matching the current filter.</EmptyDescription>
</EmptyHeader>
<EmptyContent v-if="download">
<Button variant="outline" size="sm" as-child>
+5 -15
View File
@@ -84,10 +84,11 @@ const confirmLabel = computed(() => confirmingMeta.value?.label || "Confirm");
// A refused action ("you can't do that" -- bad input, a conflicting task state)
// is the operator's to correct; a broken one (5xx, network drop, timeout) is
// the daemon's, and says so. An expired session is neither, and gets its own
// treatment above rather than either framing.
// the daemon's, and says so. Authentication failures are surfaced by the app
// shell because they affect every request, not only this row.
const errorText = computed(() => {
if (!error.value) return "";
if (error.value.kind === "session-expired") return "Dashboard authentication is required.";
if (error.value.kind === "refused") return `${error.value.message} — you can't do that.`;
return `${error.value.message} — try again, or check the daemon.`;
});
@@ -152,12 +153,6 @@ function requestFromMenu(id: string) {
request(id);
}
// A full reload, not a router navigation: the point is to re-establish the
// session with whatever is in front of archied, which a client-side route
// change would leave exactly as it was.
function reloadPage() {
window.location.reload();
}
</script>
<template>
@@ -167,13 +162,8 @@ function reloadPage() {
variant="destructive"
class="w-56 gap-0.5 px-2 py-1.5 text-xs whitespace-normal"
>
<template v-if="error.kind === 'session-expired'">
<AlertTitle class="text-xs">Your session has expired</AlertTitle>
<AlertDescription class="text-xs">
<Button size="xs" variant="outline" @click.stop="reloadPage">Reload to sign in</Button>
</AlertDescription>
</template>
<AlertDescription v-else class="text-xs">{{ errorText }}</AlertDescription>
<AlertTitle v-if="error.kind === 'session-expired'" class="text-xs">Authentication required</AlertTitle>
<AlertDescription class="text-xs">{{ errorText }}</AlertDescription>
</Alert>
<!--
+4 -22
View File
@@ -1,6 +1,6 @@
<script setup lang="ts">
import { TabsContent } from "@/components/ui/tabs";
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
import AttemptConfig from "./AttemptConfig.vue";
import ChangedFiles from "./ChangedFiles.vue";
@@ -24,23 +24,11 @@ import { useTaskRun } from "./use-task-run";
const props = defineProps<{ id: string }>();
const run = useTaskRun();
function retryLogs(): void {
if (run.attemptNumber != null) run.loadLogs(run.attemptNumber, { force: true });
}
function retryChanges(): void {
if (run.attemptNumber != null) run.loadChanges(run.attemptNumber, { force: true });
}
function retryDebug(): void {
if (run.attemptNumber != null) run.loadDebug(run.attemptNumber, { force: true });
}
</script>
<template>
<TabsContent v-for="tab in RUN_TABS" :key="tab.id" :value="tab.id">
<StageRail v-if="tab.id === 'stages'" :state="run.attempts" @retry="run.loadAttempts" />
<StageRail v-if="tab.id === 'stages'" :state="run.attempts" />
<template v-else>
<PanelLoading v-if="run.attempts === undefined" label="Loading this task's attempts…" />
@@ -49,15 +37,11 @@ function retryDebug(): void {
v-else-if="run.attempts === null"
title="Could not load this task's attempts"
detail="The task's run history could not be read."
@retry="run.loadAttempts"
/>
<Empty v-else-if="run.attemptNumber == null">
<EmptyHeader>
<EmptyTitle>No attempt recorded</EmptyTitle>
<EmptyDescription>
This task has no recorded run.
</EmptyDescription>
</EmptyHeader>
</Empty>
@@ -69,19 +53,17 @@ function retryDebug(): void {
:filters="run.filters"
:task-id="props.id"
@filter="run.setFilters"
@retry="retryLogs"
/>
<ChangedFiles v-else-if="tab.id === 'changes'" :state="run.changesState" :task="run.task" @retry="retryChanges" />
<ChangedFiles v-else-if="tab.id === 'changes'" :state="run.changesState" :task="run.task" />
<AttemptConfig
v-else-if="tab.id === 'config'"
:events="run.events"
:attempt="run.attemptNumber"
@retry="run.loadEvents"
/>
<DebugView v-else-if="tab.id === 'debug'" :state="run.debugState" :attempt="run.attemptNumber" @retry="retryDebug" />
<DebugView v-else-if="tab.id === 'debug'" :state="run.debugState" :attempt="run.attemptNumber" />
</template>
</TabsContent>
</template>
+9 -46
View File
@@ -14,13 +14,12 @@ export function revealBehavior(): ScrollBehavior {
</script>
<script setup lang="ts">
import { RefreshCw } from "@lucide/vue";
import { computed, nextTick, onMounted, onUnmounted, ref, watch } from "vue";
import { computed, nextTick, onMounted, ref, watch } from "vue";
import { useRoute, useRouter } from "vue-router";
import { Button } from "@/components/ui/button";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { api, subscribeEvents } from "@/lib/api";
import { api } from "@/lib/api";
import { useLiveResource } from "@/stores/live-updates";
import TaskFilters, { initialTaskFilter, taskMatchesStatus } from "./TaskFilters.vue";
import type { Task } from "./TaskRow.vue";
import TaskTable from "./TaskTable.vue";
@@ -80,39 +79,6 @@ const state = computed<"loading" | "error" | "empty" | "no-match">(() => {
return "no-match";
});
onMounted(() => {
void load();
unsubscribe = subscribeEvents(handleEvent);
});
onUnmounted(() => {
clearTimeout(refreshTimer);
unsubscribe?.();
});
// The live stream is an invalidation signal, not data (the same rule the
// captures page follows): every task-shaped event says the authoritative list
// changed, and load() asks for it again. Stage progress fires several events a
// minute, so the re-read is debounced -- 500ms trailing, so a burst of events
// collapses into one fetch that lands after the last one.
const REFRESH_DEBOUNCE_MS = 500;
let refreshTimer: ReturnType<typeof setTimeout> | undefined;
let unsubscribe: (() => void) | undefined;
function handleEvent(raw: unknown): void {
const ev = raw as { kind?: string; task_id?: number | string } | null;
if (!ev) return;
// Task-shaped: anything carrying a task id (stage_start, agent_finish,
// outcome, parked, human_approved, ...) or a lifecycle kind of its own
// (task_queued, task_retried, ...). Chat turns and log lines never re-read
// the board.
if (!ev.task_id && !(typeof ev.kind === "string" && ev.kind.startsWith("task_"))) return;
clearTimeout(refreshTimer);
refreshTimer = setTimeout(() => {
void load();
}, REFRESH_DEBOUNCE_MS);
}
async function load() {
error.value = null;
try {
@@ -123,6 +89,9 @@ async function load() {
}
}
useLiveResource("tasks", () => void load(), 500);
onMounted(load);
// A filter change is a query-only route change, so it must not remount the
// list: the table keeps its identity and only its rows move. An empty status is
// dropped from the query rather than written as `?status=`.
@@ -168,22 +137,16 @@ async function reveal(id: number) {
<template>
<div>
<div class="mb-5 flex flex-wrap items-start justify-between gap-5">
<div class="mb-5">
<div>
<h1 class="text-3xl font-semibold tracking-[-0.03em]">Tasks</h1>
<p class="text-fg-muted mt-2 text-sm">Every issue archied has picked up, and where it stands.</p>
</div>
<div class="flex flex-wrap items-center gap-2">
<Button @click="load">
<RefreshCw data-icon="inline-start" />
Refresh
</Button>
</div>
</div>
<Card v-if="error">
<CardContent>
<TasksState kind="error" :detail="error" @retry="load" />
<TasksState kind="error" :detail="error" />
</CardContent>
</Card>
@@ -210,7 +173,7 @@ async function reveal(id: number) {
-->
<TaskTable :tasks="visible" :show-repo="showRepo" @done="load">
<template #state>
<TasksState :kind="state" @retry="load" @clear="clearFilters" />
<TasksState :kind="state" @clear="clearFilters" />
</template>
</TaskTable>
</CardContent>
+3 -8
View File
@@ -1,5 +1,4 @@
<script setup lang="ts">
import { RefreshCw } from "@lucide/vue";
import { computed } from "vue";
import { Button } from "@/components/ui/button";
@@ -15,7 +14,7 @@ type StateKind = "loading" | "error" | "empty" | "no-match";
const props = defineProps<{ kind: StateKind; detail?: string | null }>();
const emit = defineEmits<{ retry: []; clear: [] }>();
const emit = defineEmits<{ clear: [] }>();
const copy = computed(() => {
if (props.kind === "error") {
@@ -44,12 +43,8 @@ const copy = computed(() => {
<EmptyTitle>{{ copy.title }}</EmptyTitle>
<EmptyDescription>{{ copy.description }}</EmptyDescription>
</EmptyHeader>
<EmptyContent v-if="props.kind !== 'empty'">
<Button v-if="props.kind === 'error'" variant="outline" size="sm" @click="emit('retry')">
<RefreshCw data-icon="inline-start" />
Retry
</Button>
<Button v-else variant="ghost" size="sm" @click="emit('clear')">Clear filters</Button>
<EmptyContent v-if="props.kind === 'no-match'">
<Button variant="ghost" size="sm" @click="emit('clear')">Clear filters</Button>
</EmptyContent>
</Empty>
</template>
+3
View File
@@ -15,6 +15,7 @@ import { useRoute, useRouter } from "vue-router";
import { api, classifyActionError, type ActionErrorKind } from "@/lib/api";
import { actionFor } from "@/lib/task-meta";
import { useLiveResource } from "@/stores/live-updates";
import {
attemptKey,
@@ -250,6 +251,8 @@ export function provideTaskRun(id: ComputedRef<number | null>): TaskRun {
refreshToken.value += 1;
}
useLiveResource("tasks", refreshAll, 500);
async function performRetry(): Promise<void> {
if (id.value == null) return;
retryError.value = null;