Skip to content

Commit 670cd67

Browse files
committed
fix: improve UI responsiveness for narrow sidebar widths
- Add CSS rules to prevent VSCode checkbox squeezing across all settings pages - Fix trash icon being cut off in profile selection by adjusting button spacing - Add min-width constraints to icon buttons to maintain visibility - Implement responsive CSS utilities for containers under 400px width - Add specific selectors for VSCode checkbox components to ensure proper sizing - Reduce gap between profile action buttons and add margin separation
1 parent aaec180 commit 670cd67

File tree

2 files changed

+49
-4
lines changed

2 files changed

+49
-4
lines changed

webview-ui/src/components/settings/ApiConfigManager.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,14 @@ const ApiConfigManager = ({
250250
className="grow min-w-0"
251251
data-testid="select-component"
252252
/>
253-
<div className="flex items-center gap-1 flex-shrink-0">
253+
<div className="flex items-center gap-0.5 flex-shrink-0 ml-1">
254254
<StandardTooltip content={t("settings:providers.addProfile")}>
255255
<Button
256256
variant="ghost"
257257
size="icon"
258258
onClick={handleAdd}
259259
data-testid="add-profile-button"
260-
className="flex-shrink-0">
260+
className="flex-shrink-0 min-w-[32px]">
261261
<span className="codicon codicon-add" />
262262
</Button>
263263
</StandardTooltip>
@@ -269,7 +269,7 @@ const ApiConfigManager = ({
269269
size="icon"
270270
onClick={handleStartRename}
271271
data-testid="rename-profile-button"
272-
className="flex-shrink-0">
272+
className="flex-shrink-0 min-w-[32px]">
273273
<span className="codicon codicon-edit" />
274274
</Button>
275275
</StandardTooltip>
@@ -285,7 +285,7 @@ const ApiConfigManager = ({
285285
onClick={handleDelete}
286286
data-testid="delete-profile-button"
287287
disabled={isOnlyProfile}
288-
className="flex-shrink-0">
288+
className="flex-shrink-0 min-w-[32px]">
289289
<span className="codicon codicon-trash" />
290290
</Button>
291291
</StandardTooltip>

webview-ui/src/index.css

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,26 @@ vscode-dropdown::part(listbox) {
420420
min-height: 16px;
421421
}
422422

423+
/* VSCode checkbox specific styles to prevent squeezing */
424+
vscode-checkbox {
425+
flex-shrink: 0;
426+
min-width: fit-content;
427+
display: inline-flex;
428+
align-items: center;
429+
}
430+
431+
/* Ensure VSCode checkbox internals don't squeeze */
432+
vscode-checkbox::part(control) {
433+
flex-shrink: 0;
434+
min-width: 16px;
435+
min-height: 16px;
436+
}
437+
438+
vscode-checkbox::part(label) {
439+
min-width: 0;
440+
margin-left: 0.5rem;
441+
}
442+
423443
/**
424444
* @shadcn/ui Overrides / Hacks
425445
*/
@@ -582,6 +602,31 @@ button[class*="codicon"] {
582602
flex-shrink: 0;
583603
}
584604

605+
/* Additional responsive adjustments for very narrow sidebars */
606+
@media (max-width: 350px) {
607+
/* Ensure button groups stay visible */
608+
.flex-shrink-0 {
609+
overflow-x: auto;
610+
overflow-y: hidden;
611+
scrollbar-width: thin;
612+
}
613+
614+
/* Minimum width for button containers */
615+
.flex-shrink-0:has(button) {
616+
min-width: fit-content;
617+
}
618+
}
619+
620+
/* Ensure all settings checkboxes don't squeeze */
621+
.settings-view vscode-checkbox,
622+
[class*="settings"] vscode-checkbox,
623+
[class*="Settings"] vscode-checkbox {
624+
flex-shrink: 0;
625+
min-width: fit-content;
626+
display: inline-flex;
627+
align-items: center;
628+
}
629+
585630
/* Ensure proper text wrapping and overflow handling */
586631
.text-wrap {
587632
word-wrap: break-word;

0 commit comments

Comments
 (0)