fix(chat): sort messages appropriately

This commit is contained in:
Haileyesus
2026-06-11 21:48:46 +03:00
parent 89f05247ed
commit 123ae31020
3 changed files with 193 additions and 12 deletions

View File

@@ -19,6 +19,8 @@ interface ChatMessagesPaneProps {
onWheel: () => void;
onTouchMove: () => void;
isLoadingSessionMessages: boolean;
/** True while the viewed session has an active provider run in flight. */
isProcessing?: boolean;
chatMessages: ChatMessage[];
selectedSession: ProjectSession | null;
currentSessionId: string | null;
@@ -68,6 +70,7 @@ export default function ChatMessagesPane({
onWheel,
onTouchMove,
isLoadingSessionMessages,
isProcessing = false,
chatMessages,
selectedSession,
currentSessionId,
@@ -147,7 +150,7 @@ export default function ChatMessagesPane({
onTouchMove={onTouchMove}
className="relative flex-1 space-y-3 overflow-y-auto overflow-x-hidden px-0 py-3 sm:space-y-4 sm:p-4"
>
{isLoadingSessionMessages && chatMessages.length === 0 ? (
{(isLoadingSessionMessages || isProcessing) && chatMessages.length === 0 ? (
<div className="mt-8 text-center text-gray-500 dark:text-gray-400">
<div className="flex items-center justify-center space-x-2">
<div className="h-4 w-4 animate-spin rounded-full border-b-2 border-gray-400" />