Skip to content

Give unstyled text a readable default in both themes - #982

Merged
AnthonyRonning merged 1 commit into
MaplePrivacyLabs:masterfrom
benthecarman:fix/dark-mode-text-defaults
Sep 21, 2026
Merged

AnthonyRonning merged 1 commit into
MaplePrivacyLabs:masterfrom
benthecarman:fix/dark-mode-text-defaults

Conversation

@benthecarman

Copy link
Copy Markdown
Contributor

Dark-mode readability bugs kept recurring in maple-gpui: an input typed invisibly inside an unstyled form, a pairing code rendered in caption gray. The palette was fine; the mechanism that picks a color was not.

  • Root default. The window root never set a text color, so any text without a color-setting ancestor rendered in GPUI's default, black. That is invisible on the dark surfaces and looks fine in light mode, which is why every omission surfaced only in dark mode. The root now sets the primary text color.
  • Inputs own their color. TextInput drew typed text in whatever color it inherited. It now uses the primary text color, so it reads wherever it is placed.
  • Contrast test. A unit test computes WCAG contrast for every text role on every resting surface in both palettes: 4.5:1 for body roles, 3:1 for status and link colors. It found two light-palette failures: captions at 2.5:1 on white and the warning color, never adapted for light, at 2.3:1. Captions move to 0x6b6b6b and the light warning to amber-700. Dark passes unchanged.

Follow-up, not in this PR: replace hand-set colors in the settings pane and chat with role helpers (caption, code chip, title) so captions set on containers stop leaking to children. That sweep conflicts with the remote-development branch and should land after it.

Tests: cargo test -p maple-gpui (337 pass), cargo clippy -p maple-gpui --all-targets -- -D warnings clean.

🤖 Generated with Claude Code

Text that set no color of its own rendered in GPUI's default, black,
which vanished on the dark surfaces and looked fine in light mode. Every
omission became a dark-mode bug found by eye: an input typed invisibly
inside an unstyled form, a pairing code came out in caption gray. The
screens compensated with hand-set colors on hundreds of elements.

The window root now sets the primary text color as the default, so an
omission falls back to readable text in either theme. The text input
draws typed text in the primary color rather than whatever it inherits,
so it reads wherever it is placed. A test computes the WCAG contrast of
every text role on every resting surface in both palettes and holds
body roles to 4.5:1 and status and link colors to 3:1. It found the
light palette wanting: captions were 2.5:1 on white and the warning
color, never adapted for light, was 2.3:1. Captions move to a darker
gray and the light warning to amber-700.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
@AnthonyRonning
AnthonyRonning merged commit 473eece into MaplePrivacyLabs:master Sep 21, 2026
22 checks passed
@benthecarman
benthecarman deleted the fix/dark-mode-text-defaults branch September 21, 2026 21:17
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