Skip to content

SearchBar: the placeholder is invisible in dark mode #54

Closed

Description

@romchornyi

Summary

In dark mode the SearchBar placeholder is all but invisible.

The prompt is styled with Color.dash.black1000Alpha30 (SearchBar.swift#L116). That colour set has a single, universal entry: black at 30 %. It has no dark variant, so on a dark background the prompt is black on near-black.

The library already has a token for this. Color.dash.searchPlaceholder (Color+DashUI.swift#L134) is the same black at 30 % in light mode and white at 50 % in dark mode. Nothing uses it.

The dark snapshot reference recorded the bug: in testPlaceholderAndText.states-dark.png the "Search" placeholder can hardly be seen. The test passes because the reference matches.

Fix

  • Style the prompt with Color.dash.searchPlaceholder instead of black1000Alpha30. Light mode keeps the same colour, so the light references do not change.
  • Re-record the dark SearchBar reference from CI (.github/scripts/fetch-snapshots.sh).

The other unused Search* tokens may be worth a look at the same time: searchTextEntered, searchIcon and searchClearIcon (typed text currently uses primaryText).

How to check

Show any screen with a SearchBar in dark mode, for example the username voting list in dashwallet-ios. The placeholder should be readable, as it is in light mode.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions