Skip to content

Commit 3349c02

Browse files
authored
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
1 parent 4f084f8 commit 3349c02

File tree

19 files changed

+27
-1
lines changed

19 files changed

+27
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ export const AutoApproveDropdown = ({ disabled = false, triggerClassName = "" }:
173173
"inline-flex items-center gap-1.5 relative whitespace-nowrap px-1.5 py-1 text-xs",
174174
"bg-transparent border border-[rgba(255,255,255,0.08)] rounded-md text-vscode-foreground",
175175
"transition-all duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-vscode-focusBorder focus-visible:ring-inset",
176+
"max-[300px]:shrink-0",
176177
disabled
177178
? "opacity-50 cursor-not-allowed"
178179
: "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 = "" }:
184185
<CheckCheck className="size-3 flex-shrink-0" />
185186
)}
186187

187-
<span className="truncate min-w-0">
188+
<span className="hidden min-[300px]:inline truncate min-w-0">
188189
{!effectiveAutoApprovalEnabled
189190
? t("chat:autoApprove.triggerLabelOff")
190191
: enabledCount === totalCount
191192
? t("chat:autoApprove.triggerLabelAll")
192193
: t("chat:autoApprove.triggerLabel", { count: enabledCount })}
193194
</span>
195+
<span className="inline min-[300px]:hidden min-w-0">
196+
{!effectiveAutoApprovalEnabled
197+
? t("chat:autoApprove.triggerLabelOffShort")
198+
: enabledCount === totalCount
199+
? t("chat:autoApprove.triggerLabelAll")
200+
: enabledCount}
201+
</span>
194202
</PopoverTrigger>
195203
</StandardTooltip>
196204
<PopoverContent

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

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,7 @@
287287
"toggleAriaLabel": "Toggle auto-approval",
288288
"disabledAriaLabel": "Auto-approval disabled - select options first",
289289
"triggerLabelOff": "Auto-approve off",
290+
"triggerLabelOffShort": "Off",
290291
"triggerLabel_zero": "0 auto-approve",
291292
"triggerLabel_one": "1 auto-approved",
292293
"triggerLabel_other": "{{count}} auto-approved",

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

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)