Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 30, 2026

Extends folder scanning beyond AppData (Roaming/Local/LocalLow) to support arbitrary user-selected directories.

Implementation

  • Scanner: Added scan_custom_folder() function that mirrors scan_appdata() but accepts &Path. Custom folders stored in DB with Custom: prefix to distinguish from AppData types.

  • Utils: Introduced CUSTOM_FOLDER_PREFIX constant and updated get_appdata_dir() to handle both AppData types and custom paths via prefix detection.

  • UI: Extended folder switcher menu with native dialog picker. Display shows either AppData type or custom path.

  • State management: Added custom_folder_path: Option<PathBuf> to ClearTabState. Cleared on AppData selection, populated on custom folder selection.

Example Usage

// Before: Only AppData folders
scanner::scan_appdata(tx, "Roaming");

// After: Custom folders supported
scanner::scan_custom_folder(tx, &PathBuf::from("/any/path"));

// Internal representation
get_appdata_dir("Roaming") // -> Some(PathBuf("C:\Users\...\AppData\Roaming"))
get_appdata_dir("Custom:C:\MyFolder") // -> Some(PathBuf("C:\MyFolder"))

All existing operations (delete, move, open, ignore, batch actions) work transparently with custom folders through the unified get_appdata_dir() interface.

Original prompt

This section details on the original issue you should resolve

<issue_title>建议可以选择自定义文件夹</issue_title>
<issue_description>对于需要清理的文件夹,可以自定义文件夹地址
这样就不局限appdata了</issue_description>

Comments on the Issue (you are @copilot in this section)

@TC999 具体说下,等有时间实现 @TC999 具体说下,等有时间实现

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 30, 2026 03:26
Co-authored-by: TC999 <88823709+TC999@users.noreply.github.com>
…types, clear selected folders

Co-authored-by: TC999 <88823709+TC999@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option to select custom folder for cleanup Add custom folder selection for cleaning operations Jan 30, 2026
Copilot AI requested a review from TC999 January 30, 2026 03:37
@TC999 TC999 marked this pull request as ready for review January 30, 2026 05:55
@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review

Comment @coderabbitai help to get the list of available commands and usage tips.

@TC999 TC999 merged commit a411d02 into main Jan 30, 2026
2 checks passed
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