Skip to content

Color TUI statusline from active theme#19631

Merged
etraut-openai merged 10 commits into
mainfrom
etraut/tui-statusline-theme-colors
May 1, 2026
Merged

Color TUI statusline from active theme#19631
etraut-openai merged 10 commits into
mainfrom
etraut/tui-statusline-theme-colors

Conversation

@etraut-openai

@etraut-openai etraut-openai commented Apr 26, 2026

Copy link
Copy Markdown
Collaborator

Why

Users have shared that the TUI can feel too visually flat because themes mostly show up in code syntax highlighting. The configurable statusline is a natural place to make the active theme more visible, while still letting users keep the existing monotone statusline if they prefer it.

What Changed

  • Added a statusline styling helper that builds the rendered statusline from (StatusLineItem, text) segments, preserving item identity while keeping the plain text output unchanged.
  • Derived foreground accent colors from the active syntax theme by looking up TextMate scopes through the existing syntax highlighter, with conservative ANSI fallbacks when a scope does not provide a foreground.
  • Tuned theme-derived colors to keep the accents visible without making the statusline feel overly bright.
  • Added [tui].status_line_use_colors, defaulting to true, plus a separated /statusline toggle so users can enable or disable theme-derived statusline colors from the setup UI.
  • Updated the live statusline and /statusline preview to use the same styled builder, while keeping terminal-title preview text plain.
  • Kept statusline separators and active-agent add-ons subdued while removing blanket dimming from the whole passive statusline.

Verification

  • cargo test -p codex-tui status_line
  • cargo test -p codex-tui theme_picker
  • cargo test -p codex-tui foreground_style_for_scopes
  • cargo test -p codex-tui
  • cargo test -p codex-config
  • cargo test -p codex-core status_line_use_colors
  • cargo insta pending-snapshots --manifest-path tui/Cargo.toml

Visual

Screenshot 2026-04-30 at 6 16 08 PM Screenshot 2026-04-30 at 6 16 02 PM

@etraut-openai etraut-openai force-pushed the etraut/tui-statusline-theme-colors branch from aa9c3d9 to ae53f53 Compare April 28, 2026 16:27
@etraut-openai etraut-openai marked this pull request as ready for review April 30, 2026 23:30
@etraut-openai etraut-openai requested a review from a team as a code owner April 30, 2026 23:30

@canvrno-oai canvrno-oai 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.

Tested and reviewed, this is a nice addition.

@etraut-openai etraut-openai merged commit a93c89f into main May 1, 2026
25 checks passed
@etraut-openai etraut-openai deleted the etraut/tui-statusline-theme-colors branch May 1, 2026 05:42
@github-actions github-actions Bot locked and limited conversation to collaborators May 1, 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