Skip to content

fix: prevent new conversation action when no messages are present#729

Merged
Avijit-Microsoft merged 1 commit intodevfrom
bug-34690
Feb 20, 2026
Merged

fix: prevent new conversation action when no messages are present#729
Avijit-Microsoft merged 1 commit intodevfrom
bug-34690

Conversation

@Kingshuk-Microsoft
Copy link
Contributor

Purpose

This pull request updates the logic for enabling and disabling the "New Conversation" action in the chat UI to prevent users from starting a new conversation when there are no messages or when a generation/loading process is in progress. This improves the user experience by disabling the button and link in scenarios where starting a new conversation would not make sense.

Improvements to chat action availability:

  • In ChatHistory.tsx, the "New Conversation" link is now disabled not only when a message is generating (isGenerating), but also when there are no current messages (currentMessages.length === 0). The visual styles and pointer events are updated accordingly.
  • In ChatPanel.tsx, the "New Conversation" button is disabled when either the chat is loading (isLoading) or there are no messages (messages.length === 0).

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify deployment and GP testing

Copy link
Contributor

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.

Pull request overview

This PR tightens the enable/disable logic for the “New Conversation” action across the chat UI, preventing users from starting a new conversation when there are no messages or when a loading/generation flow is in progress.

Changes:

  • Disable the “New chat” button in ChatPanel when loading or when the current message list is empty.
  • Disable the “Start new chat” link in ChatHistory when generating or when the current message list is empty (including visual/pointer behavior updates).

Reviewed changes

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

File Description
content-gen/src/app/frontend/src/components/ChatPanel.tsx Disables the new conversation button when isLoading or there are no messages.
content-gen/src/app/frontend/src/components/ChatHistory.tsx Disables the new conversation link when generating or when there are no current messages (via onClick/style gating).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Avijit-Microsoft Avijit-Microsoft merged commit ee9fb41 into dev Feb 20, 2026
7 checks passed
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.2.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants