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
@@ -23,6 +23,7 @@ const router = useRouter();
|
||||
const prompt = ref("");
|
||||
const workflow = ref("");
|
||||
const definitions = ref<WorkflowDefinition[]>([]);
|
||||
const loaded = ref(false);
|
||||
const loadError = ref("");
|
||||
const error = ref("");
|
||||
const submitting = ref(false);
|
||||
@@ -35,6 +36,8 @@ onMounted(async () => {
|
||||
workflow.value ||= definitions.value[0]?.id ?? "";
|
||||
} catch (err) {
|
||||
loadError.value = String((err as Error).message || err);
|
||||
} finally {
|
||||
loaded.value = true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -90,6 +93,7 @@ async function run() {
|
||||
<Button type="submit" :disabled="!prompt.trim() || !workflow || submitting"><Spinner v-if="submitting" data-icon="inline-start" />Run</Button>
|
||||
</div>
|
||||
<Alert v-if="loadError || error" variant="destructive"><AlertDescription>{{ loadError || error }}</AlertDescription></Alert>
|
||||
<p v-else-if="!loaded" class="text-caption text-fg-subtle" role="status">Loading workflows…</p>
|
||||
<p v-else-if="!definitions.length" class="text-caption text-fg-subtle">
|
||||
No enabled workflows. <RouterLink to="/workflows" class="underline">Enable one</RouterLink>
|
||||
</p>
|
||||
|
||||
Reference in new issue
Block a user