From bce3d6232dea89a1873124579047fe31ca9d1672 Mon Sep 17 00:00:00 2001 From: nick-delirium Date: Tue, 27 May 2025 10:23:26 +0200 Subject: [PATCH] redesign is inevitable --- frontend/app/components/Kai/KaiChat.tsx | 8 +- .../components/Kai/components/ChatHeader.tsx | 76 ++++++++++--------- .../components/Kai/components/ChatInput.tsx | 45 +++++++++-- .../app/components/Kai/components/Ideas.tsx | 3 +- .../Kai/components/IntroSection.tsx | 12 ++- 5 files changed, 88 insertions(+), 56 deletions(-) diff --git a/frontend/app/components/Kai/KaiChat.tsx b/frontend/app/components/Kai/KaiChat.tsx index d3952cffa..31166d7a6 100644 --- a/frontend/app/components/Kai/KaiChat.tsx +++ b/frontend/app/components/Kai/KaiChat.tsx @@ -100,9 +100,7 @@ function KaiChat() { }; return (
-
+
{section === 'intro' ? ( diff --git a/frontend/app/components/Kai/components/ChatHeader.tsx b/frontend/app/components/Kai/components/ChatHeader.tsx index ae3cb4068..62f07369c 100644 --- a/frontend/app/components/Kai/components/ChatHeader.tsx +++ b/frontend/app/components/Kai/components/ChatHeader.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { Icon } from 'UI'; -import { MessagesSquare, ArrowLeft } from 'lucide-react'; +import { MessagesSquare, ArrowLeft, SquarePen } from 'lucide-react'; import { useTranslation } from 'react-i18next'; function ChatHeader({ @@ -14,43 +14,49 @@ function ChatHeader({ }) { const { t } = useTranslation(); return ( -
-
- {goBack ? ( +
+
+
+ {goBack ? ( +
+ +
{t('Back')}
+
+ ) : ( +
+ +
Kai
+
+ )} +
+
+ {chatTitle ? ( +
+ {chatTitle} +
+ ) : null} +
+
+ {goBack ? ( +
+ +
{t('New Chat')}
+
+ ) : null}
- -
{t('Back')}
+ +
{t('Chats')}
- ) : null} -
-
- {chatTitle ? ( -
- {chatTitle} -
- ) : ( - <> - -
Kai
- - )} -
-
-
- -
{t('Chats')}
diff --git a/frontend/app/components/Kai/components/ChatInput.tsx b/frontend/app/components/Kai/components/ChatInput.tsx index 237b79d6c..d2c5aebb3 100644 --- a/frontend/app/components/Kai/components/ChatInput.tsx +++ b/frontend/app/components/Kai/components/ChatInput.tsx @@ -9,10 +9,12 @@ function ChatInput({ isLoading, onSubmit, threadId, + isArea, }: { isLoading?: boolean; onSubmit: (str: string) => void; threadId: string; + isArea?: boolean; }) { const inputRef = React.useRef(null); const usage = kaiStore.usage; @@ -50,7 +52,42 @@ function ChatInput({ }, [inputValue]); const isReplacing = kaiStore.replacing !== null; - + const placeholder = limited + ? `You've reached the daily limit for queries, come again tomorrow!` + : 'Ask anything about your product and users...'; + if (isArea) { + return ( + setInputValue(e.target.value)} + suffix={ + +