Skip to content

UI dropdowns: Selected option has purple highlight - #45254

Merged
noahtalerman merged 1 commit into
mainfrom
purple-dropdown
May 12, 2026
Merged

UI dropdowns: Selected option has purple highlight#45254
noahtalerman merged 1 commit into
mainfrom
purple-dropdown

Conversation

@noahtalerman

@noahtalerman noahtalerman commented May 12, 2026

Copy link
Copy Markdown
Member

For the following bug:

Summary by CodeRabbit

  • Style
    • Updated the visual appearance of selected dropdown options with a new background color for improved visual consistency and enhanced contrast throughout the user interface.

Review Change Stack

@noahtalerman
noahtalerman requested a review from a team as a code owner May 12, 2026 16:55

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.

Tip: disable this comment in your organization's Code Review settings.

) => {
if (state.isFocused) return COLORS["ui-fleet-black-5"];
if (state.isSelected) return COLORS["ui-vibrant-blue-10"];
if (state.isSelected) return COLORS["ui-fleet-black-10"];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hey @cdcme is this spot in the code necessary?

At first, I left this as is (vibrant-blue-10) and only made the stylesheet change...that alone fixed the bug.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@noahtalerman Yes, it's needed. The bug screenshots are both from the legacy Dropdown component (fixed by the SCSS change), but DropdownWrapper has the same selected-option styling and it's used in a lot of other places.

@codecov

codecov Bot commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.81%. Comparing base (81bc4a3) to head (399fe10).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main   #45254    +/-   ##
========================================
  Coverage   66.81%   66.81%            
========================================
  Files        2724     2724            
  Lines      219027   219027            
  Branches    10754    10627   -127     
========================================
  Hits       146342   146342            
- Misses      59519    59520     +1     
+ Partials    13166    13165     -1     
Flag Coverage Δ
frontend 55.31% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coderabbitai

coderabbitai Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR updates the background color styling for selected dropdown options across two components. The SCSS stylesheet for dropdown styles changes the .Select-option.is-selected background color token, while the DropdownWrapper component updates its getOptionBackgroundColor function logic to use the new color token when an option is selected. Both changes align the visual styling of the dropdown selection state.

Possibly related PRs

  • fleetdm/fleet#44771: Directly related—both PRs modify dropdown styling and switch color tokens to ui-fleet-black variants in SCSS and dropdown component files.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description only provides a reference to the related issue without explaining the changes, rationale, or testing performed. Critical sections from the template are empty. Expand the description with what was changed and why, complete the checklist items (especially testing and changes files), and provide context for the fix.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: updating dropdown selected option styling from a vibrant blue to a different color (fleet black), which addresses the reported purple highlight issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch purple-dropdown

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@frontend/components/forms/fields/Dropdown/_styles.scss`:
- Line 243: Update the selected-option styling so it is visually distinct from
the focused state: in the Dropdown styles change the .is-selected rule to use
$ui-fleet-black-10 (while leaving .is-focused using $ui-fleet-black-5) to
restore contrast and align with the DropdownWrapper component’s visual
hierarchy.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f691cde1-1a43-4518-a1fc-447d95ead39f

📥 Commits

Reviewing files that changed from the base of the PR and between 9a5fae6 and 399fe10.

📒 Files selected for processing (2)
  • frontend/components/forms/fields/Dropdown/_styles.scss
  • frontend/components/forms/fields/DropdownWrapper/DropdownWrapper.tsx


&.is-selected {
background-color: $ui-vibrant-blue-10;
background-color: $ui-fleet-black-5;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Search for remaining references to ui-vibrant-blue-10 color token

# Search in SCSS files
rg -n 'ui-vibrant-blue-10' --glob '*.scss' --glob '*.css'

# Search in TypeScript/JavaScript files  
rg -n 'ui-vibrant-blue-10' --glob '*.ts' --glob '*.tsx' --glob '*.js' --glob '*.jsx'

Repository: fleetdm/fleet

Length of output: 457


🏁 Script executed:

# Check the actual Dropdown/_styles.scss file around line 243
head -250 frontend/components/forms/fields/Dropdown/_styles.scss | tail -20

Repository: fleetdm/fleet

Length of output: 440


🏁 Script executed:

# Check DropdownWrapper.tsx around line 134
head -150 frontend/components/forms/fields/DropdownWrapper.tsx | tail -20

Repository: fleetdm/fleet

Length of output: 169


🏁 Script executed:

# Verify the color token definitions
rg -n 'ui-fleet-black-5|ui-fleet-black-10' frontend/styles/var/colors.scss

Repository: fleetdm/fleet

Length of output: 610


🏁 Script executed:

# Search for DropdownWrapper in the codebase
find frontend -name "*DropdownWrapper*" -type f

Repository: fleetdm/fleet

Length of output: 278


🏁 Script executed:

# Also search for any file containing DropdownWrapper class/component
rg -l "DropdownWrapper" frontend/

Repository: fleetdm/fleet

Length of output: 3187


🏁 Script executed:

# Check DropdownWrapper.tsx around line 134
head -150 frontend/components/forms/fields/DropdownWrapper/DropdownWrapper.tsx | tail -30

Repository: fleetdm/fleet

Length of output: 1026


🏁 Script executed:

# Also check if there are any styles defined in DropdownWrapper directory
find frontend/components/forms/fields/DropdownWrapper -name "_styles.scss" -o -name "styles.scss"

Repository: fleetdm/fleet

Length of output: 119


🏁 Script executed:

# Check DropdownWrapper _styles.scss
cat -n frontend/components/forms/fields/DropdownWrapper/_styles.scss

Repository: fleetdm/fleet

Length of output: 704


🏁 Script executed:

# Get the full context of what line 243 looked like before this change
# First, let's check git to see the original state
git diff HEAD -- frontend/components/forms/fields/Dropdown/_styles.scss | head -100

Repository: fleetdm/fleet

Length of output: 39


🏁 Script executed:

# Check git status to see what files are changed
git status

Repository: fleetdm/fleet

Length of output: 276


🏁 Script executed:

# Check the actual diff for the Dropdown _styles.scss file
git diff frontend/components/forms/fields/Dropdown/_styles.scss

Repository: fleetdm/fleet

Length of output: 39


🏁 Script executed:

# Let's also check the commit to understand context
git log --oneline -5

Repository: fleetdm/fleet

Length of output: 79


🏁 Script executed:

# Check what the previous commit changed
git show HEAD~1 -- frontend/components/forms/fields/Dropdown/_styles.scss | head -100

Repository: fleetdm/fleet

Length of output: 86


🏁 Script executed:

# Show the current commit's changes
git show HEAD -- frontend/components/forms/fields/Dropdown/_styles.scss | head -100

Repository: fleetdm/fleet

Length of output: 2190


🏁 Script executed:

# Continue showing the git diff for the full context
git show HEAD -- frontend/components/forms/fields/Dropdown/_styles.scss | grep -A 20 "is-selected"

Repository: fleetdm/fleet

Length of output: 476


🏁 Script executed:

# Also check if there was an original version of this file before
git log --all --full-history -- frontend/components/forms/fields/Dropdown/_styles.scss

Repository: fleetdm/fleet

Length of output: 2906


🏁 Script executed:

# Let me verify the complete picture - check what the previous commit had for this file
git show 29fd9c53:frontend/components/forms/fields/Dropdown/_styles.scss 2>/dev/null | grep -A 10 "is-selected" || echo "File did not exist in previous commit"

Repository: fleetdm/fleet

Length of output: 281


🏁 Script executed:

# Check if there are any other dropdowns using this same component
rg "is-selected" frontend/components/forms/fields/Dropdown/_styles.scss -A 2 -B 2

Repository: fleetdm/fleet

Length of output: 181


🏁 Script executed:

# Verify the color token values one more time for clarity
rg "ui-fleet-black-5|ui-fleet-black-10" frontend/styles/var/colors.scss | head -10

Repository: fleetdm/fleet

Length of output: 418


Fix: Selected option background color should be more visually distinct from focused state.

The current code uses $ui-fleet-black-5 for both is-selected (line 243) and is-focused (line 248), providing no visual distinction between these two states. The previous version used $ui-vibrant-blue-10 for selected options, which provided clear visual contrast.

To align with the newer DropdownWrapper component and maintain proper visual hierarchy, change the selected state to use $ui-fleet-black-10:

Proposed fix
     &.is-selected {
-      background-color: $ui-fleet-black-5;
+      background-color: $ui-fleet-black-10;
       font-weight: bold;
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/components/forms/fields/Dropdown/_styles.scss` at line 243, Update
the selected-option styling so it is visually distinct from the focused state:
in the Dropdown styles change the .is-selected rule to use $ui-fleet-black-10
(while leaving .is-focused using $ui-fleet-black-5) to restore contrast and
align with the DropdownWrapper component’s visual hierarchy.

@noahtalerman
noahtalerman merged commit af83df6 into main May 12, 2026
24 checks passed
@noahtalerman
noahtalerman deleted the purple-dropdown branch May 12, 2026 21:58
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