From 1475ffcce44da681d385233329c558ca7c88f3e5 Mon Sep 17 00:00:00 2001
From: root
Date: Tue, 13 Oct 2026 20:39:08 +0800
Subject: [PATCH] fix(web): make unavailable organize targets explicit
---
.../organize-wizard/organize-wizard.tsx | 36 +++++++++++++++++--
.../organize-wizard/step-preview.tsx | 11 +++---
2 files changed, 39 insertions(+), 8 deletions(-)
diff --git a/apps/web/app/components/organize-wizard/organize-wizard.tsx b/apps/web/app/components/organize-wizard/organize-wizard.tsx
index b3e49ca4..b8580262 100644
--- a/apps/web/app/components/organize-wizard/organize-wizard.tsx
+++ b/apps/web/app/components/organize-wizard/organize-wizard.tsx
@@ -321,7 +321,19 @@ export function OrganizeWizard({ source, onClose }: { source: OrganizeSource; on
Number.isFinite(Number(minMb)) &&
Number(minMb) >= 0 &&
Number.isSafeInteger(Math.round(Number(minMb) * MIB));
+ const targetUnavailable =
+ options.target.mode === "root" &&
+ rootsQ.isSuccess &&
+ !roots.some(
+ (r) =>
+ options.target.mode === "root" &&
+ r.id === options.target.rootId &&
+ r.kind === "library" &&
+ r.writable &&
+ r.health !== "offline",
+ );
const canPreview =
+ !targetUnavailable &&
(!needsReview || recoveryConfirmed) &&
!ambiguous &&
!lookupPending &&
@@ -548,6 +560,11 @@ export function OrganizeWizard({ source, onClose }: { source: OrganizeSource; on
批量重新整理使用本次统一设置。要沿用各记录的洗版与文件覆写,逐条打开重新整理。
) : null}
+ {targetUnavailable ? (
+
+ 原目标媒体库不可用,在高级选项中重新选择目标。
+
+ ) : null}
{src.recovery ? (
@@ -580,7 +597,7 @@ export function OrganizeWizard({ source, onClose }: { source: OrganizeSource; on
) : null}
setAdvancedOpen(e.currentTarget.open)}
className="rounded-xl border border-border p-3"
>
@@ -769,6 +786,9 @@ export function OrganizeWizard({ source, onClose }: { source: OrganizeSource; on
value: "auto",
label: profile ? `自动 · ${profile.name}` : "自动 · 按作品类型与已有目录",
},
+ ...(targetUnavailable
+ ? [{ value: targetValue, label: "原媒体库不可用 · 重新选择", disabled: true }]
+ : []),
...libRoots.map((r) => ({ value: r.id, label: r.name })),
{ value: "dir", label: "选择目录…" },
]}
@@ -962,7 +982,19 @@ export function OrganizeWizard({ source, onClose }: { source: OrganizeSource; on
className="min-w-0 space-y-3 border-t border-border p-4 sm:p-5 lg:border-t-0 lg:border-l"
aria-label="整理预览"
>
- 整理预览
+
+
整理预览
+
+
{notice ? {notice}
: null}
{dry.isPending ? (
diff --git a/apps/web/app/components/organize-wizard/step-preview.tsx b/apps/web/app/components/organize-wizard/step-preview.tsx
index 37448a00..8aa7a7ee 100644
--- a/apps/web/app/components/organize-wizard/step-preview.tsx
+++ b/apps/web/app/components/organize-wizard/step-preview.tsx
@@ -60,12 +60,11 @@ export function PreviewStatsBar({
}) {
return (
-
- {stats.groups} 组 · {stats.files} 个文件
-
-
可执行 {stats.executable}
- {stats.conflicts ?
冲突 {stats.conflicts} : null}
- {stats.failed ?
不能执行 {stats.failed} : null}
+
+ {stats.groups} 组 · {stats.files} 个文件 · 可执行 {stats.executable}
+
+ {stats.conflicts ?
· 冲突 {stats.conflicts} : null}
+ {stats.failed ?
· 不能执行 {stats.failed} : null}
只看问题