-
Notifications
You must be signed in to change notification settings - Fork 246
feat(crud): add tooltip for N/A count COMPASS-10076 #7568
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
base: main
Are you sure you want to change the base?
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 adds a tooltip to the "N/A" count display in the CRUD toolbar to explain why the count might be unavailable. When the count operation fails or exceeds the maxTimeMS limit, users can hover over the underlined "N/A" text to see an explanation.
Key changes:
- Exported the
COUNT_MAX_TIME_MS_CAPconstant to make it reusable across components - Added a tooltip component with explanatory text for unavailable counts
- Refactored the count display logic to conditionally render the tooltip when count is unavailable
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/compass-crud/src/stores/crud-store.ts | Exported the COUNT_MAX_TIME_MS_CAP constant for use in tooltip message |
| packages/compass-crud/src/components/crud-toolbar.tsx | Added tooltip functionality with styling for the N/A count display |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const INCREASE_MAX_TIME_MS_HINT = | ||
| 'Operation exceeded time limit. Please try increasing the maxTimeMS for the query in the expanded filter options.'; | ||
|
|
||
| const COUNT_UNAVAILABLE_TOOLTIP = `The count is not available for this query. This can happen when the count operation fails or exceeds the maxTimeMS of ${COUNT_MAX_TIME_MS_CAP}.`; |
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.
We cap maxTimeMS and if a user has set it to lower value in preferences, should we show that instead? When running count, we call capMaxTimeMSAtPreferenceLimit to get actual value we use.
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.
Nice catch!
COMPASS-10076
Asking about the text in slack thread https://mongodb.slack.com/archives/GDTJXPHD0/p1762874210679479