Skip to content

feat(ui-plugins): add Duplicate File Finder (duplicate-file-finder) - #257

Open
ppppp2005-p wants to merge 14 commits into
zai-org:mainfrom
ppppp2005-p:feat/duplicate-file-finder
Open

ppppp2005-p wants to merge 14 commits into
zai-org:mainfrom
ppppp2005-p:feat/duplicate-file-finder

Conversation

@ppppp2005-p

Copy link
Copy Markdown

Plugin type (required) / 插件类型(必填)

  • UI Plugin / 是 UI 插件 — provides MCP Apps interactive pages / 提供 MCP Apps 交互页面
  • Standard plugin / 普通插件(非 UI)
  • Not applicable / 不适用

Affected plugin name(s) / 涉及的插件名称:duplicate-file-finder (UI Plugin, new)

What / 改动内容

New community UI plugin Duplicate File Finder / 重复文件查找: Find files that are exact copies of each other in your folders — compared by size and SHA-256 content hash, never by name — and see how much space they waste. One copy per group is kept automatically (the original-looking name, not “copy” or “(1)”), you can change which one, then export a report or move the extra copies into a review folder. Nothing is ever deleted, and moved files can be restored. Runs locally; no API keys.

  • Tools: dupes_open, dupes_edit, dupes_status, dupes_export (all share one side panel: file picker, settings, issue list, editable table, preview, export).
  • Exact matches only: files are grouped by size, then by SHA-256 of their content, so “same name, different content” is never a false match and renamed copies are still found.
  • Which copy to keep: smart (no “copy / 副本 / (1)” in the name, shortest path), oldest, newest, or prefer a folder you name; change any group with the Keep checkbox.
  • Space saved: groups are sorted by wasted space; the summary shows how much you would free.
  • Safe clean-up: extra copies are moved into duplicate-file-finder//review/ with their original paths, never deleted; “Restore moved copies” puts them back. Groups with no kept file are blocked.
  • Filters: skip tiny files and extensions like .DS_Store; empty files are ignored.
  • Scope (v0.1):
    • Exact duplicates only; similar photos (resized or re-encoded) are not matched in v0.1.
    • Inside the workspace, up to 5 folders and 20,000 files per scan.
    • It never deletes; empty the review folder yourself when you're sure.
  • Local only; writes only duplicate-file-finder/ in the workspace. Workspace paths are checked so symlinks cannot lead reads or writes outside the workspace (regression test included).
  • Tests: vitest unit + MCP tool tests on real sample files, and a browser e2e with the official AppBridge host (panel → open → edit → export).

A ZCode Desktop demo recording is attached in the comments. / ZCode 桌面版演示录屏见评论。

Self-check / 自查清单

  • Plugin name is unique kebab-case; new external plugin directory is external_plugins/<name>/
  • Usage category is set (productivity)
  • Plugin type and affected names are declared above
  • version 0.1.0 in both plugin.json and marketplace.json
  • README.md (EN) and README_CN.md (中文) both provided and equivalent
  • description_i18n has both en and zh-CN
  • No secrets, machine-specific paths, or private dependencies
  • Model/API/network dependencies documented
  • python3 scripts/validate.py and python3 scripts/build_dist.py pass locally
  • Exercised in ZCode Desktop (ZCode 4.0.0, macOS arm64: installed from a local marketplace, scanned the folder p100/duplicate-file-finder/下载 and exported the duplicate report (CSV + HTML), nothing moved; demo video in the comments)

@ppppp2005-p

Copy link
Copy Markdown
Author

ZCode desktop demo (ZCode 4.0.0, macOS arm64)

duplicate-file-finder-demo.mp4

Flow shown:

  1. Installed duplicate-file-finder from a local marketplace built from this PR's branch.
  2. Asked ZCode to scan the folder p100/duplicate-file-finder/下载 (a messy downloads folder with an old-computer backup subfolder) and export (dupes_open, dupes_edit only if something blocks, dupes_export).
  3. dupes_open found 2 duplicate groups with 3 extra copies (6.1 KB to free) and no problems, so no edit was needed. The side panel (重复文件查找) shows the settings (minimum size, ignored extensions, which copy to keep: smart, i.e. not the "副本"/"(1)" one), the summary chips and the table with the keep checkboxes.
  4. dupes_export with the report format wrote duplicate-file-finder/下载/duplicates.csv and duplicates.html: group 1 keeps 合同-终版.pdf (extra: 合同-终版 (1).pdf, 旧电脑备份/合同.pdf), group 2 keeps logo.png (extra: the copy in 旧电脑备份/). No files were moved or deleted. Same-size but different files (notes.txt / notes-2.txt, banner.png) and the empty file were correctly not reported. The last card is the final state.

演示流程:本地 marketplace 安装 → dupes_open(2 组重复、3 个多余副本、可释放 6.1 KB)→ dupes_export 只导出报告(CSV + HTML),不移动、不删除文件;面板显示保留规则和勾选表。

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

@panda920

Copy link
Copy Markdown
Collaborator

✅ Internal validation passed. A ZCode maintainer will review the change next; after acceptance, release checks run separately and this PR is closed automatically.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants