Skip to content

feat(compass-editor): add hover styling to autocomplete dropdown item COMPASS-8227#8223

Open
johnjackweir wants to merge 4 commits into
mainfrom
COMPASS-8227
Open

feat(compass-editor): add hover styling to autocomplete dropdown item COMPASS-8227#8223
johnjackweir wants to merge 4 commits into
mainfrom
COMPASS-8227

Conversation

@johnjackweir

Copy link
Copy Markdown
Collaborator

COMPASS-8227

Add the same background color styling to autocomplete dropdown items on hover as appears when navigating with arrow keys (aria-selected state).

Description

Checklist

  • New tests and/or benchmarks are included
  • Documentation is changed or added
  • If this change updates the UI, screenshots/videos are added and a design review is requested
  • If this change could impact the load on the MongoDB cluster, please describe the expected and worst case impact
  • I have signed the MongoDB Contributor License Agreement (https://www.mongodb.com/legal/contributor-agreement)

Motivation and Context

  • Bugfix
  • New feature
  • Dependency update
  • Misc

Open Questions

Dependents

Types of changes

  • Backport Needed
  • Patch (non-breaking change which fixes an issue)
  • Minor (non-breaking change which adds functionality)
  • Major (fix or feature that would cause existing functionality to change)

…COMPASS-8227

Add the same background color styling to autocomplete dropdown items on hover
as appears when navigating with arrow keys (aria-selected state).

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@johnjackweir johnjackweir requested a review from a team as a code owner July 8, 2026 19:54
@johnjackweir johnjackweir requested a review from dudaschar July 8, 2026 19:54
@github-actions github-actions Bot added the feat label Jul 8, 2026
@johnjackweir johnjackweir removed the request for review from dudaschar July 8, 2026 21:33
johnjackweir and others added 3 commits July 8, 2026 17:45
…OMPASS-8227

Use EditorView.baseTheme to apply hover styles to autocomplete dropdown items.
This ensures styles apply to tooltips rendered at document root level.
Remove ineffective test that couldn't verify hover pseudo-class behavior.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…OMPASS-8227

Add test to verify that autocomplete hover styles from EditorView.baseTheme
are properly injected into the document. The test checks for the presence of
hover styling in the generated style tags.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…OMPASS-8227

Remove redundant hover styles from getStylesForTheme since they don't work
for tooltips rendered at document root. The autocompleteHoverStyles using
EditorView.baseTheme is the correct approach and is already in place.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@johnjackweir

Copy link
Copy Markdown
Collaborator Author

Confirmed this works, ex when hovering "text" value in the dropdown in old
Screenshot 2026-07-08 at 5 55 54 PM

and new
Screenshot 2026-07-08 at 5 55 39 PM

@johnjackweir johnjackweir requested a review from Anemy July 8, 2026 21:59
);
});

it('configures autocomplete hover styles', function () {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test is kinda dumb so open to removing it 🪓

you can't actually trigger CSS :hover pseudo-classes in a test environment (they
only work with real mouse interaction) so this test verifies the next best thing: that
the CSS rules defining the hover behavior are present in the document and will be
applied when users actually hover in the browser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants