Skip to content

Add an icon to clear the copilot chat #2236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 18, 2025
Merged

Add an icon to clear the copilot chat #2236

merged 3 commits into from
Mar 18, 2025

Conversation

billti
Copy link
Member

@billti billti commented Mar 18, 2025

This add a "Clear chat" icon (see below on the right) to the Quantum Copilot chat panel, and wires up the pre-existing clear chat functioality to it

image

@minestarks
Copy link
Member

The restartChat method is the right one. Only problem is that if there is a request currently in flight, and you clear the chat, the assistant response isn't cancelled. So when the assistant response comes back, the response will pop up in the new, blank, conversation. I think this corrupts the conversation history :/

We could try

  • disabling "clear chat" if there's a request in progress
  • associate requests with the current conversation id, and drop responses that don't match that conversation id. (restartChat refreshes the conversation id.)
  • lazy fix: drop responses if the UI isn't in the expected state (ending with a user message). This will almost certainly create race conditions though, as you can easily get in a state where you receive the "old" assistant response to a new user message that was submitted after the chat was cleared.

@billti
Copy link
Member Author

billti commented Mar 18, 2025

With this approach, the 'Clear' icon/command is now disabled when a request is in flight.

@minestarks
Copy link
Member

Just noting that if we want to match the native chat experience (as I tend to), they use a "+" icon for this and call it "New Chat" .

image

Not that I think theirs is the most intuitive, but at least it's a paradigm that's already there.

@billti billti merged commit 16c7ece into main Mar 18, 2025
18 checks passed
@billti billti deleted the billti/copilot-clear branch March 18, 2025 16:00
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