fix(tasks): limit titles and display descriptions
This commit is contained in:
1 parent
1b8abd3509
commit
dcc201e7bb
6 files changed
+117
-76
No files matched your search
@@ -182,10 +182,10 @@ async function submit() {
|
||||
|
||||
<div class="grid gap-1.5">
|
||||
<label :for="`${uid}-title`" class="text-[13px] font-medium">Title</label>
|
||||
<Input :id="`${uid}-title`" v-model="title" required />
|
||||
<Input :id="`${uid}-title`" v-model="title" maxlength="80" required />
|
||||
</div>
|
||||
<div class="grid gap-1.5">
|
||||
<label :for="`${uid}-instr`" class="text-[13px] font-medium">Instructions</label>
|
||||
<label :for="`${uid}-instr`" class="text-[13px] font-medium">Description</label>
|
||||
<Textarea :id="`${uid}-instr`" v-model="instructions" :rows="4" required />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -16,6 +16,7 @@ import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { api } from "@/lib/api";
|
||||
import { runQuery, type LogState } from "./task-run";
|
||||
import { firstLine } from "./first-line";
|
||||
import { statusKind, statusLabel } from "@/lib/task-meta";
|
||||
import { cn } from "@/lib/utils";
|
||||
import DispatchLinks from "@/bindings/DispatchLinks.vue";
|
||||
@@ -32,7 +33,8 @@ import { useTaskRun } from "./use-task-run";
|
||||
const props = defineProps<{ id: string }>();
|
||||
const run = useTaskRun();
|
||||
|
||||
const title = computed(() => run.task?.title || `Task #${props.id}`);
|
||||
const title = computed(() => firstLine(run.task?.title || `Task #${props.id}`));
|
||||
const description = computed(() => run.task?.body?.trim() || (run.task?.title !== title.value ? run.task?.title : ""));
|
||||
const status = computed(() => run.task?.status ?? "");
|
||||
const router = useRouter();
|
||||
const attempt = computed(() => run.attempts?.attempts?.find((a) => a.attempt === run.attemptNumber));
|
||||
@@ -104,7 +106,7 @@ const headerActions = computed(() =>
|
||||
</Breadcrumb>
|
||||
<div class="flex flex-wrap items-start justify-between gap-4">
|
||||
<div class="min-w-0">
|
||||
<h1 class="text-2xl font-semibold">{{ title }}</h1>
|
||||
<h1 class="text-2xl font-semibold break-words text-balance">{{ title }}</h1>
|
||||
<div class="mt-2 flex flex-wrap items-center gap-x-3 gap-y-1 text-sm">
|
||||
<Badge v-if="status" :variant="statusKind(status)">{{ statusLabel(status) }}</Badge>
|
||||
<span v-if="run.task?.workflow" class="font-mono text-xs text-fg-muted">{{ run.task.workflow }}</span>
|
||||
@@ -138,6 +140,11 @@ const headerActions = computed(() =>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="description" class="mt-4">
|
||||
<h2 class="text-sm font-medium">Description</h2>
|
||||
<p class="mt-1 whitespace-pre-wrap break-words text-sm text-fg-muted">{{ description }}</p>
|
||||
</div>
|
||||
|
||||
<dl
|
||||
v-if="io.length || run.attempts?.called_by"
|
||||
class="mt-3 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-xs"
|
||||
|
||||
@@ -43,6 +43,7 @@ const LEGACY_TAB_IDS = new Set(["stages"]);
|
||||
export interface TaskRecord {
|
||||
id: number | string;
|
||||
title?: string;
|
||||
body?: string;
|
||||
status?: string;
|
||||
workflow?: string;
|
||||
owner?: string;
|
||||
|
||||
Reference in new issue
Block a user