fix(downloads): humanized reasons and TechInfo on the download panel (DL-2b)

- board organize hint uses DEAI-2 reasonLine; add transfer_failed, blocked,
  blocked_by_conflict, main_failed, not_imported_kind, target_root_not_managed,
  download_removed to the reason table with tests
- download detail / plans tab: internal ids, raw codes and JSON moved into TechInfo
- library versions tech block switched to TechInfo (TODO(DEAI-2))
- copy: glossary terms (no 接管/候选), plan reason codes no longer shown raw

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 22:00:04 +08:00
1 parent 8315ece4d1
commit 3f1c4d6c3b
11 files changed
+105 -65

No files matched your search

@@ -24,7 +24,7 @@ import { Button } from "~/components/ui/button.tsx";
import { relTime } from "~/components/workbench/release-fields.ts";
import { errorMessage } from "~/lib/api.ts";
import { planReasonText } from "~/lib/labels.ts";
import { humanizeReason, reasonLine } from "~/lib/reasons.ts";
import { humanizeReason, reasonCode, reasonLine } from "~/lib/reasons.ts";
import { formatBytes, formatDateTime } from "~/lib/utils.ts";
import { liveItems } from "./board-format.ts";
import { BusinessTimeline } from "./business-timeline.tsx";
@@ -162,7 +162,7 @@ export function DownloadDetail({ task, live }: { task: DownloadTask; live?: Down
<KvList
className="mt-3"
items={[
{ label: "下载器", value: names.data?.get(task.instanceId) ?? task.instanceId.slice(0, 8) },
{ label: "下载器", value: names.data?.get(task.instanceId) ?? "未知" },
{ label: "大小", value: task.sizeBytes === null ? "未知" : formatBytes(task.sizeBytes, 2) },
{ label: "剩余", value: task.remainingBytes === null ? "未知" : formatBytes(task.remainingBytes, 2) },
...liveItems(live),
@@ -181,6 +181,9 @@ export function DownloadDetail({ task, live }: { task: DownloadTask; live?: Down
{ label: "内容路径", value: task.contentPath, wide: true },
{ label: "torrent hash", value: task.torrentHash, wide: true },
{ label: "任务 ID", value: task.id, wide: true },
{ label: "下载器 ID", value: task.instanceId, wide: true },
importFailed ? { label: "整理失败原因码", value: reasonCode(importFailed.reason) } : null,
importFailed ? { label: "整理记录 ID", value: importFailed.id, wide: true } : null,
]}
>
{task.lastError ? <JsonView label="下载器错误原文" value={task.lastError} tone="destructive" /> : null}
@@ -201,7 +204,13 @@ export function DownloadDetail({ task, live }: { task: DownloadTask; live?: Down
{ label: "说明", value: planReasonText(plan.data.statusReason), wide: true },
]}
/>
<TechInfo className="mt-2">
<TechInfo
className="mt-2"
items={[
{ label: "计划 ID", value: plan.data.id, wide: true },
{ label: "说明原码", value: plan.data.statusReason },
]}
>
<JsonView label="评估依据" value={plan.data.evaluation} />
</TechInfo>
</DetailSection>