From 5cb6b79d048278156f8f959cbdf142010503702e Mon Sep 17 00:00:00 2001 From: lijunjie Date: Wed, 25 Nov 2026 10:28:20 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A6=82=E8=A7=88=E9=A1=B5=E6=94=B9=E7=89=88?= =?UTF-8?q?=EF=BC=9A=E6=8C=87=E6=A0=87=E8=A1=8C=2030/42/28=20=E4=B8=89?= =?UTF-8?q?=E5=88=97=E3=80=81=E5=8F=B3=E4=B8=8A=E8=A7=92=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E6=89=AB=E6=8F=8F=E6=8C=89=E9=92=AE=E7=A7=BB=E9=99=A4=E3=80=81?= =?UTF-8?q?=E5=BC=80=E5=A7=8B=E6=89=AB=E6=8F=8F=E8=B7=B3=E8=BD=AC=E7=A9=BA?= =?UTF-8?q?=E9=97=B4=E6=B8=85=E7=90=86=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 处理器与内存合并进同一卡片上下分布(虚线分隔、各占一半垂直空间); 存储空间卡加宽到 42%,每个盘符收成一行的表格感排版(盘符 | 进度条拉满 | 百分比+总/可用),不再盘符与进度条上下两行;日常维护三个入口取消独立 区块,改为竖排三卡放进指标行右列(28%),与左两卡等高均分;窄屏回退为 横向三卡占满一行 - 页头右上角「智能扫描」大按钮移除(与 hero 的开始智能扫描重复) - 「开始智能扫描」/「空间清理」快捷卡不再在本页起扫描:先跳转空间清理页, 两阶段扫描(缓存垃圾 → 构建残留)在目标页继续跑(工作区是应用级共享的); 扫描中重复点击不再触发第三轮;扫描中/已扫完按钮语义不变 - 区块间距 14 → 26px,卡片描边对齐暖色主题,整页更透气 - demo 断言 12 项全过(列宽比例实测 30.0/42.0/28.0、单行盘符几何、右列竖排、 头部按钮移除、点击触发两阶段且重复点击无效) --- src/pages/OverviewPage.tsx | 182 +++++++++++++++++-------------------- src/styles.css | 113 +++++++++++++++++------ 2 files changed, 167 insertions(+), 128 deletions(-) diff --git a/src/pages/OverviewPage.tsx b/src/pages/OverviewPage.tsx index e2bebb5..88af33c 100644 --- a/src/pages/OverviewPage.tsx +++ b/src/pages/OverviewPage.tsx @@ -104,11 +104,13 @@ export function OverviewPage({ : 0), 0, ); - // 智能扫描 lives on the 空间清理 page now; the workspaces are app-level so - // kicking both stages from here simply continues on that page. It uses the - // default deep-scan settings — tweak them there and re-scan if needed. + // 智能扫描 is an entry point, not a resident process: the moment it is + // pressed we hand the page over to 空间清理 and launch both scan stages + // there (SpacePage owns the settings — age threshold, auto-discovery). + // A finished scan keeps the button as a shortcut back to the results. const smartScan = () => { - if (!scanned) { + onNavigate("space"); + if (!scanned && !scanning) { void cleanup.runScan().then(() => purge.runScan({ // Empty = engine auto-discovery of project containers. @@ -118,7 +120,6 @@ export function OverviewPage({ }), ); } - onNavigate("space"); }; const hardware = bootstrap.hardwareInfo; @@ -174,19 +175,6 @@ export function OverviewPage({ "One safe scan for clutter, storage and everyday performance.", "一次安全扫描,整理垃圾、空间与日常性能。", )} - actions={ - - } />
@@ -315,65 +303,70 @@ export function OverviewPage({
) : null} + {/* 指标行 30% / 42% / 28%:处理器+内存共用一框上下分布;存储每盘 + 一行;日常维护三入口竖排放右列,与左两卡等高。独立的「日常维护」 + 区块随此改版取消。 */}
-
-
- - - -
- {t("Processor", "处理器")} - - {snapshot - ? `${snapshot.cpu.physical_cores} ${t("cores", "核")} / ${snapshot.cpu.logical_cores} ${t("threads", "线程")}` - : t("Sampling…", "正在采样…")} +
+
+
+ + +
+ {t("Processor", "处理器")} + + {snapshot + ? `${snapshot.cpu.physical_cores} ${t("cores", "核")} / ${snapshot.cpu.logical_cores} ${t("threads", "线程")}` + : t("Sampling…", "正在采样…")} + +
+ {Math.round(snapshot?.cpu.total ?? 0)}%
- {Math.round(snapshot?.cpu.total ?? 0)}% + + + {snapshot?.cpu.brand || t("Processor details unavailable", "暂无处理器信息")} +
- - - {snapshot?.cpu.brand || t("Processor details unavailable", "暂无处理器信息")} - -
-
-
- - - -
- {t("Memory", "内存")} - - {snapshot - ? `${formatMemory(snapshot.memory.used)} / ${formatMemory(memoryInstalled)}` - : t("Sampling…", "正在采样…")} +
+
+ + +
+ {t("Memory", "内存")} + + {snapshot + ? `${formatMemory(snapshot.memory.used)} / ${formatMemory(memoryInstalled)}` + : t("Sampling…", "正在采样…")} + +
+ + {Math.round( + snapshot ? percent(snapshot.memory.used, snapshot.memory.total) : 0, + )} + % +
- - {Math.round( - snapshot ? percent(snapshot.memory.used, snapshot.memory.total) : 0, - )} - % - -
- - - {memoryReserved > 0 - ? t( - `Hardware reserved (integrated graphics): ${formatMemory(memoryReserved)}`, - `硬件保留(含核显):${formatMemory(memoryReserved)}`, - ) - : snapshot + + + {memoryReserved > 0 ? t( - `${formatCount(snapshot.processes)} processes running`, - `${formatCount(snapshot.processes)} 个进程正在运行`, + `Hardware reserved (integrated graphics): ${formatMemory(memoryReserved)}`, + `硬件保留(含核显):${formatMemory(memoryReserved)}`, ) - : t("Reading activity", "正在读取活动")} - + : snapshot + ? t( + `${formatCount(snapshot.processes)} processes running`, + `${formatCount(snapshot.processes)} 个进程正在运行`, + ) + : t("Reading activity", "正在读取活动")} + +
@@ -397,39 +390,29 @@ export function OverviewPage({ const usedPercent = percent(volume.total - volume.free, volume.total); return (
-
- - {driveLabel(volume)} - {volume.name && volume.name !== driveLabel(volume) - ? ` · ${volume.name}` - : ""} - - - {Math.round(usedPercent)}% - {t( - `total ${formatBytes(volume.total)} · ${formatBytes(volume.free)} free`, - `总 ${formatBytes(volume.total)} · 可用 ${formatBytes(volume.free)}`, - )} - -
- 85 ? "red" : "green"} - /> + + {driveLabel(volume)} + + + 85 ? "red" : "green"} + /> + + + {Math.round(usedPercent)}% + {t( + `total ${formatBytes(volume.total)} · ${formatBytes(volume.free)} free`, + `总 ${formatBytes(volume.total)} · 可用 ${formatBytes(volume.free)}`, + )} +
); })}
-
- -
- -
+
-