From 4fa5f157dd55dc8fe9aa26dc25c97b4f2295dfcb Mon Sep 17 00:00:00 2001 From: staticGuru Date: Fri, 13 Oct 2023 15:00:08 +0530 Subject: [PATCH 1/9] add the initial UI setup --- frontend/src/conversation/ConversationBubble.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index aba7c63b9..ca6fa500b 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -211,6 +211,13 @@ const ConversationBubble = forwardRef< )} +
+
+

+ suggested questions +

+
+
); } From 158d00d3f813720b85ca7974d4e8dd0e2618a432 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Fri, 13 Oct 2023 15:00:55 +0530 Subject: [PATCH 2/9] change the margin ratio --- frontend/src/conversation/ConversationBubble.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index ca6fa500b..32ef73dd2 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -211,7 +211,7 @@ const ConversationBubble = forwardRef< )} -
+

suggested questions From 3824c79b10f31ed4f0612ea8b2b527b48f36ecf1 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Fri, 13 Oct 2023 15:04:45 +0530 Subject: [PATCH 3/9] add the hover effect --- frontend/src/conversation/ConversationBubble.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 32ef73dd2..e77e48e2f 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -212,8 +212,8 @@ const ConversationBubble = forwardRef<

)}
-
-

+

+

suggested questions

From fab1739f40fd9205fba1ed7f2c23d42cb2e7e290 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Fri, 13 Oct 2023 15:08:32 +0530 Subject: [PATCH 4/9] add the style properties --- frontend/src/conversation/ConversationBubble.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index e77e48e2f..fcd922b25 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -212,9 +212,9 @@ const ConversationBubble = forwardRef<
)}
-
-

- suggested questions +

+

+ suggested questions lksjfs

From 0fe504b28ea0d4b746a33ddd62ed8f3383c0bfb9 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Fri, 13 Oct 2023 15:12:31 +0530 Subject: [PATCH 5/9] add the word wrap sections --- frontend/src/conversation/ConversationBubble.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index fcd922b25..bdf4bd49a 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -211,9 +211,9 @@ const ConversationBubble = forwardRef<
)} -
+
-

+

suggested questions lksjfs

From 939759e9e3583e39772f483b62e3a587bbbe22da Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sat, 14 Oct 2023 22:28:48 +0530 Subject: [PATCH 6/9] add the placeholder response --- .../src/conversation/ConversationBubble.tsx | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index bdf4bd49a..39906a9e6 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -211,10 +211,24 @@ const ConversationBubble = forwardRef<
)} -
+
+
+

+ suggested questions lksjfs klsdjlfaslkfa flkasdjfalksdjfasdfa + cfasdklfjalskf ckljsadlkfs suggested questions lksjfs + klsdjlfaslkfa flkasdjfalksdjfasdfa cfasdklfjalskf ckljsadlkfs +

+
+
+

+ suggested questions lksjfs klsdjlfaslkfa flkasdjfalksdjfasdfa + cfasdklfjalskf ckljsadlkfs +

+

- suggested questions lksjfs + suggested questions lksjfs klsdjlfaslkfa flkasdjfalksdjfasdfa + cfasdklfjalskf ckljsadlkfs

From cb9b20ac91492f0cb55b4742b87e113b44e5af94 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sat, 14 Oct 2023 22:43:35 +0530 Subject: [PATCH 7/9] Add animation in the background color --- frontend/src/conversation/ConversationBubble.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 39906a9e6..daad68b0c 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -212,8 +212,8 @@ const ConversationBubble = forwardRef<
)}
-
-

+

+

suggested questions lksjfs klsdjlfaslkfa flkasdjfalksdjfasdfa cfasdklfjalskf ckljsadlkfs suggested questions lksjfs klsdjlfaslkfa flkasdjfalksdjfasdfa cfasdklfjalskf ckljsadlkfs From f8407490a7dae36e9c19395b06cc55b8033e5d89 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sat, 14 Oct 2023 22:56:56 +0530 Subject: [PATCH 8/9] add the placeholder suggestions --- .../src/conversation/ConversationBubble.tsx | 47 +++++++++++-------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index daad68b0c..0b21d311f 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -12,6 +12,7 @@ import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'; import { vscDarkPlus } from 'react-syntax-highlighter/dist/cjs/styles/prism'; const DisableSourceFE = import.meta.env.VITE_DISABLE_SOURCE_FE || false; +const suggest = [{ id: 'dfsdfsd', query: 'ljglkjlkj kljsfd' }]; const ConversationBubble = forwardRef< HTMLDivElement, @@ -22,9 +23,18 @@ const ConversationBubble = forwardRef< feedback?: FEEDBACK; handleFeedback?: (feedback: FEEDBACK) => void; sources?: { title: string; text: string }[]; + suggestions: { id: string; query: string }[]; } >(function ConversationBubble( - { message, type, className, feedback, handleFeedback, sources }, + { + message, + type, + className, + feedback, + handleFeedback, + sources, + suggestions = suggest, + }, ref, ) { const [showFeedback, setShowFeedback] = useState(false); @@ -40,6 +50,11 @@ const ConversationBubble = forwardRef< }, 2000); }; + const handleSuggestionClick = (e: any, suggestionId: string) => { + e.preventDefault(); + console.log(suggestionId); + }; + const List = ({ ordered, children, @@ -212,25 +227,17 @@ const ConversationBubble = forwardRef<

)}
-
-

- suggested questions lksjfs klsdjlfaslkfa flkasdjfalksdjfasdfa - cfasdklfjalskf ckljsadlkfs suggested questions lksjfs - klsdjlfaslkfa flkasdjfalksdjfasdfa cfasdklfjalskf ckljsadlkfs -

-
-
-

- suggested questions lksjfs klsdjlfaslkfa flkasdjfalksdjfasdfa - cfasdklfjalskf ckljsadlkfs -

-
-
-

- suggested questions lksjfs klsdjlfaslkfa flkasdjfalksdjfasdfa - cfasdklfjalskf ckljsadlkfs -

-
+ {suggestions.map((suggestion, index) => ( +
handleSuggestionClick(e, suggestion.id)} + className="hover: rounded-3xl border border-[#7D54D1] py-1 px-4 text-left transition-colors duration-300 ease-in-out hover:bg-[#7D54D1]" + > +

+ {suggestion.query} +

+
+ ))}
); From 88a464ab28655a5a34ef28a8454f46318c7d5e21 Mon Sep 17 00:00:00 2001 From: staticGuru Date: Sat, 14 Oct 2023 23:02:48 +0530 Subject: [PATCH 9/9] fix the typescript for onclick event --- frontend/src/conversation/ConversationBubble.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 0b21d311f..d51b86601 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -50,7 +50,10 @@ const ConversationBubble = forwardRef< }, 2000); }; - const handleSuggestionClick = (e: any, suggestionId: string) => { + const handleSuggestionClick = ( + e: React.MouseEvent, + suggestionId: string, + ) => { e.preventDefault(); console.log(suggestionId); };