[Feat] Add a persisted opt-in setting for DCG - #1061
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
5c460bd to
baade5f
Compare
e655ee2 to
28fb788
Compare
edelauna
left a comment
There was a problem hiding this comment.
looks good - mostly minor nits
| } catch (error) { | ||
| message.updatedSettings.destructiveCommandGuardEnabled = false | ||
| vscode.window.showErrorMessage( | ||
| t("common:errors.destructive_command_guard_enable_failed", { |
There was a problem hiding this comment.
When !binaryPath, the already-localized unavailable message gets thrown, caught, and re-interpolated into this wrapper — so the user sees "Unable to enable Destructive Command Guard: Destructive Command Guard is enabled but is not available for this platform". Should the !binaryPath branch just call showErrorMessage directly instead of routing through this generic wrapper?
| "destructiveCommandGuard": { | ||
| "unavailable": "Destructive Command Guard is enabled but is not available for this platform" | ||
| }, | ||
| "destructive_command_guard_enable_failed": "Unable to enable Destructive Command Guard: {{error}}", |
There was a problem hiding this comment.
This sits right next to destructiveCommandGuard.unavailable (nested camelCase) but uses flat snake_case — any reason not to keep both keys under the same destructiveCommandGuard namespace?
baade5f to
e1a0c39
Compare
28fb788 to
f7ae3cb
Compare
Related GitHub Issue
Closes #1057
Part of #1049. Split from #1050.
Description
Adds the persisted
destructiveCommandGuardEnabledsetting across shared types, extension/provider state, SettingsView's local cached state, save handling, and Auto-Approve settings UI.Enabling verifies DCG installation. Failure normalizes the setting back to disabled and shows a localized error. Existing allowlist/denylist behavior remains available while DCG is disabled. This PR does not yet change command approval policy.
Stack
3 / 4 — base:
feat/dcg-binary-serviceDepends on PR 2 only for enable-time installation verification.
Test Procedure
Result: 183 extension and 11 webview tests passed; all type-checks, lint, and translation validation passed.
Checklist