-
Notifications
You must be signed in to change notification settings - Fork 2.6k
feat: Delete .roo/rules-{mode} folder when custom mode is deleted (#5210) #5317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds a two-step deletion flow for custom modes that ensures any associated .roo/rules-{mode} folder is discovered and confirmed in the UI before removal.
- Introduce a
checkOnlyflag in webview messages to fetch and relay the rules-folder path. - Update the WebView component (
ModesView.tsx) to show a confirmation dialog with the actual folder path. - Extend message handler in
webviewMessageHandler.tsto detect, report, and delete the rules folder, with translations and error handling. - Add new translation keys and update existing ones across all locales.
- Expand unit tests to cover deletion and folder-removal behaviors.
Reviewed Changes
Copilot reviewed 41 out of 41 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| webview-ui/src/i18n/locales/*/prompts.json | Added deleteMode dialog keys in all languages |
| webview-ui/src/components/modes/ModesView.tsx | Implemented AlertDialog for delete confirmation |
| src/shared/WebviewMessage.ts | Added checkOnly to the webview message interface |
| src/shared/ExtensionMessage.ts | Added deleteCustomModeCheck, rulesFolderExists and rulesFolderPath |
| src/core/webview/webviewMessageHandler.ts | Handle checkOnly, determine folder existence and perform deletion |
| src/core/webview/tests/webviewMessageHandler.spec.ts | Added tests for delete-mode logic and folder deletion |
| src/i18n/locales/*/common.json | Updated confirmation strings with rules-folder placeholders |
Comments suppressed due to low confidence (3)
webview-ui/src/components/modes/ModesView.tsx:1440
- When there's no rules folder path, the generic message is still shown. To improve clarity, render
t("prompts:deleteMode.descriptionNoRules")instead of themessagekey whenrulesFolderPathis undefined.
{t("prompts:deleteMode.message", { modeName: modeToDelete.name })}
src/core/webview/webviewMessageHandler.ts:1521
- The new confirmation translation in
common.jsonuses{scope}and{rulesFolderPath}, but the rest of the UI uses{{scope}}/{{rulesFolderPath}}interpolation syntax. For consistency with other i18n keys, update these placeholders to double braces.
type: "deleteCustomModeCheck",
src/core/webview/tests/webviewMessageHandler.spec.ts:366
- There are tests for the full deletion path, but none that simulate a
checkOnly: truemessage. Add a test to assert that whencheckOnlyis sent,postMessageToWebviewis called withdeleteCustomModeCheckand the correct folder info.
describe("webviewMessageHandler - deleteCustomMode", () => {
|
✅ No security or compliance issues detected. Reviewed everything up to 34fffef. Security Overview
Detected Code Changes
Reply to this PR with |
daniel-lxs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Looks like we got some conflicts, sorry! |
…g German translation
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
Co-authored-by: ellipsis-dev[bot] <65095814+ellipsis-dev[bot]@users.noreply.github.com>
d056c7b to
5cc6a86
Compare
Pull Request for Issue #5210
Changes Made
Verification
Related Issues
Resolves #5210: Deleting a custom mode now deletes its corresponding .roo/rules-{mode} folder.
Checklist
Important
This PR adds functionality to delete the
.roo/rules-{mode}folder when a custom mode is deleted, including UI updates, error handling improvements, and translations.webviewMessageHandler.tsto check for rules folder existence before confirming deletion.DeleteModeDialog.tsxshowing the path of the rules folder if it exists.webviewMessageHandler.spec.tsfor deleting modes and handling errors.common.jsonacross multiple languages includingca,de,en,es,fr,hi,id,it,ja,ko,nl,pl,pt-BR,ru,tr,vi,zh-CN,zh-TW.deleteCustomModeCheckmessage type inExtensionMessage.tsandWebviewMessage.ts.This description was created by
for 34fffef. You can customize this summary. It will automatically update as commits are pushed.