Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 17 additions & 6 deletions webview-ui/src/components/chat/AutoApproveDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,24 +173,35 @@ 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-[400px]:shrink-0",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 400px breakpoint is hardcoded in multiple places (lines 176, 182, 183, 191, 198). Consider extracting this to a constant or CSS variable for better maintainability. For example:

const NARROW_SCREEN_BREAKPOINT = '400px';
// Then use: `max-[${NARROW_SCREEN_BREAKPOINT}]` in template literals

Or define it as a Tailwind config value if the project supports it.

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",
triggerClassName,
)}>
{!effectiveAutoApprovalEnabled ? (
<X className="size-3 flex-shrink-0" />
) : (
<CheckCheck className="size-3 flex-shrink-0" />
)}
<CheckCheck className="min-[400px]:hidden size-3 flex-shrink-0" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this intentional? The button always shows the CheckCheck icon on narrow screens regardless of the auto-approve state. This could be confusing since users expect the icon to reflect whether auto-approve is on or off. Consider keeping the state-based icon logic even on narrow screens:

Suggested change
<CheckCheck className="min-[400px]:hidden size-3 flex-shrink-0" />
<span className="min-[400px]:hidden">
{!effectiveAutoApprovalEnabled ? (
<X className="size-3 flex-shrink-0" />
) : (
<CheckCheck className="size-3 flex-shrink-0" />
)}
</span>

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is intentional, it keeps the semantic meaning of the button (double checkmark == auto-approve) even without the text on the button that says what it does

<span className="max-[400px]:hidden">
{!effectiveAutoApprovalEnabled ? (
<X className="size-3 flex-shrink-0" />
) : (
<CheckCheck className="size-3 flex-shrink-0" />
)}
</span>

<span className="truncate min-w-0">
<span className="min-[400px]:inline hidden truncate min-w-0">
{!effectiveAutoApprovalEnabled
? t("chat:autoApprove.triggerLabelOff")
: enabledCount === totalCount
? t("chat:autoApprove.triggerLabelAll")
: t("chat:autoApprove.triggerLabel", { count: enabledCount })}
</span>
<span className="min-[400px]:hidden min-w-0">
{!effectiveAutoApprovalEnabled
? t("chat:autoApprove.triggerLabelOffShort")
: enabledCount === totalCount
? t("chat:autoApprove.triggerLabelAll")
: enabledCount}
</span>
</PopoverTrigger>
</StandardTooltip>
<PopoverContent
Expand Down
3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/en/chat.json
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@
"triggerLabel_zero": "0 auto-approve",
"triggerLabel_one": "1 auto-approved",
"triggerLabel_other": "{{count}} auto-approved",
"triggerLabelAll": "YOLO"
"triggerLabelAll": "YOLO",
"triggerLabelOffShort": "Off"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition! However, this new translation key needs to be added to all other locale files to prevent missing translation warnings. The following locales are missing this key:

  • Spanish (es)
  • French (fr)
  • German (de)
  • Chinese (zh-CN)
  • Japanese (ja)
  • And all other supported locales

Even if you don't know the translations, please add the key with the English value as a placeholder to prevent runtime warnings.

},
"announcement": {
"title": "🎉 Roo Code {{version}} Released",
Expand Down
3 changes: 2 additions & 1 deletion webview-ui/src/i18n/locales/ru/chat.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading