From 39a0752c0a05db1258c2ecb2d7eec80bd483e4ac Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Fri, 1 Aug 2025 00:51:03 -0400 Subject: [PATCH 1/4] Clean up the auto-approve UI --- .../src/components/chat/AutoApproveMenu.tsx | 12 -- .../settings/AutoApproveSettings.tsx | 103 ++++++++++-------- .../components/settings/AutoApproveToggle.tsx | 19 ++-- .../src/components/settings/MaxCostInput.tsx | 30 +++-- .../components/settings/MaxLimitInputs.tsx | 2 +- .../components/settings/MaxRequestsInput.tsx | 28 +++-- webview-ui/src/i18n/locales/en/settings.json | 1 + 7 files changed, 93 insertions(+), 102 deletions(-) diff --git a/webview-ui/src/components/chat/AutoApproveMenu.tsx b/webview-ui/src/components/chat/AutoApproveMenu.tsx index c97af13593..e6accfd87d 100644 --- a/webview-ui/src/components/chat/AutoApproveMenu.tsx +++ b/webview-ui/src/components/chat/AutoApproveMenu.tsx @@ -6,7 +6,6 @@ import { vscode } from "@src/utils/vscode" import { useExtensionState } from "@src/context/ExtensionStateContext" import { useAppTranslation } from "@src/i18n/TranslationContext" import { AutoApproveToggle, AutoApproveSetting, autoApproveSettingsConfig } from "../settings/AutoApproveToggle" -import { MaxLimitInputs } from "../settings/MaxLimitInputs" import { StandardTooltip } from "@src/components/ui" import { useAutoApprovalState } from "@src/hooks/useAutoApprovalState" import { useAutoApprovalToggles } from "@src/hooks/useAutoApprovalToggles" @@ -22,8 +21,6 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { autoApprovalEnabled, setAutoApprovalEnabled, alwaysApproveResubmit, - allowedMaxRequests, - allowedMaxCost, setAlwaysAllowReadOnly, setAlwaysAllowWrite, setAlwaysAllowExecute, @@ -34,8 +31,6 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { setAlwaysApproveResubmit, setAlwaysAllowFollowupQuestions, setAlwaysAllowUpdateTodoList, - setAllowedMaxRequests, - setAllowedMaxCost, } = useExtensionState() const { t } = useAppTranslation() @@ -245,13 +240,6 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => { - - setAllowedMaxRequests(value)} - onMaxCostChange={(value) => setAllowedMaxCost(value)} - /> )} diff --git a/webview-ui/src/components/settings/AutoApproveSettings.tsx b/webview-ui/src/components/settings/AutoApproveSettings.tsx index 95c311422a..88239c027a 100644 --- a/webview-ui/src/components/settings/AutoApproveSettings.tsx +++ b/webview-ui/src/components/settings/AutoApproveSettings.tsx @@ -1,5 +1,5 @@ import { HTMLAttributes, useState } from "react" -import { X } from "lucide-react" +import { X, CheckCheck } from "lucide-react" import { useAppTranslation } from "@/i18n/TranslationContext" import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" @@ -114,57 +114,68 @@ export const AutoApproveSettings = ({ return (
- +
- {!hasEnabledOptions ? ( - - { - // Do nothing when no options are enabled - return - }} - /> - - ) : ( - { - const newValue = !(autoApprovalEnabled ?? false) - setAutoApprovalEnabled(newValue) - vscode.postMessage({ type: "autoApprovalEnabled", bool: newValue }) - }} - /> - )} - +
{t("settings:sections.autoApprove")}
- setCachedStateField(key, value)} - /> - setCachedStateField("allowedMaxRequests", value)} - onMaxCostChange={(value) => setCachedStateField("allowedMaxCost", value)} - /> +
+
+ {!hasEnabledOptions ? ( + + { + // Do nothing when no options are enabled + return + }}> + Auto-Approve Enabled + + + ) : ( + { + const newValue = !(autoApprovalEnabled ?? false) + setAutoApprovalEnabled(newValue) + vscode.postMessage({ type: "autoApprovalEnabled", bool: newValue }) + }}> + {t("settings:autoApprove.enabled")} + + )} +
+ {t("settings:autoApprove.description")} +
+
+ + setCachedStateField(key, value)} + /> + + setCachedStateField("allowedMaxRequests", value)} + onMaxCostChange={(value) => setCachedStateField("allowedMaxCost", value)} + /> +
{/* ADDITIONAL SETTINGS */} diff --git a/webview-ui/src/components/settings/AutoApproveToggle.tsx b/webview-ui/src/components/settings/AutoApproveToggle.tsx index e8b51b01ef..e6540f3d89 100644 --- a/webview-ui/src/components/settings/AutoApproveToggle.tsx +++ b/webview-ui/src/components/settings/AutoApproveToggle.tsx @@ -109,13 +109,7 @@ export const AutoApproveToggle = ({ onToggle, ...props }: AutoApproveToggleProps const { t } = useAppTranslation() return ( -
+
{Object.values(autoApproveSettingsConfig).map(({ key, descriptionKey, labelKey, icon, testId }) => ( ))} diff --git a/webview-ui/src/components/settings/MaxCostInput.tsx b/webview-ui/src/components/settings/MaxCostInput.tsx index 369d1bfe35..944b987d27 100644 --- a/webview-ui/src/components/settings/MaxCostInput.tsx +++ b/webview-ui/src/components/settings/MaxCostInput.tsx @@ -20,22 +20,20 @@ export function MaxCostInput({ allowedMaxCost, onValueChange }: MaxCostInputProp ) return ( -
-
+ <> +
-
- $]} - /> -
-
+ {t("settings:autoApprove.apiCostLimit.title")}: + + $]} + /> + ) } diff --git a/webview-ui/src/components/settings/MaxLimitInputs.tsx b/webview-ui/src/components/settings/MaxLimitInputs.tsx index 0508843180..c09d886eb3 100644 --- a/webview-ui/src/components/settings/MaxLimitInputs.tsx +++ b/webview-ui/src/components/settings/MaxLimitInputs.tsx @@ -20,7 +20,7 @@ export const MaxLimitInputs: React.FC = ({ return (
-
+
diff --git a/webview-ui/src/components/settings/MaxRequestsInput.tsx b/webview-ui/src/components/settings/MaxRequestsInput.tsx index d0609f4e8e..ba9497cd2d 100644 --- a/webview-ui/src/components/settings/MaxRequestsInput.tsx +++ b/webview-ui/src/components/settings/MaxRequestsInput.tsx @@ -20,21 +20,19 @@ export function MaxRequestsInput({ allowedMaxRequests, onValueChange }: MaxReque ) return ( -
-
+ <> +
-
- -
-
+ {t("settings:autoApprove.apiRequestLimit.title")}: + + + ) } diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index 11c575bdf3..46c15556c8 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Allow Roo to automatically perform operations without requiring approval. Enable these settings only if you fully trust the AI and understand the associated security risks.", + "enabled": "Auto-Approve Enabled", "readOnly": { "label": "Read", "description": "When enabled, Roo will automatically view directory contents and read files without requiring you to click the Approve button.", From af9938df2d4829423b7844c5e936fbc9c53cbd87 Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Fri, 1 Aug 2025 01:01:37 -0400 Subject: [PATCH 2/4] Update webview-ui/src/components/settings/AutoApproveSettings.tsx Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com> --- webview-ui/src/components/settings/AutoApproveSettings.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/settings/AutoApproveSettings.tsx b/webview-ui/src/components/settings/AutoApproveSettings.tsx index 88239c027a..4ad9e15651 100644 --- a/webview-ui/src/components/settings/AutoApproveSettings.tsx +++ b/webview-ui/src/components/settings/AutoApproveSettings.tsx @@ -134,7 +134,9 @@ export const AutoApproveSettings = ({ // Do nothing when no options are enabled return }}> - Auto-Approve Enabled + }> + {t("settings:autoApprove.enabled")} + ) : ( From a7763e991212f66444352d0170dfef8b9d692c3f Mon Sep 17 00:00:00 2001 From: Matt Rubens Date: Fri, 1 Aug 2025 01:07:44 -0400 Subject: [PATCH 3/4] Fix --- webview-ui/src/components/settings/AutoApproveSettings.tsx | 2 -- 1 file changed, 2 deletions(-) diff --git a/webview-ui/src/components/settings/AutoApproveSettings.tsx b/webview-ui/src/components/settings/AutoApproveSettings.tsx index 4ad9e15651..5ce44c747d 100644 --- a/webview-ui/src/components/settings/AutoApproveSettings.tsx +++ b/webview-ui/src/components/settings/AutoApproveSettings.tsx @@ -134,10 +134,8 @@ export const AutoApproveSettings = ({ // Do nothing when no options are enabled return }}> - }> {t("settings:autoApprove.enabled")} - ) : ( Date: Fri, 1 Aug 2025 01:11:32 -0400 Subject: [PATCH 4/4] Translations --- webview-ui/src/i18n/locales/ca/settings.json | 1 + webview-ui/src/i18n/locales/de/settings.json | 1 + webview-ui/src/i18n/locales/es/settings.json | 1 + webview-ui/src/i18n/locales/fr/settings.json | 1 + webview-ui/src/i18n/locales/hi/settings.json | 1 + webview-ui/src/i18n/locales/id/settings.json | 1 + webview-ui/src/i18n/locales/it/settings.json | 1 + webview-ui/src/i18n/locales/ja/settings.json | 1 + webview-ui/src/i18n/locales/ko/settings.json | 1 + webview-ui/src/i18n/locales/nl/settings.json | 1 + webview-ui/src/i18n/locales/pl/settings.json | 1 + webview-ui/src/i18n/locales/pt-BR/settings.json | 1 + webview-ui/src/i18n/locales/ru/settings.json | 1 + webview-ui/src/i18n/locales/tr/settings.json | 1 + webview-ui/src/i18n/locales/vi/settings.json | 1 + webview-ui/src/i18n/locales/zh-CN/settings.json | 1 + webview-ui/src/i18n/locales/zh-TW/settings.json | 1 + 17 files changed, 17 insertions(+) diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index 82c8f40516..9ab98a8980 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Permet que Roo realitzi operacions automàticament sense requerir aprovació. Activeu aquesta configuració només si confieu plenament en la IA i enteneu els riscos de seguretat associats.", + "enabled": "Auto-aprovació activada", "toggleAriaLabel": "Commuta l'aprovació automàtica", "disabledAriaLabel": "Aprovació automàtica desactivada: seleccioneu primer les opcions", "readOnly": { diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index df61c3142e..667b313468 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Erlaubt Roo, Operationen automatisch ohne Genehmigung durchzuführen. Aktiviere diese Einstellungen nur, wenn du der KI vollständig vertraust und die damit verbundenen Sicherheitsrisiken verstehst.", + "enabled": "Auto-Genehmigung aktiviert", "toggleAriaLabel": "Automatische Genehmigung umschalten", "disabledAriaLabel": "Automatische Genehmigung deaktiviert - zuerst Optionen auswählen", "readOnly": { diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index 3afeb091ef..0f41e6ddda 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Permitir que Roo realice operaciones automáticamente sin requerir aprobación. Habilite esta configuración solo si confía plenamente en la IA y comprende los riesgos de seguridad asociados.", + "enabled": "Auto-aprobación habilitada", "toggleAriaLabel": "Alternar aprobación automática", "disabledAriaLabel": "Aprobación automática desactivada: seleccione primero las opciones", "readOnly": { diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 5b1c0431fe..5af186e6b1 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Permettre à Roo d'effectuer automatiquement des opérations sans requérir d'approbation. Activez ces paramètres uniquement si vous faites entièrement confiance à l'IA et que vous comprenez les risques de sécurité associés.", + "enabled": "Auto-approbation activée", "toggleAriaLabel": "Activer/désactiver l'approbation automatique", "disabledAriaLabel": "Approbation automatique désactivée - sélectionnez d'abord les options", "selectOptionsFirst": "Sélectionnez au moins une option ci-dessous pour activer l'approbation automatique", diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index 0c7ab3a0bc..e3743a531e 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Roo को अनुमोदन की आवश्यकता के बिना स्वचालित रूप से ऑपरेशन करने की अनुमति दें। इन सेटिंग्स को केवल तभी सक्षम करें जब आप AI पर पूरी तरह से भरोसा करते हों और संबंधित सुरक्षा जोखिमों को समझते हों।", + "enabled": "स्वत:-अनुमोदन सक्षम", "toggleAriaLabel": "स्वतः-अनुमोदन टॉगल करें", "disabledAriaLabel": "स्वतः-अनुमोदन अक्षम - पहले विकल्प चुनें", "readOnly": { diff --git a/webview-ui/src/i18n/locales/id/settings.json b/webview-ui/src/i18n/locales/id/settings.json index fc1b1915ab..0f47712f21 100644 --- a/webview-ui/src/i18n/locales/id/settings.json +++ b/webview-ui/src/i18n/locales/id/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Izinkan Roo untuk secara otomatis melakukan operasi tanpa memerlukan persetujuan. Aktifkan pengaturan ini hanya jika kamu sepenuhnya mempercayai AI dan memahami risiko keamanan yang terkait.", + "enabled": "Auto-Approve Diaktifkan", "toggleAriaLabel": "Beralih persetujuan otomatis", "disabledAriaLabel": "Persetujuan otomatis dinonaktifkan - pilih opsi terlebih dahulu", "readOnly": { diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index 3b82f073b3..e5bc317eff 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Permetti a Roo di eseguire automaticamente operazioni senza richiedere approvazione. Abilita queste impostazioni solo se ti fidi completamente dell'IA e comprendi i rischi di sicurezza associati.", + "enabled": "Auto-approvazione abilitata", "toggleAriaLabel": "Attiva/disattiva approvazione automatica", "disabledAriaLabel": "Approvazione automatica disabilitata - seleziona prima le opzioni", "readOnly": { diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index 321b269a8a..ab4cda177a 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Rooが承認なしで自動的に操作を実行できるようにします。AIを完全に信頼し、関連するセキュリティリスクを理解している場合にのみ、これらの設定を有効にしてください。", + "enabled": "自動承認が有効", "toggleAriaLabel": "自動承認の切り替え", "disabledAriaLabel": "自動承認が無効です - 最初にオプションを選択してください", "readOnly": { diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index d286ac71a2..adad29a152 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Roo가 승인 없이 자동으로 작업을 수행할 수 있도록 허용합니다. AI를 완전히 신뢰하고 관련 보안 위험을 이해하는 경우에만 이러한 설정을 활성화하세요.", + "enabled": "자동 승인 활성화됨", "toggleAriaLabel": "자동 승인 전환", "disabledAriaLabel": "자동 승인 비활성화됨 - 먼저 옵션을 선택하세요", "readOnly": { diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index e8c1db5ace..e635c8d2c8 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Sta Roo toe om automatisch handelingen uit te voeren zonder goedkeuring. Schakel deze instellingen alleen in als je de AI volledig vertrouwt en de bijbehorende beveiligingsrisico's begrijpt.", + "enabled": "Auto-goedkeuren ingeschakeld", "toggleAriaLabel": "Automatisch goedkeuren in-/uitschakelen", "disabledAriaLabel": "Automatisch goedkeuren uitgeschakeld - selecteer eerst opties", "readOnly": { diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index ab208ffe14..d176693143 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Pozwól Roo na automatyczne wykonywanie operacji bez wymagania zatwierdzenia. Włącz te ustawienia tylko jeśli w pełni ufasz AI i rozumiesz związane z tym zagrożenia bezpieczeństwa.", + "enabled": "Auto-zatwierdzanie włączone", "toggleAriaLabel": "Przełącz automatyczne zatwierdzanie", "disabledAriaLabel": "Automatyczne zatwierdzanie wyłączone - najpierw wybierz opcje", "readOnly": { diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 6bcfbb564c..a646229164 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Permitir que o Roo realize operações automaticamente sem exigir aprovação. Ative essas configurações apenas se confiar totalmente na IA e compreender os riscos de segurança associados.", + "enabled": "Aprovação automática habilitada", "toggleAriaLabel": "Alternar aprovação automática", "disabledAriaLabel": "Aprovação automática desativada - selecione as opções primeiro", "readOnly": { diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index 8d52241d6c..7476f0cb0a 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Разрешить Roo автоматически выполнять операции без необходимости одобрения. Включайте эти параметры только если полностью доверяете ИИ и понимаете связанные с этим риски безопасности.", + "enabled": "Автоодобрение включено", "toggleAriaLabel": "Переключить автоодобрение", "disabledAriaLabel": "Автоодобрение отключено - сначала выберите опции", "readOnly": { diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index 486dad0540..07e8dac1d6 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Roo'nun onay gerektirmeden otomatik olarak işlemler gerçekleştirmesine izin verin. Bu ayarları yalnızca yapay zekaya tamamen güveniyorsanız ve ilgili güvenlik risklerini anlıyorsanız etkinleştirin.", + "enabled": "Oto-onay etkinleştirildi", "toggleAriaLabel": "Otomatik onayı değiştir", "disabledAriaLabel": "Otomatik onay devre dışı - önce seçenekleri belirleyin", "readOnly": { diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index dbe0e73736..e1b91860b8 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "Cho phép Roo tự động thực hiện các hoạt động mà không cần phê duyệt. Chỉ bật những cài đặt này nếu bạn hoàn toàn tin tưởng AI và hiểu rõ các rủi ro bảo mật liên quan.", + "enabled": "Phê duyệt tự động đã bật", "toggleAriaLabel": "Chuyển đổi tự động phê duyệt", "disabledAriaLabel": "Tự động phê duyệt bị vô hiệu hóa - hãy chọn các tùy chọn trước", "readOnly": { diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 32e5c96d02..2b390f349c 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "允许 Roo 自动执行操作而无需批准。只有在您完全信任 AI 并了解相关安全风险的情况下才启用这些设置。", + "enabled": "自动批准已启用", "toggleAriaLabel": "切换自动批准", "disabledAriaLabel": "自动批准已禁用 - 请先选择选项", "readOnly": { diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index b8e09bc373..b1ec67b8db 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -127,6 +127,7 @@ }, "autoApprove": { "description": "允許 Roo 無需核准即執行操作。僅在您完全信任 AI 並了解相關安全風險時啟用這些設定。", + "enabled": "自動核准已啟用", "toggleAriaLabel": "切換自動核准", "disabledAriaLabel": "自動核准已停用 - 請先選取選項", "readOnly": {