feat: improve auto-approve button responsiveness (#8798)

- 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
This commit is contained in:
Daniel 2025-10-23 20:25:57 -05:00 • committed by GitHub
parent 4f084f89e4
commit 3349c02595
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 27 additions and 1 deletions

View file

@ -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 = "" }:
<CheckCheck className="size-3 flex-shrink-0" />
)}
<span className="truncate min-w-0">
<span className="hidden min-[300px]:inline truncate min-w-0">
{!effectiveAutoApprovalEnabled
? t("chat:autoApprove.triggerLabelOff")
: enabledCount === totalCount
? t("chat:autoApprove.triggerLabelAll")
: t("chat:autoApprove.triggerLabel", { count: enabledCount })}
</span>
<span className="inline min-[300px]:hidden min-w-0">
{!effectiveAutoApprovalEnabled
? t("chat:autoApprove.triggerLabelOffShort")
: enabledCount === totalCount
? t("chat:autoApprove.triggerLabelAll")
: enabledCount}
</span>
</PopoverTrigger>
</StandardTooltip>
<PopoverContent

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "Commuta l'aprovació automàtica",
"disabledAriaLabel": "Aprovació automàtica desactivada - selecciona primer les opcions",
"triggerLabelOff": "Aprovació automàtica desactivada",
"triggerLabelOffShort": "Off",
"triggerLabel_zero": "0 aprovacions automàtiques",
"triggerLabel_one": "1 aprovació automàtica",
"triggerLabel_other": "{{count}} aprovacions automàtiques",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "Automatische Genehmigung umschalten",
"disabledAriaLabel": "Automatische Genehmigung deaktiviert - wähle zuerst Optionen aus",
"triggerLabelOff": "Automatische Genehmigung aus",
"triggerLabelOffShort": "Aus",
"triggerLabel_zero": "0 automatisch genehmigt",
"triggerLabel_one": "1 automatisch genehmigt",
"triggerLabel_other": "{{count}} automatisch genehmigt",

View file

@ -287,6 +287,7 @@
"toggleAriaLabel": "Toggle auto-approval",
"disabledAriaLabel": "Auto-approval disabled - select options first",
"triggerLabelOff": "Auto-approve off",
"triggerLabelOffShort": "Off",
"triggerLabel_zero": "0 auto-approve",
"triggerLabel_one": "1 auto-approved",
"triggerLabel_other": "{{count}} auto-approved",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "Conmutar la aprobación automática",
"disabledAriaLabel": "Aprobación automática deshabilitada: selecciona primero las opciones",
"triggerLabelOff": "Aprobación automática desactivada",
"triggerLabelOffShort": "Desactivado",
"triggerLabel_zero": "0 aprobaciones automáticas",
"triggerLabel_one": "1 aprobación automática",
"triggerLabel_other": "{{count}} aprobaciones automáticas",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "Basculer l'approbation automatique",
"disabledAriaLabel": "Approbation automatique désactivée - sélectionnez d'abord les options",
"triggerLabelOff": "Approbation automatique désactivée",
"triggerLabelOffShort": "Désactivé",
"triggerLabel_zero": "0 approuvé automatiquement",
"triggerLabel_one": "1 approuvé automatiquement",
"triggerLabel_other": "{{count}} approuvés automatiquement",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "स्वतः-अनुमोदन टॉगल करें",
"disabledAriaLabel": "स्वतः-अनुमोदन अक्षम है - पहले विकल्प चुनें",
"triggerLabelOff": "स्वतः-अनुमोदन बंद",
"triggerLabelOffShort": "बंद",
"triggerLabel_zero": "0 स्वतः-अनुमोदन",
"triggerLabel_one": "1 स्वतः-अनुमोदित",
"triggerLabel_other": "{{count}} स्वतः-अनुमोदित",

View file

@ -291,6 +291,7 @@
"toggleAriaLabel": "Beralih persetujuan otomatis",
"disabledAriaLabel": "Persetujuan otomatis dinonaktifkan - pilih opsi terlebih dahulu",
"triggerLabelOff": "Persetujuan otomatis mati",
"triggerLabelOffShort": "Mati",
"triggerLabel_zero": "0 disetujui otomatis",
"triggerLabel_one": "1 disetujui otomatis",
"triggerLabel_other": "{{count}} disetujui otomatis",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "Attiva/disattiva approvazione automatica",
"disabledAriaLabel": "Approvazione automatica disabilitata - seleziona prima le opzioni",
"triggerLabelOff": "Approvazione automatica disattivata",
"triggerLabelOffShort": "Disattivata",
"triggerLabel_zero": "0 approvati automaticamente",
"triggerLabel_one": "1 approvato automaticamente",
"triggerLabel_other": "{{count}} approvati automaticamente",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "自動承認を切り替える",
"disabledAriaLabel": "自動承認が無効です - 最初にオプションを選択してください",
"triggerLabelOff": "自動承認オフ",
"triggerLabelOffShort": "オフ",
"triggerLabel_zero": "0個の自動承認",
"triggerLabel_one": "1個の自動承認済み",
"triggerLabel_other": "{{count}}個の自動承認済み",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "자동 승인 전환",
"disabledAriaLabel": "자동 승인 비활성화됨 - 먼저 옵션을 선택하십시오",
"triggerLabelOff": "자동 승인 꺼짐",
"triggerLabelOffShort": "꺼짐",
"triggerLabel_zero": "0개 자동 승인됨",
"triggerLabel_one": "1개 자동 승인됨",
"triggerLabel_other": "{{count}}개 자동 승인됨",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "Automatische goedkeuring in-/uitschakelen",
"disabledAriaLabel": "Automatische goedkeuring uitgeschakeld - selecteer eerst opties",
"triggerLabelOff": "Automatisch goedkeuren uit",
"triggerLabelOffShort": "Uit",
"triggerLabel_zero": "0 automatisch goedgekeurd",
"triggerLabel_one": "1 automatisch goedgekeurd",
"triggerLabel_other": "{{count}} automatisch goedgekeurd",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "Przełącz automatyczne zatwierdzanie",
"disabledAriaLabel": "Automatyczne zatwierdzanie wyłączone - najpierw wybierz opcje",
"triggerLabelOff": "Automatyczne zatwierdzanie wyłączone",
"triggerLabelOffShort": "Wyłączone",
"triggerLabel_zero": "0 automatycznie zatwierdzone",
"triggerLabel_one": "1 automatycznie zatwierdzony",
"triggerLabel_other": "{{count}} automatycznie zatwierdzonych",

View file

@ -264,6 +264,7 @@
"toggleAriaLabel": "Alternar aprovação automática",
"disabledAriaLabel": "Aprovação automática desativada - selecione as opções primeiro",
"triggerLabelOff": "Aprovação automática desativada",
"triggerLabelOffShort": "Desativada",
"triggerLabel_zero": "0 aprovados automaticamente",
"triggerLabel_one": "1 aprovado automaticamente",
"triggerLabel_other": "{{count}} aprovados automaticamente",

View file

@ -265,6 +265,7 @@
"toggleAriaLabel": "Переключить авто-утверждение",
"disabledAriaLabel": "Авто-утверждение отключено - сначала выберите опции",
"triggerLabelOff": "Авто-утверждение выкл",
"triggerLabelOffShort": "Выкл",
"triggerLabel_zero": "0 авто-утвержденных",
"triggerLabel_one": "1 авто-утвержден",
"triggerLabel_other": "{{count}} авто-утвержденных",

View file

@ -265,6 +265,7 @@
"toggleAriaLabel": "Otomatik onayı aç/kapat",
"disabledAriaLabel": "Otomatik onay devre dışı - önce seçenekleri seçin",
"triggerLabelOff": "Otomatik onay kapalı",
"triggerLabelOffShort": "Kapalı",
"triggerLabel_zero": "0 otomatik onaylandı",
"triggerLabel_one": "1 otomatik onaylandı",
"triggerLabel_other": "{{count}} otomatik onaylandı",

View file

@ -265,6 +265,7 @@
"toggleAriaLabel": "Bật/tắt tự động phê duyệt",
"disabledAriaLabel": "Tự động phê duyệt đã tắt - trước tiên hãy chọn các tùy chọn",
"triggerLabelOff": "Tự động phê duyệt tắt",
"triggerLabelOffShort": "Tắt",
"triggerLabel_zero": "0 được tự động phê duyệt",
"triggerLabel_one": "1 được tự động phê duyệt",
"triggerLabel_other": "{{count}} được tự động phê duyệt",

View file

@ -265,6 +265,7 @@
"toggleAriaLabel": "切换自动批准",
"disabledAriaLabel": "自动批准已禁用 - 请先选择选项",
"triggerLabelOff": "自动批准已关闭",
"triggerLabelOffShort": "关闭",
"triggerLabel_zero": "0 个自动批准",
"triggerLabel_one": "1 个自动批准",
"triggerLabel_other": "{{count}} 个自动批准",

View file

@ -289,6 +289,7 @@
"toggleAriaLabel": "切換自動批准",
"disabledAriaLabel": "自動批准已禁用 - 請先選擇選項",
"triggerLabelOff": "自動批准已關閉",
"triggerLabelOffShort": "關閉",
"triggerLabel_zero": "0 個自動核准",
"triggerLabel_one": "1 個自動核准",
"triggerLabel_other": "{{count}} 個自動核准",