Skip to content

Conversation

gagik
Copy link
Contributor

@gagik gagik commented Sep 25, 2025

Not-Empty:
Screenshot 2025-09-25 at 5 31 36 PM
Empty:
Screenshot 2025-09-25 at 5 31 48 PM

@gagik gagik requested a review from a team as a code owner September 25, 2025 15:32
@gagik gagik requested review from Copilot and nbbeeken September 25, 2025 15:32
Copy link
Contributor

@Copilot 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 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.

'performance insights',
buildProactiveInsightsPrompt
),
clearChat: async () => {
Copy link
Contributor Author

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

@lerouxb
Copy link
Contributor

lerouxb commented Sep 26, 2025

Slack thread about what to use as X-Request-Origin: https://mongodb.slack.com/archives/C08S0STF3A7/p1758828379287839?thread_ts=1758821865.008829&cid=C08S0STF3A7

Summary:

  • Compass gets assigned X-Request-Origin: mongodb-compass
  • DE gets assigned X-Request-Origin: atlas-data-explorer and the browser automatically adds Origin: https://cloud.mongodb.com/v2/xxx#/explorer/yyy

@lerouxb lerouxb merged commit a4ae90d into main Sep 26, 2025
79 of 82 checks passed
@lerouxb lerouxb deleted the gagik/hide-clear branch September 26, 2025 12:06
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