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:
43 files changed
+239
-315
No files matched your search
@@ -1,10 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { AlignLeft, ListChecks, RefreshCw, Route } from "@lucide/vue";
|
||||
import { AlignLeft, ListChecks, Route } from "@lucide/vue";
|
||||
import { computed } from "vue";
|
||||
import { RouterLink } from "vue-router";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { error, loadDashboard, tasks } from "./state";
|
||||
import { error, tasks } from "./state";
|
||||
import { dashboardTaskTargets } from "./task-targets";
|
||||
|
||||
/**
|
||||
@@ -16,11 +16,7 @@ const targets = computed(() => dashboardTaskTargets(tasks.value ?? []));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Button v-if="error" @click="loadDashboard">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Retry
|
||||
</Button>
|
||||
<template v-else-if="tasks !== null">
|
||||
<template v-if="!error && tasks !== null">
|
||||
<Button v-if="targets.attention.count > 0" variant="attention" as-child>
|
||||
<RouterLink :to="targets.attention.href">
|
||||
<ListChecks data-icon="inline-start" />
|
||||
@@ -39,9 +35,5 @@ const targets = computed(() => dashboardTaskTargets(tasks.value ?? []));
|
||||
Logs
|
||||
</RouterLink>
|
||||
</Button>
|
||||
<Button @click="loadDashboard">
|
||||
<RefreshCw data-icon="inline-start" />
|
||||
Refresh
|
||||
</Button>
|
||||
</template>
|
||||
</template>
|
||||
@@ -4,7 +4,7 @@ import { computed } from "vue";
|
||||
import Gauge from "@/base/Gauge.vue";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { summary, workflows } from "./state";
|
||||
|
||||
/** Sharer of runs: how much of the work that finished passed its gates. */
|
||||
@@ -27,7 +27,6 @@ const totals = computed(() => ({
|
||||
<Empty v-if="!totals.runs">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>No completed runs yet</EmptyTitle>
|
||||
<EmptyDescription>Once Archie finishes a task, its gate pass rate appears here.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<template v-else>
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
<script setup lang="ts">
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { Card, CardAction, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
|
||||
import { useLiveUpdatesStore } from "@/stores/live-updates";
|
||||
import ActivityRow from "./ActivityRow.vue";
|
||||
import { activity, streamStateKind, streamStateText } from "./state";
|
||||
|
||||
/** The last 50 events, newest first, with the stream's own state on the card. */
|
||||
|
||||
const router = useRouter();
|
||||
const { activity, streamKind, streamState } = storeToRefs(useLiveUpdatesStore());
|
||||
|
||||
function openTask(taskID: number) {
|
||||
void router.push(`/tasks?task=${encodeURIComponent(taskID)}`);
|
||||
@@ -23,7 +25,7 @@ function openTask(taskID: number) {
|
||||
<CardTitle>Live activity</CardTitle>
|
||||
<CardDescription>Last 50, newest first</CardDescription>
|
||||
<CardAction>
|
||||
<Badge :variant="streamStateKind">{{ streamStateText }}</Badge>
|
||||
<Badge :variant="streamKind">{{ streamState }}</Badge>
|
||||
</CardAction>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
@@ -50,7 +52,6 @@ function openTask(taskID: number) {
|
||||
<Empty>
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Waiting for activity</EmptyTitle>
|
||||
<EmptyDescription>Events appear here as Archie works.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
</TableCell>
|
||||
|
||||
@@ -3,7 +3,7 @@ import { computed } from "vue";
|
||||
|
||||
import SegmentBar from "@/base/SegmentBar.vue";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Empty, EmptyDescription, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
||||
import { compact } from "@/lib/format";
|
||||
import { summary } from "./state";
|
||||
|
||||
@@ -26,7 +26,6 @@ const projected = computed(() => Math.round(perDay.value * 30));
|
||||
<Empty v-if="!days.length">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>Nothing spent yet</EmptyTitle>
|
||||
<EmptyDescription>Usage appears here once Archie runs its first task.</EmptyDescription>
|
||||
</EmptyHeader>
|
||||
</Empty>
|
||||
<template v-else>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { onMounted, onUnmounted, ref } from "vue";
|
||||
import { onMounted, ref } from "vue";
|
||||
|
||||
import { api, subscribeEvents } from "@/lib/api";
|
||||
import type { StatusKind } from "@/lib/status";
|
||||
import { api } from "@/lib/api";
|
||||
import { useLiveResource } from "@/stores/live-updates";
|
||||
import type { ActivityDetailInput } from "./activity-detail";
|
||||
import type { Setup } from "./setup-preference";
|
||||
|
||||
@@ -53,9 +53,6 @@ export const workflows = ref<{ workflows?: WorkflowStat[] } | null>(null);
|
||||
export const tasks = ref<DashboardTask[] | null>(null);
|
||||
export const error = ref<string | null>(null);
|
||||
|
||||
export const activity = ref<ActivityEvent[]>([]);
|
||||
export const streamStateText = ref("connecting");
|
||||
export const streamStateKind = ref<StatusKind>("idle");
|
||||
export const taskIDsBySource = ref(new Map<string, number>());
|
||||
|
||||
export async function loadDashboard(): Promise<void> {
|
||||
@@ -95,23 +92,8 @@ export function taskIDFor(event: ActivityEvent): number {
|
||||
return taskIDForEvent(event, taskIDsBySource.value);
|
||||
}
|
||||
|
||||
let unsubscribe: (() => void) | undefined;
|
||||
|
||||
/** Owns the initial fetch and the event stream for the page's lifetime. */
|
||||
export function useDashboard(): void {
|
||||
onMounted(async () => {
|
||||
await loadDashboard();
|
||||
unsubscribe = subscribeEvents(
|
||||
(event) => {
|
||||
const next = [event as ActivityEvent, ...activity.value];
|
||||
next.splice(50);
|
||||
activity.value = next;
|
||||
},
|
||||
(state) => {
|
||||
streamStateText.value = state;
|
||||
streamStateKind.value = state === "live" ? "ok" : "warn";
|
||||
},
|
||||
);
|
||||
});
|
||||
onUnmounted(() => unsubscribe?.());
|
||||
useLiveResource("tasks", () => void loadDashboard(), 500);
|
||||
onMounted(loadDashboard);
|
||||
}
|
||||
Reference in new issue
Block a user