diff --git a/webview-ui/src/components/chat/ChatTextArea.tsx b/webview-ui/src/components/chat/ChatTextArea.tsx index 6c541353eb..2352b887e4 100644 --- a/webview-ui/src/components/chat/ChatTextArea.tsx +++ b/webview-ui/src/components/chat/ChatTextArea.tsx @@ -955,7 +955,7 @@ const ChatTextArea = forwardRef( placeholder={displayName} options={getApiConfigOptions} onChange={handleApiConfigChange} - triggerClassName="w-full text-ellipsis overflow-hidden" + triggerClassName="w-full text-ellipsis overflow-hidden min-w-0" itemClassName="group" renderItem={renderApiConfigItem} /> diff --git a/webview-ui/src/components/modes/ModesView.tsx b/webview-ui/src/components/modes/ModesView.tsx index 170d03b0e4..d18de20d90 100644 --- a/webview-ui/src/components/modes/ModesView.tsx +++ b/webview-ui/src/components/modes/ModesView.tsx @@ -663,29 +663,16 @@ const ModesView = ({ onDone }: ModesViewProps) => { setOpen(false) }} data-testid={`mode-option-${modeConfig.slug}`}> -
+
+ className="truncate flex-1 min-w-0 mr-2" + title={modeConfig.name}> {modeConfig.name} + className="text-foreground text-xs opacity-70 truncate flex-shrink-0 max-w-[40%]" + style={{ textAlign: "right" }} + title={modeConfig.slug}> {modeConfig.slug}
diff --git a/webview-ui/src/components/settings/ApiConfigManager.tsx b/webview-ui/src/components/settings/ApiConfigManager.tsx index e737678c01..62be19dc24 100644 --- a/webview-ui/src/components/settings/ApiConfigManager.tsx +++ b/webview-ui/src/components/settings/ApiConfigManager.tsx @@ -225,7 +225,7 @@ const ApiConfigManager = ({
) : ( <> -
+
- - - - {currentApiConfigName && ( - <> - - - - - - - - )} +
+ + + + {currentApiConfigName && ( + <> + + + + + + + + )} +
{t("settings:providers.description")} diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index fd3a8a129b..d794c84d44 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -386,8 +386,8 @@ const SettingsView = forwardRef(({ onDone, t const observer = new ResizeObserver((entries) => { for (const entry of entries) { - // If container width is less than 500px, switch to compact mode - setIsCompactMode(entry.contentRect.width < 500) + // If container width is less than 600px, switch to compact mode + setIsCompactMode(entry.contentRect.width < 600) } }) diff --git a/webview-ui/src/index.css b/webview-ui/src/index.css index fbb362ca8f..ee340f0ce3 100644 --- a/webview-ui/src/index.css +++ b/webview-ui/src/index.css @@ -399,6 +399,47 @@ vscode-dropdown::part(listbox) { min-height: 16px; } +/* Ensure checkbox containers don't squeeze */ +.vscrui-checkbox { + flex-shrink: 0; + min-width: fit-content; +} + +/* Prevent checkbox label text from wrapping inappropriately */ +.vscrui-checkbox label { + display: flex; + align-items: center; + gap: 0.5rem; + min-width: 0; +} + +/* Ensure checkbox input maintains size */ +.vscrui-checkbox input[type="checkbox"] { + flex-shrink: 0; + min-width: 16px; + min-height: 16px; +} + +/* VSCode checkbox specific styles to prevent squeezing */ +vscode-checkbox { + flex-shrink: 0; + min-width: fit-content; + display: inline-flex; + align-items: center; +} + +/* Ensure VSCode checkbox internals don't squeeze */ +vscode-checkbox::part(control) { + flex-shrink: 0; + min-width: 16px; + min-height: 16px; +} + +vscode-checkbox::part(label) { + min-width: 0; + margin-left: 0.5rem; +} + /** * @shadcn/ui Overrides / Hacks */ @@ -479,3 +520,116 @@ input[cmdk-input]:focus { transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; } + +/* Responsive utilities for narrow containers */ +@media (max-width: 640px) { + .responsive-text { + font-size: 0.875rem; + } + + .responsive-gap { + gap: 0.25rem; + } + + .responsive-padding { + padding: 0.5rem; + } +} + +/* Container query support for components */ +@container (max-width: 600px) { + .container-compact { + flex-direction: column; + gap: 0.5rem; + } + + .container-compact .settings-tab { + min-width: auto; + flex: 1; + } +} + +/* Improved flex utilities for narrow containers */ +.flex-responsive { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; +} + +.flex-responsive > * { + min-width: 0; + flex: 1 1 auto; +} + +/* Better text truncation for dropdowns and selectors */ +.dropdown-text { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + min-width: 0; + max-width: 100%; +} + +/* Settings view specific responsive adjustments */ +@container (max-width: 400px) { + /* Reduce button sizes in very narrow containers */ + .settings-view button[class*="size-icon"] { + width: 2rem; + height: 2rem; + padding: 0.25rem; + } + + /* Adjust gap between elements */ + .settings-view .flex.gap-1 { + gap: 0.25rem; + } +} + +/* Ensure profile selector doesn't overflow */ +.profile-selector-container { + min-width: 0; + overflow: hidden; +} + +/* Prevent icon buttons from shrinking */ +button[class*="codicon"] { + flex-shrink: 0; +} + +/* Additional responsive adjustments for very narrow sidebars */ +@media (max-width: 350px) { + /* Ensure button groups stay visible */ + .flex-shrink-0 { + overflow-x: auto; + overflow-y: hidden; + scrollbar-width: thin; + } + + /* Minimum width for button containers */ + .flex-shrink-0:has(button) { + min-width: fit-content; + } +} + +/* Ensure all settings checkboxes don't squeeze */ +.settings-view vscode-checkbox, +[class*="settings"] vscode-checkbox, +[class*="Settings"] vscode-checkbox { + flex-shrink: 0; + min-width: fit-content; + display: inline-flex; + align-items: center; +} + +/* Ensure proper text wrapping and overflow handling */ +.text-wrap { + word-wrap: break-word; + overflow-wrap: break-word; +} + +.text-ellipsis-safe { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + min-width: 0; +}