From 180c4e855ea35aecff006321e226eacf469adcb6 Mon Sep 17 00:00:00 2001 From: siiddhantt Date: Mon, 2 Oct 2023 22:37:12 +0530 Subject: [PATCH 1/4] feat: updated sources section design --- .../src/conversation/ConversationBubble.tsx | 50 ++++++++++++------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 92411a3e..adf18885 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -60,7 +60,7 @@ const ConversationBubble = forwardRef<
{message} + +
+
Sources:
+
+ {DisableSourceFE + ? null + : sources?.map((source, index) => ( +
+ setOpenSource(openSource === index ? null : index) + } + > +

+ {index + 1}. {source.title} +

+
+ ))} +
+
-
- {DisableSourceFE - ? null - : sources?.map((source, index) => ( -
- setOpenSource(openSource === index ? null : index) - } - > -

- {index + 1}. {source.title} -

-
- ))} -
{sources && openSource !== null && sources[openSource] && (
From 1765a8a7f93378d761303dbba55b7c03843e78b9 Mon Sep 17 00:00:00 2001 From: siiddhantt Date: Mon, 2 Oct 2023 23:22:04 +0530 Subject: [PATCH 2/4] fix: fixes according to figma design --- 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 adf18885..56ca97d1 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -103,13 +103,13 @@ const ConversationBubble = forwardRef<
Sources:
-
+
{DisableSourceFE ? null : sources?.map((source, index) => (

Date: Tue, 3 Oct 2023 10:47:15 +0530 Subject: [PATCH 3/4] fix: css changes --- 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 56ca97d1..70320bc3 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -101,15 +101,15 @@ const ConversationBubble = forwardRef< {message} -

+
Sources:
-
+
{DisableSourceFE ? null : sources?.map((source, index) => (
Date: Tue, 3 Oct 2023 23:32:08 +0530 Subject: [PATCH 4/4] fix: added conditions for error state --- frontend/src/conversation/ConversationBubble.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/src/conversation/ConversationBubble.tsx b/frontend/src/conversation/ConversationBubble.tsx index 70320bc3..65b5fbef 100644 --- a/frontend/src/conversation/ConversationBubble.tsx +++ b/frontend/src/conversation/ConversationBubble.tsx @@ -100,9 +100,15 @@ const ConversationBubble = forwardRef< > {message} - + {DisableSourceFE || type === 'ERROR' ? null : ( + + )}
-
Sources:
+ {DisableSourceFE || type === 'ERROR' ? null : ( +
+ Sources: +
+ )}
{DisableSourceFE ? null