feat: add concurrent edits toggle to auto-approval dropdown

- Add a top-level toggle for the MULTI_FILE_APPLY_DIFF experiment
- Display toggle in AutoApproveDropdown above regular auto-approval settings
- Connect toggle to experiment state management
- Add localization strings for the new toggle
- Implement proper TypeScript types and message handling

Fixes #8791
This commit is contained in:
Roo Code 2025-10-23 15:07:18 +00:00
parent b9110dc243
commit d8df7d0066
2 changed files with 36 additions and 2 deletions

View file

@ -1,5 +1,5 @@
import React from "react"
import { ListChecks, LayoutList, Settings, CheckCheck, X } from "lucide-react"
import { ListChecks, LayoutList, Settings, CheckCheck, X, FileEdit } from "lucide-react"
import { vscode } from "@/utils/vscode"
import { cn } from "@/lib/utils"
@ -35,6 +35,8 @@ export const AutoApproveDropdown = ({ disabled = false, triggerClassName = "" }:
setAlwaysApproveResubmit,
setAlwaysAllowFollowupQuestions,
setAlwaysAllowUpdateTodoList,
experiments,
setExperimentEnabled,
} = useExtensionState()
const baseToggles = useAutoApprovalToggles()
@ -215,6 +217,34 @@ export const AutoApproveDropdown = ({ disabled = false, triggerClassName = "" }:
{t("chat:autoApprove.description")}
</p>
</div>
{/* Concurrent Edits Toggle - Always visible as a quick access toggle */}
<div className="px-3 py-2 border-b border-vscode-dropdown-border">
<StandardTooltip content={t("chat:autoApprove.concurrentEdits.description")}>
<label className="flex items-center justify-between cursor-pointer">
<div className="flex items-center gap-2">
<FileEdit className="size-4 flex-shrink-0" />
<span className="text-sm font-medium">
{t("chat:autoApprove.concurrentEdits.label")}
</span>
</div>
<ToggleSwitch
checked={experiments?.multiFileApplyDiff ?? false}
onChange={() => {
const newValue = !(experiments?.multiFileApplyDiff ?? false)
if (setExperimentEnabled) {
setExperimentEnabled("multiFileApplyDiff", newValue)
}
vscode.postMessage({
type: "updateExperimental",
values: { multiFileApplyDiff: newValue },
})
}}
aria-label={t("chat:autoApprove.concurrentEdits.label")}
/>
</label>
</StandardTooltip>
</div>
<div className="grid grid-cols-1 min-[340px]:grid-cols-2 gap-x-2 gap-y-2 p-3">
{settingsArray.map(({ key, labelKey, descriptionKey, icon }) => {
const isEnabled = toggles[key]

View file

@ -290,7 +290,11 @@
"triggerLabel_zero": "0 auto-approve",
"triggerLabel_one": "1 auto-approved",
"triggerLabel_other": "{{count}} auto-approved",
"triggerLabelAll": "YOLO"
"triggerLabelAll": "YOLO",
"concurrentEdits": {
"label": "Concurrent Edits",
"description": "Enable concurrent file edits for faster multi-file operations"
}
},
"announcement": {
"title": "🎉 Roo Code {{version}} Released",