diff --git a/docs/cleanbar-mock.html b/docs/cleanbar-mock.html new file mode 100644 index 0000000..beac14f --- /dev/null +++ b/docs/cleanbar-mock.html @@ -0,0 +1,246 @@ + + + + + + + +

Squid 清理进度交互 · 统一 UI 语言

+
重复文件 / 垃圾清理 / 大文件 三处共用同一组件(示意以「重复文件」页为底)。
+ +

① 清理前 现状不变:底部绿色确认条

+
+
+
垃圾清理
+
重复文件612 组
+
大文件
+
+
+
安装包 · 2 个副本 · 共 1.9 GB
+
C:\Users\34798\Downloads\wxworkwindows-4.1.35.6027.exe996 MB
+
建议保留D:\Program Files (x86)\WXWork\9999.1.0\WeCom_Setup.exe996 MB
+
+
+
+
+
✓
+
+
已选中 128 个副本 · 预计释放 3.2 GB
+
其中 2 组将「完全删除」,删除后进入回收站,可从历史撤销
+
+ +
+
+
+
+ +

② 清理中 确认条就地变形 · 真实逐文件进度 · 橙色流光

+
+
+
垃圾清理
+
重复文件612 组
+
大文件
+
+
+
安装包 · 2 个副本 · 共 1.9 GB
+
C:\Users\34798\Downloads\wxworkwindows-4.1.35.6027.exe996 MB
+
建议保留D:\Program Files (x86)\WXWork\9999.1.0\WeCom_Setup.exe996 MB
+
+
+
+
+
+
+
正在清理 37 / 128 个文件 · 已释放 890 MB
+
当前:C:\Users\34798\Downloads\VisualStudioProjSetup-2022.zip(移入回收站)
+
+ 29% + +
+
+
+
期间可正常切页签 / 浏览其他页面,任务后台继续;按钮防重复提交;超过 10 秒才出现「转入后台」(缩成右下角小胶囊,点它随时唤回)。
+
+
+ +

③ 清理完成 原地变绿 + 气泡双保险 · 5 秒自动收起

+
+
+
垃圾清理
+
重复文件604 组
+
大文件
+
+
+
已删除的 128 个副本从列表实时消失,组徽标同步减 8 组
+
+
+
+
+
✓
+
+
清理完成 · 128 个文件已移入回收站 · 释放 3.2 GB
+
用时 41 秒 · 可从「历史」一键撤销
+
+ + +
+
+
+
+ +

④ 部分未处理 琥珀色 · 接入现有「未处理原因」分组页

+
+
+
垃圾清理
+
重复文件605 组
+
大文件
+
+
+
与完成态同位置,仅颜色与文案不同
+
+
+
+
+
!
+
+
已清理 120 个 · 释放 3.1 GB · 8 个未处理
+
占用中 5 · 需要管理员 2 · 文件已消失 1 · 用时 38 秒
+
+ + +
+
+
+
+ +

⑤ 另两页同语言 只换名词,组件/颜色/节奏完全一致

+
+
+
+
+
+
+
正在清理 214 / 986 项 · 已释放 2.4 GB
+
当前:Chrome 缓存 · index-dir\…(阶段 2/3:浏览器缓存)
+
+ 22% + +
+
+
+
+
+
+
+
正在清理 4 / 12 个大文件 · 已释放 6.8 GB
+
当前:D:\VMs\Ubuntu-24.04-disk001.vmdk(移入回收站)
+
+ 33% + +
+
+
+
+
+
✓
+
+
清理完成 · 986 项已处理 · 释放 11.6 GB
+
回收站未清空前仍可恢复 · 用时 1 分 12 秒
+
+ + +
+
+
+
+ + diff --git a/docs/cleanbar-mock.png b/docs/cleanbar-mock.png new file mode 100644 index 0000000..29daf27 Binary files /dev/null and b/docs/cleanbar-mock.png differ diff --git a/release/0.1.13/RELEASE_NOTES.md b/release/0.1.13/RELEASE_NOTES.md index dbc7966..cca13d3 100644 --- a/release/0.1.13/RELEASE_NOTES.md +++ b/release/0.1.13/RELEASE_NOTES.md @@ -39,6 +39,13 @@ Squid 0.1.13 更新说明 看着像系统组件实为第三方库,此前在启动列表里开了一个独立的假软件组; 现在这类「Windows/Microsoft + Proxy/Host/Service…)」的角色名一律归入 「其他软件」,真实产品名不受影响。 +- 清理全程有反馈(垃圾清理 / 重复文件 / 大文件三处统一):点下清理后, + 底部确认条就地变成长条进度器——橙色流光进度条 + 「正在清理 N / M 个 + 文件 · 已释放 X」实时计数 + 当前正在删的文件路径,再久也不像卡死; + 超过 10 秒出现「转入后台」,进度缩成右下角小胶囊随时点回。完成后原地 + 变绿「清理完成 · N 个已移入回收站 · 释放 X · 用时 Y」,可一键查看历史 + 撤销,5 秒自动收起;有删不掉的变琥珀色并写明原因(占用/权限/已消失), + 「查看原因并处理」直达按原因分组的处置建议。 - 软件图标获取机制加强:不带任何图标资源的「更新服务」类小程序,现在会 按它自己声称归属的产品去卸载注册表里借图标——腾讯会议的 `WemeetUpdateSvc.exe`(单独躺在 `Tencent\UpdateSvr\`,自己零图标)取到 diff --git a/release/0.1.13/SHA256SUMS.txt b/release/0.1.13/SHA256SUMS.txt index fb4d28a..25e5c6a 100644 --- a/release/0.1.13/SHA256SUMS.txt +++ b/release/0.1.13/SHA256SUMS.txt @@ -1,2 +1,2 @@ -24256da12d3d3de03777e5b916c7aaef14f9ec512befe044df43572e1ea56c67 Squid-Setup-0.1.13-win-x64.exe -7a4e50877b72c6340ad09bfab710a3892a3d6a3511a4d2c612908a121d776431 Squid-0.1.13-portable-win-x64.zip \ No newline at end of file +69e0d9009e91f5119ea2c607abfc9129083ec2c85de7beb88090451867e5c5be Squid-Setup-0.1.13-win-x64.exe +0d95918cdfb2fed04556b7ca03eadc0fb6c9a13aa2fd144c184626df63eaeb7e Squid-0.1.13-portable-win-x64.zip \ No newline at end of file diff --git a/release/0.1.13/Squid-0.1.13-portable-win-x64.zip b/release/0.1.13/Squid-0.1.13-portable-win-x64.zip index 576b835..4ea159e 100644 Binary files a/release/0.1.13/Squid-0.1.13-portable-win-x64.zip and b/release/0.1.13/Squid-0.1.13-portable-win-x64.zip differ diff --git a/release/0.1.13/Squid-Setup-0.1.13-win-x64.exe b/release/0.1.13/Squid-Setup-0.1.13-win-x64.exe index 8c6bcc5..db1be52 100644 Binary files a/release/0.1.13/Squid-Setup-0.1.13-win-x64.exe and b/release/0.1.13/Squid-Setup-0.1.13-win-x64.exe differ diff --git a/release/0.1.13/squid-update.json b/release/0.1.13/squid-update.json index 05cf845..4c6404f 100644 --- a/release/0.1.13/squid-update.json +++ b/release/0.1.13/squid-update.json @@ -2,12 +2,12 @@ "schema": 1, "version": "0.1.13", "date": "2026-11-25", - "notes": "Squid 0.1.13 更新说明\n\n新增\n- 开机启动项大升级(权限管理内,位置不变):\n · 状态筛选段:全部 / 已启用 / 已禁用 / 残留,每档带实时计数,一点即筛。\n · 残留项自动识别:程序文件已不在磁盘上、只剩启动配置的,标红并给出\n 「删除启动项」按钮——只删注册表值/快捷方式/计划任务本身,绝不动\n 程序文件;残留服务改为「禁用」而非卸载,删除前弹窗讲清影响范围。\n · 「显示系统项」开关:微软签名或位于 Windows 目录的启动项默认折进\n 「系统组件」组隐藏,列表只剩真正拖累开机的第三方软件。\n · 每行显示来源与路径明细,展开可见完整命令行,并可一键「打开所在\n 文件夹」。\n- 重复文件:保留副本也可以勾选了。勾上即「本组一份不剩」,行与组标题\n 变琥珀警示,顶部汇总显示有几组将被完全删除,确认条同时变红并要求\n 「确认完全删除」;删除仍走回收站,可从历史撤销。\n- 右键菜单扩展按软件分组:同一个软件注册在多个菜单位置的条目合并成一张\n 卡片(组头 = 软件图标 + 名称 + 开启状态 + 组级总开关),和开机启动项\n 同一套样式;认不出归属的落入「其他软件」。菜单位置类别与计数不变。\n\n调整\n- 重复文件扫描不再进入 WorkBuddy 的会话快照目录:任何盘符上的\n `.workbuddy\\workspace\\sessions\\…` 整棵子树直接跳过——那是智能体自己\n 生成的文件副本,列出来只会重复劳动。\n- 电脑概览页排版改版:处理器与内存合并为一张卡(上下分布),存储空间卡\n 加宽、每个盘符收成一行的表格感排版(盘符|进度条|用量与容量),日常\n 维护三个入口竖排进右列——指标行按 30% / 42% / 28% 三列分布,区块间距\n 整体加大,页面更透气。\n- 「开始智能扫描」不再停留在概览页:点击立即跳转到空间清理页,两阶段\n 扫描(缓存垃圾 → 构建残留)在那边继续执行;「空间清理」快捷卡同此。\n- 套件归组:同一厂商装在 Program Files 下多个子目录的产品(如新华三\n H3C Workspace 的 SpaceAgent、摄像头/打印机/USB/串并口重定向等一组服务,\n 每个程序都不带产品名信息)自动合并为一组「H3C Workspace」,不再散成\n 单行组和「其他软件」;带真实产品名的软件不受影响。\n- 电脑概览继续微调:页头三行文字(问候/标题/副标题)间距拉开、整块连同\n 下方模块适度下移,页面不再顶格;处理器/内存的进度条左缘与图标对齐;\n 明细小字(CPU 型号、进程数)与存储卡的盘符信息统一字号与颜色;\n 「实时监控」按钮升级为与「开始智能扫描」同款的橙色主按钮。\n- 角色名不再自成一组:WinFsp 的启动服务自称「Windows File System Proxy」,\n 看着像系统组件实为第三方库,此前在启动列表里开了一个独立的假软件组;\n 现在这类「Windows/Microsoft + Proxy/Host/Service…)」的角色名一律归入\n 「其他软件」,真实产品名不受影响。\n- 软件图标获取机制加强:不带任何图标资源的「更新服务」类小程序,现在会\n 按它自己声称归属的产品去卸载注册表里借图标——腾讯会议的\n `WemeetUpdateSvc.exe`(单独躺在 `Tencent\\UpdateSvr\\`,自己零图标)取到\n 腾讯会议图标,企业微信的 `WXWorkUpgrader.exe` 经 `WXWorkService` 顺到\n `WXWork.exe` 的图标;同名厂商目录、App Paths、同目录兄弟程序的既有兜底\n 顺序不变,实在认不出的仍显示中性占位,绝不张冠李戴。\n- 商店应用归组修复:ChatGPT 等微软商店安装的应用此前因为读不到程序信息\n 而全部堆在「其他软件」,现在按安装包名自动归组(ChatGPT 独立成组,带\n 自己的图标);「其他软件」组头改用中性九宫格图标,不再借用组内某个\n 软件的图标误导。\n- 空间清理三个页签统一扫描交互:同一颗大号「开始扫描」主按钮,固定在各\n 自配置栏的最右侧(垃圾清理原先孤悬的小按钮、重复文件的「开始查找」、\n 大文件的小按钮全部归一);未扫描 → 开始扫描,扫描中 → 扫描中…,扫过\n 之后 → 重新扫描,三页文案与状态一致;大文件页补上扫描前的引导空态。\n- 大文件扫描不再列出 pagefile.sys / swapfile.sys——系统全程持有,谁都\n 删不掉,列出来只会误导;hiberfil.sys 保留并注明可「关闭休眠」释放。\n- 权限管理开机启动项与进阶启动项共用同一套签名核验批处理:一次系统\n 调用覆盖整页,翻页不再重复等待。\n\n移除\n- 电脑概览右上角的「智能扫描」大按钮(与卡内的「开始智能扫描」重复)。\n\n修复\n- 重复文件「清理 N 个副本」按钮深红字压在红底上看不清:移除页面级\n 配色覆盖,回归全局危险按钮样式(红底白字),并禁止页面再覆盖按钮\n 颜色。\n- 打开权限管理(开机启动项 / 进阶启动项)时会闪出一个黑色命令行窗口:\n 批量签名核验调用 PowerShell 时漏了隐藏窗口标志,GUI 程序拉起控制台\n 程序就会新建窗口;现已全部静默。同类漏网(清理扫描里的 git 探测)\n 一并堵上。\n- 一键安装.bat 重写:先自动退出正在运行的 Squid、前台同步安装、每步\n 有进度输出与错误码,不再出现「双击后只剩空命令行」的无响应窗口。", + "notes": "Squid 0.1.13 更新说明\n\n新增\n- 开机启动项大升级(权限管理内,位置不变):\n · 状态筛选段:全部 / 已启用 / 已禁用 / 残留,每档带实时计数,一点即筛。\n · 残留项自动识别:程序文件已不在磁盘上、只剩启动配置的,标红并给出\n 「删除启动项」按钮——只删注册表值/快捷方式/计划任务本身,绝不动\n 程序文件;残留服务改为「禁用」而非卸载,删除前弹窗讲清影响范围。\n · 「显示系统项」开关:微软签名或位于 Windows 目录的启动项默认折进\n 「系统组件」组隐藏,列表只剩真正拖累开机的第三方软件。\n · 每行显示来源与路径明细,展开可见完整命令行,并可一键「打开所在\n 文件夹」。\n- 重复文件:保留副本也可以勾选了。勾上即「本组一份不剩」,行与组标题\n 变琥珀警示,顶部汇总显示有几组将被完全删除,确认条同时变红并要求\n 「确认完全删除」;删除仍走回收站,可从历史撤销。\n- 右键菜单扩展按软件分组:同一个软件注册在多个菜单位置的条目合并成一张\n 卡片(组头 = 软件图标 + 名称 + 开启状态 + 组级总开关),和开机启动项\n 同一套样式;认不出归属的落入「其他软件」。菜单位置类别与计数不变。\n\n调整\n- 重复文件扫描不再进入 WorkBuddy 的会话快照目录:任何盘符上的\n `.workbuddy\\workspace\\sessions\\…` 整棵子树直接跳过——那是智能体自己\n 生成的文件副本,列出来只会重复劳动。\n- 电脑概览页排版改版:处理器与内存合并为一张卡(上下分布),存储空间卡\n 加宽、每个盘符收成一行的表格感排版(盘符|进度条|用量与容量),日常\n 维护三个入口竖排进右列——指标行按 30% / 42% / 28% 三列分布,区块间距\n 整体加大,页面更透气。\n- 「开始智能扫描」不再停留在概览页:点击立即跳转到空间清理页,两阶段\n 扫描(缓存垃圾 → 构建残留)在那边继续执行;「空间清理」快捷卡同此。\n- 套件归组:同一厂商装在 Program Files 下多个子目录的产品(如新华三\n H3C Workspace 的 SpaceAgent、摄像头/打印机/USB/串并口重定向等一组服务,\n 每个程序都不带产品名信息)自动合并为一组「H3C Workspace」,不再散成\n 单行组和「其他软件」;带真实产品名的软件不受影响。\n- 电脑概览继续微调:页头三行文字(问候/标题/副标题)间距拉开、整块连同\n 下方模块适度下移,页面不再顶格;处理器/内存的进度条左缘与图标对齐;\n 明细小字(CPU 型号、进程数)与存储卡的盘符信息统一字号与颜色;\n 「实时监控」按钮升级为与「开始智能扫描」同款的橙色主按钮。\n- 角色名不再自成一组:WinFsp 的启动服务自称「Windows File System Proxy」,\n 看着像系统组件实为第三方库,此前在启动列表里开了一个独立的假软件组;\n 现在这类「Windows/Microsoft + Proxy/Host/Service…)」的角色名一律归入\n 「其他软件」,真实产品名不受影响。\n- 清理全程有反馈(垃圾清理 / 重复文件 / 大文件三处统一):点下清理后,\n 底部确认条就地变成长条进度器——橙色流光进度条 + 「正在清理 N / M 个\n 文件 · 已释放 X」实时计数 + 当前正在删的文件路径,再久也不像卡死;\n 超过 10 秒出现「转入后台」,进度缩成右下角小胶囊随时点回。完成后原地\n 变绿「清理完成 · N 个已移入回收站 · 释放 X · 用时 Y」,可一键查看历史\n 撤销,5 秒自动收起;有删不掉的变琥珀色并写明原因(占用/权限/已消失),\n 「查看原因并处理」直达按原因分组的处置建议。\n- 软件图标获取机制加强:不带任何图标资源的「更新服务」类小程序,现在会\n 按它自己声称归属的产品去卸载注册表里借图标——腾讯会议的\n `WemeetUpdateSvc.exe`(单独躺在 `Tencent\\UpdateSvr\\`,自己零图标)取到\n 腾讯会议图标,企业微信的 `WXWorkUpgrader.exe` 经 `WXWorkService` 顺到\n `WXWork.exe` 的图标;同名厂商目录、App Paths、同目录兄弟程序的既有兜底\n 顺序不变,实在认不出的仍显示中性占位,绝不张冠李戴。\n- 商店应用归组修复:ChatGPT 等微软商店安装的应用此前因为读不到程序信息\n 而全部堆在「其他软件」,现在按安装包名自动归组(ChatGPT 独立成组,带\n 自己的图标);「其他软件」组头改用中性九宫格图标,不再借用组内某个\n 软件的图标误导。\n- 空间清理三个页签统一扫描交互:同一颗大号「开始扫描」主按钮,固定在各\n 自配置栏的最右侧(垃圾清理原先孤悬的小按钮、重复文件的「开始查找」、\n 大文件的小按钮全部归一);未扫描 → 开始扫描,扫描中 → 扫描中…,扫过\n 之后 → 重新扫描,三页文案与状态一致;大文件页补上扫描前的引导空态。\n- 大文件扫描不再列出 pagefile.sys / swapfile.sys——系统全程持有,谁都\n 删不掉,列出来只会误导;hiberfil.sys 保留并注明可「关闭休眠」释放。\n- 权限管理开机启动项与进阶启动项共用同一套签名核验批处理:一次系统\n 调用覆盖整页,翻页不再重复等待。\n\n移除\n- 电脑概览右上角的「智能扫描」大按钮(与卡内的「开始智能扫描」重复)。\n\n修复\n- 重复文件「清理 N 个副本」按钮深红字压在红底上看不清:移除页面级\n 配色覆盖,回归全局危险按钮样式(红底白字),并禁止页面再覆盖按钮\n 颜色。\n- 打开权限管理(开机启动项 / 进阶启动项)时会闪出一个黑色命令行窗口:\n 批量签名核验调用 PowerShell 时漏了隐藏窗口标志,GUI 程序拉起控制台\n 程序就会新建窗口;现已全部静默。同类漏网(清理扫描里的 git 探测)\n 一并堵上。\n- 一键安装.bat 重写:先自动退出正在运行的 Squid、前台同步安装、每步\n 有进度输出与错误码,不再出现「双击后只剩空命令行」的无响应窗口。", "artifacts": { "windows": { "file": "Squid-Setup-0.1.13-win-x64.exe", - "sha256": "24256da12d3d3de03777e5b916c7aaef14f9ec512befe044df43572e1ea56c67", - "size": 3872318 + "sha256": "69e0d9009e91f5119ea2c607abfc9129083ec2c85de7beb88090451867e5c5be", + "size": 3872637 } } } \ No newline at end of file diff --git a/release/CHANGELOG-SINCE-0.1.4.md b/release/CHANGELOG-SINCE-0.1.4.md new file mode 100644 index 0000000..35d3ce3 --- /dev/null +++ b/release/CHANGELOG-SINCE-0.1.4.md @@ -0,0 +1,140 @@ +# Squid 版本更新说明(自上次上传 0.1.4 之后:0.1.6 → 0.1.13) + +本文按版本记录自上一次上传代码仓(0.1.4,releases 分支)以来的全部更新。 +每一版末尾注明设计**学习了哪些 GitHub 上的开源软件**(借鉴交互与产品思路, +未引入其代码;闭源参照物单独标注)。 + +--- + +## 0.1.6 — 权限管理 + 本机配置 + +- 新增「权限管理」页:开机启动项(注册表 Run/RunOnce、启动文件夹、计划 + 任务、系统服务四源聚合,与任务管理器/电脑管家状态对齐)、管理右键菜单 + (Shell 扩展按位置分组、本地保留恢复配方)、弹窗拦截(窗口一键建规则, + 常驻观察者自动关闭)。 +- 启动项与已安装应用显示软件中文本地化名(ProductName/FileDescription 优先), + 启动项按软件分组显示「n/n 开启」。 +- 软件真实图标:从 DisplayIcon、卸载器、安装目录主程序提取,老式图标补 + 透明通道,.lnk 解析真实目标。 +- 电脑概览「本机配置」:CPU/内存/主板/硬盘/显卡经 SMBIOS、存储 IOCTL 与 + 注册表原生读取,无需管理员、不拉命令行。 + +学习对象:腾讯电脑管家(启动项/右键菜单/弹窗拦截三件套的产品形态)。 + +## 0.1.7 — 右键菜单颗粒度重做 + 图标全覆盖 + +- 卸载应用大小读 EstimatedSize(与「设置 > 应用」同口径),缺失时实测目录。 +- 右键菜单按真实入口分五类(文件/文件夹/桌面/驱动器/所有对象),显示可读 + 软件名与「创建者」,同模块合并,分类带「已启用/总数」。 +- 第三方软件所在处统一显示其默认图标(启动项行、右键项、弹窗拦截窗口)。 + +学习对象:腾讯电脑管家(右键菜单分类与「创建者」字段)。 + +## 0.1.8 — 桌面小工具 + 静默覆盖安装 + +- 桌面小工具:无边框、置顶、不抢焦点的桌面看板,运行状态/网络/存储读写/ + 存储空间四卡片独立开关,不透明度与刷新频率可调,主窗口进托盘照常刷新。 +- 安装程序静默覆盖升级,不再弹「先卸载再安装」。 + +学习对象:飞牛 fnOS 资源监控组件(看板形态;闭源参照)。 + +## 0.1.9 — 小工具桌面层修正 + +- 小工具改桌面层:贴壁纸与图标之上、其他软件之下,Win+D 后自动回位。 +- 透明度收紧到最多 10%,旧设置自动迁移。 + +学习对象:无新增(对 0.1.8 的实机修正)。 + +## 0.1.10 — 扫描体验对齐专业工具 + +- 空间清理扫描实时计数(已统计 N 文件 · X GB)、分类先到先显示、进度封顶 + 99%、90 天未动「休眠」标签、node_modules 可删依据面板(锁文件/Git 状态/ + 手工修改)、低风险一步确认条、未处理项按原因分组给下一步、「导出清单」 + Markdown。 +- 「隐藏的吃空间大户」(更新缓存/休眠文件/WinSxS/手机备份等);测量缓存 + 10 分钟;升级安装包分类(只匹配安装包形态且放置超 7 天)。 +- 微信/QQ 聊天文件等「像缓存实际是您的文件」强制保护 + 待解锁行。 +- 启动项按软件分组(组级总开关、部分开启 3/10 计数、其他软件兜底组)。 +- 深度清理全自动目录发现;小工具 CPU 核心柱状面板;常驻 CPU 8.5%→0.2%。 + +学习对象:tw93/Mole(https://github.com/tw93/Mole ——扫描计数、99% 封顶 +纪律、未处理分组、依据面板);腾讯电脑管家(清理点粒度分组,闭源参照)。 + +## 0.1.11 — 洞察与维护双扩展包 + +- 重复文件独立页:三级漏斗(大小分组→头中尾采样→全量 SHA-256)、哈希 + 缓存增量、智能保留、个人文件锁定、回收站撤销;3.4 万文件约 1 秒。 +- 大文件独立页:范围/阈值/类型过滤、休眠标记、网盘副本提示、关键镜像隐藏。 +- 存储空间矩形图下钻;清理新增「AI 工具与模型」(Ollama 按模型、HuggingFace + 按仓库、AI 桌面端缓存)。 +- 系统维护 6 项白名单修复任务(风险徽章、超时、单实例互斥、日志滚动); + 隐私清理页(浏览器/Cookie/跳转列表/剪贴板/活动历史);系统优化页(可逆 + 开关 + 一键还原)。 +- 进阶启动项页签:Winlogon 登录链、AppInit_DLLs、IFEO、BHO、自动启动服务, + 每行数字签名徽章。 +- 应用卸载增强:安装不完整徽章、来源识别(winget/scoop/choco/Store)、残留 + 注册表清理。 +- 修复「定位」含空格路径跳错文件夹(explorer /select raw_arg)。 + +学习对象:BleachBit(https://github.com/nikkov/bleachbit-ng 一脉的隐私 +清理范围)、Uninstall Tool/Geek Uninstaller 类产品的残留与来源徽章思路 +(闭源参照)、腾讯电脑管家「启动影响」进阶视图。 + +## 0.1.12 — 导航大整合 + +- 「空间清理」三页签(垃圾/重复/大文件,实时计数徽标,切换不清结果); + 「系统维护」三页签(修复/隐私/优化);移除一级「存储空间」;快捷键重排。 +- 修复小组件 RDP 重连后被摆到屏幕中间(纯 Win32 坐标心跳归位 + dock_v2 + 代际标记作废旧位置记忆)。 + +学习对象:无新增(整合既有能力)。 + +## 0.1.13 — 大迭代(含多次原地重打包,本次上传为最终版) + +启动项与图标: +- 启动项 MangoDisk 式管理:全部/已启用/已禁用/残留筛选段带计数、残留识别 + 与「删除启动项」(只删配置不动程序)、「显示系统项」开关、来源与完整 + 命令行明细。 +- 软件图标机制加强:零图标资源的更新服务小程序按 PE 字符串声称的产品名, + 去卸载注册表 DisplayIcon 借图标(腾讯会议 WemeetUpdateSvc → WeMeetApp, + 企业微信 WXWorkUpgrader → WXWork.exe);短别名不参与伸展,绝不张冠李戴。 +- 套件归组(H3C Workspace)、商店应用按包名归组(ChatGPT)、角色名归入 + 「其他软件」;右键菜单扩展按软件分组带总开关。 + +空间与清理: +- 重复文件保留副本可勾选删除(本组一份不剩,琥珀 + 红色双重警示); + 扫描跳过 .workbuddy\workspace\sessions 子树;三页签统一大号「开始扫描」。 +- 大文件不再列 pagefile/swapfile;概览页 30/42/28 三列重排与多轮留白微调。 + +清理进度统一交互(最终打包版新增): +- 垃圾清理/重复文件/大文件三处统一:点清理后确认条就地变形为真实逐文件 + 进度条(正在清理 N/M · 已释放 X · 当前文件路径,橙色流光);超 10 秒可 + 「转入后台」缩成右下角胶囊;完成原地变绿(释放量、用时、查看历史撤销) + 5 秒自动收起;有未处理项变琥珀并写明原因分组(占用/管理员/已消失)与 + 处置建议。 + +学习对象:MangoDisk(启动项管理形态;其教程广为流传,未建公开仓库)、 +腾讯电脑管家(分组、图标兜底链);最终版清理进度交互参考了 +microsoft/PowerToys(https://github.com/microsoft/PowerToys ——Text +Extractor 式「就地、即时、可撤销」的轻量反馈语言)与 mg-chao/snow-shot +(https://github.com/mg-chao/snow-shot ——进度条就地变形而非弹新窗口的 +形态);同期完成 hiroi-sora/Umi-OCR、ShareX/ShareX、xushengfeng/eSearch +等截图-OCR 工具调研(https://github.com/hiroi-sora/Umi-OCR 等),为「小 +工具 › 截图识字」立项做过方案评审,未实装。 + +--- + +## 借鉴来源一览(GitHub) + +| 项目 | 仓库 | 首次借鉴版本 | 借鉴点 | +| --- | --- | --- | --- | +| Mole | https://github.com/tw93/Mole | 0.1.10 | 扫描实时计数、99% 封顶、未处理按原因分组、可删依据 | +| PowerToys | https://github.com/microsoft/PowerToys | 0.1.13 最终版 | 就地即时的进度反馈语言 | +| snow-shot | https://github.com/mg-chao/snow-shot | 0.1.13 最终版 | 确认条就地变形的进度形态 | +| Umi-OCR | https://github.com/hiroi-sora/Umi-OCR | 调研(未实装) | 截图识字集成方案 | +| ShareX | https://github.com/ShareX/ShareX | 调研(未实装) | 截图后动作流水线 | +| eSearch | https://github.com/xushengfeng/eSearch | 调研(未实装) | 截图+离线 OCR 一体化工具形态 | +| BleachBit | https://github.com/nikkov/bleachbit-ng | 0.1.11 | 隐私清理项目范围 | + +闭源参照(无 GitHub 仓库):腾讯电脑管家(启动项/右键菜单/图标兜底)、 +飞牛 fnOS 资源监控(桌面小工具)、MangoDisk(启动项筛选与残留管理)。 diff --git a/src/components/CleanBar.tsx b/src/components/CleanBar.tsx new file mode 100644 index 0000000..f61f6a4 --- /dev/null +++ b/src/components/CleanBar.tsx @@ -0,0 +1,276 @@ +import { AlertTriangle, Check, LoaderCircle } from "lucide-react"; +import { useCallback, useEffect, useMemo, useRef, useState } from "react"; +import { useI18n } from "../i18n"; +import { formatBytes, formatCount } from "../lib/format"; +import { skipGroupOf, skipTally, formatDuration } from "../lib/skipGroups"; +import { Button } from "./ui"; +import type { DeleteResult, JobProgress } from "../types"; + +/** + * The one clean-progress language every page speaks (垃圾清理 / 重复文件 / + * 大文件): the confirm strip morphs in place into an honest per-file + * progress bar, then settles into a green (or amber when items stayed + * behind) result banner that fades itself after 5 seconds. After 10 seconds + * of work a「转入后台」link shrinks the bar into a corner capsule so the + * page stays usable — there is deliberately no mid-delete cancel. + */ + +export interface CleanPhase { + phase: "busy" | "done"; + /** Final outcome; required (and rendered) once phase === "done". */ + outcome?: DeleteResult | null; + /** Wall-clock delete duration measured by the page. */ + elapsedMs?: number; +} + +const DISMISS_SECONDS = 5; +const BACKDROP_SECONDS = 10; + +export function CleanBar({ + spec, + progress, + noun, + mode, + onHistory, + onDismiss, + onRescan, + auto = true, + showSkips = true, +}: { + spec: CleanPhase; + /** Live job events (tick carries done/total, deleted carries freed). */ + progress: JobProgress | null; + /** Noun the counted items are called, e.g. 副本 / 项 / 大文件. */ + noun: [string, string]; + mode: "trash" | "permanent"; + onHistory: () => void; + onDismiss: () => void; + /** Offered on the amber banner's reason groups when a rescan helps. */ + onRescan?: () => void; + /** false = a sticky result screen: no countdown, 知道了 dismisses. */ + auto?: boolean; + /** false = the page renders the skipped-reason groups itself below. */ + showSkips?: boolean; +}) { + const { t, lang } = useI18n(); + const zh = lang === "zh"; + const unit = zh ? noun[0] : noun[1]; + const binWord = mode === "trash" ? t("to the Recycle Bin", "移入回收站") : t("deleted for good", "彻底删除"); + + // Honest cumulative state across the event stream: keep the last known + // done/total (ticks), sum freed over unique deleted paths (two engine + // halves can stream in sequence; paths dedupe the pair). + const freedPaths = useRef>(new Map()); + const lastTick = useRef<{ done: number; total: number } | null>(null); + const [mirror, setMirror] = useState<{ done: number; total: number; freed: number }>({ + done: 0, + total: 0, + freed: 0, + }); + const [elapsed, setElapsed] = useState(0); + + const resetRun = useCallback(() => { + freedPaths.current = new Map(); + lastTick.current = null; + setMirror({ done: 0, total: 0, freed: 0 }); + setElapsed(0); + }, []); + + useEffect(() => { + if (spec.phase !== "busy") return; + if (!progress) return; + if (progress.event === "deleted") { + const path = progress.detail ?? ""; + if (path && !freedPaths.current.has(path)) { + freedPaths.current.set(path, progress.freed ?? 0); + } + let freed = 0; + freedPaths.current.forEach((value) => (freed += value)); + setMirror((current) => ({ ...current, freed })); + return; + } + if (progress.event === "tick" && progress.done !== null && progress.total !== null) { + lastTick.current = { done: progress.done, total: progress.total }; + setMirror((current) => ({ ...current, ...lastTick.current })); + } + }, [progress, spec.phase]); + + const [minimized, setMinimized] = useState(false); + const [skipsOpen, setSkipsOpen] = useState(false); + const [secondsLeft, setSecondsLeft] = useState(DISMISS_SECONDS); + const dismiss = useRef(onDismiss); + dismiss.current = onDismiss; + + // Busy clock: powers the 转入后台 threshold and a live elapsed feel. + useEffect(() => { + if (spec.phase !== "busy") return; + resetRun(); + const started = Date.now(); + const timer = window.setInterval(() => setElapsed(Date.now() - started), 1000); + return () => window.clearInterval(timer); + }, [spec.phase, resetRun]); + + // Done banner: countdown to self-dismiss (sticky result screens opt out). + useEffect(() => { + if (spec.phase !== "done") return; + if (!auto) return; + setSecondsLeft(DISMISS_SECONDS); + const timer = window.setInterval(() => { + setSecondsLeft((current) => { + if (current <= 1) { + window.clearInterval(timer); + dismiss.current(); + return 0; + } + return current - 1; + }); + }, 1000); + return () => window.clearInterval(timer); + }, [spec.phase, auto]); + + const pct = + spec.phase === "busy" && mirror.total > 0 + ? Math.min(100, Math.round((mirror.done / mirror.total) * 100)) + : null; + + const skipped = spec.outcome?.skipped ?? []; + const groups = useMemo(() => { + const map = new Map< + string, + { + title: [string, string]; + hint: [string, string]; + action?: "rescan"; + rows: { path: string; reason: string }[]; + } + >(); + for (const row of skipped) { + const meta = skipGroupOf(row.reason); + const bucket = + map.get(meta.key) ?? { title: meta.title, hint: meta.hint, action: meta.action, rows: [] }; + bucket.rows.push(row); + map.set(meta.key, bucket); + } + return [...map.values()]; + }, [skipped]); + + if (spec.phase === "busy") { + if (minimized) { + return ( + + ); + } + return ( +
+
+ +
+ + {t(`Cleaning ${formatCount(mirror.done)} / ${formatCount(mirror.total)} ${unit}`, `正在清理 ${formatCount(mirror.done)} / ${formatCount(mirror.total)} ${unit}`)} + {" · "} + {t(`${formatBytes(mirror.freed)} freed so far`, `已释放 ${formatBytes(mirror.freed)}`)} + + + {progress?.subject + ? `${t("Current", "当前")}:${progress.subject}(${binWord})` + : t("Preparing…", "准备中…")} + +
+ {pct !== null ? {pct}% : null} + {elapsed >= BACKDROP_SECONDS * 1000 ? ( + + ) : null} +
+
+ +
+
+ ); + } + + const outcome = spec.outcome; + if (!outcome) return null; + const partial = skipped.length > 0; + const freed = outcome.freedAllocated || outcome.freed; + return ( +
+
+ + {partial ? : } + +
+ + {partial + ? t( + `Cleaned ${formatCount(outcome.removed)} ${unit} · ${formatBytes(freed)} freed · ${formatCount(skipped.length)} left behind`, + `已清理 ${formatCount(outcome.removed)} ${unit} · 释放 ${formatBytes(freed)} · ${formatCount(skipped.length)} 个未处理`, + ) + : t( + `Clean finished · ${formatCount(outcome.removed)} ${unit} ${binWord} · ${formatBytes(freed)} freed`, + `清理完成 · ${formatCount(outcome.removed)} ${unit}${binWord} · 释放 ${formatBytes(freed)}`, + )} + + + {partial ? skipTally(skipped) : ""} + {partial && spec.elapsedMs ? " · " : ""} + {spec.elapsedMs ? t(`took ${formatDuration(spec.elapsedMs)} · undo from History`, `用时 ${formatDuration(spec.elapsedMs)} · 可从「历史」撤销`) : t("undo from History", "可从「历史」撤销")} + +
+ {partial && showSkips ? ( + + ) : null} + + +
+ {showSkips && partial && skipsOpen ? ( +
+ {groups.map((group) => ( +
+
+ {zh ? group.title[1] : group.title[0]} + {group.rows.length} +
+
    + {group.rows.slice(0, 5).map((row) => ( +
  • + {row.path} + {row.reason} +
  • + ))} + {group.rows.length > 5 ? ( +
  • + {t(`… ${group.rows.length - 5} more`, `… 另有 ${group.rows.length - 5} 项`)} +
  • + ) : null} +
+ {zh ? group.hint[1] : group.hint[0]} + {group.action === "rescan" && onRescan ? ( + + ) : null} +
+ ))} +
+ ) : null} +
+ ); +} diff --git a/src/hooks/useDuplicatesWorkspace.ts b/src/hooks/useDuplicatesWorkspace.ts index 34c39bf..5f64d92 100644 --- a/src/hooks/useDuplicatesWorkspace.ts +++ b/src/hooks/useDuplicatesWorkspace.ts @@ -280,6 +280,12 @@ export function useDuplicatesWorkspace(): DuplicatesWorkspace { currentJob.current = id; setDeleting(true); setError(null); + setProgress(null); + // The delete loop streams the same tick/deleted frames the scan used + // to, so the page's in-place CleanBar can count files honestly. + const stop = await subscribeJobProgress(id, (event) => { + if (event.event === "tick" || event.event === "deleted") setProgress(event); + }); try { const outcome = await api.duplicatesDelete(id, result.scanId, selections, mode); setSummary(outcome); @@ -293,6 +299,7 @@ export function useDuplicatesWorkspace(): DuplicatesWorkspace { setError(messageFrom(reason)); return null; } finally { + stop(); setDeleting(false); currentJob.current = null; } diff --git a/src/lib/skipGroups.ts b/src/lib/skipGroups.ts new file mode 100644 index 0000000..413f9b4 --- /dev/null +++ b/src/lib/skipGroups.ts @@ -0,0 +1,74 @@ +/* Why a skipped item stayed behind — the same taxonomy the 空间清理 result + * view uses, now shared with the in-place clean banners on every page. */ +export interface SkipGroup { + key: string; + title: [string, string]; + hint: [string, string]; + action?: "rescan"; +} + +export function skipGroupOf(reason: string): SkipGroup { + const lower = reason.toLowerCase(); + if (lower.includes("running") || lower.includes("占用")) { + return { + key: "running", + title: ["应用正在运行", "应用正在运行"], + hint: ["退出这些应用后重新扫描,即可再次选中。", "退出这些应用后重新扫描,即可再次选中。"], + action: "rescan", + }; + } + if (lower.includes("admin") || lower.includes("管理员")) { + return { + key: "admin", + title: ["需要管理员权限", "需要管理员权限"], + hint: [ + "以管理员身份重新启动 Squid 后再清理这批项目。", + "以管理员身份重新启动 Squid 后再清理这批项目。", + ], + action: "rescan", + }; + } + if (lower.includes("已不存在") || lower.includes("no longer") || lower.includes("missing")) { + return { + key: "gone", + title: ["扫描后已消失", "扫描后已消失"], + hint: ["这些路径在清理开始前就不在了,无需处理。", "这些路径在清理开始前就不在了,无需处理。"], + }; + } + if (lower.includes("whitelist")) { + return { + key: "whitelist", + title: ["命中白名单", "命中白名单"], + hint: [ + "在 设置 → 白名单 中移除对应规则后才会被清理。", + "在 设置 → 白名单 中移除对应规则后才会被清理。", + ], + }; + } + return { + key: "protected", + title: ["受安全策略保护", "受安全策略保护"], + hint: [ + "这些目录看似缓存,实际可能存有您自己的文件,Squid 不会删除。", + "这些目录看似缓存,实际可能存有您自己的文件,Squid 不会删除。", + ], + }; +} + +/** "占用中 5 · 需要管理员 2" — the skipped-reason tally the amber banner + * shows under its headline. */ +export function skipTally(skipped: { reason: string }[]): string { + const counts = new Map(); + for (const row of skipped) { + const group = skipGroupOf(row.reason); + counts.set(group.title[1], (counts.get(group.title[1]) ?? 0) + 1); + } + return [...counts.entries()].map(([title, count]) => `${title} ${count}`).join(" · "); +} + +/** 41 秒 / 1 分 12 秒 — elapsed labels for the done banner. */ +export function formatDuration(ms: number): string { + const seconds = Math.max(1, Math.round(ms / 1000)); + if (seconds < 60) return `${seconds} 秒`; + return `${Math.floor(seconds / 60)} 分 ${seconds % 60} 秒`; +} diff --git a/src/pages/DuplicateFilesPage.tsx b/src/pages/DuplicateFilesPage.tsx index f45b50f..c790ab7 100644 --- a/src/pages/DuplicateFilesPage.tsx +++ b/src/pages/DuplicateFilesPage.tsx @@ -25,7 +25,8 @@ import { ProgressCard, useToast, } from "../components/ui"; -import type { DupGroup } from "../types"; +import { CleanBar } from "../components/CleanBar"; +import type { DeleteResult, DupGroup } from "../types"; const MIN_SIZE_OPTIONS = [ { value: 1024 * 1024, label: "≥1MB" }, @@ -172,10 +173,13 @@ function DupGroupCard({ export function DuplicateFilesPage({ embedded = false, onBadge, + onHistory, }: { /** Rendered inside 空间清理 hub: page title hides, stats flow to onBadge. */ embedded?: boolean; onBadge?: (value: string | null) => void; + /** Jump to 历史记录 for an undo. */ + onHistory?: () => void; } = {}) { const { t, lang } = useI18n(); const { push } = useToast(); @@ -183,6 +187,9 @@ export function DuplicateFilesPage({ const [minSize, setMinSize] = useState(1024 * 1024); const [extraRoots, setExtraRoots] = useState([]); const [confirming, setConfirming] = useState(false); + const [cleanDone, setCleanDone] = useState<{ outcome: DeleteResult; elapsedMs: number } | null>( + null, + ); const entries = workspace.visible; const groups = entries.map((entry) => entry.group); @@ -204,9 +211,11 @@ export function DuplicateFilesPage({ }; const confirmClean = async () => { - const outcome = await workspace.clean("trash"); setConfirming(false); + const startedAt = Date.now(); + const outcome = await workspace.clean("trash"); if (outcome) { + setCleanDone({ outcome, elapsedMs: Date.now() - startedAt }); push( lang === "zh" ? `已将 ${outcome.removed} 个副本移入回收站(${formatBytes(outcome.freed)}),可在「历史记录」撤销` @@ -343,7 +352,35 @@ export function DuplicateFilesPage({ /> ) : null} - {!workspace.scanning && groups.length === 0 && !workspace.result && !workspace.error ? ( + {workspace.deleting ? ( + onHistory?.()} + onDismiss={() => undefined} + /> + ) : null} + + {!workspace.deleting && cleanDone ? ( + onHistory?.()} + onDismiss={() => setCleanDone(null)} + onRescan={() => void workspace.runScan(extraRoots, minSize)} + /> + ) : null} + + {!workspace.scanning && + groups.length === 0 && + !workspace.result && + !workspace.error && + !workspace.deleting && + !cleanDone ? ( } title={t("No duplicate scan yet", "还没有扫描过重复文件")} diff --git a/src/pages/LargeFilesPage.tsx b/src/pages/LargeFilesPage.tsx index cb2d664..5bc9607 100644 --- a/src/pages/LargeFilesPage.tsx +++ b/src/pages/LargeFilesPage.tsx @@ -26,7 +26,8 @@ import { ProgressCard, useToast, } from "../components/ui"; -import type { JobProgress, LargeFile } from "../types"; +import { CleanBar } from "../components/CleanBar"; +import type { DeleteResult, JobProgress, LargeFile } from "../types"; const THRESHOLDS = [ { value: 100 * 1024 * 1024, label: "≥100MB" }, @@ -56,10 +57,13 @@ const DORMANT_SECS = 180 * 86_400; export function LargeFilesPage({ embedded = false, onBadge, + onHistory, }: { /** Rendered inside 空间清理 hub: page title hides, stats flow to onBadge. */ embedded?: boolean; onBadge?: (value: string | null) => void; + /** Jump to 历史记录 for an undo. */ + onHistory?: () => void; } = {}) { const { t, lang } = useI18n(); const { push } = useToast(); @@ -74,6 +78,9 @@ export function LargeFilesPage({ const [progress, setProgress] = useState(null); const [picked, setPicked] = useState>(new Set()); const [confirming, setConfirming] = useState(false); + const [cleanDone, setCleanDone] = useState< + { outcome: DeleteResult; elapsedMs: number } | null + >(null); const job = useRef(null); const run = useCallback(async () => { @@ -143,12 +150,19 @@ export function LargeFilesPage({ const confirmDelete = async () => { const id = crypto.randomUUID?.() ?? String(Date.now()); + job.current = id; setDeleting(true); + setProgress(null); + const stop = await subscribeJobProgress(id, (event) => { + if (event.event === "tick" || event.event === "deleted") setProgress(event); + }); + const startedAt = Date.now(); try { const outcome = await apiClient.api.largeFilesDelete(id, [...picked], "trash"); setFiles((current) => current?.filter((f) => !picked.has(f.path)) ?? null); setPicked(new Set()); setConfirming(false); + setCleanDone({ outcome, elapsedMs: Date.now() - startedAt }); push( lang === "zh" ? `已将 ${outcome.removed} 个大文件移入回收站(${formatBytes(outcome.freed)}),可在「历史记录」撤销` @@ -158,7 +172,9 @@ export function LargeFilesPage({ } catch (reason) { setError(messageFrom(reason)); } finally { + stop(); setDeleting(false); + job.current = null; } }; @@ -253,6 +269,29 @@ export function LargeFilesPage({ /> ) : null} + {deleting ? ( + onHistory?.()} + onDismiss={() => undefined} + /> + ) : null} + + {!deleting && cleanDone ? ( + onHistory?.()} + onDismiss={() => setCleanDone(null)} + onRescan={() => void run()} + /> + ) : null} + {!files && !scanning ? ( } diff --git a/src/pages/SpaceHubPage.tsx b/src/pages/SpaceHubPage.tsx index 01c3676..a11a3f9 100644 --- a/src/pages/SpaceHubPage.tsx +++ b/src/pages/SpaceHubPage.tsx @@ -85,10 +85,10 @@ export function SpaceHubPage({ />
- +
- +
); diff --git a/src/pages/SpacePage.tsx b/src/pages/SpacePage.tsx index b34e92a..96c4cc8 100644 --- a/src/pages/SpacePage.tsx +++ b/src/pages/SpacePage.tsx @@ -42,6 +42,8 @@ import type { PreflightResult, } from "../types"; import type { ScanWorkspace } from "../hooks/useScanWorkspace"; +import { CleanBar } from "../components/CleanBar"; +import { skipGroupOf } from "../lib/skipGroups"; import { Button, CATEGORY_META, @@ -160,61 +162,8 @@ type Cluster = { /* A⑦: skipped items on the result page are grouped by *why* they were * skipped, each group with the concrete next step — Mole's ledger reads as - * "here is what to do about it", not as a wall of paths. */ -type SkipGroup = { - key: string; - title: [string, string]; - hint: [string, string]; - action?: "rescan"; -}; - -function skipGroupOf(reason: string): SkipGroup { - const lower = reason.toLowerCase(); - if (lower.includes("running") || lower.includes("占用")) { - return { - key: "running", - title: ["应用正在运行", "应用正在运行"], - hint: ["退出这些应用后重新扫描,即可再次选中。", "退出这些应用后重新扫描,即可再次选中。"], - action: "rescan", - }; - } - if (lower.includes("admin") || lower.includes("管理员")) { - return { - key: "admin", - title: ["需要管理员权限", "需要管理员权限"], - hint: [ - "以管理员身份重新启动 Squid 后再清理这批项目。", - "以管理员身份重新启动 Squid 后再清理这批项目。", - ], - action: "rescan", - }; - } - if (lower.includes("已不存在") || lower.includes("no longer") || lower.includes("missing")) { - return { - key: "gone", - title: ["扫描后已消失", "扫描后已消失"], - hint: ["这些路径在清理开始前就不在了,无需处理。", "这些路径在清理开始前就不在了,无需处理。"], - }; - } - if (lower.includes("whitelist")) { - return { - key: "whitelist", - title: ["命中白名单", "命中白名单"], - hint: [ - "在 设置 → 白名单 中移除对应规则后才会被清理。", - "在 设置 → 白名单 中移除对应规则后才会被清理。", - ], - }; - } - return { - key: "protected", - title: ["受安全策略保护", "受安全策略保护"], - hint: [ - "这些目录看似缓存,实际可能存有您自己的文件,Squid 不会删除。", - "这些目录看似缓存,实际可能存有您自己的文件,Squid 不会删除。", - ], - }; -} + * "here is what to do about it", not as a wall of paths. (The taxonomy + * itself lives in lib/skipGroups so CleanBar shares it.) */ /* A③: a cluster is "dormant" when its newest member stopped changing more * than 90 days ago — size plus dormancy is what makes a deletion call easy. */ @@ -483,6 +432,7 @@ export function SpacePage({ const [mode, setMode] = useState(deleteMode); const [busy, setBusy] = useState(false); const [result, setResult] = useState(null); + const [elapsed, setElapsed] = useState(null); const scanning = cleanup.scanning || purge.scanning; const deleting = cleanup.deleting || purge.deleting; const inFlight = useRef(false); @@ -745,6 +695,7 @@ export function SpacePage({ return; } setBusy(true); + const startedAt = Date.now(); const merged: DeleteResult = { freed: 0, freedAllocated: 0, @@ -775,6 +726,7 @@ export function SpacePage({ setPreflight(null); } setResult(merged); + setElapsed(Date.now() - startedAt); push( t( `${formatBytes(merged.freedAllocated || merged.freed)} cleaned`, @@ -941,32 +893,16 @@ export function SpacePage({ "机器上的其他内容未被改动。", )} /> -
-
-
{t("Done", "完成")}
-
- {formatBytes(result.freedAllocated || result.freed)}{" "} - - {t("freed", "已释放")} · {formatCount(result.removed)}{" "} - {t("items", "项")} - {result.failed > 0 - ? t(` · ${result.failed} failed`, ` · ${result.failed} 项失败`) - : ""} - -
-
-
- - - -
-
+ setResult(null)} + /> {result.skipped && result.skipped.length > 0 ? (
@@ -1133,20 +1069,15 @@ export function SpacePage({
) : null} - {deleting ? ( -
- - ✓ {t("Scan complete", "扫描完成")} - - - ◌ {t("Cleaning", "正在清理")}({formatBytes(selectedStats.total)}) - - void (cleanup.deleting ? cleanup.cancel() : purge.cancel())} - /> -
+ {busy || deleting ? ( + undefined} + /> ) : null} {error && !scanning ? ( diff --git a/src/styles.css b/src/styles.css index d3a58d9..acbdafe 100644 --- a/src/styles.css +++ b/src/styles.css @@ -8448,3 +8448,198 @@ html.widget-mode body { gap: 10px; margin-top: 14px; } + +/* ── CleanBar ───────────────────────────────────────────────────────────── + The one clean-progress language every cleaner page speaks: the confirm + strip morphs in place into a per-file progress bar (busy), then settles + into a green / amber result banner (done). Colour contract: orange = + working, green = everything went, amber = some items stayed behind. */ +.cleanbar { + border: 1px solid; + border-radius: 12px; + padding: 12px 16px; + margin: 4px 0 14px; + animation: cleanbar-in 0.22s ease-out; +} + +@keyframes cleanbar-in { + from { + opacity: 0; + transform: translateY(4px); + } + to { + opacity: 1; + transform: none; + } +} + +.cleanbar.is-busy { + border-color: rgba(var(--nex-primary-rgb), 0.4); + background: #fff; + box-shadow: 0 8px 22px rgba(var(--nex-primary-rgb), 0.12); +} + +.cleanbar.is-done { + border-color: rgba(25, 169, 116, 0.4); + background: var(--green-soft); +} + +.cleanbar.is-partial { + border-color: rgba(238, 132, 76, 0.45); + background: var(--orange-soft); +} + +.cleanbar-row { + display: flex; + align-items: center; + gap: 12px; +} + +.cleanbar-main { + flex: 1 1 auto; + min-width: 0; + display: flex; + flex-direction: column; + gap: 3px; +} + +.cleanbar-main b { + font-size: var(--nex-text-sm); + font-weight: var(--nex-weight-semibold); + color: var(--nex-ink); +} + +.cleanbar-main small { + color: var(--nex-muted); + font-size: var(--nex-text-2xs); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + +.cleanbar-current { + font-family: var(--nex-font-mono); + font-size: var(--nex-text-3xs) !important; + color: var(--nex-muted-soft) !important; +} + +.cleanbar-pct { + flex: 0 0 auto; + font-family: var(--nex-font-mono); + font-size: var(--nex-text-xs); + font-weight: var(--nex-weight-bold); + color: var(--nex-primary-strong); +} + +.cleanbar-back { + flex: 0 0 auto; + border: none; + background: none; + color: var(--nex-muted-soft); + font-size: var(--nex-text-3xs); + text-decoration: underline dotted; + cursor: pointer; +} + +.cleanbar-back:hover { + color: var(--nex-primary-strong); +} + +.cleanbar-mark { + flex: 0 0 auto; + width: 26px; + height: 26px; + border-radius: 50%; + display: inline-flex; + align-items: center; + justify-content: center; + color: #fff; +} + +.cleanbar-mark.is-ok { + background: var(--green); +} + +.cleanbar-mark.is-warn { + background: var(--orange); +} + +.cleanbar .spin.is-primary { + color: var(--nex-primary); + flex: 0 0 auto; +} + +.cleanbar-track { + height: 10px; + border-radius: 999px; + background: rgba(89, 51, 34, 0.08); + margin-top: 10px; + overflow: hidden; +} + +.cleanbar-track > span { + display: block; + height: 100%; + border-radius: 999px; + background: + repeating-linear-gradient( + 115deg, + rgba(255, 255, 255, 0.28) 0 10px, + rgba(255, 255, 255, 0) 10px 24px + ), + linear-gradient(90deg, #ff9a68, var(--nex-primary)); + background-size: + 34px 100%, + 100% 100%; + animation: cleanbar-stripes 0.9s linear infinite; + transition: width 0.35s ease; +} + +.cleanbar-track > span.is-indeterminate { + width: 36%; + animation: + cleanbar-stripes 0.9s linear infinite, + cleanbar-sweep 1.4s ease-in-out infinite alternate; +} + +@keyframes cleanbar-stripes { + to { + background-position: + 34px 0, + 0 0; + } +} + +@keyframes cleanbar-sweep { + from { + transform: translateX(-10%); + } + to { + transform: translateX(200%); + } +} + +.cleanbar-capsule { + position: fixed; + right: 22px; + bottom: 22px; + z-index: 60; + display: inline-flex; + align-items: center; + gap: 8px; + padding: 9px 16px; + border-radius: 999px; + border: 1px solid rgba(var(--nex-primary-rgb), 0.35); + background: #fff; + color: var(--nex-primary-strong); + font-size: var(--nex-text-2xs); + font-weight: var(--nex-weight-semibold); + box-shadow: 0 10px 24px rgba(var(--nex-primary-rgb), 0.22); + cursor: pointer; +} + +.cleanbar-skips { + margin-top: 10px; + padding-top: 6px; + border-top: 1px dashed rgba(238, 132, 76, 0.4); +}