From 2acb7ef0d0403aa06b4f276af8aecc8020a4f65d Mon Sep 17 00:00:00 2001 From: Iuliia Ivashko Date: Thu, 29 Jan 2026 22:27:26 +0200 Subject: [PATCH] fix: control elements padding in chatbox --- packages/ui/src/components/chat/ChatInput.tsx | 46 +++++++---- .../ui/src/components/chat/ModelControls.tsx | 78 +++++++------------ packages/ui/src/components/chat/StatusRow.tsx | 20 ++++- packages/ui/src/components/icons/StopIcon.tsx | 32 ++++---- 4 files changed, 95 insertions(+), 81 deletions(-) diff --git a/packages/ui/src/components/chat/ChatInput.tsx b/packages/ui/src/components/chat/ChatInput.tsx index 2cd9d88b..55551946 100644 --- a/packages/ui/src/components/chat/ChatInput.tsx +++ b/packages/ui/src/components/chat/ChatInput.tsx @@ -1132,7 +1132,7 @@ export const ChatInput: React.FC = ({ onOpenSettings, scrollToBo event.target.value = ''; }, [attachFiles]); - const footerGapClass = isMobile ? 'gap-x-0.5 gap-y-0' : 'gap-x-1.5 gap-y-0'; + const footerGapClass = 'gap-x-1.5 gap-y-0'; const isVSCode = isVSCodeRuntime(); const footerPaddingClass = isMobile ? 'px-1.5 py-1.5' : (isVSCode ? 'px-1.5 py-1' : 'px-2.5 py-1.5'); const footerHeightClass = isMobile ? 'h-9 w-9' : (isVSCode ? 'h-[22px] w-[22px]' : 'h-7 w-7'); @@ -1143,12 +1143,13 @@ export const ChatInput: React.FC = ({ onOpenSettings, scrollToBo 'flex items-center justify-center text-muted-foreground transition-none outline-none focus:outline-none flex-shrink-0' ); - const cancelButton = canAbort ? ( + const stopButton = canAbort ? ( ) : null; - const sendButton = ( + const actionButton = ( @@ -1382,6 +1383,7 @@ export const ChatInput: React.FC = ({ onOpenSettings, scrollToBo )} style={chatInputWrapperStyle} > + {stopButton} {} {showCommandAutocomplete && ( = ({ onOpenSettings, scrollToBo className={cn( 'min-h-[52px] resize-none border-0 px-3 shadow-none rounded-b-none appearance-none focus:shadow-none focus-visible:shadow-none focus-visible:border-transparent focus-visible:ring-0 focus-visible:ring-transparent hover:border-transparent bg-transparent', isMobile ? "py-2.5" : "pt-4 pb-2", + canAbort && 'pr-10', "focus-visible:outline-none focus-visible:ring-0" )} style={{ @@ -1450,7 +1453,7 @@ export const ChatInput: React.FC = ({ onOpenSettings, scrollToBo className={cn( 'bg-transparent', footerPaddingClass, - cn('flex items-center justify-between', footerGapClass) + isMobile ? 'flex items-center gap-x-1.5' : cn('flex items-center justify-between', footerGapClass) )} style={{ borderBottomLeftRadius: cornerRadius, @@ -1458,18 +1461,29 @@ export const ChatInput: React.FC = ({ onOpenSettings, scrollToBo }} data-chat-input-footer="true" > -
-
- {attachmentsControls} + {isMobile ? ( +
+
+ {attachmentsControls} +
+
+
+ +
+ {actionButton} +
-
- -
-
-
- {cancelButton} - {sendButton} -
+ ) : ( + <> +
+ {attachmentsControls} +
+
+ + {actionButton} +
+ + )}
diff --git a/packages/ui/src/components/chat/ModelControls.tsx b/packages/ui/src/components/chat/ModelControls.tsx index f9da3878..263fb7ab 100644 --- a/packages/ui/src/components/chat/ModelControls.tsx +++ b/packages/ui/src/components/chat/ModelControls.tsx @@ -37,7 +37,6 @@ import { ProviderLogo } from '@/components/ui/ProviderLogo'; import { ScrollableOverlay } from '@/components/ui/ScrollableOverlay'; import { Switch } from '@/components/ui/switch'; import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'; -import { useProviderLogo } from '@/hooks/useProviderLogo'; import { useIsDesktopRuntime, useIsVSCodeRuntime } from '@/hooks/useRuntimeAPIs'; import { getAgentColor } from '@/lib/agentColors'; import { useDeviceInfo } from '@/lib/device'; @@ -139,27 +138,6 @@ type ModalityIcon = { type ModelApplyResult = 'applied' | 'provider-missing' | 'model-missing'; -const ProviderLogoOrFallback: React.FC<{ - providerId: string; - className?: string; - fallbackClassName?: string; -}> = ({ providerId, className, fallbackClassName }) => { - const { src, onError, hasLogo } = useProviderLogo(providerId); - - if (hasLogo && src) { - return ( - {`${providerId} - ); - } - - return