Skip to content

Commit bbca0c4

Browse files
committed
Fixes broken behavior of the dropdowns in narrow windows
1 parent c3642ed commit bbca0c4

File tree

2 files changed

+25
-31
lines changed

2 files changed

+25
-31
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export const ApiConfigSelector = ({
149149
disabled={disabled}
150150
data-testid="dropdown-trigger"
151151
className={cn(
152-
"w-full min-w-0 max-w-full inline-flex items-center gap-1.5 relative whitespace-nowrap px-1.5 py-1 text-xs",
152+
"min-w-0 inline-flex items-center gap-1.5 relative whitespace-nowrap px-1.5 py-1 text-xs",
153153
"bg-transparent border border-[rgba(255,255,255,0.08)] rounded-md text-vscode-foreground",
154154
"transition-all duration-150 focus:outline-none focus-visible:ring-1 focus-visible:ring-vscode-focusBorder focus-visible:ring-inset",
155155
disabled

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

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1174,37 +1174,31 @@ export const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
11741174
/>
11751175
)}
11761176

1177-
<div className="flex justify-between items-center">
1178-
<div className="flex items-center gap-1">
1179-
<div className="max-w-32">
1180-
<ModeSelector
1181-
value={mode}
1182-
title={t("chat:selectMode")}
1183-
onChange={handleModeChange}
1184-
triggerClassName="w-full"
1185-
modeShortcutText={modeShortcutText}
1186-
customModes={customModes}
1187-
customModePrompts={customModePrompts}
1188-
/>
1189-
</div>
1190-
<div className="max-w-32">
1191-
<ApiConfigSelector
1192-
value={currentConfigId}
1193-
displayName={displayName}
1194-
disabled={selectApiConfigDisabled}
1195-
title={t("chat:selectApiConfig")}
1196-
onChange={handleApiConfigChange}
1197-
triggerClassName="w-full text-ellipsis overflow-hidden"
1198-
listApiConfigMeta={listApiConfigMeta || []}
1199-
pinnedApiConfigs={pinnedApiConfigs}
1200-
togglePinnedApiConfig={togglePinnedApiConfig}
1201-
/>
1202-
</div>
1203-
<div className="max-w-48">
1204-
<AutoApproveDropdown triggerClassName="w-full" />
1205-
</div>
1177+
<div className="flex items-center gap-2">
1178+
<div className="flex items-center gap-2 min-w-40 overflow-clip flex-1">
1179+
<ModeSelector
1180+
value={mode}
1181+
title={t("chat:selectMode")}
1182+
onChange={handleModeChange}
1183+
triggerClassName="min-w-20 text-ellipsis overflow-hidden"
1184+
modeShortcutText={modeShortcutText}
1185+
customModes={customModes}
1186+
customModePrompts={customModePrompts}
1187+
/>
1188+
<ApiConfigSelector
1189+
value={currentConfigId}
1190+
displayName={displayName}
1191+
disabled={selectApiConfigDisabled}
1192+
title={t("chat:selectApiConfig")}
1193+
onChange={handleApiConfigChange}
1194+
triggerClassName="min-w-16 text-ellipsis overflow-hidden"
1195+
listApiConfigMeta={listApiConfigMeta || []}
1196+
pinnedApiConfigs={pinnedApiConfigs}
1197+
togglePinnedApiConfig={togglePinnedApiConfig}
1198+
/>
1199+
<AutoApproveDropdown triggerClassName="min-w-20 text-ellipsis overflow-hidden" />
12061200
</div>
1207-
<div className="flex items-center gap-0.5">
1201+
<div className="flex flex-shrink-0 items-center gap-0.5">
12081202
{isTtsPlaying && (
12091203
<StandardTooltip content={t("chat:stopTts")}>
12101204
<button

0 commit comments

Comments
 (0)