fix(ui): workflow list uses Progress; tooltip essays go; instructions lead workflow settings (#1957)
This commit is contained in:
6 files changed
+19
-18
No files matched your search
@@ -162,7 +162,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
|
||||
<section v-if="branching" class="space-y-3">
|
||||
<Label v-if="type === 'switch'" class="block space-y-1.5">
|
||||
<span class="text-caption font-medium text-fg-muted" title="The value whose case runs; a case named default runs when none matches">Switch on</span>
|
||||
<span class="text-caption font-medium text-fg-muted">Switch on</span>
|
||||
<SuggestInput :model-value="branching.on" class="font-mono" placeholder="steps.assess.result.fit" :options="earlier.map((id) => `steps.${id}.result.`)" @change="setOn(($event.target as HTMLInputElement).value.trim())" />
|
||||
</Label>
|
||||
<div class="text-caption font-medium text-fg-muted">{{ type === "switch" ? "Cases" : "Branches" }}</div>
|
||||
@@ -284,7 +284,7 @@ const ON_FAILURE = [{ value: "", label: "Park the task" }, { value: "continue",
|
||||
<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>
|
||||
<span class="flex-1 text-label">Run only when</span>
|
||||
<Input
|
||||
class="h-8 w-48 font-mono text-caption"
|
||||
placeholder="inputs.enabled"
|
||||
|
||||
@@ -175,7 +175,7 @@ function commitRename(event: Event): void {
|
||||
<span v-if="data.retry" class="flex items-center gap-0.5 rounded bg-secondary px-1" :title="`Up to ${data.retry} attempts`">
|
||||
<Repeat class="size-3" aria-hidden="true" />×{{ data.retry }}
|
||||
</span>
|
||||
<span v-if="data.continues" class="flex items-center gap-0.5 rounded bg-secondary px-1" title="A failure does not stop the run">
|
||||
<span v-if="data.continues" class="flex items-center gap-0.5 rounded bg-secondary px-1" title="Continues on failure">
|
||||
<SkipForward class="size-3" aria-hidden="true" />continues</span>
|
||||
</div>
|
||||
<p v-if="data.run?.error" class="mt-1 line-clamp-2 text-caption text-danger" :title="data.run.error">{{ data.run.error }}</p>
|
||||
|
||||
@@ -46,7 +46,7 @@ function open(trigger: WorkflowTrigger): void {
|
||||
<RouterLink v-else-if="trigger.kind === 'workflow' || trigger.kind === 'playbook'" :to="trigger.kind === 'workflow' ? { path: '/workflows', query: { workflow: trigger.label } } : { path: '/org/playbooks' }" class="flex items-center gap-2 px-3 py-2 hover:bg-secondary">
|
||||
<span class="truncate">{{ trigger.label }}</span><span class="ml-auto truncate text-caption text-fg-subtle">{{ trigger.detail }}</span>
|
||||
</RouterLink>
|
||||
<div v-else class="flex items-center gap-2 px-3 py-2" title="Built-in issue routing. Disable this workflow to stop it running automatically.">
|
||||
<div v-else class="flex items-center gap-2 px-3 py-2">
|
||||
<span class="truncate">{{ trigger.label }}</span>
|
||||
<Badge v-if="trigger.kind === 'issue'" variant="outline" class="ml-auto">Built-in</Badge>
|
||||
<span v-if="trigger.detail" class="ml-auto truncate text-caption text-fg-subtle">{{ trigger.detail }}</span>
|
||||
|
||||
@@ -69,6 +69,18 @@ const repository = computed(() => text("repository") || "required");
|
||||
|
||||
<template>
|
||||
<div class="space-y-4 px-3 py-3">
|
||||
<!-- The main field first: what the workflow is told, then how it runs. -->
|
||||
<section class="space-y-1.5">
|
||||
<Label for="workflow-instructions" class="text-caption font-medium text-fg-muted">Instructions</Label>
|
||||
<Textarea
|
||||
id="workflow-instructions"
|
||||
:model-value="text('instructions')"
|
||||
:rows="4"
|
||||
class="font-mono text-label"
|
||||
@change="set('instructions', ($event.target as HTMLTextAreaElement).value)"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<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">Runs as</span>
|
||||
@@ -104,16 +116,6 @@ const repository = computed(() => text("repository") || "required");
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<section class="space-y-1.5">
|
||||
<Label for="workflow-instructions" class="text-caption font-medium text-fg-muted">Instructions</Label>
|
||||
<Textarea
|
||||
id="workflow-instructions"
|
||||
:model-value="text('instructions')"
|
||||
:rows="4"
|
||||
class="font-mono text-label"
|
||||
@change="set('instructions', ($event.target as HTMLTextAreaElement).value)"
|
||||
/>
|
||||
</section>
|
||||
|
||||
<SpecList :yaml="yaml" field="outputs" @update:yaml="emit('update:yaml', $event)" />
|
||||
</div>
|
||||
|
||||
@@ -16,6 +16,7 @@ import { Badge } from "@/components/ui/badge";
|
||||
import { ContextMenu, ContextMenuContent, ContextMenuItem, ContextMenuTrigger } from "@/components/ui/context-menu";
|
||||
import { DropdownMenuItem } from "@/components/ui/dropdown-menu";
|
||||
import { MoreMenu } from "@/components/ui/more-menu";
|
||||
import { Progress } from "@/components/ui/progress";
|
||||
import { Section } from "@/components/ui/section";
|
||||
import { StatusDot } from "@/components/ui/status-dot";
|
||||
import { api, describeError } from "@/lib/api";
|
||||
@@ -232,9 +233,7 @@ const rate = (deliveredRuns = 0, total = 0) => (total ? deliveredRuns / total :
|
||||
</span>
|
||||
<span v-else-if="row.last_status" class="w-20 shrink-0 truncate" :title="`Latest run: ${statusLabel(row.last_status)}`">{{ statusLabel(row.last_status) }}</span>
|
||||
<span v-else-if="statsKnown" class="shrink-0">Never run</span>
|
||||
<span v-if="row.runs" class="h-1 flex-1 overflow-hidden rounded-full bg-border" role="img" :aria-label="`${delivered(row)} of ${row.runs ?? 0} runs delivered`" :title="`${delivered(row)} of ${row.runs ?? 0} runs delivered`">
|
||||
<span class="block h-full rounded-full bg-primary" :style="{ width: `${rate(delivered(row), row.runs) * 100}%` }" />
|
||||
</span>
|
||||
<Progress v-if="row.runs" :model-value="Math.round(rate(delivered(row), row.runs) * 100)" :aria-label="`${delivered(row)} of ${row.runs ?? 0} runs delivered`" class="h-1 flex-1" />
|
||||
<span v-if="row.runs" class="w-16 shrink-0 text-right font-mono" aria-hidden="true">{{ delivered(row) }}/{{ row.runs }}</span>
|
||||
</span>
|
||||
</button>
|
||||
|
||||
@@ -70,7 +70,7 @@ export function triggersFor(id: string, sources: TriggerSources): WorkflowTrigge
|
||||
if (workflow !== id) continue;
|
||||
triggers.push(
|
||||
kind === "default"
|
||||
? { kind: "issue", label: "Unlabelled issues", detail: "anything no label routes elsewhere" }
|
||||
? { kind: "issue", label: "Unlabelled issues" }
|
||||
: { kind: "issue", label: `Issues labelled ${kind}` },
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user