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

Commit 221bc69

Browse files
committed
fix: prevent bottom bar clipping in API config popover (#12237)
The PopoverContent used overflow-hidden without a max-height constraint, which allowed Radix UI viewport collision avoidance to clip the bottom bar (containing the lock and settings buttons) when the popover was positioned near the bottom of the screen. Changes: - Add max-h based on --radix-popover-content-available-height CSS variable to PopoverContent so the flex layout can properly distribute space - Add max-h-inherit to the inner flex container so it respects the constraint - Add flex-shrink-0 to header, bottom bar to prevent them from shrinking - Change config list to use min-h-0 flex-1 so it shrinks instead of the bottom bar when viewport space is limited
1 parent ad25634 commit 221bc69

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,11 @@ export const ApiConfigSelector = ({
167167
align="start"
168168
sideOffset={4}
169169
container={portalContainer}
170-
className="p-0 overflow-hidden w-[300px]">
171-
<div className="flex flex-col w-full">
170+
className="p-0 overflow-hidden w-[300px] max-h-[var(--radix-popover-content-available-height,80vh)]">
171+
<div className="flex flex-col w-full max-h-[inherit]">
172172
{/* Search input or info blurb */}
173173
{listApiConfigMeta.length > 6 ? (
174-
<div className="relative p-2 border-b border-vscode-dropdown-border">
174+
<div className="relative p-2 border-b border-vscode-dropdown-border flex-shrink-0">
175175
<input
176176
aria-label={t("common:ui.search_placeholder")}
177177
value={searchValue}
@@ -190,7 +190,7 @@ export const ApiConfigSelector = ({
190190
)}
191191
</div>
192192
) : (
193-
<div className="p-3 border-b border-vscode-dropdown-border">
193+
<div className="p-3 border-b border-vscode-dropdown-border flex-shrink-0">
194194
<p className="text-xs text-vscode-descriptionForeground m-0">
195195
{t("prompts:apiConfiguration.select")}
196196
</p>
@@ -201,7 +201,7 @@ export const ApiConfigSelector = ({
201201
{filteredConfigs.length === 0 && searchValue ? (
202202
<div className="py-2 px-3 text-sm text-vscode-foreground/70">{t("common:ui.no_results")}</div>
203203
) : (
204-
<div className="max-h-[300px] overflow-y-auto">
204+
<div className="min-h-0 flex-1 overflow-y-auto max-h-[300px]">
205205
{/* Pinned configs - sticky header */}
206206
{pinnedConfigs.length > 0 && (
207207
<div
@@ -224,7 +224,7 @@ export const ApiConfigSelector = ({
224224
)}
225225

226226
{/* Bottom bar with buttons on left and title on right */}
227-
<div className="flex flex-row items-center justify-between px-2 py-2 border-t border-vscode-dropdown-border">
227+
<div className="flex flex-row items-center justify-between px-2 py-2 border-t border-vscode-dropdown-border flex-shrink-0">
228228
<div className="flex flex-row gap-1">
229229
<IconButton
230230
iconClass="codicon-settings-gear"

0 commit comments

Comments
 (0)