From 22638d1a97c687f438784a82d8b8b9dad968aa29 Mon Sep 17 00:00:00 2001 From: daniel-lxs Date: Thu, 23 Oct 2025 18:18:46 -0500 Subject: [PATCH] feat: improve auto-approve button responsiveness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add responsive breakpoint at 300px for compact view - Icon correctly reflects state (X when off, ✓ when on) at all screen sizes - Show abbreviated labels on very narrow screens (< 300px) - Add triggerLabelOffShort translation key to all locales Fixes issues from PR #8152: - Icon always showing checkmark on narrow screens - Breakpoint activating too early (was 400px) - Incorrect Tailwind class ordering --- webview-ui/src/components/chat/AutoApproveDropdown.tsx | 10 +++++++++- webview-ui/src/i18n/locales/ca/chat.json | 1 + webview-ui/src/i18n/locales/de/chat.json | 1 + webview-ui/src/i18n/locales/en/chat.json | 1 + webview-ui/src/i18n/locales/es/chat.json | 1 + webview-ui/src/i18n/locales/fr/chat.json | 1 + webview-ui/src/i18n/locales/hi/chat.json | 1 + webview-ui/src/i18n/locales/id/chat.json | 1 + webview-ui/src/i18n/locales/it/chat.json | 1 + webview-ui/src/i18n/locales/ja/chat.json | 1 + webview-ui/src/i18n/locales/ko/chat.json | 1 + webview-ui/src/i18n/locales/nl/chat.json | 1 + webview-ui/src/i18n/locales/pl/chat.json | 1 + webview-ui/src/i18n/locales/pt-BR/chat.json | 1 + webview-ui/src/i18n/locales/ru/chat.json | 1 + webview-ui/src/i18n/locales/tr/chat.json | 1 + webview-ui/src/i18n/locales/vi/chat.json | 1 + webview-ui/src/i18n/locales/zh-CN/chat.json | 1 + webview-ui/src/i18n/locales/zh-TW/chat.json | 1 + 19 files changed, 27 insertions(+), 1 deletion(-) diff --git a/webview-ui/src/components/chat/AutoApproveDropdown.tsx b/webview-ui/src/components/chat/AutoApproveDropdown.tsx index 08e4a90f6bb5..1fbe8cc0db93 100644 --- a/webview-ui/src/components/chat/AutoApproveDropdown.tsx +++ b/webview-ui/src/components/chat/AutoApproveDropdown.tsx @@ -173,6 +173,7 @@ export const AutoApproveDropdown = ({ disabled = false, triggerClassName = "" }: "inline-flex items-center gap-1.5 relative whitespace-nowrap px-1.5 py-1 text-xs", "bg-transparent border border-[rgba(255,255,255,0.08)] rounded-md text-vscode-foreground", "transition-all duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-vscode-focusBorder focus-visible:ring-inset", + "max-[300px]:shrink-0", disabled ? "opacity-50 cursor-not-allowed" : "opacity-90 hover:opacity-100 hover:bg-[rgba(255,255,255,0.03)] hover:border-[rgba(255,255,255,0.15)] cursor-pointer", @@ -184,13 +185,20 @@ export const AutoApproveDropdown = ({ disabled = false, triggerClassName = "" }: )} - + {!effectiveAutoApprovalEnabled ? t("chat:autoApprove.triggerLabelOff") : enabledCount === totalCount ? t("chat:autoApprove.triggerLabelAll") : t("chat:autoApprove.triggerLabel", { count: enabledCount })} + + {!effectiveAutoApprovalEnabled + ? t("chat:autoApprove.triggerLabelOffShort") + : enabledCount === totalCount + ? t("chat:autoApprove.triggerLabelAll") + : enabledCount} +