From ce5cd5561a65f81842fc93a9ddd550bde69b0878 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 19 Mar 2026 15:52:27 +0000 Subject: [PATCH] loading animation --- frontend/src/conversation/Conversation.tsx | 2 +- .../src/conversation/ConversationMessages.tsx | 32 +++++++++++++++ frontend/src/index.css | 41 +++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) diff --git a/frontend/src/conversation/Conversation.tsx b/frontend/src/conversation/Conversation.tsx index cba4a479..eda3ee68 100644 --- a/frontend/src/conversation/Conversation.tsx +++ b/frontend/src/conversation/Conversation.tsx @@ -89,7 +89,7 @@ export default function Conversation() { .map((a) => ({ id: a.id as string, fileName: a.fileName })); if (index !== undefined) { - if (!isRetry) dispatch(resendQuery({ index, prompt: trimmedQuestion })); + dispatch(resendQuery({ index, prompt: trimmedQuestion })); handleFetchAnswer({ question: trimmedQuestion, index }); } else { if (!isRetry) diff --git a/frontend/src/conversation/ConversationMessages.tsx b/frontend/src/conversation/ConversationMessages.tsx index b0f68ab7..1a666667 100644 --- a/frontend/src/conversation/ConversationMessages.tsx +++ b/frontend/src/conversation/ConversationMessages.tsx @@ -9,6 +9,7 @@ import { import { useTranslation } from 'react-i18next'; import ArrowDown from '../assets/arrow-down.svg'; +import DocsGPT3 from '../assets/cute_docsgpt3.svg'; import RetryIcon from '../components/RetryIcon'; import Hero from '../Hero'; import { useDarkTheme } from '../hooks'; @@ -191,6 +192,37 @@ export default function ConversationMessages({ /> ); } + + if (status === 'loading' && isLastMessage) { + return ( +
+
+
+
+ {t('conversation.answer')} +
+

+ {t('conversation.answer')} +

+
+
+
+ + + +
+
+
+
+ ); + } + return null; }; diff --git a/frontend/src/index.css b/frontend/src/index.css index ef5cc78e..8daff385 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -776,6 +776,47 @@ Avoid over-scrolling in mobile browsers animation: fadeInUp 0.5s forwards; } + .thinking-dots { + display: inline-flex; + gap: 4px; + align-items: center; + } + + .thinking-dots span { + width: 6px; + height: 6px; + border-radius: 50%; + background-color: #7d54d1; + animation: thinkingBounce 1.4s infinite ease-in-out both; + } + + .dark .thinking-dots span { + background-color: #976af3; + } + + .thinking-dots span:nth-child(1) { + animation-delay: -0.32s; + } + + .thinking-dots span:nth-child(2) { + animation-delay: -0.16s; + } + + .thinking-dots span:nth-child(3) { + animation-delay: 0s; + } + + @keyframes thinkingBounce { + 0%, 80%, 100% { + transform: scale(0.6); + opacity: 0.4; + } + 40% { + transform: scale(1); + opacity: 1; + } + } + @keyframes fadeInUp { to { opacity: 1;