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

@@ -1673,9 +1673,15 @@ export async function loadRecordsPublic(exec: Exec, rows: OrganizationRecordRow[
.execute(),
]);
const iso = (v: Date | null) => (v ? v.toISOString() : null);
// blocked:* 的说明在 error.conflicts[].detail(中文),有就用它,不把内部串直接给人看
const conflictText = (err: unknown) =>
((err as { conflicts?: { detail?: string }[] } | null)?.conflicts ?? [])
.map((c) => c.detail)
.filter(Boolean)
.join(";");
const reason = (code: string | null, err: unknown) =>
code
? { code: code.split(":")[0]!, message: code }
? { code: code.split(":")[0]!, message: conflictText(err) || code }
: err
? {
code: (err as { code?: string }).code ?? "error",
@@ -523,6 +523,16 @@ function manualIdentityOptions(sourceReleaseId: string) {
];
}
/** 事项摘要里给人看的原因;原始代码仍记在 resolution_evidence */
const DETAIL_TEXT: Record<string, string> = {
no_viable_candidate: "没有可信候选",
unparseable_title: "标题无法解析",
weak_evidence: "证据不足",
multiple_candidates_same_level: "多个候选同级",
automation_off: "自动化已关闭",
};
const detailText = (d: string) => DETAIL_TEXT[d] ?? d;
async function toPool(
rt: SourcesRuntime,
release: SourceReleaseRow,
@@ -583,7 +593,7 @@ async function toPool(
kind: "identity_ambiguous",
severity: "info",
title: `待确认身份:${release.title}`,
summary: `${candidates.length} 个候选证据等级相近(${detail})。选择一个或忽略`,
summary: `${candidates.length} 个候选证据等级相近(${detailText(detail)})。选择一个或忽略`,
subjectType: "source_release",
subjectId: release.id,
dedupeKey: `identity:${release.id}`,
@@ -609,7 +619,7 @@ async function toPool(
summary:
reason === "lookup_failed"
? `元数据查询多次失败(${detail}),已停止自动复查。手动指定作品或忽略`
: `没有匹配的作品(${detail})。手动指定 TMDB ID、选本地作品或忽略`,
: `没有匹配的作品(${detailText(detail)})。手动指定 TMDB ID、选本地作品或忽略`,
subjectType: "source_release",
subjectId: release.id,
dedupeKey: `identity:${release.id}`,