fix: replace raw codes and internal IDs in the console with Chinese labels

Found in v0.2 visual QA (docs/plan/09-visual-qa.md):
- actor strings (admin_session:<uuid>, user:<uuid>, system) -> 管理员/系统/API Key
  in policy revisions, subscriptions, inbox, trash, business tasks, organize detail
- cache volume without key shows the downloader name instead of instance:<uuid>
- download timeline/plan: task and organize statuses, plan purpose, priority and
  status reason localized; audit gets labels for capability/files/site/feed actions
- organize record reason uses conflict detail (没有可入库的主视频) instead of
  blocked:no_main_video; slot/candidate reasons drop inflight:<uuid>
- identity decision summary no longer shows no_viable_candidate
- upstream test: 'Connection error.' classified as network, with a Chinese hint
- new policy draft prefills key default (placeholder looked like a value)
- dialog/sheet close sr-only text in Chinese

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-28 15:22:15 +08:00
1 parent d7eb6a45d0
commit 46d37d87fe
23 files changed
+176 -43

No files matched your search

+1
View File
@@ -24,6 +24,7 @@ const DECISION_FLAG: Record<string, { label: string; tone: OverlayFlag["tone"] }
reject: { label: "未选", tone: "warning" },
unknown_field: { label: "字段未知", tone: "warning" },
skipped: { label: "被跳过", tone: "neutral" },
deferred: { label: "延后", tone: "neutral" },
};
/** 该资源在各 Slot 上的最近一次评估(服务端每个 (Slot, 资源) 只保留一条) */
+13 -2
View File
@@ -10,6 +10,7 @@ import {
type TaskKind,
type TaskStatus,
} from "@umt/contracts";
import { organizationActionLabel, organizationLabel } from "~/lib/labels.ts";
import { PLAN_STATUS_LABEL } from "./downloads.ts";
import { apiParsed } from "./parse.ts";
@@ -96,6 +97,16 @@ export function useRecordsForDownload(downloadTaskId: string | undefined) {
});
}
const TASK_STATUS_TEXT: Record<string, string> = {
pending: "排队",
running: "运行中",
waiting: "等待",
succeeded: "成功",
failed: "失败",
cancelled: "已取消",
dead: "放弃",
};
const TASK_KIND_LABEL: Partial<Record<TaskKind, string>> = {
submitDownload: "提交下载",
verifyAndImport: "核验入库",
@@ -227,7 +238,7 @@ export function buildTimeline(input: {
key: `rec-${r.id}`,
stage: "organization",
at: r.startedAt ?? r.createdAt,
title: `整理 ${r.action === "copy" ? "复制" : r.action === "move" ? "移动" : r.action}:${r.status}`,
title: `整理 ${organizationActionLabel(r.action)}:${organizationLabel(r.status).label}`,
detail: `${c.succeeded}/${c.total} 文件成功${c.failed ? `,${c.failed} 失败` : ""}${c.skipped ? `,${c.skipped} 跳过` : ""}${r.reason ? ` · ${r.reason.message}` : ""}`,
tone: RECORD_TONE[r.status],
href: `/console/organize/${r.id}`,
@@ -262,7 +273,7 @@ export function buildTimeline(input: {
key: `task-${t.id}`,
stage: "engine",
at: t.startedAt ?? t.createdAt,
title: `任务 ${TASK_KIND_LABEL[t.kind] ?? t.kind}:${t.status}`,
title: `任务 ${TASK_KIND_LABEL[t.kind] ?? t.kind}:${TASK_STATUS_TEXT[t.status] ?? t.status}`,
detail:
[t.attempts > 1 ? `第 ${t.attempts} 次尝试` : null, t.waitReason, err].filter(Boolean).join(" · ") || null,
tone: TASK_STATUS_TONE[t.status],