From d5aa580eb4ab315263757e19780a861278e437c1 Mon Sep 17 00:00:00 2001 From: Emir Karabeg Date: Sat, 14 Jun 2025 15:54:41 -0700 Subject: [PATCH 1/2] improvement(ui/ux): chat deploy experience --- apps/sim/app/chat/[subdomain]/chat-client.tsx | 4 +- .../[subdomain]/components/header/header.tsx | 15 +- .../[subdomain]/components/input/input.tsx | 216 ++++++++---------- .../components/input/voice-input.tsx | 29 ++- .../voice-interface/components/particles.tsx | 48 ++-- 5 files changed, 154 insertions(+), 158 deletions(-) diff --git a/apps/sim/app/chat/[subdomain]/chat-client.tsx b/apps/sim/app/chat/[subdomain]/chat-client.tsx index b28182c4dd6..1f5c087fcc0 100644 --- a/apps/sim/app/chat/[subdomain]/chat-client.tsx +++ b/apps/sim/app/chat/[subdomain]/chat-client.tsx @@ -570,8 +570,8 @@ export default function ChatClient({ subdomain }: { subdomain: string }) { /> {/* Input area (free-standing at the bottom) */} -
-
+
+
{ void handleSendMessage(value, isVoiceInput) diff --git a/apps/sim/app/chat/[subdomain]/components/header/header.tsx b/apps/sim/app/chat/[subdomain]/components/header/header.tsx index 1680f50f0aa..d620104ebf9 100644 --- a/apps/sim/app/chat/[subdomain]/components/header/header.tsx +++ b/apps/sim/app/chat/[subdomain]/components/header/header.tsx @@ -1,6 +1,5 @@ 'use client' -import { motion } from 'framer-motion' import { GithubIcon } from '@/components/icons' interface ChatHeaderProps { @@ -19,7 +18,7 @@ export function ChatHeader({ chatConfig, starCount }: ChatHeaderProps) { const primaryColor = chatConfig?.customizations?.primaryColor || '#701FFC' return ( -
+
{chatConfig?.customizations?.logoUrl && (
-
- + {starCount} - + void @@ -45,8 +35,12 @@ export const ChatInput: React.FC<{ el.style.height = 'auto' // Reset height to correctly calculate scrollHeight const scrollHeight = el.scrollHeight - if (scrollHeight > MAX_TEXTAREA_HEIGHT) { - el.style.height = `${MAX_TEXTAREA_HEIGHT}px` + // Use mobile height on mobile devices, desktop height on desktop + const isMobile = window.innerWidth < 768 + const maxHeight = isMobile ? MAX_TEXTAREA_HEIGHT_MOBILE : MAX_TEXTAREA_HEIGHT + + if (scrollHeight > maxHeight) { + el.style.height = `${maxHeight}px` el.style.overflowY = 'auto' } else { el.style.height = `${scrollHeight}px` @@ -136,32 +130,28 @@ export const ChatInput: React.FC<{ return ( <> -
- -
- {/* Voice Input with Tooltip */} - {isSttAvailable && ( -
+
+
+ {/* Text Input Area with Controls */} + +
+ {/* Voice Input */} + {isSttAvailable && (
- +
@@ -170,97 +160,87 @@ export const ChatInput: React.FC<{
+ )} + + {/* Text Input Container */} +
+