Skip to content

Commit

Permalink
Chat: fix abort message loading state (#4601)
Browse files Browse the repository at this point in the history
  • Loading branch information
abeatrix authored and valerybugakov committed Jun 19, 2024
1 parent 14a9d19 commit 4a0f385
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion vscode/src/chat/chat-view/SimpleChatPanelProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,8 @@ export class SimpleChatPanelProvider implements vscode.Disposable, ChatSession {

private handleAbort(): void {
this.cancelSubmitOrEditOperation()

// Notify the webview there is no message in progress.
this.postViewTranscript()
telemetryService.log('CodyVSCodeExtension:abortButton:clicked', { hasV2Event: true })
telemetryRecorder.recordEvent('cody.sidebar.abortButton', 'clicked')
}
Expand Down
3 changes: 2 additions & 1 deletion vscode/webviews/chat/Transcript.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const Transcript: React.FunctionComponent<{
i === interactions.length - 2 && interaction.assistantMessage !== null
}
priorAssistantMessageIsLoading={Boolean(
interactions.at(i - 1)?.assistantMessage?.isLoading
messageInProgress && interactions.at(i - 1)?.assistantMessage?.isLoading
)}
/>
))}
Expand Down Expand Up @@ -87,6 +87,7 @@ export function transcriptToInteractionPairs(
index: i + 1,
isLoading:
assistantMessage.error === undefined &&
!!assistantMessageInProgress &&
(isLastPairInTranscript || assistantMessage.text === undefined),
}
: null,
Expand Down

0 comments on commit 4a0f385

Please sign in to comment.