空间清理三页签统一扫描交互语言:大号主按钮钉配置栏右侧,文案/状态机一致
- 垃圾清理:embedded 下孤悬在配置栏上方的开始/重新扫描按钮移除,主按钮 并入配置栏右侧(与大文件/重复文件同一位置同一尺寸);扫描中按钮显示 扫描中…;空态文案改为指向右侧按钮,去掉空态里的重复入口 - 重复文件:主按钮文案 开始查找 → 开始扫描,升级为大号 + 扫描图标, 扫描过之后变 重新扫描(与另两页同一状态机) - 大文件:主按钮升级大号 + 图标并钉右;补上"还没有扫描过大文件"空态 (原先扫描前整页空白,与另两页语言不一致) - 新共享样式:.scan-cta(flex 钉右)+.config-items(配置项左侧换行区) +.space-config-spacer;三页配置栏同一骨架:配置项在左、一颗大主按钮在右 - demo 10 断言全过:三页 CTA 类名/尺寸/图标/文案一致、几何同高同右缘、 垃圾页点击真实触发两阶段扫描dev
parent
f66d5e3d6f
commit
f163858344
|
|
@ -4,6 +4,7 @@ import {
|
|||
FolderPlus,
|
||||
Lock,
|
||||
MapPin,
|
||||
ScanSearch,
|
||||
ShieldAlert,
|
||||
Sparkles,
|
||||
Trash2,
|
||||
|
|
@ -286,10 +287,19 @@ export function DuplicateFilesPage({
|
|||
</button>
|
||||
))}
|
||||
</div>
|
||||
<Button variant="primary" onClick={start} disabled={workspace.scanning || workspace.deleting}>
|
||||
<span className="dup-start-icon">
|
||||
{workspace.scanning ? t("Scanning…", "扫描中…") : t("Scan duplicates", "开始查找")}
|
||||
</span>
|
||||
<Button
|
||||
size="lg"
|
||||
variant="primary"
|
||||
className="scan-cta"
|
||||
icon={<ScanSearch size={16} />}
|
||||
onClick={start}
|
||||
disabled={workspace.scanning || workspace.deleting}
|
||||
>
|
||||
{workspace.scanning
|
||||
? t("Scanning…", "扫描中…")
|
||||
: workspace.result
|
||||
? t("Rescan", "重新扫描")
|
||||
: t("Start scan", "开始扫描")}
|
||||
</Button>
|
||||
</section>
|
||||
|
||||
|
|
@ -338,7 +348,7 @@ export function DuplicateFilesPage({
|
|||
icon={<FileQuestion size={26} />}
|
||||
title={t("No duplicate scan yet", "还没有扫描过重复文件")}
|
||||
description={t(
|
||||
"The first scan walks your files once; later scans reuse the hash cache and only re-check what changed.",
|
||||
"Start scan walks your files once; later scans reuse the hash cache and only re-check what changed.",
|
||||
"首次扫描遍历一遍文件;之后的扫描复用哈希缓存,只重算发生变化的文件。",
|
||||
)}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -2,11 +2,13 @@ import {
|
|||
Archive,
|
||||
Disc3,
|
||||
Cloud,
|
||||
FileQuestion,
|
||||
FileVideo,
|
||||
HardDrive,
|
||||
Lock,
|
||||
MapPin,
|
||||
Package,
|
||||
ScanSearch,
|
||||
ShieldAlert,
|
||||
Trash2,
|
||||
} from "lucide-react";
|
||||
|
|
@ -225,8 +227,19 @@ export function LargeFilesPage({
|
|||
);
|
||||
})}
|
||||
</div>
|
||||
<Button variant="primary" onClick={() => void run()} disabled={scanning || deleting}>
|
||||
{scanning ? t("Scanning…", "扫描中…") : t("Scan", "开始扫描")}
|
||||
<Button
|
||||
size="lg"
|
||||
variant="primary"
|
||||
className="scan-cta"
|
||||
icon={<ScanSearch size={16} />}
|
||||
onClick={() => void run()}
|
||||
disabled={scanning || deleting}
|
||||
>
|
||||
{scanning
|
||||
? t("Scanning…", "扫描中…")
|
||||
: files
|
||||
? t("Rescan", "重新扫描")
|
||||
: t("Start scan", "开始扫描")}
|
||||
</Button>
|
||||
</section>
|
||||
|
||||
|
|
@ -240,6 +253,17 @@ export function LargeFilesPage({
|
|||
/>
|
||||
) : null}
|
||||
|
||||
{!files && !scanning ? (
|
||||
<EmptyState
|
||||
icon={<FileQuestion size={26} />}
|
||||
title={t("No large-file scan yet", "还没有扫描过大文件")}
|
||||
description={t(
|
||||
"Start scan walks every drive above the size floor; results sort heaviest first.",
|
||||
"点击「开始扫描」按体积门槛遍历所选磁盘,结果从最大往下排。",
|
||||
)}
|
||||
/>
|
||||
) : null}
|
||||
|
||||
{visible && visible.length === 0 && !scanning ? (
|
||||
<EmptyState
|
||||
icon={<HardDrive size={26} />}
|
||||
|
|
|
|||
|
|
@ -1024,20 +1024,7 @@ export function SpacePage({
|
|||
|
||||
return (
|
||||
<div className={`page ${embedded ? "is-embedded" : ""}`}>
|
||||
{embedded ? (
|
||||
<div className="space-embedded-head">
|
||||
<Button
|
||||
variant={cleanup.result || purge.result ? "secondary" : "primary"}
|
||||
icon={<ScanSearch size={15} />}
|
||||
onClick={() => void runScan()}
|
||||
disabled={scanning || deleting}
|
||||
>
|
||||
{cleanup.result || purge.result
|
||||
? t("Rescan", "重新扫描")
|
||||
: t("Start scan", "开始扫描")}
|
||||
</Button>
|
||||
</div>
|
||||
) : (
|
||||
{!embedded ? (
|
||||
<div className="space-head">
|
||||
<div>
|
||||
<div className="eyebrow">{t("Space cleaning", "空间清理")}</div>
|
||||
|
|
@ -1051,44 +1038,53 @@ export function SpacePage({
|
|||
)}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
{/* Shared hub toolbar: config items wrap on the left, one big primary
|
||||
action pinned right — the three space tabs dress it identically. */}
|
||||
<div className="space-config">
|
||||
<div className="config-items">
|
||||
<span className="space-config-label">
|
||||
{t("Deep-scan folders", "深度扫描目录")}
|
||||
</span>
|
||||
<span className="space-config-static">
|
||||
{t(
|
||||
"Auto-discovered: Desktop, Documents, project folders on every drive",
|
||||
"自动发现:桌面、文档、各磁盘根目录下的项目目录(无需设置)",
|
||||
)}
|
||||
</span>
|
||||
<span className="space-config-spacer" />
|
||||
<span className="space-config-label">
|
||||
{t("Older than", "仅处理早于")}
|
||||
</span>
|
||||
<div className="space-seg">
|
||||
{AGE_CHOICES.map((days) => (
|
||||
<button
|
||||
key={days}
|
||||
type="button"
|
||||
className={minAge === days ? "is-on" : ""}
|
||||
onClick={() => setMinAge(days)}
|
||||
>
|
||||
{t(`${days} days`, `${days}天`)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<Button
|
||||
size="lg"
|
||||
variant="primary"
|
||||
icon={<ScanSearch size={16} />}
|
||||
className="scan-cta"
|
||||
onClick={() => void runScan()}
|
||||
disabled={scanning || deleting}
|
||||
>
|
||||
{cleanup.result || purge.result
|
||||
? t("Rescan", "重新扫描")
|
||||
: t("Start scan", "开始扫描")}
|
||||
{scanning
|
||||
? t("Scanning…", "扫描中…")
|
||||
: cleanup.result || purge.result
|
||||
? t("Rescan", "重新扫描")
|
||||
: t("Start scan", "开始扫描")}
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="space-config">
|
||||
<span className="space-config-label">
|
||||
{t("Deep-scan folders", "深度扫描目录")}
|
||||
</span>
|
||||
<span className="space-config-static">
|
||||
{t(
|
||||
"Auto-discovered: Desktop, Documents, project folders on every drive",
|
||||
"自动发现:桌面、文档、各磁盘根目录下的项目目录(无需设置)",
|
||||
)}
|
||||
</span>
|
||||
<span className="space-config-label">
|
||||
{t("Older than", "仅处理早于")}
|
||||
</span>
|
||||
<div className="space-seg">
|
||||
{AGE_CHOICES.map((days) => (
|
||||
<button
|
||||
key={days}
|
||||
type="button"
|
||||
className={minAge === days ? "is-on" : ""}
|
||||
onClick={() => setMinAge(days)}
|
||||
>
|
||||
{t(`${days} days`, `${days}天`)}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{/* Git 保护不再有开关:它永远是开着的(删前用 git 复核被跟踪的目录),
|
||||
需要绕过时走 CLI 的 --all。 */}
|
||||
</div>
|
||||
|
|
@ -1169,16 +1165,9 @@ export function SpacePage({
|
|||
<span>
|
||||
{t(
|
||||
"Not scanned yet. Start scan checks known cache spots and auto-discovers project folders across the machine.",
|
||||
"尚未扫描。点击「开始扫描」,Squid 会检查已知缓存位置,并自动发现本机各处的项目构建目录。",
|
||||
"尚未扫描。点击右侧「开始扫描」,Squid 会检查已知缓存位置,并自动发现本机各处的项目构建目录。",
|
||||
)}
|
||||
</span>
|
||||
{/* Embedded: the head button is hidden inside the hub, so the
|
||||
empty stage carries its own entry point. */}
|
||||
{embedded ? (
|
||||
<Button variant="primary" icon={<ScanSearch size={15} />} onClick={() => void runScan()}>
|
||||
{t("Start scan", "开始扫描")}
|
||||
</Button>
|
||||
) : null}
|
||||
</div>
|
||||
) : null}
|
||||
|
||||
|
|
|
|||
|
|
@ -5486,6 +5486,30 @@ select:focus-visible,
|
|||
background: #fff;
|
||||
}
|
||||
|
||||
/* Config bars of the three space tabs all end in the same big primary CTA
|
||||
pinned right; labels/segs wrap inside .config-items on the left. */
|
||||
.config-items {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex: 1 1 auto;
|
||||
flex-wrap: wrap;
|
||||
gap: 12px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.space-config-spacer {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
|
||||
.page.is-embedded .space-config {
|
||||
margin-top: 14px;
|
||||
}
|
||||
|
||||
.button.scan-cta {
|
||||
flex: 0 0 auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.space-config-label {
|
||||
color: #3a3226;
|
||||
font-size: var(--nex-text-2xs);
|
||||
|
|
|
|||
Loading…
Reference in New Issue