Skip to content

Commit c0b3c69

Browse files
authored
Consider the previous message as last if the last is a checkpoint (RooCodeInc#3571)
1 parent 080ed7c commit c0b3c69

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.changeset/beige-pets-type.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"claude-dev": patch
3+
---
4+
5+
fix eternal loading states when the last message is a checkpoint

webview-ui/src/components/chat/ChatView.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,14 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
983983
)
984984
}
985985

986+
// We display certain statuses for the last message only
987+
// If the last message is a checkpoint, we want to show the status of the previous message
988+
const nextMessage = index < groupedMessages.length - 1 && groupedMessages[index + 1]
989+
const isNextCheckpoint = !Array.isArray(nextMessage) && nextMessage && nextMessage?.say === "checkpoint_created"
990+
const isLastMessageGroup = isNextCheckpoint && index === groupedMessages.length - 2
991+
992+
const isLast = index === groupedMessages.length - 1 || isLastMessageGroup
993+
986994
// regular message
987995
return (
988996
<ChatRow
@@ -991,7 +999,7 @@ const ChatView = ({ isHidden, showAnnouncement, hideAnnouncement, showHistoryVie
991999
isExpanded={expandedRows[messageOrGroup.ts] || false}
9921000
onToggleExpand={() => toggleRowExpansion(messageOrGroup.ts)}
9931001
lastModifiedMessage={modifiedMessages.at(-1)}
994-
isLast={index === groupedMessages.length - 1}
1002+
isLast={isLast}
9951003
onHeightChange={handleRowHeightChange}
9961004
inputValue={inputValue}
9971005
sendMessageFromChatRow={handleSendMessage}

0 commit comments

Comments
 (0)