The page stacked five chrome strips before its content and every state wrote an essay. The head is now one strip -- title, workflow, actions, a single meta line -- the retry explainer is gone (the confirm dialog already carries the commit-discard consequence), and empty states say the fact in the title without a paragraph re-deriving it.
40 lines
1.3 KiB
Vue
40 lines
1.3 KiB
Vue
<script setup lang="ts">
|
|
import { AlertTriangle } from "@lucide/vue";
|
|
import { computed } from "vue";
|
|
|
|
import { Alert, AlertDescription } from "@/components/ui/alert";
|
|
|
|
import { useTaskRun } from "./use-task-run";
|
|
|
|
/**
|
|
* Two things the page can say about its own reads, both warnings rather than
|
|
* errors: the page still works, with less than it would like.
|
|
*
|
|
* The task list is the 100 most recently updated, so a task outside it is
|
|
* normal, and saying so is what stops an operator reading the missing status
|
|
* and controls as the task having none.
|
|
*/
|
|
const props = defineProps<{ id: string }>();
|
|
|
|
const run = useTaskRun();
|
|
|
|
const note = computed(() => {
|
|
if (run.taskList === null) {
|
|
return "The task list could not be read, so the current status and operator controls are unavailable.";
|
|
}
|
|
if (Array.isArray(run.taskList) && !run.task) {
|
|
return `Task ${props.id} is outside the recent-tasks list (the 100 most recently updated). Its recorded attempts are shown below.`;
|
|
}
|
|
return "";
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<!-- warn-soft rather than the Alert's default surface: this is a caution the
|
|
operator should read past, not a panel to look at. -->
|
|
<Alert v-if="note" class="mb-4 border-warn bg-warn-soft">
|
|
<AlertTriangle />
|
|
<AlertDescription>{{ note }}</AlertDescription>
|
|
</Alert>
|
|
</template>
|