Skip to content

Commit e734ec7

Browse files
committed
fix: address PR review comments
- Fix French translation: 'automatically' -> 'automatiquement' - Fix Hindi translation: mixed scripts in 'कॉन्फ़िgerेशन' -> 'कॉन्फ़िगरेशन' - Fix typo: 'CodeAccordian' -> 'CodeAccordion' in test file - Remove redundant state variables in AutoApproveMenu.tsx - Fix translation key namespace: use settings:autoApprove.selectOptionsFirst - Add missing translation key to all language files
1 parent 1852ad1 commit e734ec7

File tree

22 files changed

+42
-29
lines changed

22 files changed

+42
-29
lines changed

webview-ui/src/components/chat/AutoApproveMenu.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ interface AutoApproveMenuProps {
1515

1616
const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
1717
const [isExpanded, setIsExpanded] = useState(false)
18-
const [isMenuExpanded, setIsMenuExpanded] = useState(false)
1918

2019
const {
2120
autoApprovalEnabled,
@@ -151,17 +150,13 @@ const AutoApproveMenu = ({ style }: AutoApproveMenuProps) => {
151150
)
152151

153152
const toggleExpanded = useCallback(() => {
154-
setIsExpanded((prev) => {
155-
const newExpanded = !prev
156-
setIsMenuExpanded(newExpanded)
157-
return newExpanded
158-
})
153+
setIsExpanded((prev) => !prev)
159154
}, [])
160155

161156
// Disable main checkbox while menu is open or no options selected
162157
const isCheckboxDisabled = useMemo(() => {
163-
return !hasEnabledOptions || isMenuExpanded
164-
}, [hasEnabledOptions, isMenuExpanded])
158+
return !hasEnabledOptions || isExpanded
159+
}, [hasEnabledOptions, isExpanded])
165160

166161
const enabledActionsList = Object.entries(toggles)
167162
.filter(([_key, value]) => !!value)

webview-ui/src/components/chat/__tests__/ChatView.auto-approve-new.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ vi.mock("@src/components/common/CodeBlock", () => ({
5252
CODE_BLOCK_BG_COLOR: "rgb(30, 30, 30)",
5353
}))
5454

55-
vi.mock("@src/components/common/CodeAccordian", () => ({
55+
vi.mock("@src/components/common/CodeAccordion", () => ({
5656
default: () => null,
5757
}))
5858

webview-ui/src/components/settings/AutoApproveSettings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export const AutoApproveSettings = ({
136136
<div {...props}>
137137
<SectionHeader description={t("settings:autoApprove.description")}>
138138
<div className="flex items-center gap-2">
139-
<StandardTooltip content={!hasEnabledOptions ? t("chat:autoApprove.selectOptionsFirst") : ""}>
139+
<StandardTooltip content={!hasEnabledOptions ? t("settings:autoApprove.selectOptionsFirst") : ""}>
140140
<VSCodeCheckbox
141141
checked={effectiveAutoApprovalEnabled}
142142
disabled={!hasEnabledOptions}

webview-ui/src/i18n/locales/ca/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@
192192
"title": "Màximes Sol·licituds",
193193
"description": "Fes aquesta quantitat de sol·licituds API automàticament abans de demanar aprovació per continuar amb la tasca.",
194194
"unlimited": "Il·limitat"
195-
}
195+
},
196+
"selectOptionsFirst": "Seleccioneu almenys una opció a continuació per activar l'aprovació automàtica"
196197
},
197198
"providers": {
198199
"providerDocumentation": "Documentació de {{provider}}",

webview-ui/src/i18n/locales/de/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@
192192
"title": "Maximale Anfragen",
193193
"description": "Automatisch so viele API-Anfragen stellen, bevor du um die Erlaubnis gebeten wirst, mit der Aufgabe fortzufahren.",
194194
"unlimited": "Unbegrenzt"
195-
}
195+
},
196+
"selectOptionsFirst": "Wähle mindestens eine Option unten aus, um die automatische Genehmigung zu aktivieren"
196197
},
197198
"providers": {
198199
"providerDocumentation": "{{provider}}-Dokumentation",

webview-ui/src/i18n/locales/en/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@
192192
"unlimited": "Unlimited"
193193
},
194194
"toggleAriaLabel": "Toggle auto-approval",
195-
"disabledAriaLabel": "Auto-approval disabled - select options first"
195+
"disabledAriaLabel": "Auto-approval disabled - select options first",
196+
"selectOptionsFirst": "Select at least one option below to enable auto-approval"
196197
},
197198
"providers": {
198199
"providerDocumentation": "{{provider}} documentation",

webview-ui/src/i18n/locales/es/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@
192192
"title": "Solicitudes máximas",
193193
"description": "Realizar automáticamente esta cantidad de solicitudes a la API antes de pedir aprobación para continuar con la tarea.",
194194
"unlimited": "Ilimitado"
195-
}
195+
},
196+
"selectOptionsFirst": "Selecciona al menos una opción a continuación para habilitar la aprobación automática"
196197
},
197198
"providers": {
198199
"providerDocumentation": "Documentación de {{provider}}",

webview-ui/src/i18n/locales/fr/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,10 @@
122122
"resetToDefault": "Réinitialiser par défaut"
123123
},
124124
"autoApprove": {
125-
"description": "Permettre à Roo d'effectuer automatically 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.",
125+
"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.",
126126
"toggleAriaLabel": "Activer/désactiver l'approbation automatique",
127127
"disabledAriaLabel": "Approbation automatique désactivée - sélectionnez d'abord les options",
128+
"selectOptionsFirst": "Sélectionnez au moins une option ci-dessous pour activer l'approbation automatique",
128129
"readOnly": {
129130
"label": "Lecture",
130131
"description": "Lorsque cette option est activée, Roo affichera automatiquement le contenu des répertoires et lira les fichiers sans que vous ayez à cliquer sur le bouton Approuver.",

webview-ui/src/i18n/locales/hi/chat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@
222222
"autoApprove": {
223223
"title": "स्वत:-स्वीकृति:",
224224
"none": "कोई नहीं",
225-
"description": "स्वत:-स्वीकृति Roo Code को अनुमति मांगे बिना क्रियाएँ करने की अनुमति देती है। केवल उन क्रियाओं के लिए सक्षम करें जिन पर आप पूरी तरह से विश्वास करते हैं। अधिक विस्तृत कॉन्फ़िgerेशन <settingsLink>सेटिंग्स</settingsLink> में उपलब्ध है।",
225+
"description": "स्वत:-स्वीकृति Roo Code को अनुमति मांगे बिना क्रियाएँ करने की अनुमति देती है। केवल उन क्रियाओं के लिए सक्षम करें जिन पर आप पूरी तरह से विश्वास करते हैं। अधिक विस्तृत कॉन्फ़िगरेशन <settingsLink>सेटिंग्स</settingsLink> में उपलब्ध है।",
226226
"selectOptionsFirst": "स्वतः-अनुमोदन सक्षम करने के लिए नीचे दिए گئے विकल्पों में से कम से कम एक का चयन करें",
227227
"toggleAriaLabel": "स्वतः-अनुमोदन टॉगल करें",
228228
"disabledAriaLabel": "स्वतः-अनुमोदन अक्षम - पहले विकल्प चुनें"

webview-ui/src/i18n/locales/hi/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@
192192
"title": "अधिकतम अनुरोध",
193193
"description": "कार्य जारी रखने के लिए अनुमति मांगने से पहले स्वचालित रूप से इतने API अनुरोध करें।",
194194
"unlimited": "असीमित"
195-
}
195+
},
196+
"selectOptionsFirst": "स्वतः-अनुमोदन सक्षम करने के लिए नीचे से कम से कम एक विकल्प चुनें"
196197
},
197198
"providers": {
198199
"providerDocumentation": "{{provider}} दस्तावेज़ीकरण",

0 commit comments

Comments
 (0)