fix(ui): disabled reasons and truncated values reachable without hover (#1752)
Quality / check (push) Canceled after 4m7s
deploy / gate (push) Successful in 4m49s
deploy / archied-image (push) Successful in 3m32s
deploy / agent-image (push) Successful in 12s
deploy / dist-zip (push) Skipped

Disabled New run and task-row buttons now carry their reason in a Tooltip
on a focusable wrapper (disabled buttons cannot take focus), and New run
says when the task list has not loaded. Truncated values (binding filter
and failure reason, activity rows, live alerts, event-type rule summaries,
source URLs, mapping field paths) are focusable spans whose full text is in
a Tooltip. The org switcher has distinct loading ('…' tile, 'Loading…')
and failed ('!' tile, 'Organisations unavailable') states.
This commit is contained in:
sam committed 2026-11-06 23:52:25 +11:00
1 parent d58125c0bc
commit 53c6b3e413
9 files changed
+69 -60

No files matched your search

+14 -11
View File
@@ -3,6 +3,7 @@ import { computed } from "vue";
import { Check, Pause, Pencil, Play, Trash2 } from "@lucide/vue";
import { Badge } from "@/components/ui/badge";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { Button } from "@/components/ui/button";
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
import { MoreMenu } from "@/components/ui/more-menu";
@@ -51,22 +52,24 @@ const emit = defineEmits<{
<Badge v-if="props.binding.unsigned" variant="warn">Unsigned</Badge>
</div>
</TableCell>
<TableCell
class="max-w-56 truncate font-mono text-caption text-fg-muted"
:title="props.binding.filter"
>
{{ props.binding.filter || "–" }}
<TableCell class="max-w-56 font-mono text-caption text-fg-muted">
<Tooltip>
<TooltipTrigger as-child>
<span tabindex="0" class="block truncate">{{ props.binding.filter || "–" }}</span>
</TooltipTrigger>
<TooltipContent v-if="props.binding.filter">{{ props.binding.filter }}</TooltipContent>
</Tooltip>
</TableCell>
<TableCell>
<div class="flex items-center gap-2">
{{ props.binding.workflow || "–" }}
<Badge v-if="props.binding.workflow_disabled" variant="warn">Disabled</Badge>
<Badge
v-if="failing"
variant="danger"
:title="props.binding.last_outcome?.reason"
>Not dispatching</Badge
>
<Tooltip v-if="failing">
<TooltipTrigger as-child>
<span tabindex="0" class="inline-flex"><Badge variant="danger">Not dispatching</Badge></span>
</TooltipTrigger>
<TooltipContent v-if="props.binding.last_outcome?.reason">{{ props.binding.last_outcome?.reason }}</TooltipContent>
</Tooltip>
</div>
</TableCell>
<TableCell class="font-mono text-fg-muted">{{
+3 -8
View File
@@ -1,5 +1,6 @@
<script setup lang="ts">
import { Spinner } from "@/components/ui/spinner";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import {
ClipboardPaste,
Pencil,
@@ -95,10 +96,7 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
fieldCount(p.schema)
}}</TableCell>
<TableCell class="font-mono text-caption"
><span
class="block max-w-96 truncate"
:title="ruleSummary(p.rule)"
>{{ ruleSummary(p.rule) }}</span
><Tooltip><TooltipTrigger as-child><span tabindex="0" class="block max-w-96 truncate">{{ ruleSummary(p.rule) }}</span></TooltipTrigger><TooltipContent>{{ ruleSummary(p.rule) }}</TooltipContent></Tooltip
></TableCell
>
<TableCell class="text-right">
@@ -126,10 +124,7 @@ function fieldCount(schema: Record<string, string> | null | undefined): number {
<TableCell class="font-mono">{{ t.source }}</TableCell>
<TableCell>{{ t.name }}</TableCell>
<TableCell class="font-mono text-caption"
><span
class="block max-w-96 truncate"
:title="ruleSummary(t.rule)"
>{{ ruleSummary(t.rule) }}</span
><Tooltip><TooltipTrigger as-child><span tabindex="0" class="block max-w-96 truncate">{{ ruleSummary(t.rule) }}</span></TooltipTrigger><TooltipContent>{{ ruleSummary(t.rule) }}</TooltipContent></Tooltip
></TableCell
>
<TableCell class="text-right whitespace-nowrap">
+2 -2
View File
@@ -47,10 +47,10 @@ async function choose(id: string): Promise<void> {
class="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground disabled:opacity-100"
>
<div class="bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg font-semibold">
{{ active ? initial(active.name) : "?" }}
{{ active ? initial(active.name) : failed ? "!" : "…" }}
</div>
<div class="grid flex-1 text-left leading-tight">
<span class="truncate text-label font-medium">{{ active?.name ?? (failed ? "Organisations unavailable" : "") }}</span>
<span class="truncate text-label font-medium">{{ active?.name ?? (failed ? "Organisations unavailable" : "Loading…") }}</span>
</div>
<ChevronsUpDown v-if="choices.length > 1" class="ml-auto" aria-hidden="true" />
</SidebarMenuButton>
+7 -5
View File
@@ -2,6 +2,7 @@
import { computed } from "vue";
import { TableCell, TableRow } from "@/components/ui/table";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { Timestamp } from "@/components/ui/timestamp";
import { useOrgStore } from "@/stores/org";
import { activityDetail } from "./activity-detail";
@@ -49,11 +50,12 @@ function open() {
taskID > 0 ? `#${taskID}` : "–"
}}</TableCell>
<TableCell class="w-[55%] max-w-0">
<span
class="block truncate"
:title="detail.truncated ? detail.full : undefined"
>{{ detail.text }}</span
>
<Tooltip>
<TooltipTrigger as-child>
<span tabindex="0" class="block truncate">{{ detail.text }}</span>
</TooltipTrigger>
<TooltipContent v-if="detail.truncated">{{ detail.full }}</TooltipContent>
</Tooltip>
</TableCell>
<TableCell><Timestamp :at="event.at" /></TableCell>
</TableRow>
+13 -10
View File
@@ -5,6 +5,7 @@ import { useRouter } from "vue-router";
import { ChevronDown, ChevronRight } from "@lucide/vue";
import { Badge } from "@/components/ui/badge";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { Section } from "@/components/ui/section";
import { StatusDot } from "@/components/ui/status-dot";
import { Timestamp } from "@/components/ui/timestamp";
@@ -132,7 +133,12 @@ function openTask(taskID: number) {
<TableCell class="font-mono">–</TableCell>
<TableCell class="w-[55%] max-w-0">
<span class="flex items-center gap-3">
<span class="min-w-0 flex-1 truncate" :title="alert.body || undefined">{{ alert.title }}</span>
<Tooltip>
<TooltipTrigger as-child>
<span tabindex="0" class="min-w-0 flex-1 truncate">{{ alert.title }}</span>
</TooltipTrigger>
<TooltipContent v-if="alert.body">{{ alert.body }}</TooltipContent>
</Tooltip>
<RouterLink v-if="alert.link" :to="alert.link" class="shrink-0 text-warn hover:underline">Fix →</RouterLink>
</span>
</TableCell>
@@ -202,15 +208,12 @@ function openTask(taskID: number) {
group.taskID > 0 ? `#${group.taskID}` : "–"
}}</TableCell>
<TableCell class="w-[55%] max-w-0">
<span
class="block truncate"
:title="
groupDetail(group).truncated
? groupDetail(group).full
: undefined
"
>{{ groupDetail(group).text }}</span
>
<Tooltip>
<TooltipTrigger as-child>
<span tabindex="0" class="block truncate">{{ groupDetail(group).text }}</span>
</TooltipTrigger>
<TooltipContent v-if="groupDetail(group).truncated">{{ groupDetail(group).full }}</TooltipContent>
</Tooltip>
</TableCell>
<TableCell><Timestamp :at="group.representative.at" /></TableCell>
</TableRow>
+2 -3
View File
@@ -2,6 +2,7 @@
import { Trash2 } from "@lucide/vue";
import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { Checkbox } from "@/components/ui/checkbox";
import { Input } from "@/components/ui/input";
import {
@@ -50,9 +51,7 @@ const emit = defineEmits<{
/>
</TableCell>
<TableCell class="font-mono text-caption">
<span class="block max-w-56 truncate" :title="field.path">{{
field.path
}}</span>
<Tooltip><TooltipTrigger as-child><span tabindex="0" class="block max-w-56 truncate">{{ field.path }}</span></TooltipTrigger><TooltipContent>{{ field.path }}</TooltipContent></Tooltip>
</TableCell>
<TableCell>
<Select
+1 -1
View File
@@ -126,7 +126,7 @@ function url(source: Source): string {
:disabled="busy"
@change="rename(source, ($event.target as HTMLInputElement).value)"
/>
<span class="truncate" :title="url(source)">{{ source.path }}</span>
<Tooltip><TooltipTrigger as-child><span tabindex="0" class="truncate">{{ source.path }}</span></TooltipTrigger><TooltipContent>{{ url(source) }}</TooltipContent></Tooltip>
<Input
class="h-6 border-transparent px-1 font-mono text-caption text-fg-muted shadow-none hover:border-input md:text-caption dark:bg-transparent"
:model-value="source.delivery_header ?? ''"
+18 -11
View File
@@ -15,6 +15,7 @@ import {
} from "@/components/ui/alert-dialog";
import { Alert, AlertDescription } from "@/components/ui/alert";
import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { Spinner } from "@/components/ui/spinner";
import { statusLabel } from "@/lib/task-meta";
@@ -43,7 +44,8 @@ const confirmText = computed(
);
const unavailable = computed(() => {
if (run.canRetry || run.taskList === undefined) return "";
if (run.taskList === undefined) return "The task list has not loaded yet.";
if (run.canRetry) return "";
return run.task
? `Only a parked task can start a new run. This task is ${statusLabel(run.task.status ?? "")}.`
: "";
@@ -62,16 +64,21 @@ const errorText = computed(() => {
<template>
<AlertDialog>
<AlertDialogTrigger as-child>
<Button
:class="props.class"
:variant="run.retryKind === 'primary' ? 'default' : 'outline'"
:disabled="!run.canRetry || run.retryBusy"
:title="unavailable || undefined"
>
<Spinner v-if="run.retryBusy" data-icon="inline-start" />{{ run.retryBusy ? "Starting…" : "New run" }}
</Button>
</AlertDialogTrigger>
<Tooltip>
<TooltipTrigger as-child>
<span tabindex="0" class="inline-flex" :class="props.class">
<AlertDialogTrigger as-child>
<Button
:variant="run.retryKind === 'primary' ? 'default' : 'outline'"
:disabled="!run.canRetry || run.retryBusy"
>
<Spinner v-if="run.retryBusy" data-icon="inline-start" />{{ run.retryBusy ? "Starting…" : "New run" }}
</Button>
</AlertDialogTrigger>
</span>
</TooltipTrigger>
<TooltipContent v-if="unavailable">{{ unavailable }}</TooltipContent>
</Tooltip>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>New run</AlertDialogTitle>
+9 -9
View File
@@ -15,6 +15,7 @@ import {
AlertDialogTitle,
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import {
Dialog,
DialogContent,
@@ -308,15 +309,14 @@ function onConfirmationOpen(open: boolean) {
>{{ control.label }}</a
>
</Button>
<Button
v-else
variant="ghost"
size="sm"
disabled
:title="`${control.label} is unavailable`"
>
{{ control.label }}
</Button>
<Tooltip v-else>
<TooltipTrigger as-child>
<span tabindex="0" class="inline-flex">
<Button variant="ghost" size="sm" disabled>{{ control.label }}</Button>
</span>
</TooltipTrigger>
<TooltipContent>{{ control.label }} is unavailable</TooltipContent>
</Tooltip>
</template>
<span v-if="overflowControls.length" class="contents" @click.stop><MoreMenu label="More actions">