文案(文件管理):按 human-copy 重写对话框、状态、菜单与提示
- 永久删除的说明改成实际开关 FILES_ALLOW_PERMANENT_DELETE,去掉「在设置里开启」的错误说法 - 去掉「待处理」「仅 TMDB」「目录根」等旧称,收录版本退回状态写「需处理」 - 删除、移动/复制、重命名、刮削、刷新元数据对话框去掉复述界面的说明 - 加载与进行中文字统一带省略号;Toast 只写结果 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Cxwgnn2pbzQ7rXv3rq7fei
This commit is contained in:
1 parent
542f107566
commit
32bf49a148
11 files changed
+87
-86
No files matched your search
@@ -15,11 +15,11 @@ export type StatusView = { label: string; tone: StatusTone; hint?: string };
|
||||
|
||||
/** 行主状态 → 徽标(文字必带,不只靠颜色) */
|
||||
export function entryStatusView(e: Pick<FileEntry, "status" | "download" | "escape" | "type">): StatusView | null {
|
||||
if (e.escape) return { label: "链接越界", tone: "destructive", hint: "符号链接指向登记目录之外,所有操作已禁用" };
|
||||
if (e.escape) return { label: "链接越界", tone: "destructive", hint: "符号链接指向登记目录之外,不能操作" };
|
||||
const s: FileStatus = e.status;
|
||||
switch (s) {
|
||||
case "temp":
|
||||
return { label: "未完成", tone: "neutral", hint: "下载器或整理过程中的未完成文件" };
|
||||
return { label: "未完成", tone: "neutral", hint: "下载或整理还没完成的临时文件" };
|
||||
case "downloading":
|
||||
return {
|
||||
label: e.download?.progress != null ? `下载中 ${Math.floor(e.download.progress * 100)}%` : "下载中",
|
||||
@@ -44,7 +44,7 @@ export const FILTER_CHIPS = [
|
||||
{ value: "unidentified", label: "未识别" },
|
||||
{ value: "registered", label: "已整理" },
|
||||
{ value: "downloading", label: "下载中" },
|
||||
{ value: "temp", label: "未完成下载" },
|
||||
{ value: "temp", label: "未完成" },
|
||||
] as const;
|
||||
|
||||
export const SORT_OPTIONS = [
|
||||
@@ -100,7 +100,7 @@ export function opDisabledReason(op: FileOp, e: FileEntry, root: Pick<FileRoot,
|
||||
case "scrape":
|
||||
return e.asset ? null : "整理后才能刷新元数据";
|
||||
case "writeNfo":
|
||||
if (root.kind === "library" && !root.writable) return "只读目录,不写 NFO";
|
||||
if (root.kind === "library" && !root.writable) return "只读目录,不能刮削";
|
||||
if (e.status === "temp") return "未完成的文件不能刮削";
|
||||
return null;
|
||||
case "probe":
|
||||
@@ -201,7 +201,7 @@ export function transferTargetProblem(
|
||||
for (const it of items) {
|
||||
if (it.root !== target.root) continue;
|
||||
if (target.path === it.path || target.path.startsWith(`${it.path}/`))
|
||||
return `目标在源目录之内(${baseName(it.path)}),换一个目录`;
|
||||
return `目标不能是 ${baseName(it.path)} 或它的子目录,换一个目录`;
|
||||
if (parentRel(it.path) === target.path) return `${baseName(it.path)} 已在这个目录里,换一个目录`;
|
||||
}
|
||||
return null;
|
||||
@@ -226,11 +226,11 @@ export function collapseCrumbs<T>(items: T[], max: number): (T | null)[] {
|
||||
export function nameProblem(name: string): string | null {
|
||||
const n = name.trim();
|
||||
if (!n) return "名称不能为空";
|
||||
if (n === "." || n === "..") return "不能用 . 或 ..";
|
||||
if (n === "." || n === "..") return "名称不能是 . 或 ..";
|
||||
if (/[/\\]/.test(n)) return "名称不能包含 / 或 \\";
|
||||
// biome-ignore lint/suspicious/noControlCharactersInRegex: 过滤控制字符
|
||||
if (/[\u0000-\u001f]/.test(n)) return "名称不能包含控制字符";
|
||||
if (n.length > 255) return "名称过长";
|
||||
if (n.length > 255) return "名称不能超过 255 个字符";
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -318,7 +318,7 @@ export function deleteBlockText(b: string | null): { text: string; soft: boolean
|
||||
case "needs_unbind":
|
||||
return { text: "是作品或季的绑定目录,勾选「解除路径绑定」后才能删除", soft: true };
|
||||
case "root_unavailable":
|
||||
return { text: "目录离线,不能确认文件状态", soft: false };
|
||||
return { text: "目录离线,无法确认文件状态", soft: false };
|
||||
case "not_found":
|
||||
return { text: "文件已不存在", soft: false };
|
||||
case "escape":
|
||||
@@ -557,7 +557,7 @@ const REMOTE_PENDING_WARNING = /^远端候选在后台查询/;
|
||||
export function applyIdentifyCompleted(r: FilesIdentifyResult, p: IdentifyCompletedPayload): FilesIdentifyResult {
|
||||
if (!r.remoteTaskId || p.taskId !== r.remoteTaskId) return r;
|
||||
if (p.status === "failed") {
|
||||
const note = `远端查询失败,只有本地结果${p.error ? `:${p.error.slice(0, 200)}` : ""}`;
|
||||
const note = `TMDB 查询失败,只显示本地结果${p.error ? `:${p.error.slice(0, 200)}` : ""}`;
|
||||
return {
|
||||
...r,
|
||||
remoteTaskId: null,
|
||||
|
||||
Reference in new issue
Block a user