From 773e69ef7ae9766cd694a2a31a575c6e2e8b2be6 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Fri, 6 Dec 2024 09:36:42 -0500 Subject: [PATCH 1/5] Update BaseChat.tsx moved the model collapse button. --- app/components/chat/BaseChat.tsx | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 8c7589a6..f42df901 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -333,21 +333,6 @@ export const BaseChat = React.forwardRef(
-
- -
-
( onStop={stopListening} disabled={isStreaming} /> + setIsModelSettingsCollapsed(!isModelSettingsCollapsed)} + > +
+ {isModelSettingsCollapsed && {model}} + {chatStarted && {() => }}
{input.length > 3 ? ( From 5692a4c01186515090821f601d5a28140852a967 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Fri, 6 Dec 2024 09:42:58 -0500 Subject: [PATCH 2/5] lint fix --- app/components/chat/BaseChat.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index f42df901..3fabfc1d 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -488,13 +488,15 @@ export const BaseChat = React.forwardRef( setIsModelSettingsCollapsed(!isModelSettingsCollapsed)} >
- {isModelSettingsCollapsed && {model}} + {isModelSettingsCollapsed ? {model} : } {chatStarted && {() => }}
From 66fe6a2efcab12b574d9356fb5092159c42a29d5 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 7 Dec 2024 16:22:11 -0500 Subject: [PATCH 3/5] fix position issue fix position issue when in chat --- app/components/chat/BaseChat.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index 6d61df17..da4d0c9d 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -525,6 +525,7 @@ export const BaseChat = React.forwardRef( onStop={stopListening} disabled={isStreaming} /> + {chatStarted && {() => }} (
{isModelSettingsCollapsed ? {model} : } - {chatStarted && {() => }}
{input.length > 3 ? (
From b6f6f187fd31415216db1cbb98e98f23f518bba2 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 7 Dec 2024 16:27:37 -0500 Subject: [PATCH 4/5] fix: small bug stopped collapse from happen when no provider selected --- app/components/chat/BaseChat.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/components/chat/BaseChat.tsx b/app/components/chat/BaseChat.tsx index da4d0c9d..411da94b 100644 --- a/app/components/chat/BaseChat.tsx +++ b/app/components/chat/BaseChat.tsx @@ -476,6 +476,7 @@ export const BaseChat = React.forwardRef( 0 || isStreaming || uploadedFiles.length > 0} isStreaming={isStreaming} + disabled={enabledProviders.length === 0} onClick={(event) => { if (isStreaming) { handleStop?.(); @@ -535,6 +536,7 @@ export const BaseChat = React.forwardRef( !isModelSettingsCollapsed, })} onClick={() => setIsModelSettingsCollapsed(!isModelSettingsCollapsed)} + disabled={enabledProviders.length === 0} >
{isModelSettingsCollapsed ? {model} : } From 7ee3bea2a095be27335bf049da88772cca881410 Mon Sep 17 00:00:00 2001 From: Dustin Loring Date: Sat, 7 Dec 2024 16:34:08 -0500 Subject: [PATCH 5/5] typecheck fix --- app/components/chat/SendButton.client.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/components/chat/SendButton.client.tsx b/app/components/chat/SendButton.client.tsx index 59e5e52a..c5aa8304 100644 --- a/app/components/chat/SendButton.client.tsx +++ b/app/components/chat/SendButton.client.tsx @@ -3,25 +3,29 @@ import { AnimatePresence, cubicBezier, motion } from 'framer-motion'; interface SendButtonProps { show: boolean; isStreaming?: boolean; + disabled?: boolean; onClick?: (event: React.MouseEvent) => void; onImagesSelected?: (images: File[]) => void; } const customEasingFn = cubicBezier(0.4, 0, 0.2, 1); -export const SendButton = ({ show, isStreaming, onClick }: SendButtonProps) => { +export const SendButton = ({ show, isStreaming, disabled, onClick }: SendButtonProps) => { return ( {show ? ( { event.preventDefault(); - onClick?.(event); + if (!disabled) { + onClick?.(event); + } }} >