From 1bf602c36f81bc4ced7c5c5360af534a1789f276 Mon Sep 17 00:00:00 2001 From: Dhravya Shah Date: Fri, 19 Jul 2024 18:12:55 -0500 Subject: [PATCH] memories and justification clubbed together, justification more nested --- apps/web/app/(dash)/chat/chatWindow.tsx | 214 +++++++++++------------- 1 file changed, 99 insertions(+), 115 deletions(-) diff --git a/apps/web/app/(dash)/chat/chatWindow.tsx b/apps/web/app/(dash)/chat/chatWindow.tsx index c2199191..f0827a3d 100644 --- a/apps/web/app/(dash)/chat/chatWindow.tsx +++ b/apps/web/app/(dash)/chat/chatWindow.tsx @@ -224,71 +224,7 @@ function ChatWindow({ {chat.question} -
- {/* Related memories */} -
0 || chat.answer.parts.length === 0 ? "flex" : "hidden"}`} - > - - - - Related Memories - - {/* TODO: fade out content on the right side, the fade goes away when the user scrolls */} - - {/* Loading state */} - {chat.answer.sources.length > 0 || - (chat.answer.parts.length === 0 && ( - <> - {[1, 2, 3, 4].map((_, idx) => ( -
-
-
-
- ))} - - ))} - {chat.answer.sources.map((source, idx) => ( - -
- {source.type} - - {source.numChunks > 1 && ( - {source.numChunks} chunks - )} -
-
- {source.title} -
-
- {source.content.length > 100 - ? source.content.slice(0, 100) + "..." - : source.content} -
- - ))} -
-
-
-
- - {/* Summary */} +
Answer
@@ -347,60 +283,108 @@ function ChatWindow({ > -
- {/* Justification */} - {chat.answer.justification && - chat.answer.justification.length && ( -
0 ? "flex" : "hidden"}`} - > - 0 || chat.answer.parts.length === 0 ? "flex" : "hidden"}`} + > + + + + Related Memories + + {/* TODO: fade out content on the right side, the fade goes away when the user scrolls */} + - - - Justification - - - {chat.answer.justification.length > 0 - ? chat.answer.justification - .replaceAll("", "") - .replaceAll("", "") - : "No justification provided."} - - - -
- )} +
+ {/* Loading state */} + {chat.answer.sources.length > 0 || + (chat.answer.parts.length === 0 && ( + <> + {[1, 2, 3, 4].map((_, idx) => ( +
+
+
+
+ ))} + + ))} + {chat.answer.sources.map((source, idx) => ( + +
+ {source.type} + + {source.numChunks > 1 && ( + {source.numChunks} chunks + )} +
+
+ {source.title} +
+
+ {source.content.length > 100 + ? source.content.slice(0, 100) + "..." + : source.content} +
+ + ))} +
+ + {chat.answer.justification && + chat.answer.justification.length && ( +
0 ? "flex" : "hidden"}`} + > + + + + Justification + + + {chat.answer.justification.length > 0 + ? chat.answer.justification + .replaceAll( + "", + "", + ) + .replaceAll( + "", + "", + ) + : "No justification provided."} + + + +
+ )} + + + +