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}