Skip to content

refactor: consolidate the assistant bubble display#17

Merged
jjleng merged 1 commit intomainfrom
consolidate-assistant-bubble
Apr 8, 2025
Merged

refactor: consolidate the assistant bubble display#17
jjleng merged 1 commit intomainfrom
consolidate-assistant-bubble

Conversation

@jjleng
Copy link
Copy Markdown
Owner

@jjleng jjleng commented Apr 8, 2025

No description provided.

@jjleng jjleng requested a review from Copilot April 8, 2025 22:27
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

cp-webapp/src/components/chat/index.tsx:239

  • Add tests to cover the scenario where the last assistant message is empty and streaming is canceled to ensure the message is correctly skipped in the mapping logic.
if (isLastAssistantMessage && !message.content && wasCanceled) {

cp-webapp/src/components/chat/index.tsx:277

  • Add tests for the canceled message bubble conditions to ensure that when there are no messages, the last message is not from the assistant, or the assistant message is empty, the canceled bubble renders correctly.
const showCanceledMessage = wasCanceled && (!messages.length || messages[messages.length - 1].role !== 'assistant' || !messages[messages.length - 1].content);

@jjleng jjleng merged commit 897e9c2 into main Apr 8, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants