diff --git a/ui/src/audit/DenialsPage.vue b/ui/src/audit/DenialsPage.vue index 0f5486887..93ef48801 100644 --- a/ui/src/audit/DenialsPage.vue +++ b/ui/src/audit/DenialsPage.vue @@ -49,7 +49,7 @@ onMounted(() => void store.load()); No denials recorded { }); const statuses = ref([]); +// A failed status read keeps the last known badges and flags the error, so a +// transient failure neither clears every badge nor passes as "all idle". +const statusError = ref(false); async function loadStatus() { try { statuses.value = (await api.channels<{ channels?: ChannelStatus[] }>())?.channels ?? []; + statusError.value = false; } catch { - statuses.value = []; + statusError.value = true; } } useLiveResource(null, () => void loadStatus()); @@ -147,6 +151,11 @@ function setModels(list: string[]) { {{ catalogError || error }} + + Couldn't load channel status + Retry + + diff --git a/ui/src/chat/ChatTranscript.vue b/ui/src/chat/ChatTranscript.vue index b85dee2db..2b8e4629f 100644 --- a/ui/src/chat/ChatTranscript.vue +++ b/ui/src/chat/ChatTranscript.vue @@ -16,11 +16,15 @@ import ChatBubble from "./ChatBubble.vue"; import ChatChooseCard from "./ChatChooseCard.vue"; import ChatUpdateCard from "./ChatUpdateCard.vue"; import ChatEmptyState from "./ChatEmptyState.vue"; +import { Alert, AlertDescription } from "@/components/ui/alert"; import { Skeleton } from "@/components/ui/skeleton"; import { + currentSession, isLoadingSession, messages, + selectSession, sendMessage, + sessionError, streamingTurn, type ChatMessage, reloadTranscript, @@ -90,6 +94,14 @@ useLiveResource("chat", () => void reloadTranscript()); + + {{ sessionError }} + Retry + + (null); export const selectorData = ref({}); @@ -255,7 +258,7 @@ export async function selectSession(id: string): Promise { streamingTurn.value = null; queuedMessages.value = []; isLoadingSession.value = true; - + sessionError.value = ""; try { // Resuming is the server's own command, so the transcript read below is of @@ -263,8 +266,9 @@ export async function selectSession(id: string): Promise { await api.chatMessage(channelID(), `/resume ${id}`); messages.value = await readTranscript(id); } catch (err) { - statusText.value = - (err as Error).message || "Could not load session messages"; + if (isCurrentSession(id)) + sessionError.value = + (err as Error).message || "Could not load session messages"; } finally { if (isCurrentSession(id)) isLoadingSession.value = false; } diff --git a/ui/src/components/command-palette/CommandPalette.vue b/ui/src/components/command-palette/CommandPalette.vue index 979303e42..e88e22ce5 100644 --- a/ui/src/components/command-palette/CommandPalette.vue +++ b/ui/src/components/command-palette/CommandPalette.vue @@ -46,8 +46,10 @@ const workflows = ref([]); const shortcut = navigator.platform.startsWith("Mac") ? "⌘K" : "Ctrl K"; const showWorkflows = computed(() => !props.hidden.includes("/workflows")); -// A failed read leaves that group empty: the pages still work, and the -// palette is not the place to report a broken task list. +// A failed read shows as an error item with Retry in that group, not as a +// missing group: the pages still work either way. +const tasksError = ref(false); +const workflowsError = ref(false); async function loadEntries(): Promise { const [taskPage, workflowList] = await Promise.all([ api.taskPage({ limit: 100 }).catch(() => null), @@ -55,7 +57,9 @@ async function loadEntries(): Promise { ? api.workflows<{ definitions?: { id: string }[] }>().catch(() => null) : null, ]); + tasksError.value = taskPage === null; tasks.value = taskPage?.tasks ?? []; + workflowsError.value = showWorkflows.value && workflowList === null; workflows.value = (workflowList?.definitions ?? []).map(({ id }) => id); } @@ -129,7 +133,10 @@ onUnmounted(() => document.removeEventListener("keydown", onGlobalKeydown)); {{ entry.label }} - + + Couldn't load workflows — Retry + + document.removeEventListener("keydown", onGlobalKeydown)); {{ id }} - + + Couldn't load tasks — Retry + + import { computed } from "vue"; +import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { @@ -16,8 +17,11 @@ import { eventTypeLabel } from "@/captures/event-types"; import { captures, capturesEnabled, + capturesError, draft, eventTypes, + eventTypesError, + loadMappings, selectCapture, type Capture, } from "./state"; @@ -49,9 +53,11 @@ function captureLabel(capture: Capture): string { return `${capture.source || "(unknown)"} · ${ago(capture.received_at)}`; } -/** What an empty picker means, which is not the same on every deployment. */ +/** What an empty picker means, which is not the same on every deployment. + * A failed read is not an empty store, so it shows no hint here -- the error + * row below says so and offers Retry. */ const captureHint = computed(() => { - if (captures.value.length) return null; + if (capturesError.value || captures.value.length) return null; return capturesEnabled.value ? "No captured events yet." : "Capture is not configured on this deployment."; @@ -83,6 +89,10 @@ const captureHint = computed(() => { + + Couldn't load event types + Retry + @@ -112,6 +122,10 @@ const captureHint = computed(() => { {{ captureHint }} + + Couldn't load captured events + Retry + diff --git a/ui/src/mappings/state.ts b/ui/src/mappings/state.ts index 8d72c02e4..c5faa7899 100644 --- a/ui/src/mappings/state.ts +++ b/ui/src/mappings/state.ts @@ -103,6 +103,10 @@ export const listLoading = ref(true); /** A failed list load. Distinct from an action failure: the list is unusable, * where a refused action leaves it perfectly readable. */ export const loadError = ref(null); +// The optional legs fail on their own: the flag says the picker's data is a +// failed read, not an empty store, so the form can offer Retry. +export const capturesError = ref(false); +export const eventTypesError = ref(false); /** Whether the editor overlay is showing the draft. */ export const editorOpen = ref(false); @@ -136,8 +140,8 @@ export async function loadMappings(): Promise { listLoading.value = true; try { // Capture storage is optional infrastructure -- a deployment can serve - // mappings without it -- so a failing capture leg degrades to an empty - // picker instead of taking the mappings list down with it. + // mappings without it -- so a failing capture leg flags the picker instead + // of taking the mappings list down with it. const [listed, captured, types] = await Promise.all([ api.mappings<{ mappings?: Mapping[] }>(useEventsStore().workspace), api @@ -149,6 +153,8 @@ export async function loadMappings(): Promise { eventTypes.value = types?.event_types || []; captures.value = captured?.captures || []; capturesEnabled.value = captured?.enabled !== false; + capturesError.value = captured === null; + eventTypesError.value = types === null; loadError.value = null; } catch (err) { loadError.value = String((err as Error).message || err); diff --git a/ui/src/sources/SourcesPanel.vue b/ui/src/sources/SourcesPanel.vue index 6fed5fa09..42126fba4 100644 --- a/ui/src/sources/SourcesPanel.vue +++ b/ui/src/sources/SourcesPanel.vue @@ -7,6 +7,7 @@ import { Badge } from "@/components/ui/badge"; import { Button } from "@/components/ui/button"; import { Section } from "@/components/ui/section"; import { Input } from "@/components/ui/input"; +import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty"; import { Table, TableBody, @@ -37,6 +38,7 @@ import { useSources } from "./use-sources"; */ const { sources, + loadError, failure, revealed, busy, @@ -96,6 +98,11 @@ function url(source: Source): string { {{ failure }} + + Couldn't load sources + {{ loadError }} Retry + + @@ -220,5 +227,9 @@ function url(source: Source): string { + + + No sources yet + diff --git a/ui/src/sources/use-sources.ts b/ui/src/sources/use-sources.ts index f4230e288..f63fa3169 100644 --- a/ui/src/sources/use-sources.ts +++ b/ui/src/sources/use-sources.ts @@ -12,6 +12,9 @@ import type { Source, SourceRefusals } from "./source-signing"; export function useSources() { // null means loading, [] means loaded and empty. const sources = ref(null); + // Read failures are kept apart from write failures: a failed load is not "a + // write that did not take effect", and belongs next to the list, with Retry. + const loadError = ref(null); const failure = ref(null); const revealed = ref(null); const refusals = ref>({}); @@ -30,8 +33,9 @@ export function useSources() { sources.value = res.sources || []; refusals.value = res.refusals || {}; failure.value = null; + loadError.value = null; } catch (err) { - failure.value = message(err); + loadError.value = message(err); } } @@ -51,6 +55,7 @@ export function useSources() { return { sources, + loadError, failure, revealed, refusals,
+ Couldn't load event types + Retry +
{{ captureHint }}
+ Couldn't load captured events + Retry +