Files
archie/ui/src/tasks/TaskRail.vue
T
sam 94f79177a2
deploy / gate (push) Successful in 4m53s
Quality / check (push) Successful in 6m42s
deploy / archied-image (push) Successful in 3m20s
deploy / agent-image (push) Successful in 11s
deploy / dist-zip (push) Skipped
fix(ui): adopt the type scale across components/ui and pages (#1758)
components/ui and the pages now use only the style.css scale:
text-[0.8rem]→text-label, text-[0.625rem]→text-micro, text-base/text-sm→
text-label (rows and controls), text-xs→text-caption (captions and
secondary text), text-lg/text-xl/text-2xl→text-title (panel and page
titles). Rendered markdown (ChatMarkdown/ChatInline/markdown.ts) keeps
Tailwind steps as the issue allows. 196 files, class-token swaps only.
2026-11-06 23:07:46 +11:00

78 lines
3.3 KiB
Vue

<script setup lang="ts">
import { computed } from "vue";
import { ArrowUpRight } from "@lucide/vue";
import { compact } from "@/lib/format";
import { cn } from "@/lib/utils";
import { stageStatusMeta } from "./stage-rail";
import { MetadataList } from "@/components/ui/metadata-list";
import { Section } from "@/components/ui/section";
import { StatusDot } from "@/components/ui/status-dot";
import { Timestamp } from "@/components/ui/timestamp";
import StageRail from "./StageRail.vue";
import { useTaskRun } from "./use-task-run";
import { duration } from "./timeline-event";
/** The task's right rail: every attempt with its outcome, the selected
* attempt's stages, and the task's details. */
const run = useTaskRun();
const attempts = computed(() => [...(run.attempts?.attempts ?? [])].reverse());
const tone = (status?: string) => stageStatusMeta(status).kind;
const details = computed(() => {
const task = run.task;
if (!task) return [];
const rows: { label: string; value: string; mono?: boolean; href?: string; arrow?: boolean }[] = [
{ label: "Workflow", value: task.workflow || "none" },
];
if (task.repo) rows.push({ label: "Repository", value: `${task.owner}/${task.repo}`, mono: true, href: task.repo_url });
if (task.issue_url && task.issue_number) rows.push({ label: "Issue", value: `#${task.issue_number}`, mono: true, href: task.issue_url, arrow: true });
if (task.tokens_used) rows.push({ label: "Tokens", value: compact(task.tokens_used), mono: true });
return rows;
});
</script>
<template>
<aside class="grid gap-4" aria-label="Task details">
<Section v-if="attempts.length" title="Attempts" class="mb-0">
<ul class="flex flex-col gap-0.5">
<li v-for="a in attempts" :key="a.attempt">
<button
type="button"
:aria-current="Number(a.attempt) === Number(run.attemptNumber) ? 'true' : undefined"
:class="
cn(
'flex w-full items-center gap-2.5 rounded-md px-3 py-2 text-left text-label transition-colors hover:bg-secondary',
Number(a.attempt) === Number(run.attemptNumber) && 'bg-secondary font-medium',
)
"
@click="run.selectAttempt(Number(a.attempt))"
>
<StatusDot :tone="tone(a.status)" />
<span class="flex-1">Attempt {{ a.attempt }}</span>
<span class="text-caption text-fg-subtle">{{ a.status ? stageStatusMeta(a.status).label : "" }}</span>
</button>
<p v-if="a.started_at" class="px-3 pb-1 pl-7 text-caption text-fg-subtle">
<Timestamp :at="a.started_at" /><template v-if="a.duration_ms"> · {{ duration(a.duration_ms) }}</template>
</p>
</li>
</ul>
</Section>
<Section title="Stages" class="mb-0">
<StageRail :state="run.attempts" />
</Section>
<Section v-if="run.task" title="Details" class="mb-0">
<MetadataList :rows="details">
<template #value="{ row }">
<a v-if="row.href" :href="row.href" target="_blank" rel="noreferrer" class="inline-flex items-center gap-0.5 hover:underline"
>{{ row.value }}<ArrowUpRight v-if="row.arrow" class="size-3" aria-hidden="true"
/></a>
<template v-else>{{ row.value }}</template>
</template>
</MetadataList>
</Section>
</aside>
</template>