A keyed read whose request never settles pinned the panel's loading line forever; after a quiet minute the read is declared broken so the retry button appears, and the started-dedupe is released so it can run again. Also drops the download button from the log's empty state -- a log with nothing recorded has nothing to download -- and the leftover imports from the empty-state cuts.
62 lines
2.0 KiB
Vue
62 lines
2.0 KiB
Vue
<script setup lang="ts">
|
|
import { computed } from "vue";
|
|
|
|
import { Empty, EmptyHeader, EmptyTitle } from "@/components/ui/empty";
|
|
|
|
import ChangeCapture from "./ChangeCapture.vue";
|
|
import PanelError from "./PanelError.vue";
|
|
import PanelLoading from "./PanelLoading.vue";
|
|
import type { ChangesState, TaskRecord } from "./task-run";
|
|
|
|
/**
|
|
* What one attempt changed, as archied captured it.
|
|
*
|
|
* A capture with `found: true` and no readable payload is NOT reported as "no
|
|
* capture was recorded": the server reports `found` from the event's existence
|
|
* precisely so the two stay apart. One is a read failure, the other is a
|
|
* statement about the run -- and a statement this panel is not entitled to make
|
|
* on a read failure.
|
|
*/
|
|
const props = defineProps<{
|
|
state: ChangesState | null | undefined;
|
|
task: TaskRecord | null;
|
|
}>();
|
|
|
|
const captures = computed(() => props.state?.captures || []);
|
|
|
|
// A capture event WAS recorded but its payload could not be read.
|
|
const undecodable = computed(() => props.state?.found === true && !captures.value.length);
|
|
const nothingRecorded = computed(() => !props.state?.found || !captures.value.length);
|
|
</script>
|
|
|
|
<template>
|
|
<PanelLoading v-if="state === undefined" label="Loading changed files…" />
|
|
<PanelError
|
|
v-else-if="state === null"
|
|
title="Could not load this attempt's changed files"
|
|
detail="archied did not answer for this attempt. Live updates will try again when the daemon reconnects."
|
|
/>
|
|
|
|
<Empty v-else-if="undecodable">
|
|
<EmptyHeader>
|
|
<EmptyTitle>A change capture was recorded but could not be read</EmptyTitle>
|
|
</EmptyHeader>
|
|
</Empty>
|
|
|
|
<Empty v-else-if="nothingRecorded">
|
|
<EmptyHeader>
|
|
<EmptyTitle>No change capture recorded</EmptyTitle>
|
|
</EmptyHeader>
|
|
</Empty>
|
|
|
|
<div v-else class="flex flex-col">
|
|
<ChangeCapture
|
|
v-for="(capture, i) in captures"
|
|
:key="`${capture.captured_at || ''}:${i}`"
|
|
:capture="capture"
|
|
:task="task"
|
|
:class="i > 0 ? 'mt-5 border-t border-border pt-4' : ''"
|
|
/>
|
|
</div>
|
|
</template>
|