Skip to content

fix(tui): improve light-mode selection contrast#21950

Merged
fcoury-oai merged 1 commit into
mainfrom
fcoury/fix-lightmode
May 9, 2026
Merged

fix(tui): improve light-mode selection contrast#21950
fcoury-oai merged 1 commit into
mainfrom
fcoury/fix-lightmode

Conversation

@fcoury-oai
Copy link
Copy Markdown
Contributor

@fcoury-oai fcoury-oai commented May 9, 2026

Why

On light terminal backgrounds, selected rows in several TUI pickers were rendered with the same bright cyan accent used on dark themes. Against the light menu surface, that made the current selection hard to distinguish at a glance.

Before

SCR-20260509-nmtz

After

SCR-20260509-nmox

What changed

  • Added a shared background-aware accent style for active/selected TUI controls.
  • Use a darker cyan-family accent on light backgrounds while preserving the existing bright cyan accent on dark or unknown backgrounds.
  • Reused that accent across shared picker rows and the custom selection-like surfaces that had drifted separately: picker tabs, hooks browsing, external-agent migration choices, and /keymap affordances.
  • Added focused tests for the light/dark accent rule and rendered selected-row styling.

How to Test

  1. Start Codex in a terminal using a light background theme.
  2. Type / to open the slash-command picker and move the selection through a few rows.
  3. Confirm that the selected row is visibly colored with strong contrast instead of blending into the popup surface.
  4. Open /keymap and confirm the active tab, selected rows, and picker hint accents use the same light-theme accent treatment.
  5. In a dark terminal theme, repeat the slash-picker check and confirm the existing bright cyan selection styling is preserved.

Targeted tests:

  • cargo test -p codex-tui accent_style_uses_
  • cargo test -p codex-tui selected_rows_use_the_shared_accent_style
  • cargo test -p codex-tui selected_event_rows_use_the_shared_accent_style

Notes:

  • A full cargo test -p codex-tui run reached the end of the suite but hit an unrelated existing stack overflow in tests::fork_last_filters_latest_session_by_cwd_unless_show_all.

@fcoury-oai fcoury-oai changed the title tui: improve light-mode selection contrast fix(tui): improve light-mode selection contrast May 9, 2026
Copy link
Copy Markdown
Collaborator

@etraut-openai etraut-openai left a comment

Choose a reason for hiding this comment

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

Looks good! I was able to repro the bug on iTerm2 with a light theme, and I confirmed that the fix addresses the problem.

@fcoury-oai fcoury-oai merged commit 53468b9 into main May 9, 2026
36 of 38 checks passed
@fcoury-oai fcoury-oai deleted the fcoury/fix-lightmode branch May 9, 2026 19:10
@github-actions github-actions Bot locked and limited conversation to collaborators May 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants