fix(aggregations): $rerank bug bash changes COMPASS-10696#8117
Open
DarshanaVenkatesh wants to merge 8 commits into
Open
fix(aggregations): $rerank bug bash changes COMPASS-10696#8117DarshanaVenkatesh wants to merge 8 commits into
DarshanaVenkatesh wants to merge 8 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Bug-bash polish for the $rerank feature: tightens banner layouts via a shared button style, adds "View token usage" affordances (in the rerank tokens banner and focus-mode header), deep-links the "Native reranking not enabled" error to the project settings highlight (with a docs fallback), and expands the assistant prompt for the "rerank as first stage" insight.
Changes:
- Extract a shared
bannerButtonStylesand apply consistent gap-based layouts across rerank/server-error banners. - Add
View token usagebuttons/links sourced from a newbuildRerankTokenUsageUrl(with a dochub fallback when Atlas metadata is absent). - Extend
buildProjectSettingsUrlwith an optionalhighlightparameter (covered by a new unit test) and rewrite the assistant prompt forrerank-first-stage.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/compass-assistant/src/prompts.ts | Rewrites the rerank-first-stage insight prompt and updates its display text. |
| packages/compass-aggregations/src/components/banner-button-styles.ts | New shared style for in-banner action buttons (no-wrap, no underline). |
| packages/compass-aggregations/src/components/rerank-first-stage-banner.tsx | Switches to shared button styles and uses gap for layout. |
| packages/compass-aggregations/src/components/rerank-version-warning-banner.tsx | Drops the local bannerButtonStyles in favor of the shared one. |
| packages/compass-aggregations/src/components/rerank-tokens-banner.tsx | Adds a "View token usage" button using buildRerankTokenUsageUrl with a docs fallback. |
| packages/compass-aggregations/src/components/server-error-banner.tsx | Always renders a Project Settings/docs link for rerank-not-enabled errors and uses the new highlight query param. |
| packages/compass-aggregations/src/components/focus-mode/focus-mode-modal-header.tsx | Adds a "View token usage" link when focusing a $rerank stage. |
| packages/atlas-service/src/url-builders.ts | Adds optional highlight query param to buildProjectSettingsUrl. |
| packages/atlas-service/src/url-builders.spec.ts | Adds a unit test for the highlight parameter. |
Comments suppressed due to low confidence (1)
packages/compass-aggregations/src/components/server-error-banner.tsx:98
- When
atlasMetadatais unavailable,projectSettingsHrefnow falls back toRERANK_DOCS_URL, but the button is still labeled "Project Settings" with anOpenNewTabicon. Clicking it will take the user to MongoDB documentation rather than an actual project settings page, which is misleading. Consider rendering different label/affordance (e.g. "Learn more") when the link points to docs, or only render the button when the Atlas link is available.
{projectSettingsHref && (
<Button
size="xsmall"
href={projectSettingsHref}
target="_blank"
rightGlyph={<Icon glyph="OpenNewTab" />}
className={bannerButtonStyles}
>
Project Settings
</Button>
)}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Checklist
Motivation and Context
Open Questions
Dependents
Types of changes