-
Notifications
You must be signed in to change notification settings - Fork 237
chore(compass-assistant): hide clear chat button when messages are empty COMPASS-9788 #7379
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
Conversation
There was a problem hiding this 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 implements conditional visibility for the "Clear chat" button in the MongoDB Compass Assistant, hiding it when there are no clearable messages. The change improves the user interface by only showing the button when it's actually needed.
- Removed
clearChat
action from the assistant provider context - Extracted clear chat functionality into a new
ClearChatButton
component that includes visibility logic - Added comprehensive test coverage for the new conditional behavior
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
compass-assistant-provider.tsx | Removed clearChat from context interface and implementation |
compass-assistant-provider.spec.tsx | Added test cases for button visibility based on message states |
compass-assistant-drawer.tsx | Extracted clear chat button into separate component with conditional rendering |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
2257b38
to
2c737c4
Compare
2c737c4
to
549ea4c
Compare
'performance insights', | ||
buildProactiveInsightsPrompt | ||
), | ||
clearChat: async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
figured there's no point in keeping this around here
Slack thread about what to use as X-Request-Origin: https://mongodb.slack.com/archives/C08S0STF3A7/p1758828379287839?thread_ts=1758821865.008829&cid=C08S0STF3A7 Summary:
|
Not-Empty:


Empty: