From c0b3c69a8f856a8ef11c62a6fb2613251a2b933c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Barreiro?= <52393857+BarreiroT@users.noreply.github.com> Date: Fri, 16 May 2025 05:55:38 +0200 Subject: [PATCH] Consider the previous message as last if the last is a checkpoint (#3571) --- .changeset/beige-pets-type.md | 5 +++++ webview-ui/src/components/chat/ChatView.tsx | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changeset/beige-pets-type.md diff --git a/.changeset/beige-pets-type.md b/.changeset/beige-pets-type.md new file mode 100644 index 00000000..750b8572 --- /dev/null +++ b/.changeset/beige-pets-type.md @@ -0,0 +1,5 @@ +--- +"claude-dev": patch +--- + +fix eternal loading states when the last message is a checkpoint diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index d822b74c..a3d9a160 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -983,6 +983,14 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie ) } + // We display certain statuses for the last message only + // If the last message is a checkpoint, we want to show the status of the previous message + const nextMessage = index < groupedMessages.length - 1 && groupedMessages[index + 1] + const isNextCheckpoint = !Array.isArray(nextMessage) && nextMessage && nextMessage?.say === "checkpoint_created" + const isLastMessageGroup = isNextCheckpoint && index === groupedMessages.length - 2 + + const isLast = index === groupedMessages.length - 1 || isLastMessageGroup + // regular message return ( toggleRowExpansion(messageOrGroup.ts)} lastModifiedMessage={modifiedMessages.at(-1)} - isLast={index === groupedMessages.length - 1} + isLast={isLast} onHeightChange={handleRowHeightChange} inputValue={inputValue} sendMessageFromChatRow={handleSendMessage}