fix(ui): empty states wait for the first read to settle (#1742)
Skills, curators, QuickTask's workflow list, the alerts bell and the extensions catalogue now show a loading state until the first read settles, then the data, the error, or the empty state. Draft-backed lists (agent profiles, playbooks, credential bindings) show their empty state only once the draft exists, not beside the load error.
This commit is contained in:
10 files changed
+28
-7
No files matched your search
@@ -51,7 +51,7 @@ function patch(key: string, changes: Partial<Profile>) {
|
||||
<Input v-model="name" aria-label="Profile name" placeholder="Profile name" class="max-w-xs" :disabled="unsaved" />
|
||||
<Button type="submit" :disabled="unsaved || !name.trim() || !!profiles?.[name.trim()]">Add profile</Button>
|
||||
</form>
|
||||
<Empty v-if="!Object.keys(profiles ?? {}).length"><EmptyHeader><EmptyTitle>No agent profiles</EmptyTitle></EmptyHeader></Empty>
|
||||
<Empty v-if="profiles && !Object.keys(profiles).length"><EmptyHeader><EmptyTitle>No agent profiles</EmptyTitle></EmptyHeader></Empty>
|
||||
<CardAccordion v-model:open="open" :items="entries" :title="([key]) => key" remove-label="Remove" mono @remove="removeProfile">
|
||||
<template #default="{ item: [key, profile] }">
|
||||
<FieldGroup class="@container/field-group">
|
||||
|
||||
@@ -51,7 +51,7 @@ function patch(index: number, changes: Partial<Binding>) {
|
||||
<PageHeader title="Credential bindings"><HistoryLink :kinds="[KIND]" /><Button :disabled="unsaved" @click="add">Add binding</Button></PageHeader>
|
||||
<ApplyStatusRows :kind="KIND" class="mb-4" />
|
||||
<Alert v-if="store.catalogError || store.pageErrorFor(KIND)" variant="destructive" class="mb-4"><AlertDescription>{{ store.catalogError || store.pageErrorFor(KIND) }}</AlertDescription></Alert>
|
||||
<Empty v-if="!bindings?.length"><EmptyHeader><EmptyTitle>No credential bindings</EmptyTitle></EmptyHeader></Empty>
|
||||
<Empty v-if="bindings && !bindings.length"><EmptyHeader><EmptyTitle>No credential bindings</EmptyTitle></EmptyHeader></Empty>
|
||||
<CardAccordion v-model:open="open" :items="bindings ?? []" :title="(b) => b.service || 'New binding'" remove-label="Remove" mono @remove="remove">
|
||||
<template #default="{ item: binding, index }">
|
||||
<FieldGroup class="@container/field-group">
|
||||
|
||||
@@ -96,7 +96,8 @@ const groups = computed(() => {
|
||||
</ul>
|
||||
</section>
|
||||
|
||||
<Empty v-if="!groups.length" class="py-6">
|
||||
<p v-if="!store.catalogueLoaded && !store.catalogueError" class="py-6 text-center text-label text-fg-muted" role="status">Loading catalogue…</p>
|
||||
<Empty v-else-if="!groups.length" class="py-6">
|
||||
<EmptyHeader>
|
||||
<EmptyTitle>{{ store.catalogue.length ? "No extensions match" : "The catalogue is empty" }}</EmptyTitle>
|
||||
</EmptyHeader>
|
||||
|
||||
@@ -41,7 +41,7 @@ function remove(index: number) {
|
||||
<ApplyStatusRows :kind="KIND" class="mb-4" />
|
||||
<Alert v-if="store.catalogError || store.pageErrorFor(KIND)" variant="destructive" class="mb-4"><AlertDescription>{{ store.catalogError || store.pageErrorFor(KIND) }}</AlertDescription></Alert>
|
||||
<form class="mb-4 flex flex-wrap gap-2" @submit.prevent="add"><Input v-model="id" aria-label="Playbook ID" placeholder="Playbook ID" class="max-w-xs" :disabled="unsaved" /><Button type="submit" :disabled="unsaved || !id.trim() || collection?.playbooks.some(entry => entry.id === id.trim())">Add playbook</Button></form>
|
||||
<Empty v-if="!collection?.playbooks.length"><EmptyHeader><EmptyTitle>No playbooks installed</EmptyTitle></EmptyHeader></Empty>
|
||||
<Empty v-if="collection && !collection.playbooks.length"><EmptyHeader><EmptyTitle>No playbooks installed</EmptyTitle></EmptyHeader></Empty>
|
||||
<CardAccordion v-model:open="open" :items="collection?.playbooks ?? []" :title="(entry) => entry.id" remove-label="Remove" mono @remove="remove">
|
||||
<template #default="{ item: entry, index }">
|
||||
<form.Field v-if="form" v-slot="{ field }" :name="`playbooks[${index}].yaml`">
|
||||
|
||||
Reference in new issue
Block a user