Skip to content

upstreamable: frontend: GlobalSearch: Fix visibility on dark navbar#418

Draft
skoeva wants to merge 1 commit intoAzure:headlamp-downstreamfrom
skoeva:search-bg
Draft

upstreamable: frontend: GlobalSearch: Fix visibility on dark navbar#418
skoeva wants to merge 1 commit intoAzure:headlamp-downstreamfrom
skoeva:search-bg

Conversation

@skoeva
Copy link
Collaborator

@skoeva skoeva commented Mar 12, 2026

This change ensures the search bar remains visible and consistent across all zoom levels and themes with colored or dark navbars.

Fixes: #417

Summary

  • TextField and IconButton (small/zoomed breakpoint) lacked explicit backgrounds, making them invisible on colored navbars (e.g. Azure blue, dark themes). Both now use theme.palette.background.default.
  • Small-breakpoint IconButton hover now uses background.muted instead of inheriting the navbar color.
  • Search icons and placeholder text now use text.primary/text.secondary palette tokens. The standalone icon-only button (isIconButton) inherits currentColor from the navbar instead, so it stays visible on any navbar color.
  • searchFallback (shown while GlobalSearchContent lazy-loads) had no background, causing a flash of navbar color on click. Fixed with background.default.
  • The full-width overlay shown when the search is focused now correctly uses navbar.background instead of background.default.
  • Added aria-label to the icon-only IconButton variant; marked the decorative TextField search icon aria-hidden. Replaced alpha(text.primary, 0.42) magic value with semantic text.secondary for WCAG-consistent contrast.

Screenshots

On load

image

On click

image

On load (zoomed in)

image

On click (zoomed in)

image

@skoeva skoeva self-assigned this Mar 12, 2026
Copilot AI review requested due to automatic review settings March 12, 2026 12:17
@skoeva skoeva added the a11y a11y related issues label Mar 12, 2026
Copy link

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

Improves GlobalSearch styling so the search affordance remains visible/consistent on dark/colored navbars (including at high zoom) by aligning icon/button/textfield colors and backgrounds with the active theme.

Changes:

  • Adds background/hover/border/font styling to the collapsed IconButton placeholder so it isn’t transparent on dark navbars.
  • Makes the search TextField background solid (background.default) and sets search icon color explicitly to text.primary.
  • Styles the lazy-load searchFallback TextField with a matching background to prevent a brief navbar-color flash.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 12, 2026 12:29
Copy link

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

@illume illume marked this pull request as draft March 12, 2026 12:39
@illume illume added p-none No priority was assigned bug Something isn't working labels Mar 12, 2026
Copy link
Collaborator

@illume illume left a comment

Choose a reason for hiding this comment

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

left a note about aria-hidden for the decoration

Signed-off-by: Evangelos Skopelitis <eskopelitis@microsoft.com>
@skoeva skoeva force-pushed the search-bg branch 3 times, most recently from 97c570c to 726829e Compare March 12, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a11y a11y related issues bug Something isn't working p-none No priority was assigned

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants