onChatBodyScroll(e.currentTarget)}
- className="custom-scrollbar-always flex flex-col grow overflow-y-auto overflow-x-hidden px-4 pt-4 gap-2 fast-smooth-scroll"
+ className="custom-scrollbar-always flex flex-col grow overflow-y-auto overflow-x-hidden px-4 pt-4 gap-2"
>
- {isLoadingMessages && !isV1Conversation && !isTask && (
-
+ {isChatLoading && isReturningToConversation && (
+
+ )}
+
+ {isChatLoading && !isReturningToConversation && (
+
)}
- {(conversationWebSocket?.isLoadingHistory || !showV1Messages) &&
- isV1Conversation &&
- !isTask && (
-
-
-
- )}
-
{!isLoadingMessages && v0UserEventsExist && (
+ );
+}
+
+export function ChatMessagesSkeleton() {
+ return (
+
+ {SKELETON_PATTERN.map((item, i) => (
+
+
+
+ ))}
+
+ );
+}
diff --git a/frontend/src/hooks/use-scroll-to-bottom.ts b/frontend/src/hooks/use-scroll-to-bottom.ts
index 18516785fa..0f59ce184a 100644
--- a/frontend/src/hooks/use-scroll-to-bottom.ts
+++ b/frontend/src/hooks/use-scroll-to-bottom.ts
@@ -61,11 +61,7 @@ export function useScrollToBottom(scrollRef: RefObject
) {
setAutoscroll(true);
setHitBottom(true);
- // Use smooth scrolling but with a fast duration
- dom.scrollTo({
- top: dom.scrollHeight,
- behavior: "smooth",
- });
+ dom.scrollTop = dom.scrollHeight;
});
}
}, [scrollRef]);
@@ -77,11 +73,7 @@ export function useScrollToBottom(scrollRef: RefObject) {
if (autoscroll) {
const dom = scrollRef.current;
if (dom) {
- // Scroll to bottom - this will trigger on any DOM change
- dom.scrollTo({
- top: dom.scrollHeight,
- behavior: "smooth",
- });
+ dom.scrollTop = dom.scrollHeight;
}
}
}); // No dependency array - runs after every render to follow new content
diff --git a/frontend/test-utils.tsx b/frontend/test-utils.tsx
index a55cb7d132..0d2a55f51d 100644
--- a/frontend/test-utils.tsx
+++ b/frontend/test-utils.tsx
@@ -8,13 +8,17 @@ import i18n from "i18next";
import { vi } from "vitest";
import { AxiosError } from "axios";
+export const useParamsMock = vi.fn(() => ({
+ conversationId: "test-conversation-id",
+}));
+
// Mock useParams before importing components
vi.mock("react-router", async () => {
const actual =
await vi.importActual("react-router");
return {
...actual,
- useParams: () => ({ conversationId: "test-conversation-id" }),
+ useParams: useParamsMock,
};
});