Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Commit 650f52a

Browse files
committed
fix: improve lock icon visibility in API config popover (#12237)
- Replace subtle IconButton with a visible Button + text label ("Locked"/"Unlocked") - Use text-vscode-descriptionForeground instead of opacity-60 for unlocked state - Add StandardTooltip explaining the lock function on hover - Ensure cursor:pointer is always present - Add i18n keys for "locked"/"unlocked" labels in all 18 locales - Update tests to match new styling classes
1 parent ad25634 commit 650f52a

20 files changed

Lines changed: 88 additions & 29 deletions

File tree

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

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,39 @@ export const ApiConfigSelector = ({
232232
onClick={handleEditClick}
233233
tooltip={false}
234234
/>
235-
<IconButton
236-
iconClass={lockApiConfigAcrossModes ? "codicon-lock" : "codicon-unlock"}
237-
title={
235+
<StandardTooltip
236+
content={
238237
lockApiConfigAcrossModes
239238
? t("chat:unlockApiConfigAcrossModes")
240239
: t("chat:lockApiConfigAcrossModes")
241-
}
242-
className={lockApiConfigAcrossModes ? "text-vscode-focusBorder" : "opacity-60"}
243-
onClick={onToggleLockApiConfig}
244-
/>
240+
}>
241+
<Button
242+
aria-label={
243+
lockApiConfigAcrossModes
244+
? t("chat:unlockApiConfigAcrossModes")
245+
: t("chat:lockApiConfigAcrossModes")
246+
}
247+
className={cn(
248+
"inline-flex items-center gap-1 px-1.5 py-1 h-7 rounded-md text-xs",
249+
"bg-transparent border-none cursor-pointer",
250+
"transition-all duration-150",
251+
"hover:bg-[rgba(255,255,255,0.06)]",
252+
"focus:outline-none focus-visible:ring-1 focus-visible:ring-vscode-focusBorder",
253+
lockApiConfigAcrossModes
254+
? "text-vscode-focusBorder opacity-100"
255+
: "text-vscode-descriptionForeground opacity-90 hover:opacity-100",
256+
)}
257+
onClick={onToggleLockApiConfig}>
258+
<span
259+
className={cn(
260+
"codicon",
261+
lockApiConfigAcrossModes ? "codicon-lock" : "codicon-unlock",
262+
)}
263+
style={{ fontSize: 14 }}
264+
/>
265+
<span>{lockApiConfigAcrossModes ? t("chat:locked") : t("chat:unlocked")}</span>
266+
</Button>
267+
</StandardTooltip>
245268
</div>
246269

247270
{/* Info icon and title on the right with matching spacing */}

webview-ui/src/components/chat/__tests__/ChatTextArea.lockApiConfig.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ describe("ChatTextArea - lockApiConfigAcrossModes toggle", () => {
7878

7979
const button = openPopoverAndGetLockToggle("chat:lockApiConfigAcrossModes")
8080
expect(button).toBeInTheDocument()
81-
// Unlocked state has muted opacity
82-
expect(button.className).toContain("opacity-60")
81+
// Unlocked state has visible but muted style
82+
expect(button.className).toContain("text-vscode-descriptionForeground")
8383
expect(button.className).not.toContain("text-vscode-focusBorder")
8484
})
8585

@@ -95,7 +95,7 @@ describe("ChatTextArea - lockApiConfigAcrossModes toggle", () => {
9595
expect(button).toBeInTheDocument()
9696
// Locked state has the focus border highlight color
9797
expect(button.className).toContain("text-vscode-focusBorder")
98-
expect(button.className).not.toContain("opacity-60")
98+
expect(button.className).not.toContain("text-vscode-descriptionForeground")
9999
})
100100

101101
it("renders in unlocked state when lockApiConfigAcrossModes is undefined (default)", () => {
@@ -108,7 +108,7 @@ describe("ChatTextArea - lockApiConfigAcrossModes toggle", () => {
108108
const button = openPopoverAndGetLockToggle("chat:lockApiConfigAcrossModes")
109109
expect(button).toBeInTheDocument()
110110
// Default (undefined/falsy) renders in unlocked style
111-
expect(button.className).toContain("opacity-60")
111+
expect(button.className).toContain("text-vscode-descriptionForeground")
112112
})
113113
})
114114

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

Lines changed: 3 additions & 1 deletion
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: 3 additions & 1 deletion
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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,5 +493,7 @@
493493
"title": "Provider no longer supported",
494494
"message": "Sorry, this provider is no longer supported. We saw very few Roo users actually using it and we need to reduce the surface area of our codebase so we can keep shipping fast and serving our community well in this space. It was a really hard decision but it lets us focus on what matters most to you. It sucks, we know.",
495495
"openSettings": "Open Settings"
496-
}
496+
},
497+
"locked": "Locked",
498+
"unlocked": "Unlocked"
497499
}

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

Lines changed: 3 additions & 1 deletion
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: 3 additions & 1 deletion
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: 3 additions & 1 deletion
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: 3 additions & 1 deletion
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: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)