Add consistent theme-based thread colors across the TUI (#44857)

## What changed

Assign thread colors deterministically from the full thread ID and the active syntax theme's accents. Use the same color for thread names and titles in the status line, status previews, agents overview, and resume/fork pickers, independent of renaming or list order.

Preserve thread colors when picker rows are selected and honor `tui.status_line_use_colors`. Load the configured theme before startup pickers render and refresh the cached palette when the theme changes. Fall back to the terminal's default color when no accents are available.

## Testing

Add unit and snapshot tests for palette extraction and refresh, default accent coverage, selected titles in both picker layouts, color suppression, and preview/footer consistency during automatic naming.

GitOrigin-RevId: 2b83a66bb3e80d4a1daea48ab9a86dbf2b525eef
This commit is contained in:
Eric Traut authored and copyberry committed 2026-09-11 16:20:50 +00:00
1 parent 654b0a77d0
commit 0818b6550b
17 files changed
+398 -19

No files matched your search

+11
View File
@@ -214,6 +214,7 @@ mod terminal_title;
mod terminal_visualization_instructions;
mod text_formatting;
mod theme_picker;
mod thread_color;
mod thread_transcript;
mod token_usage;
mod tooltips;
@@ -1327,6 +1328,16 @@ async fn run_ratatui_app(
})
};
// Startup pickers need the current theme before selection can reload config.
// Leave the one-time override initialization below to use the final config.
if (cli.resume_picker || cli.fork_picker)
&& let Some(name) = config.tui_theme.as_deref()
&& let Some(theme) =
crate::render::highlight::resolve_theme_by_name(name, Some(config.codex_home.as_path()))
{
crate::render::highlight::set_syntax_theme(theme);
}
let use_fork = cli.fork_picker || cli.fork_last || cli.fork_session_id.is_some();
let mut session_selection = if cli.agents_overview {
resume_picker::SessionSelection::AgentsOverview