refactor(ui): audit leftovers use Alert, Item, CodeView and Tooltip

Inline error paragraphs become destructive Alerts, divided record lists
become Item rows, the redirect URI box uses CodeView, and icon-button
title hints use Tooltip. Native titles remain on truncated values and on
disabled controls.
This commit is contained in:
sam committed 2026-10-26 22:35:47 +11:00
1 parent efb9b011cd
commit a5137a4eca
35 files changed
+333 -243

No files matched your search

+4 -3
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Label } from "@/components/ui/label";
import { Input } from "@/components/ui/input";
import { SuggestInput } from "@/components/ui/suggest-input";
@@ -322,7 +323,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
placeholder="fixed value"
class="h-8 w-full font-mono text-xs"
/>
<p v-if="rows[name]!.from === 'path' && resolved(name).failure" class="text-xs text-danger">{{ resolved(name).failure }}</p>
<Alert v-if="rows[name]!.from === 'path' && resolved(name).failure" variant="destructive"><AlertDescription>{{ resolved(name).failure }}</AlertDescription></Alert>
<p v-else-if="rows[name]!.from === 'path' && resolved(name).value !== undefined" class="truncate font-mono text-xs text-success" :title="resolved(name).value">{{ resolved(name).value }}</p>
</div>
<div v-if="repository" class="space-y-1 px-3 py-2">
@@ -334,7 +335,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
placeholder="payload path"
class="h-8 w-full font-mono text-xs"
/>
<p v-if="resolved(REPOSITORY_FIELD).failure" class="text-xs text-danger">{{ resolved(REPOSITORY_FIELD).failure }}</p>
<Alert v-if="resolved(REPOSITORY_FIELD).failure" variant="destructive"><AlertDescription>{{ resolved(REPOSITORY_FIELD).failure }}</AlertDescription></Alert>
<p v-else-if="resolved(REPOSITORY_FIELD).value !== undefined" class="truncate font-mono text-xs text-success">{{ resolved(REPOSITORY_FIELD).value }}</p>
</div>
<p v-if="!inputs.length && !repository" class="px-3 py-2 text-xs text-fg-subtle">No inputs.</p>
@@ -342,7 +343,7 @@ const resume = () => transition(api.bindingResume, "pending_approval");
</section>
<div class="space-y-2">
<p v-if="error" role="alert" class="text-xs text-danger">{{ error }}</p>
<Alert v-if="error" variant="destructive"><AlertDescription>{{ error }}</AlertDescription></Alert>
<p v-else-if="blockers.length" class="text-xs text-fg-subtle">Cannot save: {{ blockers[0] }}</p>
<div class="flex flex-wrap gap-2">
<Button type="submit" size="sm" :disabled="saving || !!blockers.length"><Spinner v-if="saving" />Save binding</Button>
+3 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Label } from "@/components/ui/label";
import { computed, onMounted, ref } from "vue";
import { ArrowLeft } from "@lucide/vue";
@@ -191,7 +192,7 @@ async function remove(): Promise<void> {
<form v-else class="flex-1 space-y-5 overflow-y-auto px-4 py-4" @submit.prevent="save">
<section class="space-y-1.5">
<Label for="schedule-trigger" class="text-xs font-medium text-fg-muted">Schedule</Label>
<p v-if="loadError" class="text-xs text-danger" role="alert">{{ loadError }}</p>
<Alert v-if="loadError" variant="destructive"><AlertDescription>{{ loadError }}</AlertDescription></Alert>
<OptionSelect v-else id="schedule-trigger" aria-label="Schedule" :model-value="scheduleId" :options="scheduleOptions" class="w-full" @update:model-value="pickSchedule" />
</section>
@@ -212,7 +213,7 @@ async function remove(): Promise<void> {
</section>
<div class="space-y-2">
<p v-if="error" role="alert" class="text-xs text-danger">{{ error }}</p>
<Alert v-if="error" variant="destructive"><AlertDescription>{{ error }}</AlertDescription></Alert>
<p v-else-if="blockers.length" class="text-xs text-fg-subtle">Cannot save: {{ blockers[0] }}</p>
<div class="flex flex-wrap gap-2">
<Button type="submit" size="sm" :disabled="saving || !!blockers.length"><Spinner v-if="saving" />Save trigger</Button>
+3 -2
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Label } from "@/components/ui/label";
import { computed, ref, useId } from "vue";
import { ChevronDown, CircleHelp, Plus, Trash2 } from "@lucide/vue";
@@ -172,7 +173,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
<Input v-model="newBranch" :aria-label="type === 'switch' ? 'New case value' : 'New branch name'" :placeholder="type === 'switch' ? 'Value, or default' : 'Branch name'" @keydown.enter.prevent="changeBranch('add', newBranch.trim())" />
<Button type="button" size="icon-sm" variant="outline" :aria-label="type === 'switch' ? 'Add case' : 'Add branch'" :disabled="!newBranch.trim()" @click="changeBranch('add', newBranch.trim())"><Plus /></Button>
</div>
<p v-if="branchError" role="alert" class="text-xs text-danger">{{ branchError }}</p>
<Alert v-if="branchError" variant="destructive"><AlertDescription>{{ branchError }}</AlertDescription></Alert>
</section>
<section v-if="fields.lead" class="space-y-1.5">
@@ -275,7 +276,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
</section>
<section class="space-y-1.5">
<p v-if="flowProblem" role="alert" class="text-xs text-danger">{{ flowProblem }}</p>
<Alert v-if="flowProblem" variant="destructive"><AlertDescription>{{ flowProblem }}</AlertDescription></Alert>
<div class="divide-y divide-border rounded-md border border-border">
<Label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
<span class="flex-1 text-label" title="Empty always runs. A field such as inputs.enabled, !inputs.skip, or steps.plan.result.ready == true">Run only when</span>
+5 -4
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Item, ItemGroup } from "@/components/ui/item";
import { Button } from "@/components/ui/button";
import { computed, onUnmounted, ref, watch } from "vue";
import { api } from "@/lib/api";
@@ -118,12 +119,12 @@ const scopedLogs = computed(() => logs.value ? { ...logs.value, entries: (logs.v
</div>
<div v-if="group.tools.length" class="space-y-1">
<h4 class="text-caption font-medium uppercase text-fg-muted">Tool calls · {{ group.tools.length }}</h4>
<ol class="divide-y divide-border rounded-md border border-border">
<li v-for="(tool, i) in expanded ? group.tools : group.tools.slice(0, 12)" :key="i" class="px-3 py-2">
<ItemGroup class="gap-0">
<Item v-for="(tool, i) in expanded ? group.tools : group.tools.slice(0, 12)" :key="i" as="li" variant="outline" size="xs" class="block">
<div class="flex justify-between gap-2 text-xs"><span class="font-mono">{{ tool.data?.tool }}</span><span :class="tool.data?.failed ? 'text-danger' : 'text-fg-muted'">{{ tool.data?.failed ? 'Failed' : 'Returned' }}</span></div>
<p v-if="tool.detail" class="mt-1 break-words whitespace-pre-wrap text-xs text-fg-muted">{{ tool.detail }}</p>
</li>
</ol>
</Item>
</ItemGroup>
<Button v-if="group.tools.length > 12" type="button" variant="link" size="xs" class="px-0" @click="expanded = !expanded">{{ expanded ? 'Show first 12' : `Show all ${group.tools.length}` }}</Button>
</div>
<p v-if="group.reports.length" class="text-xs text-fg-muted">{{ group.reports.map((report) => describeTimelineEvent(report).detail).filter(Boolean).join(' · ') }}</p>
+19 -3
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { computed, nextTick, ref, watch } from "vue";
import { VueFlow, type NodeMouseEvent, type VueFlowStore } from "@vue-flow/core";
import { Background } from "@vue-flow/background";
@@ -317,9 +318,24 @@ const beforePath = computed(() => menuPath.value ? [...menuPath.value.slice(0, -
</VueFlow>
</div>
<div class="flex shrink-0 items-center justify-center gap-1 border-t border-border bg-card p-1">
<Button variant="ghost" size="icon-sm" title="Zoom in" aria-label="Zoom in" @click="flow?.zoomIn()"><Plus /></Button>
<Button variant="ghost" size="icon-sm" title="Zoom out" aria-label="Zoom out" @click="flow?.zoomOut()"><Minus /></Button>
<Button variant="ghost" size="icon-sm" title="Fit view" aria-label="Fit view" @click="place()"><Maximize /></Button>
<Tooltip>
<TooltipTrigger as-child>
<Button variant="ghost" size="icon-sm" aria-label="Zoom in" @click="flow?.zoomIn()"><Plus /></Button>
</TooltipTrigger>
<TooltipContent>Zoom in</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger as-child>
<Button variant="ghost" size="icon-sm" aria-label="Zoom out" @click="flow?.zoomOut()"><Minus /></Button>
</TooltipTrigger>
<TooltipContent>Zoom out</TooltipContent>
</Tooltip>
<Tooltip>
<TooltipTrigger as-child>
<Button variant="ghost" size="icon-sm" aria-label="Fit view" @click="place()"><Maximize /></Button>
</TooltipTrigger>
<TooltipContent>Fit view</TooltipContent>
</Tooltip>
</div>
<Dialog :open="phone && !!anchor" @update:open="!$event && anchor && emit('toggle', keyOf(anchor.data))">
<DialogContent v-if="anchor" class="max-h-[calc(100dvh-2rem)] overflow-y-auto" :aria-describedby="undefined">
+2 -1
View File
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Label } from "@/components/ui/label";
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
import { Input } from "@/components/ui/input";
@@ -94,7 +95,7 @@ const needs = computed<{ captures?: boolean; gate_retries?: number }>(() => {
@update:model-value="set('identity', $event)"
/>
</Label>
<p v-if="identitiesError" role="alert" class="px-3 py-2 text-xs text-danger">{{ identitiesError }} <Button variant="link" size="xs" @click="loadAgents">Retry</Button></p>
<Alert v-if="identitiesError" variant="destructive" class="m-3"><AlertDescription>{{ identitiesError }} <Button variant="link" size="xs" @click="loadAgents">Retry</Button></AlertDescription></Alert>
<p v-else-if="!identitiesLoading && !agents.length" class="px-3 py-2 text-xs text-fg-subtle">No active agents in your organisation.</p>
<Label class="flex min-h-10 items-center gap-3 px-3 py-1.5">
<span class="flex-1 text-label">Container profile</span>