Lightweight coding agent that runs in your terminal
Rust
Improve TUI contrast, keyboard hints, and picker layouts (#46680)
Eric Traut132c2be239ec
diff --git a/codex-rs/tui/src/analytics/render.rs b/codex-rs/tui/src/analytics/render.rsindex 5f37e27460..595fbcea81 100644--- a/codex-rs/tui/src/analytics/render.rs+++ b/codex-rs/tui/src/analytics/render.rs@@ -9,14 +9,12 @@ use crate::analytics::models::AccountAnalyticsValue;use crate::analytics::sections::Section;use crate::keymap::ListAction;use crate::style::accent_style;-use crate::style::footer_hint_key_style;use crate::wrapping::RtOptions;use crate::wrapping::word_wrap_lines;use ratatui::buffer::Buffer;use ratatui::layout::Constraint;use ratatui::layout::Layout;use ratatui::layout::Rect;-use ratatui::style::Color;use ratatui::style::Styled;use ratatui::style::Stylize;use ratatui::text::Line;@@ -171,11 +169,7 @@ impl AnalyticsView {spans.push(" · ".into());}let (keys, description) = control.rsplit_once(' ').unwrap_or((control, ""));- spans.push(- keys.to_owned()- .fg(Color::Reset)- .patch_style(footer_hint_key_style().bold().not_dim()),- );+ spans.extend(crate::key_hint::key_label_spans(keys));if !description.is_empty() {spans.push(format!(" {description}").into());}diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__duplicate_message_dates_render_the_full_other_remainder.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__duplicate_message_dates_render_the_full_other_remainder.snapindex 6a5d3333c5..e50c24e2f2 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__duplicate_message_dates_render_the_full_other_remainder.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__duplicate_message_dates_render_the_full_other_remainder.snap@@ -23,8 +23,8 @@ Palette:2: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()3: Style::new().magenta().bg(Color::Reset).underline_color(Color::Reset)4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-6: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+6: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 22:1 24:01: 0:0 1:2 3:0 18:3 30:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__missing_zero_and_narrow_charts_keep_the_selection_visible.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__missing_zero_and_narrow_charts_keep_the_selection_visible.snapindex bc23bf58b1..a0dd98e27d 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__missing_zero_and_narrow_charts_keep_the_selection_visible.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__missing_zero_and_narrow_charts_keep_the_selection_visible.snap@@ -17,8 +17,8 @@ Palette:2: Style::new().fg(Color::Rgb(165, 165, 165)).bg(Color::Reset).underline_color(Color::Reset)3: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)4: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-6: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+5: Style::new().fg(Color::Rgb(99, 168, 248)).bg(Color::Reset).underline_color(Color::Reset).bold()+6: Style::new().fg(Color::Rgb(99, 168, 248)).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 30:1 31:01: 0:0 1:2 2:0 27:3 34:0@@ -43,8 +43,8 @@ Palette:2: Style::new().fg(Color::Rgb(165, 165, 165)).bg(Color::Reset).underline_color(Color::Reset)3: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)4: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-6: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+5: Style::new().fg(Color::Rgb(99, 168, 248)).bg(Color::Reset).underline_color(Color::Reset).bold()+6: Style::new().fg(Color::Rgb(99, 168, 248)).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 30:1 31:01: 0:0 1:2 2:0 27:3 34:0@@ -68,9 +68,9 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)3: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()+4: Style::new().fg(Color::Rgb(99, 168, 248)).bg(Color::Reset).underline_color(Color::Reset).bold()5: Style::new().fg(Color::Rgb(165, 165, 165)).bg(Color::Reset).underline_color(Color::Reset)-6: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+6: Style::new().fg(Color::Rgb(99, 168, 248)).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 6:1 7:01: 0:0 5:2 7:0@@ -93,7 +93,7 @@ Palette:0: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()1: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)2: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()-3: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()+3: Style::new().fg(Color::Rgb(99, 168, 248)).bg(Color::Reset).underline_color(Color::Reset).bold()4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)Rows (column:palette):0: 0:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__narrow_long_range_charts_never_truncate_dates.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__narrow_long_range_charts_never_truncate_dates.snapindex fd494d74a1..7a25e2484f 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__narrow_long_range_charts_never_truncate_dates.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__narrow_long_range_charts_never_truncate_dates.snap@@ -16,7 +16,7 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)3: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()Rows (column:palette):0: 0:01: 0:1@@ -40,8 +40,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)3: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:01: 0:0 1:1@@ -65,8 +65,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)3: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:01: 0:0 4:1@@ -90,8 +90,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)3: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:01: 0:0 5:1diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__oversized_axes_are_hidden_instead_of_truncated.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__oversized_axes_are_hidden_instead_of_truncated.snapindex f082b06e12..fd6afa476b 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__oversized_axes_are_hidden_instead_of_truncated.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__oversized_axes_are_hidden_instead_of_truncated.snap@@ -17,8 +17,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)3: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 1:1 5:01: 0:0 1:2 6:0@@ -44,8 +44,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()3: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 15:1 19:01: 0:0 1:2 5:0 12:3 24:0@@ -71,8 +71,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()3: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 18:1 22:01: 0:0 1:2 5:0 14:3 26:0@@ -98,8 +98,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()3: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 22:1 26:01: 0:0 1:2 5:0 19:3 31:0@@ -125,8 +125,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)3: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:01: 0:0 4:1 24:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__partial_cells_use_the_midpoint_and_descend_from_the_baseline.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__partial_cells_use_the_midpoint_and_descend_from_the_baseline.snapindex f8b8f2f1a6..7370a839bf 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__partial_cells_use_the_midpoint_and_descend_from_the_baseline.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__partial_cells_use_the_midpoint_and_descend_from_the_baseline.snap@@ -14,8 +14,8 @@ Palette:1: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)2: Style::new().magenta().bg(Color::Reset).underline_color(Color::Reset)3: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 4:11: 0:1 1:2 5:1 8:3 9:1@@ -37,8 +37,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()3: Style::new().magenta().bg(Color::Reset).underline_color(Color::Reset).reversed()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:01: 0:0 8:1 9:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__selected_callout_keeps_the_authoritative_daily_total.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__selected_callout_keeps_the_authoritative_daily_total.snapindex b9a309eac9..8b6deef67c 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__selected_callout_keeps_the_authoritative_daily_total.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__selected_callout_keeps_the_authoritative_daily_total.snap@@ -17,8 +17,8 @@ Palette:2: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()3: Style::new().magenta().bg(Color::Reset).underline_color(Color::Reset)4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-6: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+6: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:01: 0:0 1:1 3:0 21:2 26:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__seven_day_totals.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__seven_day_totals.snapindex a1f322d99a..74c241a4b2 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__seven_day_totals.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__seven_day_totals.snap@@ -20,8 +20,8 @@ Palette:1: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()2: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)3: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 91:1 94:01: 0:0 1:1 4:0 77:1 80:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__signed_chart_dark.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__signed_chart_dark.snapindex 82660a65c4..a76a24d098 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__signed_chart_dark.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__signed_chart_dark.snap@@ -24,8 +24,8 @@ Palette:4: Style::new().magenta().bg(Color::Reset).underline_color(Color::Reset).reversed()5: Style::new().magenta().bg(Color::Reset).underline_color(Color::Reset)6: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()-7: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-8: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+7: Style::new().fg(Color::Rgb(99, 168, 248)).bg(Color::Reset).underline_color(Color::Reset).bold()+8: Style::new().fg(Color::Rgb(99, 168, 248)).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:01: 0:0 3:1 5:0 9:2 13:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__signed_chart_light.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__signed_chart_light.snapindex f100f1c7e8..10525e141a 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__signed_chart_light.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__signed_chart_light.snap@@ -24,8 +24,8 @@ Palette:4: Style::new().magenta().bg(Color::Reset).underline_color(Color::Reset).reversed()5: Style::new().magenta().bg(Color::Reset).underline_color(Color::Reset)6: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()-7: Style::new().fg(Color::Rgb(0, 95, 135)).bg(Color::Reset).underline_color(Color::Reset).bold()-8: Style::new().fg(Color::Rgb(0, 95, 135)).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+7: Style::new().fg(Color::Rgb(28, 100, 200)).bg(Color::Reset).underline_color(Color::Reset).bold()+8: Style::new().fg(Color::Rgb(28, 100, 200)).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:01: 0:0 3:1 5:0 9:2 13:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__tiny_segments_keep_their_series_color_beside_a_large_day.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__tiny_segments_keep_their_series_color_beside_a_large_day.snapindex cd4be0edf0..87340fc974 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__tiny_segments_keep_their_series_color_beside_a_large_day.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__tiny_segments_keep_their_series_color_beside_a_large_day.snap@@ -17,8 +17,8 @@ Palette:1: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()2: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()3: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 11:1 17:01: 0:0 1:2 4:0 8:3 20:0@@ -50,8 +50,8 @@ Palette:2: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()3: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset)4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).reversed()-5: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-6: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+5: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+6: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:0 12:1 18:01: 0:0 2:2 5:0 9:3 21:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__zero_credit_history_uses_a_readable_scale.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__zero_credit_history_uses_a_readable_scale.snapindex 8c4964a90b..85b4bef1f3 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__zero_credit_history_uses_a_readable_scale.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__plot__tests__zero_credit_history_uses_a_readable_scale.snap@@ -15,8 +15,8 @@ Palette:0: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)1: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()2: Style::new().white().bg(Color::Reset).underline_color(Color::Reset).bold()-3: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold()-4: Style::new().cyan().bg(Color::Reset).underline_color(Color::Reset).bold().underlined()+3: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold()+4: Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold().underlined()Rows (column:palette):0: 0:01: 0:0 3:1 4:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_1.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_1.snapindex bfbea75055..460aadeb4e 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_1.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_1.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,14 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: White|Reset|Reset|BOLD8: Cyan|Reset|Reset|NONE-9: Cyan|Reset|Reset|BOLD | UNDERLINED+9: Rgb(99, 168, 248)|Reset|Reset|BOLD | UNDERLINED+10: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0@@ -99,5 +99,5 @@ Rows (column:palette):37: 0:0 2:6 4:038: 0:0 2:5 4:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 34:1 37:2 44:1 49:2 118:0-41: 0:0 2:1 3:2 12:1 13:2 22:1 23:2 34:1 37:2 45:1 46:2 118:0+40: 0:0 2:10 9:2 20:10 21:2 34:10 37:2 44:10 49:2 118:0+41: 0:0 2:10 3:2 12:10 13:2 22:10 23:2 34:10 37:2 45:10 46:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_2.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_2.snapindex 4b02d8fb9d..c696e96599 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_2.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_2.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,14 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: White|Reset|Reset|BOLD6: Green|Reset|Reset|NONE7: Magenta|Reset|Reset|NONE8: Cyan|Reset|Reset|NONE-9: Cyan|Reset|Reset|BOLD | UNDERLINED+9: Rgb(99, 168, 248)|Reset|Reset|BOLD | UNDERLINED+10: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0@@ -99,5 +99,5 @@ Rows (column:palette):37: 0:0 2:6 4:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 34:1 37:2 44:1 49:2 118:0-41: 0:0 2:1 3:2 12:1 13:2 24:1 27:2 35:1 36:2 118:0+40: 0:0 2:10 9:2 20:10 21:2 34:10 37:2 44:10 49:2 118:0+41: 0:0 2:10 3:2 12:10 13:2 24:10 27:2 35:10 36:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_3.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_3.snapindex 2374745fef..fccb190361 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_3.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_3.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,14 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: White|Reset|Reset|BOLD8: Cyan|Reset|Reset|NONE-9: Cyan|Reset|Reset|BOLD | UNDERLINED+9: Rgb(99, 168, 248)|Reset|Reset|BOLD | UNDERLINED+10: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0@@ -99,5 +99,5 @@ Rows (column:palette):37: 0:0 2:5 4:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 34:1 37:2 44:1 49:2 118:0-41: 0:0 2:1 3:2 12:1 13:2 24:1 27:2 35:1 36:2 118:0+40: 0:0 2:10 9:2 20:10 21:2 34:10 37:2 44:10 49:2 118:0+41: 0:0 2:10 3:2 12:10 13:2 24:10 27:2 35:10 36:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_4.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_4.snapindex b23c8ebfdb..936e828772 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_4.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_4.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,8 +50,9 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM+5: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0@@ -94,5 +94,5 @@ Rows (column:palette):37: 0:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 34:1 37:2 44:1 49:2 118:0-41: 0:0 2:1 3:2 14:1 17:2 25:1 26:2 118:0+40: 0:0 2:5 9:2 20:5 21:2 34:5 37:2 44:5 49:2 118:0+41: 0:0 2:5 3:2 14:5 17:2 25:5 26:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_6.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_6.snapindex 0a4af96b8e..fa9bac691b 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_6.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_6.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,14 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: White|Reset|Reset|BOLD6: Green|Reset|Reset|NONE7: Magenta|Reset|Reset|NONE8: Cyan|Reset|Reset|NONE-9: Cyan|Reset|Reset|BOLD | UNDERLINED+9: Rgb(99, 168, 248)|Reset|Reset|BOLD | UNDERLINED+10: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0@@ -99,5 +99,5 @@ Rows (column:palette):37: 0:0 2:6 4:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 34:1 37:2 44:1 49:2 118:0-41: 0:0 2:1 3:2 12:1 13:2 24:1 27:2 35:1 36:2 118:0+40: 0:0 2:10 9:2 20:10 21:2 34:10 37:2 44:10 49:2 118:0+41: 0:0 2:10 3:2 12:10 13:2 24:10 27:2 35:10 36:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_8.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_8.snapindex d13c95b507..5cb858f651 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_8.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_business_8.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,8 +50,9 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM+5: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0@@ -94,5 +94,5 @@ Rows (column:palette):37: 0:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 118:0-41: 0:0 2:1 3:2 11:1 12:2 23:1 26:2 34:1 35:2 118:0+40: 0:0 2:5 9:2 20:5 21:2 118:0+41: 0:0 2:5 3:2 11:5 12:2 23:5 26:2 34:5 35:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_1.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_1.snapindex 623a419afe..c712bee228 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_1.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_1.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,14 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: White|Reset|Reset|BOLD7: Magenta|Reset|Reset|NONE8: Cyan|Reset|Reset|NONE-9: Cyan|Reset|Reset|BOLD | UNDERLINED+9: Rgb(99, 168, 248)|Reset|Reset|BOLD | UNDERLINED+10: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0@@ -99,5 +99,5 @@ Rows (column:palette):37: 0:0 2:5 4:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 34:1 37:2 44:1 49:2 118:0-41: 0:0 2:1 3:2 12:1 13:2 22:1 23:2 34:1 37:2 45:1 46:2 118:0+40: 0:0 2:10 9:2 20:10 21:2 34:10 37:2 44:10 49:2 118:0+41: 0:0 2:10 3:2 12:10 13:2 22:10 23:2 34:10 37:2 45:10 46:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_2.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_2.snapindex ec95172894..38f4881a07 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_2.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_2.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,14 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: White|Reset|Reset|BOLD6: Green|Reset|Reset|NONE7: Magenta|Reset|Reset|NONE8: Cyan|Reset|Reset|NONE-9: Cyan|Reset|Reset|BOLD | UNDERLINED+9: Rgb(99, 168, 248)|Reset|Reset|BOLD | UNDERLINED+10: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0@@ -99,5 +99,5 @@ Rows (column:palette):37: 0:0 2:6 4:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 34:1 37:2 44:1 49:2 118:0-41: 0:0 2:1 3:2 12:1 13:2 24:1 27:2 35:1 36:2 118:0+40: 0:0 2:10 9:2 20:10 21:2 34:10 37:2 44:10 49:2 118:0+41: 0:0 2:10 3:2 12:10 13:2 24:10 27:2 35:10 36:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_4.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_4.snapindex ec82b2cc00..a1cb1fa49c 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_4.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_4.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,8 +50,9 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM+5: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0@@ -94,5 +94,5 @@ Rows (column:palette):37: 0:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 29:1 30:2 43:1 46:2 53:1 58:2 118:0-41: 0:0 2:1 3:2 14:1 17:2 25:1 26:2 118:0+40: 0:0 2:5 9:2 20:5 21:2 29:5 30:2 43:5 46:2 53:5 58:2 118:0+41: 0:0 2:5 3:2 14:5 17:2 25:5 26:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_5.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_5.snapindex c2f68771d2..afffb965e7 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_5.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_5.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,14 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: White|Reset|Reset|BOLD6: Green|Reset|Reset|NONE7: Magenta|Reset|Reset|NONE8: Cyan|Reset|Reset|NONE-9: Cyan|Reset|Reset|BOLD | UNDERLINED+9: Rgb(99, 168, 248)|Reset|Reset|BOLD | UNDERLINED+10: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0@@ -99,5 +99,5 @@ Rows (column:palette):37: 0:0 2:6 4:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 34:1 37:2 44:1 49:2 118:0-41: 0:0 2:1 3:2 12:1 13:2 22:1 23:2 34:1 37:2 45:1 46:2 118:0+40: 0:0 2:10 9:2 20:10 21:2 34:10 37:2 44:10 49:2 118:0+41: 0:0 2:10 3:2 12:10 13:2 22:10 23:2 34:10 37:2 45:10 46:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_6.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_6.snapindex 7055b2e97e..55c7516092 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_6.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_6.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,14 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: White|Reset|Reset|BOLD6: Green|Reset|Reset|NONE7: Magenta|Reset|Reset|NONE8: Cyan|Reset|Reset|NONE-9: Cyan|Reset|Reset|BOLD | UNDERLINED+9: Rgb(99, 168, 248)|Reset|Reset|BOLD | UNDERLINED+10: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0@@ -99,5 +99,5 @@ Rows (column:palette):37: 0:0 2:6 4:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 34:1 37:2 44:1 49:2 118:0-41: 0:0 2:1 3:2 12:1 13:2 24:1 27:2 35:1 36:2 118:0+40: 0:0 2:10 9:2 20:10 21:2 34:10 37:2 44:10 49:2 118:0+41: 0:0 2:10 3:2 12:10 13:2 24:10 27:2 35:10 36:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_8.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_8.snapindex 28745da194..122ec68267 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_8.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_dark_consumer_8.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,8 +50,9 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(165, 165, 165)|Reset|Reset|NONE-3: Cyan|Reset|Reset|BOLD+3: Rgb(99, 168, 248)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM+5: Rgb(230, 230, 230)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0@@ -94,5 +94,5 @@ Rows (column:palette):37: 0:038: 0:039: 0:0-40: 0:0 2:1 9:2 20:1 21:2 118:0-41: 0:0 2:1 3:2 11:1 12:2 23:1 26:2 34:1 35:2 118:0+40: 0:0 2:5 9:2 20:5 21:2 118:0+41: 0:0 2:5 3:2 11:5 12:2 23:5 26:2 34:5 35:2 118:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_1.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_1.snapindex 1f63635aea..9861d8e10a 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_1.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_1.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,13 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: Cyan|Reset|Reset|NONE-8: Rgb(0, 95, 135)|Reset|Reset|BOLD | UNDERLINED-9: Black|Reset|Reset|BOLD+8: Rgb(28, 100, 200)|Reset|Reset|BOLD | UNDERLINED+9: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_2.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_2.snapindex a15617282c..7e6cd04148 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_2.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_2.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,13 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: Cyan|Reset|Reset|NONE-8: Rgb(0, 95, 135)|Reset|Reset|BOLD | UNDERLINED-9: Black|Reset|Reset|BOLD+8: Rgb(28, 100, 200)|Reset|Reset|BOLD | UNDERLINED+9: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_3.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_3.snapindex 49269593e2..a28457a2cd 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_3.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_3.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,13 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: Cyan|Reset|Reset|NONE-8: Rgb(0, 95, 135)|Reset|Reset|BOLD | UNDERLINED-9: Black|Reset|Reset|BOLD+8: Rgb(28, 100, 200)|Reset|Reset|BOLD | UNDERLINED+9: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_4.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_4.snapindex 8662eb5e28..e8858d06c5 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_4.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_4.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,9 +50,9 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM-5: Black|Reset|Reset|BOLD+5: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_6.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_6.snapindex 9f093b8d45..9567ca60cb 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_6.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_6.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,13 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: Cyan|Reset|Reset|NONE-8: Rgb(0, 95, 135)|Reset|Reset|BOLD | UNDERLINED-9: Black|Reset|Reset|BOLD+8: Rgb(28, 100, 200)|Reset|Reset|BOLD | UNDERLINED+9: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_8.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_8.snapindex ca433ec2fa..fce5f75cf4 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_8.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_business_8.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,9 +50,9 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM-5: Black|Reset|Reset|BOLD+5: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_1.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_1.snapindex e645f00b8c..c200c6da5d 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_1.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_1.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,13 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: Cyan|Reset|Reset|NONE-8: Rgb(0, 95, 135)|Reset|Reset|BOLD | UNDERLINED-9: Black|Reset|Reset|BOLD+8: Rgb(28, 100, 200)|Reset|Reset|BOLD | UNDERLINED+9: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_2.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_2.snapindex 1ce6707eae..4503d2ceb0 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_2.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_2.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,13 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: Cyan|Reset|Reset|NONE-8: Rgb(0, 95, 135)|Reset|Reset|BOLD | UNDERLINED-9: Black|Reset|Reset|BOLD+8: Rgb(28, 100, 200)|Reset|Reset|BOLD | UNDERLINED+9: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_4.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_4.snapindex 7ad65de1c7..fadeb43c44 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_4.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_4.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,9 +50,9 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM-5: Black|Reset|Reset|BOLD+5: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_5.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_5.snapindex c3bc5b7441..12f5d44320 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_5.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_5.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,13 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: Cyan|Reset|Reset|NONE-8: Rgb(0, 95, 135)|Reset|Reset|BOLD | UNDERLINED-9: Black|Reset|Reset|BOLD+8: Rgb(28, 100, 200)|Reset|Reset|BOLD | UNDERLINED+9: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_6.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_6.snapindex 1637106ca7..71f2b5f8eb 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_6.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_6.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,13 +50,13 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM5: Green|Reset|Reset|NONE6: Magenta|Reset|Reset|NONE7: Cyan|Reset|Reset|NONE-8: Rgb(0, 95, 135)|Reset|Reset|BOLD | UNDERLINED-9: Black|Reset|Reset|BOLD+8: Rgb(28, 100, 200)|Reset|Reset|BOLD | UNDERLINED+9: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0 2:3 6:0 11:2 34:0diff --git a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_8.snap b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_8.snapindex 11182eb8a3..ef848bd058 100644--- a/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_8.snap+++ b/codex-rs/tui/src/analytics/snapshots/codex_tui__analytics__tests__terminal_styles__analytics_light_consumer_8.snap@@ -1,6 +1,5 @@---source: tui/src/analytics/styles_tests.rs-assertion_line: 145expression: snapshot---120x42@@ -51,9 +50,9 @@ Palette (foreground|background|underline|modifiers):0: Reset|Reset|Reset|NONE1: Reset|Reset|Reset|BOLD2: Rgb(76, 76, 76)|Reset|Reset|NONE-3: Rgb(0, 95, 135)|Reset|Reset|BOLD+3: Rgb(28, 100, 200)|Reset|Reset|BOLD4: Reset|Reset|Reset|DIM-5: Black|Reset|Reset|BOLD+5: Rgb(38, 38, 38)|Reset|Reset|BOLDRows (column:palette):0: 0:0 2:1 11:2 28:01: 0:0diff --git a/codex-rs/tui/src/app/resize_reflow_tests.rs b/codex-rs/tui/src/app/resize_reflow_tests.rsindex 56b6d2b81a..e0ff1156d3 100644--- a/codex-rs/tui/src/app/resize_reflow_tests.rs+++ b/codex-rs/tui/src/app/resize_reflow_tests.rs@@ -164,8 +164,8 @@ async fn capped_resize_reflow_prepends_transcript_notice_without_changing_transc.map(rendered_line_text).collect::<Vec<_>>().join("\n"),- @r"- Earlier messages are available — press ctrl + t to view the full transcript+ @"+ Earlier messages are available — press ctrl+t to view the full transcriptcell 8cell 9@@ -193,10 +193,10 @@ async fn capped_resize_reflow_counts_wrapped_notice_rows() {.map(rendered_line_text).collect::<Vec<_>>().join("\n"),- @r"+ @"Earlier messages are- available — press ctrl + t- to view the full transcript+ available — press ctrl+t to+ view the full transcriptcell 9cell 10@@ -243,8 +243,8 @@ async fn paginated_resize_reflow_prepends_transcript_notice_for_unloaded_history.map(rendered_line_text).collect::<Vec<_>>().join("\n"),- @r"- Earlier messages are available — press ctrl + t to view the full transcript+ @"+ Earlier messages are available — press ctrl+t to view the full transcriptcell 0cell 1diff --git a/codex-rs/tui/src/app/side.rs b/codex-rs/tui/src/app/side.rsindex d809bed2dc..f4006ba36a 100644--- a/codex-rs/tui/src/app/side.rs+++ b/codex-rs/tui/src/app/side.rs@@ -281,7 +281,7 @@ impl App {) {label_parts.push(format!("{} to switch", binding.display_label()));}- label_parts.push("ctrl + c to close".to_string());+ label_parts.push("ctrl+c to close".to_string());self.chat_widget.set_side_conversation_context_label(Some(format!("Side {}", label_parts.join(" · "))));}diff --git a/codex-rs/tui/src/app/tests.rs b/codex-rs/tui/src/app/tests.rsindex e1b9b516d3..dee16226e2 100644--- a/codex-rs/tui/src/app/tests.rs+++ b/codex-rs/tui/src/app/tests.rs@@ -5090,11 +5090,11 @@ async fn side_parent_status_prioritizes_input_over_approval() -> Result<()> {);assert_snapshot!(format!("{input_footer}\n{approval_footer}\n{cleared_footer}"),- @r"- Side from main thread · main needs input · ctrl + / to switch · ctrl + c to close- Side from main thread · main needs approval · ctrl + / to switch · ctrl + c to close- Side from main thread · ctrl + / to switch · ctrl + c to close- "+ @"+ Side from main thread · main needs input · ctrl+/ to switch · ctrl+c to close+ Side from main thread · main needs approval · ctrl+/ to switch · ctrl+c to close+ Side from main thread · ctrl+/ to switch · ctrl+c to close+ ");Ok(())@@ -6506,8 +6506,7 @@ async fn capped_resize_reflow_renders_recent_suffix_only() {.map(rendered_line_text).collect::<Vec<_>>(),vec![- "Earlier messages are available — press ctrl + t to view the full transcript"- .to_string(),+ "Earlier messages are available — press ctrl+t to view the full transcript".to_string(),String::new(),"cell 18".to_string(),String::new(),diff --git a/codex-rs/tui/src/app/tests/key_chords.rs b/codex-rs/tui/src/app/tests/key_chords.rsindex 9b33abd62b..04436675a5 100644--- a/codex-rs/tui/src/app/tests/key_chords.rs+++ b/codex-rs/tui/src/app/tests/key_chords.rs@@ -102,11 +102,11 @@ async fn completed_global_chord_reuses_the_existing_action_handler() -> Result<(insta::assert_snapshot!(render_bottom_popup(&app.chat_widget, /*width*/ 80).replace(&test_path_display("/tmp/project"), "/tmp/project"),- @r"- › Ask Codex to do anything+ @"+ › Ask Codex to do anything- ctrl + x … waiting for next key esc cancel- "+ ctrl+x … waiting for next key · esc cancel+ ");press(&mut app, &mut tui, &mut app_server, ctrl('t')).await?;@@ -597,7 +597,7 @@ async fn dashboard_chord_hint_survives_refresh_and_clears_on_cancel() -> Result<let _ = app.agents_overview_view(Vec::new(), /*selected_thread_id*/ None);insta::assert_snapshot!(render_bottom_popup(&app.chat_widget, /*width*/ 80).lines().last().unwrap(),- @" ctrl + x … waiting for next key esc cancel"+ @" ctrl+x … waiting for next key esc cancel");assert_eq!(app.route_key_chord_event(&mut tui, KeyCode::Esc.into()),diff --git a/codex-rs/tui/src/app/tests/session_lifecycle_requests.rs b/codex-rs/tui/src/app/tests/session_lifecycle_requests.rsindex f0a3502056..8b752eddd1 100644--- a/codex-rs/tui/src/app/tests/session_lifecycle_requests.rs+++ b/codex-rs/tui/src/app/tests/session_lifecycle_requests.rs@@ -4331,15 +4331,15 @@ fn session_lifecycle_avoids_redundant_subagent_metadata_reads() -> Result<()> {render_bottom_popup(&app.chat_widget, /*width*/ 80).replace(&root_thread_id.to_string(), "[root]").replace(&child_thread_id.to_string(), "[child]"),- @r###"- Subagents- Select an agent to watch. ⌥ + ← previous, ⌥ + → next.+ @"+ Subagents+ Select an agent to watch. ⌥+← previous, ⌥+→ next.- › 1. • Main [default] (current) [root]- 2. • /root/worker [child]+ › 1. • Main [default] (current) [root]+ 2. • /root/worker [child]- Press enter to confirm or esc to go back- "###+ Press enter to confirm or esc to go back+ ");assert_eq!(take_backfill_counts(&requests), (0, 0));tokio::time::timeout(Duration::from_secs(5), started_rx).await??;diff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__active_reconnect__reconnect_failed.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__active_reconnect__reconnect_failed.snapindex 86c54bfc86..f0ab661ff0 100644--- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__active_reconnect__reconnect_failed.snap+++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__active_reconnect__reconnect_failed.snap@@ -7,4 +7,4 @@ expression: "render_bottom_popup(&app.chat_widget, 80)"› Ask Codex to do anything- ctrl+c quit+ ctrl+c quitdiff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__active_reconnect__restored_conversation.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__active_reconnect__restored_conversation.snapindex e6a6142008..3f6cf1fb82 100644--- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__active_reconnect__restored_conversation.snap+++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__active_reconnect__restored_conversation.snap@@ -4,7 +4,7 @@ expression: "render_bottom_popup(&app.chat_widget, 80)"---• Queued follow-up inputs↳ old queued input- ⌥ + ↑ edit last queued message+ ⌥+↑ edit last queued message› kept draftdiff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__buffered_replay__misalignment_replayed_input.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__buffered_replay__misalignment_replayed_input.snapindex 02cd67bd44..62c4ad734a 100644--- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__buffered_replay__misalignment_replayed_input.snap+++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__buffered_replay__misalignment_replayed_input.snap@@ -4,7 +4,7 @@ expression: "normalize_snapshot_paths(render_bottom_popup(&app.chat_widget, 80))---• Queued follow-up inputs↳ keep queued- ⌥ + ↑ edit last queued message+ ⌥+↑ edit last queued message› keep draftdiff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__disconnect__offline_draft.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__disconnect__offline_draft.snapindex 4722388cf8..6313aaf5c7 100644--- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__disconnect__offline_draft.snap+++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__disconnect__offline_draft.snap@@ -7,8 +7,8 @@ expression: "format!(\"{}\\n{}\",\nlines_to_single_string(&app.transcript_cells.• Queued follow-up inputs↳ queued before disconnect- ⌥ + ↑ edit last queued message+ ⌥+↑ edit last queued message› keep this draft!- ctrl+c quit+ ctrl+c quitdiff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__pagination_completion_tests__older_pagination_completion_footers_follow_answers_without_overlap_duplicates.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__pagination_completion_tests__older_pagination_completion_footers_follow_answers_without_overlap_duplicates.snapindex 5aa6a8f8db..eedea6813b 100644--- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__pagination_completion_tests__older_pagination_completion_footers_follow_answers_without_overlap_duplicates.snap+++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__pagination_completion_tests__older_pagination_completion_footers_follow_answers_without_overlap_duplicates.snap@@ -2,7 +2,7 @@source: tui/src/app/tests/pagination_completion_tests.rsexpression: "snapshots.join(\"\\n\\n--- next overlapping page ---\\n\\n\")"----Earlier messages are available — press ctrl + t to view the full transcript+Earlier messages are available — press ctrl+t to view the full transcript• Middle answerWorked for 2m 5s · Sep 6, 2000 at 2:33 PMdiff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__startup_warnings_tests__mcp_startup_summary.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__startup_warnings_tests__mcp_startup_summary.snapindex 6b5d082fa8..50fa1e3bf0 100644--- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__startup_warnings_tests__mcp_startup_summary.snap+++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__startup_warnings_tests__mcp_startup_summary.snap@@ -3,5 +3,5 @@ source: tui/src/app/tests/startup_warnings_tests.rsexpression: warnings.display_lines(100)---[- Line::from(Span::from("⚠ 3 MCP startup issues (2 need sign-in) · ctrl + t for details").yellow().dim()),+ Line::from(Span::from("⚠ 3 MCP startup issues (2 need sign-in) · ctrl+t for details").yellow().dim()),]diff --git a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__startup_warnings_tests__mixed_startup_summary.snap b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__startup_warnings_tests__mixed_startup_summary.snapindex 9576e9ffae..09f5f9c9a1 100644--- a/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__startup_warnings_tests__mixed_startup_summary.snap+++ b/codex-rs/tui/src/app/tests/snapshots/codex_tui__app__tests__startup_warnings_tests__mixed_startup_summary.snap@@ -3,5 +3,5 @@ source: tui/src/app/tests/startup_warnings_tests.rsexpression: "app.transcript_cells[1].display_lines(100)"---[- Line::from(Span::from("⚠ 4 startup issues (3 MCP; 2 need sign-in) · ctrl + t for details").yellow().dim()),+ Line::from(Span::from("⚠ 4 startup issues (3 MCP; 2 need sign-in) · ctrl+t for details").yellow().dim()),]diff --git a/codex-rs/tui/src/app/tests/startup_warnings_tests.rs b/codex-rs/tui/src/app/tests/startup_warnings_tests.rsindex 9f76d19342..31f9914acd 100644--- a/codex-rs/tui/src/app/tests/startup_warnings_tests.rs+++ b/codex-rs/tui/src/app/tests/startup_warnings_tests.rs@@ -142,7 +142,7 @@ async fn startup_warnings_wait_for_splash_and_coalesce_with_full_details() -> Relet transcript = app.transcript_cells[1].transcript_lines(/*width*/ 80);insta::assert_snapshot!(format!("display:\n{}\n\ntranscript:\n{}", lines_to_single_string(&display), lines_to_single_string(&transcript)), @"display:- ⚠ 2 startup issues · ctrl + t for details+ ⚠ 2 startup issues · ctrl+t for detailstranscript:⚠ Skill manifest is invalid.diff --git a/codex-rs/tui/src/bottom_pane/async_questions/render.rs b/codex-rs/tui/src/bottom_pane/async_questions/render.rsindex 59415de15c..d65cb21d5c 100644--- a/codex-rs/tui/src/bottom_pane/async_questions/render.rs+++ b/codex-rs/tui/src/bottom_pane/async_questions/render.rs@@ -188,25 +188,19 @@ impl AsyncQuestions {if self.keymap.chat.interrupt_turn.contains(&binding)|| self.keymap.chat.edit_queued_message.contains(&binding))){- tips.push(- Span::styled(- format!("{} submit", key.display_label()),- crate::style::accent_style(),- )- .bold(),- );+ tips.push(crate::footer_hint::shortcut(&key.display_label(), "submit"));}if let Some(key) = chat_hint("skip_question") {- tips.push(format!("{} skip", key.display_label()).dim());+ tips.push(crate::footer_hint::shortcut(&key.display_label(), "skip"));}- tips.extend(option_tip);+ tips.extend(option_tip.map(Line::from));if let Some(key) = chat_hint("prompt_stack_back") {let label = if self.state.current_idx > 0 {"prev question"} else {"main prompt"};- tips.push(format!("{} {label}", key.display_label()).dim());+ tips.push(crate::footer_hint::shortcut(&key.display_label(), label));}let next = if self.state.current_idx + 1 < self.state.pending.len() {Some("next question")@@ -218,7 +212,7 @@ impl AsyncQuestions {if let Some(label) = next&& let Some(key) = self.next_hint{- tips.push(format!("{} {label}", key.display_label()).dim());+ tips.push(crate::footer_hint::shortcut(&key.display_label(), label));}let mut lines = Vec::new();let mut line = Line::default();@@ -230,7 +224,7 @@ impl AsyncQuestions {line.spans.push(TIP_SEPARATOR.into());}}- line.spans.push(tip);+ line.spans.extend(tip.spans);}lines.push(line);linesdiff --git a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_capped_other.snap b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_capped_other.snapindex 6e0a26e293..09e5783d7b 100644--- a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_capped_other.snap+++ b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_capped_other.snap@@ -16,5 +16,4 @@ expression: buffer_text(&buffer)long draft- enter submit ctrl + ] skip- ⌥ + ↓ main prompt+ enter submit ctrl+] skip ⌥+↓ main promptdiff --git a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_inline_history_search.snap b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_inline_history_search.snapindex 58e4bce628..6b2f5d253a 100644--- a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_inline_history_search.snap+++ b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_inline_history_search.snap@@ -11,5 +11,5 @@ expression: buffer_text(&buffer)› 13. earlier answerreverse-i-search: e enter accept · esc- enter submit ctrl + ] skip option 13/13- ⌥ + ↓ prev question+ enter submit ctrl+] skip option 13/13+ ⌥+↓ prev questiondiff --git a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_named_other.snap b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_named_other.snapindex bceeebde78..20706d1bfe 100644--- a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_named_other.snap+++ b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_named_other.snap@@ -9,5 +9,4 @@ expression: buffer_text(&buffer)› 1. Other2. Other (write an answer)- enter submit ctrl + ] skip- ⌥ + ↓ prev question+ enter submit ctrl+] skip ⌥+↓ prev questiondiff --git a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_remapped_choice_footer.snap b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_remapped_choice_footer.snapindex f4a07f722a..9f8bb1483e 100644--- a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_remapped_choice_footer.snap+++ b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_remapped_choice_footer.snap@@ -11,5 +11,5 @@ expression: buffer_text(&buffer)2. Option 2 is long enough to wrap acrossrows- f9 submit ctrl + ] skip option 1/13- ⌥ + ↓ prev question+ f9 submit ctrl+] skip option 1/13+ ⌥+↓ prev questiondiff --git a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_named_option.snap b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_named_option.snapindex ee4c3d579d..eaeaae1bdd 100644--- a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_named_option.snap+++ b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_named_option.snap@@ -10,5 +10,5 @@ expression: buffer_text(&buffer)multiple rows2. Other- enter submit ctrl + ] skip- ⌥ + ↓ main prompt+ enter submit ctrl+] skip+ ⌥+↓ main promptdiff --git a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_other.snap b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_other.snapindex 423d83438e..d99153d310 100644--- a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_other.snap+++ b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_other.snap@@ -12,5 +12,5 @@ expression: buffer_text(&buffer)wraps across several optionrows- enter submit ctrl + ] skip- ⌥ + ↓ main prompt+ enter submit ctrl+] skip+ ⌥+↓ main promptdiff --git a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_selected_option.snap b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_selected_option.snapindex 5b1c3c3609..48245c4716 100644--- a/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_selected_option.snap+++ b/codex-rs/tui/src/bottom_pane/async_questions/snapshots/codex_tui__bottom_pane__async_questions__tests__question_wrapped_selected_option.snap@@ -9,5 +9,5 @@ expression: buffer_text(&clipped)long enough to wrap acrossmultiple rows- enter submit ctrl + ] skip- option 2/3 ⌥ + ↓ main prompt+ enter submit ctrl+] skip+ option 2/3 ⌥+↓ main promptdiff --git a/codex-rs/tui/src/bottom_pane/async_questions/state_tests.rs b/codex-rs/tui/src/bottom_pane/async_questions/state_tests.rsindex 354a260127..12f3c35fe6 100644--- a/codex-rs/tui/src/bottom_pane/async_questions/state_tests.rs+++ b/codex-rs/tui/src/bottom_pane/async_questions/state_tests.rs@@ -371,7 +371,7 @@ fn existing_cross_context_keymaps_load_without_misleading_submit_hints() {let mut editor = editor();editor.navigate(/*forward*/ true);editor.set_keymap(&keymap);- insta::allow_duplicates! { insta::assert_snapshot!(editor.footer_lines(/*width*/ 100, /*option_tip*/ None)[0].to_string(), @"ctrl + ] skip ⌥ + ↓ prev question"); }+ insta::allow_duplicates! { insta::assert_snapshot!(editor.footer_lines(/*width*/ 100, /*option_tip*/ None)[0].to_string(), @"ctrl+] skip ⌥+↓ prev question"); }editor.handle_key_event(KeyEvent::from(KeyCode::F(12)));assert!(editor.submission.is_none());}diff --git a/codex-rs/tui/src/bottom_pane/chat_composer/history_search.rs b/codex-rs/tui/src/bottom_pane/chat_composer/history_search.rsindex 5ce24e7392..528a75c4a7 100644--- a/codex-rs/tui/src/bottom_pane/chat_composer/history_search.rs+++ b/codex-rs/tui/src/bottom_pane/chat_composer/history_search.rs@@ -407,7 +407,7 @@ impl ChatComposer {}fn history_search_action_key_span(key: KeyCode) -> Span<'static> {- Span::from(key_hint::plain(key)).cyan().bold().not_dim()+ Span::from(key_hint::plain(key))}/// Returns byte ranges that should be highlighted in the current composer preview.@@ -900,63 +900,79 @@ mod tests {#[test]fn history_search_footer_action_hints_are_emphasized() {- let (tx, _rx) = unbounded_channel::<AppEvent>();- let sender = AppEventSender::new(tx);- let mut composer = ChatComposer::new(- /*has_input_focus*/ true,- sender,- /*enhanced_keys_supported*/ true,- "Ask Codex to do anything".to_string(),- /*disable_paste_burst*/ false,- );- composer- .history- .record_local_submission(HistoryEntry::new("cargo test".to_string()));-- let _ = composer.handle_key_event(KeyEvent::new(KeyCode::Char('r'), KeyModifiers::CONTROL));- let _ = composer.handle_key_event(KeyEvent::new(KeyCode::Char('c'), KeyModifiers::NONE));-- let line = composer- .history_search_footer_line()- .expect("expected history search footer line");- assert_eq!(- line.spans- .iter()- .map(|span| span.content.as_ref())- .collect::<Vec<_>>(),- vec![- "reverse-i-search: ",- "c",- " ",- "enter",- " accept",- " · ",- "esc",- " cancel"- ]+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (240, 240, 240),+ bg: (24, 24, 24),+ },+ || {+ let (tx, _rx) = unbounded_channel::<AppEvent>();+ let sender = AppEventSender::new(tx);+ let mut composer = ChatComposer::new(+ /*has_input_focus*/ true,+ sender,+ /*enhanced_keys_supported*/ true,+ "Ask Codex to do anything".to_string(),+ /*disable_paste_burst*/ false,+ );+ composer+ .history+ .record_local_submission(HistoryEntry::new("cargo test".to_string()));++ let _ = composer+ .handle_key_event(KeyEvent::new(KeyCode::Char('r'), KeyModifiers::CONTROL));+ let _ = composer+ .handle_key_event(KeyEvent::new(KeyCode::Char('c'), KeyModifiers::NONE));++ let line = composer+ .history_search_footer_line()+ .expect("expected history search footer line");+ assert_eq!(+ line.spans+ .iter()+ .map(|span| span.content.as_ref())+ .collect::<Vec<_>>(),+ vec![+ "reverse-i-search: ",+ "c",+ " ",+ "enter",+ " accept",+ " · ",+ "esc",+ " cancel"+ ]+ );++ let query_style = line.spans[1].style;+ assert_eq!(query_style.fg, Some(ratatui::style::Color::Cyan));++ let enter_style = line.spans[3].style;+ assert_eq!(+ enter_style.fg,+ Some(crate::terminal_palette::rgb_color((240, 240, 240)))+ );+ assert!(enter_style.add_modifier.contains(Modifier::BOLD));+ assert!(enter_style.sub_modifier.contains(Modifier::DIM));++ let accept_style = line.spans[4].style;+ assert!(accept_style.add_modifier.contains(Modifier::DIM));++ let separator_style = line.spans[5].style;+ assert!(separator_style.add_modifier.contains(Modifier::DIM));++ let esc_style = line.spans[6].style;+ assert_eq!(+ esc_style.fg,+ Some(crate::terminal_palette::rgb_color((240, 240, 240)))+ );+ assert!(esc_style.add_modifier.contains(Modifier::BOLD));+ assert!(esc_style.sub_modifier.contains(Modifier::DIM));++ let cancel_style = line.spans[7].style;+ assert!(cancel_style.add_modifier.contains(Modifier::DIM));+ },);-- let query_style = line.spans[1].style;- assert_eq!(query_style.fg, Some(ratatui::style::Color::Cyan));-- let enter_style = line.spans[3].style;- assert_eq!(enter_style.fg, Some(ratatui::style::Color::Cyan));- assert!(enter_style.add_modifier.contains(Modifier::BOLD));- assert!(enter_style.sub_modifier.contains(Modifier::DIM));-- let accept_style = line.spans[4].style;- assert!(accept_style.add_modifier.contains(Modifier::DIM));-- let separator_style = line.spans[5].style;- assert!(separator_style.add_modifier.contains(Modifier::DIM));-- let esc_style = line.spans[6].style;- assert_eq!(esc_style.fg, Some(ratatui::style::Color::Cyan));- assert!(esc_style.add_modifier.contains(Modifier::BOLD));- assert!(esc_style.sub_modifier.contains(Modifier::DIM));-- let cancel_style = line.spans[7].style;- assert!(cancel_style.add_modifier.contains(Modifier::DIM));}#[test]diff --git a/codex-rs/tui/src/bottom_pane/chat_composer/snapshots/codex_tui__bottom_pane__chat_composer__sparkle__tests__shortcut_help_hides_visible_sparkles_without_restarting_their_deadline.snap b/codex-rs/tui/src/bottom_pane/chat_composer/snapshots/codex_tui__bottom_pane__chat_composer__sparkle__tests__shortcut_help_hides_visible_sparkles_without_restarting_their_deadline.snapindex a9ac149b27..d2048569da 100644--- a/codex-rs/tui/src/bottom_pane/chat_composer/snapshots/codex_tui__bottom_pane__chat_composer__sparkle__tests__shortcut_help_hides_visible_sparkles_without_restarting_their_deadline.snap+++ b/codex-rs/tui/src/bottom_pane/chat_composer/snapshots/codex_tui__bottom_pane__chat_composer__sparkle__tests__shortcut_help_hides_visible_sparkles_without_restarting_their_deadline.snap@@ -12,13 +12,13 @@ shortcut help:› Ask Codex to do anything- / for commands ! for shell commands- ctrl + j for newline tab to submit message- @ for file paths ctrl + v to paste images- ctrl + g to edit in external editor esc esc to edit previous message- ctrl + r search history ctrl + c to exit- ⌥ + , reasoning down ⌥ + . reasoning up- ctrl + t to view transcript+ / for commands ! for shell commands+ ctrl+j for newline tab to submit message+ @ for file paths ctrl+v to paste images+ ctrl+g to edit in external editor esc esc to edit previous message+ ctrl+r search history ctrl+c to exit+ ⌥+, reasoning down ⌥+. reasoning up+ ctrl+t to view transcriptcustomize shortcuts with /keymapafter closing:@@ -37,13 +37,13 @@ shortcut help:› Ask Codex to do anything- / for commands ! for shell commands- ctrl + j for newline tab to submit message- @ for file paths ctrl + v to paste images- ctrl + g to edit in external editor esc esc to edit previous message- ctrl + r search history ctrl + c to exit- ⌥ + , reasoning down ⌥ + . reasoning up- ctrl + t to view transcript+ / for commands ! for shell commands+ ctrl+j for newline tab to submit message+ @ for file paths ctrl+v to paste images+ ctrl+g to edit in external editor esc esc to edit previous message+ ctrl+r search history ctrl+c to exit+ ⌥+, reasoning down ⌥+. reasoning up+ ctrl+t to view transcriptcustomize shortcuts with /keymapafter closing:diff --git a/codex-rs/tui/src/bottom_pane/chat_composer/snapshots/codex_tui__bottom_pane__chat_composer__sparkle__tests__shortcut_help_preserves_an_unused_sparkle_but_literal_question_marks_do_not.snap b/codex-rs/tui/src/bottom_pane/chat_composer/snapshots/codex_tui__bottom_pane__chat_composer__sparkle__tests__shortcut_help_preserves_an_unused_sparkle_but_literal_question_marks_do_not.snapindex 69f211f7e9..5b4cdacb05 100644--- a/codex-rs/tui/src/bottom_pane/chat_composer/snapshots/codex_tui__bottom_pane__chat_composer__sparkle__tests__shortcut_help_preserves_an_unused_sparkle_but_literal_question_marks_do_not.snap+++ b/codex-rs/tui/src/bottom_pane/chat_composer/snapshots/codex_tui__bottom_pane__chat_composer__sparkle__tests__shortcut_help_preserves_an_unused_sparkle_but_literal_question_marks_do_not.snap@@ -6,13 +6,13 @@ shortcut help:› Ask Codex to do anything- / for commands ! for shell commands- ctrl + j for newline tab to submit message- @ for file paths ctrl + v to paste images- ctrl + g to edit in external editor esc esc to edit previous message- ctrl + r search history ctrl + c to exit- ⌥ + , reasoning down ⌥ + . reasoning up- ctrl + t to view transcript+ / for commands ! for shell commands+ ctrl+j for newline tab to submit message+ @ for file paths ctrl+v to paste images+ ctrl+g to edit in external editor esc esc to edit previous message+ ctrl+r search history ctrl+c to exit+ ⌥+, reasoning down ⌥+. reasoning up+ ctrl+t to view transcriptcustomize shortcuts with /keymapdiff --git a/codex-rs/tui/src/bottom_pane/command_popup.rs b/codex-rs/tui/src/bottom_pane/command_popup.rsindex 26050f7300..05108a1d1c 100644--- a/codex-rs/tui/src/bottom_pane/command_popup.rs+++ b/codex-rs/tui/src/bottom_pane/command_popup.rs@@ -209,6 +209,7 @@ impl CommandPopup {let name = format!("/{}", item.command());let description = item.description().to_string();GenericDisplayRow {+ selection_style: None,name,name_prefix_spans: Vec::new(),match_indices: indices.map(|v| v.into_iter().map(|i| i + 1).collect()),diff --git a/codex-rs/tui/src/bottom_pane/file_search_popup.rs b/codex-rs/tui/src/bottom_pane/file_search_popup.rsindex fe903a0b37..0982826470 100644--- a/codex-rs/tui/src/bottom_pane/file_search_popup.rs+++ b/codex-rs/tui/src/bottom_pane/file_search_popup.rs@@ -118,6 +118,7 @@ impl WidgetRef for &FileSearchPopup {self.matches.iter().map(|m| GenericDisplayRow {+ selection_style: None,name: m.path.to_string_lossy().to_string(),name_prefix_spans: Vec::new(),match_indices: mdiff --git a/codex-rs/tui/src/bottom_pane/footer.rs b/codex-rs/tui/src/bottom_pane/footer.rsindex d5cbd09067..64f97630b8 100644--- a/codex-rs/tui/src/bottom_pane/footer.rs+++ b/codex-rs/tui/src/bottom_pane/footer.rs@@ -46,10 +46,12 @@ use crate::key_hint::KeyBinding;use crate::key_hint::ShortcutHint;use crate::render::line_utils::prefix_lines;use crate::status::format_tokens_compact;+use crate::style::secondary_text_style;use crate::ui_consts::FOOTER_INDENT_COLS;use crossterm::event::KeyCode;use ratatui::buffer::Buffer;use ratatui::layout::Rect;+use ratatui::style::Styled;use ratatui::style::Stylize;use ratatui::text::Line;use ratatui::text::Span;@@ -149,11 +151,14 @@ impl CollaborationModeIndicator {}}- fn styled_span(self, show_cycle_hint: bool) -> Span<'static> {- let label = self.label(show_cycle_hint);- match self {- CollaborationModeIndicator::Plan => Span::from(label).magenta(),+ fn styled_line(self, show_cycle_hint: bool) -> Line<'static> {+ let mut line = Line::from(self.label(/*show_cycle_hint*/ false).magenta());+ if show_cycle_hint {+ line.push_span(" (".set_style(secondary_text_style()));+ line.extend(key_hint::shift(KeyCode::Tab).spans());+ line.push_span(" to cycle)".set_style(secondary_text_style()));}+ line}}@@ -316,36 +321,40 @@ fn left_side_line(SummaryHintKind::None => {}SummaryHintKind::Shortcuts => {if let Some(key) = key_hints.agents {- line.push_span(key);- line.push_span(" for agents".dim());+ line.extend(key.spans());+ line.push_span(" for agents".set_style(secondary_text_style()));if key_hints.toggle_shortcuts.is_some() {- line.push_span(" · ".dim());+ line.push_span(" · ".set_style(secondary_text_style()));}}if let Some(key) = key_hints.toggle_shortcuts {- line.push_span(key);- line.push_span(" for shortcuts".dim());+ line.extend(key.spans());+ line.push_span(" for shortcuts".set_style(secondary_text_style()));}}SummaryHintKind::QueueMessage => {if let Some(key) = key_hints.queue {- line.push_span(key);- line.push_span(" to queue message".dim());+ line.extend(key.spans());+ line.push_span(" to queue message".set_style(secondary_text_style()));}}SummaryHintKind::QueueShort => {if let Some(key) = key_hints.queue {- line.push_span(key);- line.push_span(" to queue".dim());+ line.extend(key.spans());+ line.push_span(" to queue".set_style(secondary_text_style()));}}};if let Some(collaboration_mode_indicator) = collaboration_mode_indicator {if !matches!(state.hint, SummaryHintKind::None) {- line.push_span(" · ".dim());+ line.push_span(" · ".set_style(secondary_text_style()));}- line.push_span(collaboration_mode_indicator.styled_span(state.show_cycle_hint));+ line.extend(+ collaboration_mode_indicator+ .styled_line(state.show_cycle_hint)+ .spans,+ );}line@@ -547,7 +556,7 @@ pub(crate) fn mode_indicator_line(indicator: Option<CollaborationModeIndicator>,show_cycle_hint: bool,) -> Option<Line<'static>> {- indicator.map(|indicator| Line::from(vec![indicator.styled_span(show_cycle_hint)]))+ indicator.map(|indicator| indicator.styled_line(show_cycle_hint))}pub(crate) fn goal_status_indicator_line(@@ -600,7 +609,7 @@ pub(crate) fn status_line_right_indicator_line(.flatten(){if let Some(line) = line.as_mut() {- line.push_span(" · ".dim());+ line.push_span(" · ".set_style(secondary_text_style()));for span in indicator.spans {line.push_span(span);}@@ -613,11 +622,28 @@ pub(crate) fn status_line_right_indicator_line(}pub(crate) fn side_conversation_context_line(label: &str) -> Line<'static> {- if let Some(rest) = label.strip_prefix("Side ") {- Line::from(vec!["Side".magenta().bold(), format!(" {rest}").magenta()])+ let mut line = Line::default();+ let rest = if let Some(rest) = label.strip_prefix("Side ") {+ line.extend(["Side".magenta().bold(), " ".into()]);+ rest} else {- Line::from(vec![Span::from(label.to_string()).magenta()])+ label+ };+ for (index, part) in rest.split(" · ").enumerate() {+ if index > 0 {+ line.push_span(" · ".set_style(secondary_text_style()));+ }+ if let Some((keys, action)) = [" to switch", " to close", " for side"]+ .into_iter()+ .find_map(|action| part.strip_suffix(action).map(|keys| (keys, action)))+ {+ line.extend(key_hint::key_label_spans(keys));+ line.push_span(action.set_style(secondary_text_style()));+ } else {+ line.push_span(part.to_owned().magenta());+ }}+ line}fn right_aligned_x(area: Rect, content_width: u16) -> Option<u16> {@@ -736,7 +762,9 @@ fn footer_from_props_lines(FooterMode::QuitShortcutReminder => {vec![quit_shortcut_reminder_line(props.quit_shortcut_key)]}- FooterMode::HistorySearch => vec![Line::from("reverse-i-search: ").dim()],+ FooterMode::HistorySearch => {+ vec![Line::from("reverse-i-search: ").set_style(secondary_text_style())]+ }FooterMode::ComposerEmpty => {let state = LeftSideState {hint: if show_shortcuts_hint {@@ -803,10 +831,12 @@ pub(crate) fn passive_footer_status_line(props: &FooterProps) -> Option<Line<'stif let Some(active_agent_label) = props.active_agent_label.as_ref() {if let Some(existing) = line.as_mut() {- existing.spans.push(" · ".dim());- existing.spans.push(active_agent_label.clone().dim());+ existing.spans.push(" · ".set_style(secondary_text_style()));+ existing+ .spans+ .push(active_agent_label.clone().set_style(secondary_text_style()));} else {- line = Some(Line::from(active_agent_label.clone()).dim());+ line = Some(Line::from(active_agent_label.clone()).set_style(secondary_text_style()));}}@@ -814,7 +844,9 @@ pub(crate) fn passive_footer_status_line(props: &FooterProps) -> Option<Line<'st&& let Some(key) = props.key_hints.agents&& let Some(line) = line.as_mut(){- line.extend(vec![" · ".dim(), key.into(), " for agents".dim()]);+ line.push_span(" · ".set_style(secondary_text_style()));+ line.extend(key.spans());+ line.push_span(" for agents".set_style(secondary_text_style()));}line@@ -873,19 +905,18 @@ pub(crate) fn footer_hint_items_width(items: &[(String, String)]) -> u16 {pub(crate) fn footer_hint_items_line(items: &[(String, String)]) -> Line<'static> {let mut spans = Vec::with_capacity(items.len() * 4);for (idx, (key, label)) in items.iter().enumerate() {- spans.push(" ".into());- spans.push(key.clone().bold());+ if idx > 0 {+ spans.push(" · ".set_style(secondary_text_style()));+ }+ spans.extend(key_hint::key_label_spans(key));if idx == 0&& key == "voice"&& let Some(label) = label.strip_prefix("● "){spans.push(" ●".red());- spans.push(format!(" {label}").into());+ spans.push(format!(" {label}").set_style(secondary_text_style()));} else {- spans.push(format!(" {label}").into());- }- if idx + 1 != items.len() {- spans.push((if items[0].0 == "voice" { " " } else { " " }).into());+ spans.push(format!(" {label}").set_style(secondary_text_style()));}}Line::from(spans)@@ -903,21 +934,23 @@ struct ShortcutsState {}fn quit_shortcut_reminder_line(key: KeyBinding) -> Line<'static> {- Line::from(vec![key.into(), " again to quit".into()]).dim()+ let mut line = Line::from(key.spans());+ line.push_span(" again to quit".set_style(secondary_text_style()));+ line}fn esc_hint_line(esc_backtrack_hint: bool) -> Line<'static> {let esc = key_hint::plain(KeyCode::Esc);if esc_backtrack_hint {- Line::from(vec![esc.into(), " again to edit previous message".into()]).dim()+ let mut line = Line::from(esc.spans());+ line.push_span(" again to edit previous message".set_style(secondary_text_style()));+ line} else {- Line::from(vec![- esc.into(),- " ".into(),- esc.into(),- " to edit previous message".into(),- ])- .dim()+ let mut line = Line::from(esc.spans());+ line.push_span(" ".set_style(secondary_text_style()));+ line.extend(esc.spans());+ line.push_span(" to edit previous message".set_style(secondary_text_style()));+ line}}@@ -979,14 +1012,20 @@ fn shortcut_overlay_lines(state: ShortcutsState) -> Vec<Line<'static>> {let mut lines = build_columns(ordered);if let Some(key) = state.key_hints.agents {lines.push(Line::from(vec![- key.into(),- " for agents (empty prompt)".into(),+ key.display_label()+ .fg(crate::style::accent_color_on(/*background*/ None))+ .not_bold()+ .not_dim(),+ " for agents (empty prompt)".set_style(secondary_text_style()),]));}lines.push(Line::from(""));lines.push(Line::from(vec![- "customize shortcuts with ".into(),- "/keymap".cyan(),+ "customize shortcuts with ".set_style(secondary_text_style()),+ "/keymap"+ .fg(crate::style::accent_color_on(/*background*/ None))+ .not_bold()+ .not_dim(),]));lines}@@ -1033,7 +1072,7 @@ fn build_columns(entries: Vec<Line<'static>>) -> Vec<Line<'static>> {line.push_span(Span::from(" ".repeat(padding)));}}- line.dim()+ line.set_style(secondary_text_style())}).collect()}@@ -1041,15 +1080,21 @@ fn build_columns(entries: Vec<Line<'static>>) -> Vec<Line<'static>> {pub(crate) fn context_window_line(percent: Option<i64>, used_tokens: Option<i64>) -> Line<'static> {if let Some(percent) = percent {let percent = percent.clamp(0, 100);- return Line::from(vec![Span::from(format!("{percent}% context left")).dim()]);+ return Line::from(vec![+ Span::from(format!("{percent}% context left")).set_style(secondary_text_style()),+ ]);}if let Some(tokens) = used_tokens {let used_fmt = format_tokens_compact(tokens);- return Line::from(vec![Span::from(format!("{used_fmt} used")).dim()]);+ return Line::from(vec![+ Span::from(format!("{used_fmt} used")).set_style(secondary_text_style()),+ ]);}- Line::from(vec![Span::from("100% context left").dim()])+ Line::from(vec![+ Span::from("100% context left").set_style(secondary_text_style()),+ ])}#[derive(Clone, Copy, Debug, Eq, PartialEq)]@@ -1134,7 +1179,12 @@ impl ShortcutDescriptor {.binding_for(state).map(|binding| ShortcutHint::Single(binding.key)),}?;- let mut line = Line::from(vec![self.prefix.into(), key.into()]);+ let reference_key = key+ .display_label()+ .fg(crate::style::accent_color_on(/*background*/ None))+ .not_bold()+ .not_dim();+ let mut line = Line::from(vec![self.prefix.into(), reference_key.clone()]);match self.id {ShortcutId::QueueMessageTab => {if state.is_task_running || state.queue_submissions {@@ -1149,7 +1199,7 @@ impl ShortcutDescriptor {} else {line.extend(vec![" ".into(),- key.into(),+ reference_key," to edit previous message".into(),]);}@@ -1310,6 +1360,10 @@ const SHORTCUTS: &[ShortcutDescriptor] = &[},];+#[cfg(test)]+#[path = "footer_typography_tests.rs"]+mod typography_tests;+#[cfg(test)]mod tests {use super::*;@@ -1324,7 +1378,7 @@ mod tests {#[test]fn voice_live_microphone_indicator_is_red() {let line = footer_hint_items_line(&[("voice".into(), "● listen".into())]);- assert_eq!(line.spans[2].style.fg, Some(ratatui::style::Color::Red));+ assert_eq!(line.spans[1].style.fg, Some(ratatui::style::Color::Red));}#[test]diff --git a/codex-rs/tui/src/bottom_pane/footer_typography_tests.rs b/codex-rs/tui/src/bottom_pane/footer_typography_tests.rsnew file mode 100644index 0000000000..576c673e94--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/footer_typography_tests.rs@@ -0,0 +1,88 @@+//! Legacy help keeps accent keys while ordinary footer keys clear inherited emphasis.++use super::*;+use pretty_assertions::assert_eq;+use ratatui::Terminal;+use ratatui::backend::TestBackend;+use ratatui::style::Color;+use ratatui::style::Modifier;+use ratatui::style::Style;++#[test]+fn help_reference_and_footer_preserve_distinct_key_styles() {+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (32, 32, 32),+ bg: (255, 255, 255),+ },+ || {+ let help = shortcut_overlay_lines(ShortcutsState {+ use_shift_enter_hint: false,+ esc_backtrack_hint: false,+ is_task_running: false,+ queue_submissions: false,+ is_wsl: false,+ collaboration_modes_enabled: false,+ key_hints: FooterKeyHints::default_bindings(),+ });+ let help_height = help.len() as u16;+ let footer = footer_hint_items_line(&[+ ("ctrl+o".into(), "then".into()),+ ("o".into(), "copy".into()),+ ]);+ let mut terminal = Terminal::new(TestBackend::new(+ /*width*/ 80,+ /*height*/ help_height + 1,+ ))+ .unwrap();+ terminal+ .draw(|frame| {+ let inherited = Style::default().fg(Color::Green).bold().dim();+ frame.render_widget(+ Paragraph::new(help).style(inherited),+ Rect::new(/*x*/ 0, /*y*/ 0, /*width*/ 80, help_height),+ );+ frame.render_widget(+ Paragraph::new(footer).style(inherited),+ Rect::new(+ /*x*/ 0,+ help_height,+ /*width*/ 80,+ /*height*/ 1,+ ),+ );+ })+ .unwrap();+ let buffer = terminal.backend().buffer();+ let styles = [+ (0, 0),+ (2, 0),+ (0, help_height),+ (4, help_height),+ (7, help_height),+ ]+ .map(|position| {+ let cell = &buffer[position];+ (cell.fg, cell.modifier)+ });+ let key_color = key_hint::ctrl(KeyCode::Char('o')).spans()[0]+ .style+ .fg+ .unwrap();+ let secondary_color = secondary_text_style().fg.unwrap();+ assert_eq!(+ styles,+ [+ (+ crate::style::accent_color_on(/*background*/ None),+ Modifier::empty()+ ),+ (secondary_color, Modifier::empty()),+ (key_color, Modifier::BOLD),+ (key_color, Modifier::BOLD),+ (secondary_color, Modifier::empty()),+ ]+ );+ },+ );+}diff --git a/codex-rs/tui/src/bottom_pane/hooks_browser_view.rs b/codex-rs/tui/src/bottom_pane/hooks_browser_view.rsindex 88318fb08a..1729e4b611 100644--- a/codex-rs/tui/src/bottom_pane/hooks_browser_view.rs+++ b/codex-rs/tui/src/bottom_pane/hooks_browser_view.rs@@ -1093,16 +1093,7 @@ mod tests {"hooks_browser_events_with_review_column",render_lines(&view, /*width*/ 112));- assert_eq!(- view.event_table_lines()[1].spans[3].style.fg,- Some(Color::Cyan)- );- assert!(- view.event_table_lines()[1].spans[3]- .style- .add_modifier- .contains(ratatui::style::Modifier::BOLD)- );+ assert_eq!(view.event_table_lines()[1].spans[3].style, accent_style());}#[test]diff --git a/codex-rs/tui/src/bottom_pane/list_selection_view.rs b/codex-rs/tui/src/bottom_pane/list_selection_view.rsindex 57c3e8793e..47298afe5e 100644--- a/codex-rs/tui/src/bottom_pane/list_selection_view.rs+++ b/codex-rs/tui/src/bottom_pane/list_selection_view.rs@@ -1,3 +1,6 @@+//! Render selectable lists while existing callers retain the legacy presentation.+//! Picker appearance opts into stable controls, full-width selection, and separate overflow rows.+use crossterm::event::KeyCode;use crossterm::event::KeyEvent;use crossterm::event::KeyModifiers;@@ -11,6 +14,10 @@ use ratatui::text::Line;use ratatui::text::Span;use ratatui::widgets::Paragraph;use ratatui::widgets::Widget;+use ratatui::widgets::Wrap;++use super::selection_picker_layout::PickerLayoutSizes;+use super::selection_picker_layout::picker_areas;use super::selection_popup_common::render_menu_surface;use super::selection_popup_common::wrap_styled_line;@@ -21,12 +28,17 @@ use crate::key_hint::KeyBindingListExt;use crate::key_hint::ShortcutHint;use crate::key_hint::is_plain_text_key_event;use crate::keymap::ListKeymap;+use crate::render::Insets;+use crate::render::RectExt as _;use crate::render::renderable::ColumnRenderable;use crate::render::renderable::Renderable;use super::CancellationEvent;use super::bottom_pane_view::BottomPaneView;use super::bottom_pane_view::ViewCompletion;+pub(crate) use super::picker_style::PickerSurface;+use super::picker_style::render_scroll_indicators;+use super::picker_style::selection_style;use super::popup_consts::MAX_POPUP_ROWS;use super::scroll_state::ScrollState;use super::selection_popup_common::ColumnWidthConfig;@@ -37,6 +49,7 @@ use super::selection_popup_common::render_rows_single_line_with_col_width_mode;use super::selection_popup_common::render_rows_with_col_width_mode;pub(crate) use super::selection_row_layout::SelectionDescriptionLayout;use super::selection_tabs::SelectionTab;+use super::selection_tabs::TabAppearance;use super::selection_tabs::render_tab_bar;use super::selection_tabs::tab_bar_height;use unicode_width::UnicodeWidthStr;@@ -105,6 +118,15 @@ pub(crate) enum SelectionRowDisplay {SingleLine,}+/// Visual treatment is opt-in while existing workflows retain their current layout.+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]+pub(crate) enum SelectionAppearance {+ #[default]+ Legacy,+ /// Full-width focus and separate overflow rows on a terminal or panel surface.+ Picker,+}+/// One selectable item in the generic selection list.pub(crate) type SelectionAction = Box<dyn Fn(&AppEventSender) + Send + Sync>;@@ -180,6 +202,12 @@ pub(crate) struct SelectionItem {/// `description_layout` optionally moves descriptions below labels when their/// column would become too narrow.pub(crate) struct SelectionViewParams {+ pub appearance: SelectionAppearance,+ pub picker_surface: PickerSurface,+ /// Upper row budget; compact completion menus retain the default of eight.+ pub max_visible_rows: usize,+ /// Keep the result area at its configured row budget when filtering shrinks it.+ pub reserve_result_rows: bool,pub view_id: Option<&'static str>,pub title: Option<String>,pub subtitle: Option<String>,@@ -234,6 +262,10 @@ pub(crate) struct SelectionViewParams {impl Default for SelectionViewParams {fn default() -> Self {Self {+ appearance: SelectionAppearance::default(),+ picker_surface: PickerSurface::default(),+ max_visible_rows: MAX_POPUP_ROWS,+ reserve_result_rows: false,view_id: None,title: None,subtitle: None,@@ -270,6 +302,10 @@ impl Default for SelectionViewParams {/// visible rows and source items and for preserving selection while filters/// change.pub(crate) struct ListSelectionView {+ appearance: SelectionAppearance,+ picker_surface: PickerSurface,+ max_visible_rows: usize,+ reserve_result_rows: bool,view_id: Option<&'static str>,footer_note: Option<Line<'static>>,footer_hint: Option<Line<'static>>,@@ -384,11 +420,20 @@ impl ListSelectionView {if params.title.is_some() || params.subtitle.is_some() {let title = params.title.map(|title| Line::from(title.bold()));let subtitle = params.subtitle.map(|subtitle| Line::from(subtitle.dim()));- header = Box::new(ColumnRenderable::with([- header,- Box::new(title),- Box::new(subtitle),- ]));+ header = match params.appearance {+ SelectionAppearance::Legacy => Box::new(ColumnRenderable::with([+ header,+ Box::new(title),+ Box::new(subtitle),+ ])),+ SelectionAppearance::Picker => Box::new(ColumnRenderable::with([+ header,+ Box::new(+ Paragraph::new(title.into_iter().chain(subtitle).collect::<Vec<_>>())+ .wrap(Wrap { trim: false }),+ ),+ ])),+ };}let active_tab_idx = params.initial_tab_id.as_ref().and_then(|initial_tab_id| {params@@ -403,6 +448,10 @@ impl ListSelectionView {};let has_initial_selected_idx = params.initial_selected_idx.is_some();let mut s = Self {+ appearance: params.appearance,+ picker_surface: params.picker_surface,+ max_visible_rows: params.max_visible_rows.max(/*other*/ 1),+ reserve_result_rows: params.reserve_result_rows,view_id: params.view_id,footer_note: params.footer_note,footer_hint: params.footer_hint,@@ -472,13 +521,31 @@ impl ListSelectionView {self.items.as_mut_slice()}- fn active_header(&self) -> &dyn Renderable {+ fn active_header(&self, width: u16) -> &dyn Renderable {self.active_tab_idx.and_then(|idx| self.tabs.get(idx))+ .filter(|tab| {+ self.appearance == SelectionAppearance::Legacy+ || tab.header.desired_height(width) > 0+ }).map(|tab| tab.header.as_ref()).unwrap_or(self.header.as_ref())}+ fn header_height(&self, width: u16) -> u16 {+ let active_height = self.active_header(width).desired_height(width);+ if self.appearance == SelectionAppearance::Picker && self.reserve_result_rows {+ self.tabs+ .iter()+ .map(|tab| tab.header.desired_height(width))+ .max()+ .unwrap_or(active_height)+ .max(active_height)+ } else {+ active_height+ }+ }+fn active_footer_hint(&self) -> Option<&Line<'static>> {if let Some(action) = self.selected_actual_idx()@@ -502,8 +569,14 @@ impl ListSelectionView {.map(|tab| tab.id.as_str())}- fn max_visible_rows(len: usize) -> usize {- MAX_POPUP_ROWS.min(len.max(1))+ fn visible_rows(&self, len: usize) -> usize {+ let rendered = self.rendered_item_count.get();+ let limit = if self.appearance == SelectionAppearance::Picker && rendered > 0 {+ self.max_visible_rows.min(rendered)+ } else {+ self.max_visible_rows+ };+ limit.min(len.max(/*other*/ 1))}fn selected_actual_idx(&self) -> Option<usize> {@@ -572,7 +645,7 @@ impl ListSelectionView {.or_else(|| self.first_enabled_visible_idx()).or_else(|| (len > 0).then_some(0));- let visible = Self::max_visible_rows(len);+ let visible = self.visible_rows(len);self.state.clamp_selection(len);self.state.ensure_visible(len, visible);@@ -598,6 +671,8 @@ impl ListSelectionView {.to_string().len();let mut enabled_row_number = 0;+ let row_selection_style =+ (self.appearance == SelectionAppearance::Picker).then(selection_style);self.filtered_indices.iter().enumerate()@@ -646,6 +721,7 @@ impl ListSelectionView {.or_else(|| item.description.clone());let wrap_indent = description.is_none().then_some(wrap_prefix_width);GenericDisplayRow {+ selection_style: row_selection_style,name: name_with_marker,name_prefix_spans,display_shortcut: item.display_shortcut,@@ -677,6 +753,9 @@ impl ListSelectionView {};self.active_tab_idx = Some(next_idx);self.search_query.clear();+ if self.appearance == SelectionAppearance::Picker {+ self.rendered_item_count.set(/*val*/ 0);+ }self.state.reset();self.apply_filter();if self.state.selected_idx.is_none() {@@ -729,7 +808,7 @@ impl ListSelectionView {let before = self.selected_actual_idx();let len = self.visible_len();self.state.move_up_wrap(len);- let visible = Self::max_visible_rows(len);+ let visible = self.visible_rows(len);self.skip_disabled_up();self.state.ensure_visible(len, visible);if self.selected_actual_idx() != before {@@ -741,7 +820,7 @@ impl ListSelectionView {let before = self.selected_actual_idx();let len = self.visible_len();self.state.move_down_wrap(len);- let visible = Self::max_visible_rows(len);+ let visible = self.visible_rows(len);self.skip_disabled_down();self.state.ensure_visible(len, visible);if self.selected_actual_idx() != before {@@ -752,7 +831,7 @@ impl ListSelectionView {fn page_up(&mut self) {let before = self.selected_actual_idx();let len = self.visible_len();- let visible = Self::max_visible_rows(len);+ let visible = self.visible_rows(len);self.state.page_up_clamped(len, visible);self.skip_disabled_up_clamped();self.state.ensure_visible(len, visible);@@ -764,7 +843,7 @@ impl ListSelectionView {fn page_down(&mut self) {let before = self.selected_actual_idx();let len = self.visible_len();- let visible = Self::max_visible_rows(len);+ let visible = self.visible_rows(len);self.state.page_down_clamped(len, visible);self.skip_disabled_down_clamped();self.state.ensure_visible(len, visible);@@ -776,7 +855,7 @@ impl ListSelectionView {fn jump_top(&mut self) {let before = self.selected_actual_idx();let len = self.visible_len();- let visible = Self::max_visible_rows(len);+ let visible = self.visible_rows(len);self.state.jump_top(len, visible);self.skip_disabled_down_clamped();self.state.ensure_visible(len, visible);@@ -788,7 +867,7 @@ impl ListSelectionView {fn jump_bottom(&mut self) {let before = self.selected_actual_idx();let len = self.visible_len();- let visible = Self::max_visible_rows(len);+ let visible = self.visible_rows(len);self.state.jump_bottom(len, visible);self.skip_disabled_up_clamped();self.state.ensure_visible(len, visible);@@ -864,8 +943,52 @@ impl ListSelectionView {self.last_selected_actual_idx.take()}- fn rows_width(total_width: u16) -> u16 {- total_width.saturating_sub(2)+ fn tab_appearance(&self) -> TabAppearance {+ match self.appearance {+ SelectionAppearance::Legacy => TabAppearance::Legacy,+ SelectionAppearance::Picker => TabAppearance::Filled,+ }+ }++ fn footer_hint_lines(&self, width: u16) -> Vec<Line<'_>> {+ let Some(hint) = self.active_footer_hint() else {+ return Vec::new();+ };+ if self.appearance == SelectionAppearance::Legacy {+ return vec![hint.clone()];+ }+ let mut lines = wrap_styled_line(hint, width);+ if self.reserve_result_rows {+ let height = self+ .tab_footer_hints+ .iter()+ .map(|(_, hint)| wrap_styled_line(hint, width).len())+ .chain(+ self.footer_hint+ .iter()+ .map(|hint| wrap_styled_line(hint, width).len()),+ )+ .max()+ .unwrap_or(lines.len());+ lines.resize(height.max(lines.len()), Line::default());+ }+ lines+ }++ fn result_area_height(&self, measured_height: u16) -> u16 {+ if self.appearance == SelectionAppearance::Picker && self.reserve_result_rows {+ let reserved_height = self.max_visible_rows.min(usize::from(u16::MAX)) as u16;+ measured_height.max(reserved_height)+ } else {+ measured_height+ }+ }++ fn rows_width(&self, total_width: u16) -> u16 {+ match self.appearance {+ SelectionAppearance::Legacy => total_width.saturating_sub(/*rhs*/ 2),+ SelectionAppearance::Picker => total_width,+ }}fn clear_to_terminal_bg(buf: &mut Buffer, area: Rect) {@@ -1184,12 +1307,13 @@ impl Renderable for ListSelectionView {// When side-by-side is active, measure the list at the reduced width// that accounts for the gap and side panel.let effective_rows_width = if let Some(side_w) = self.side_layout_width(inner_width) {- Self::rows_width(width).saturating_sub(SIDE_CONTENT_GAP + side_w)+ // Leave the preview's right inset outside the full-width focus row.+ width.saturating_sub(MENU_SURFACE_HORIZONTAL_INSET / 2 + SIDE_CONTENT_GAP + side_w)} else {- Self::rows_width(width)+ self.rows_width(width)};- // Measure wrapped height for up to MAX_POPUP_ROWS items.+ // The shared measurement API reserves one column; compensate to match painted rows.let rows = self.build_rows();let column_width = ColumnWidthConfig::new(self.col_width_mode, self.name_column_width).with_description_layout(self.description_layout);@@ -1197,20 +1321,41 @@ impl Renderable for ListSelectionView {SelectionRowDisplay::Wrapped => measure_rows_height_with_col_width_mode(&rows,&self.state,- MAX_POPUP_ROWS,- effective_rows_width.saturating_add(1),+ self.max_visible_rows,+ effective_rows_width.saturating_add(/*rhs*/ 1),column_width,),- SelectionRowDisplay::SingleLine => rows.len().clamp(1, MAX_POPUP_ROWS) as u16,+ SelectionRowDisplay::SingleLine => {+ rows.len().clamp(/*min*/ 1, self.max_visible_rows) as u16+ }};- let header = self.active_header();- let tab_height = tab_bar_height(&self.tabs, self.active_tab_idx.unwrap_or(0), inner_width);- let mut height = header.desired_height(inner_width);- height = height.saturating_add(tab_height + u16::from(tab_height > 0));- height = height.saturating_add(rows_height + 2 + self.header_gap);+ let rows_height = self.result_area_height(rows_height);+ let tab_height = tab_bar_height(+ &self.tabs,+ self.active_tab_idx.unwrap_or(/*default*/ 0),+ inner_width,+ self.tab_appearance(),+ );+ let mut height = self.header_height(inner_width);+ let header_gap = if self.appearance == SelectionAppearance::Picker && height == 0 {+ 0+ } else {+ self.header_gap+ };+ let tab_gap = u16::from(+ tab_height > 0+ && (self.appearance == SelectionAppearance::Legacy || self.is_searchable),+ );+ height = height.saturating_add(tab_height + tab_gap);+ height = height.saturating_add(rows_height + 2 + header_gap);+ if self.appearance == SelectionAppearance::Picker+ && self.picker_surface == PickerSurface::Panel+ {+ height = height.saturating_add(/*rhs*/ 1);+ }if self.is_searchable {- height = height.saturating_add(1);+ height = height.saturating_add(/*rhs*/ 1);}// Side content: when the terminal is wide enough the panel sits beside@@ -1230,14 +1375,15 @@ impl Renderable for ListSelectionView {let note_lines = wrap_styled_line(note, note_width);height = height.saturating_add(note_lines.len() as u16);}- if self.active_footer_hint().is_some() {- height = height.saturating_add(1);- }+ height = height.saturating_add(+ self.footer_hint_lines(width.saturating_sub(/*rhs*/ 2))+ .len() as u16,+ );height}fn render(&self, area: Rect, buf: &mut Buffer) {- self.rendered_item_count.set(0);+ self.rendered_item_count.set(/*val*/ 0);if area.height == 0 || area.width == 0 {return;}@@ -1248,28 +1394,69 @@ impl Renderable for ListSelectionView {.as_ref().map(|note| wrap_styled_line(note, note_width));let note_height = note_lines.as_ref().map_or(0, |lines| lines.len() as u16);- let footer_rows = note_height + u16::from(self.active_footer_hint().is_some());+ let hint_lines = self.footer_hint_lines(note_width);+ let hint_height = hint_lines.len() as u16;+ let inner_width = popup_content_width(area.width);+ let header_height = self.header_height(inner_width);+ let tab_height = tab_bar_height(+ &self.tabs,+ self.active_tab_idx.unwrap_or(/*default*/ 0),+ inner_width,+ self.tab_appearance(),+ );+ let mut footer_rows = note_height + hint_height;+ if self.appearance == SelectionAppearance::Picker {+ // Wrapped hints yield before the title, controls, and selected result.+ let minimum_content = u16::from(self.picker_surface == PickerSurface::Panel)+ + header_height.min(/*other*/ 1)+ + tab_height+ + u16::from(self.is_searchable)+ + 1;+ footer_rows = footer_rows.min(area.height.saturating_sub(minimum_content));+ }let [content_area, footer_area] =Layout::vertical([Constraint::Fill(1), Constraint::Length(footer_rows)]).areas(area);let outer_content_area = content_area;// Paint the shared menu surface and then layout inside the returned inset.- let content_area = render_menu_surface(outer_content_area, buf);+ let content_area = match self.appearance {+ SelectionAppearance::Legacy => render_menu_surface(outer_content_area, buf),+ SelectionAppearance::Picker => {+ Self::clear_to_terminal_bg(buf, outer_content_area);+ if self.picker_surface == PickerSurface::Panel {+ ratatui::widgets::Block::default()+ .style(crate::style::user_message_style())+ .render(outer_content_area, buf);+ }+ // The list owns its vertical spacer rows so hints remain adjacent+ // to results even when search, tabs, or a header are present.+ let area = outer_content_area.inset(Insets::vh(/*v*/ 0, /*h*/ 2));+ if self.picker_surface == PickerSurface::Panel {+ Rect::new(+ area.x,+ area.y.saturating_add(/*rhs*/ 1),+ area.width,+ area.height.saturating_sub(/*rhs*/ 1),+ )+ } else {+ area+ }+ }+ };- let inner_width = popup_content_width(outer_content_area.width);let side_w = self.side_layout_width(inner_width);// When side-by-side is active, shrink the list to make room.- let full_rows_width = Self::rows_width(outer_content_area.width);+ let full_rows_width = self.rows_width(outer_content_area.width);let effective_rows_width = if let Some(sw) = side_w {- full_rows_width.saturating_sub(SIDE_CONTENT_GAP + sw)+ outer_content_area+ .width+ .saturating_sub(MENU_SURFACE_HORIZONTAL_INSET / 2 + SIDE_CONTENT_GAP + sw)} else {full_rows_width};- let header = self.active_header();- let header_height = header.desired_height(inner_width);- let tab_height = tab_bar_height(&self.tabs, self.active_tab_idx.unwrap_or(0), inner_width);+ let header = self.active_header(inner_width);let rows = self.build_rows();let column_width = ColumnWidthConfig::new(self.col_width_mode, self.name_column_width).with_description_layout(self.description_layout);@@ -1277,13 +1464,17 @@ impl Renderable for ListSelectionView {SelectionRowDisplay::Wrapped => measure_rows_height_with_col_width_mode(&rows,&self.state,- MAX_POPUP_ROWS,- effective_rows_width.saturating_add(1),+ self.max_visible_rows,+ effective_rows_width.saturating_add(/*rhs*/ 1),column_width,),- SelectionRowDisplay::SingleLine => rows.len().clamp(1, MAX_POPUP_ROWS) as u16,+ SelectionRowDisplay::SingleLine => {+ rows.len().clamp(/*min*/ 1, self.max_visible_rows) as u16+ }};+ let rows_height = self.result_area_height(rows_height);+// Stacked (fallback) side content height — only used when not side-by-side.let stacked_side_h = if side_w.is_none() {self.stacked_side_content().desired_height(inner_width)@@ -1298,23 +1489,60 @@ impl Renderable for ListSelectionView {tabs_area,_,search_area,+ above_area,list_area,+ below_area,_,stacked_side_area,- ] = Layout::vertical([- Constraint::Max(header_height),- Constraint::Max(self.header_gap),- Constraint::Length(tab_height),- Constraint::Length(u16::from(tab_height > 0)),- Constraint::Length(if self.is_searchable { 1 } else { 0 }),- Constraint::Length(rows_height),- Constraint::Length(stacked_gap),- Constraint::Length(stacked_side_h),- ])- .areas(content_area);+ ] = if self.appearance == SelectionAppearance::Picker {+ picker_areas(+ content_area,+ PickerLayoutSizes {+ header: header_height,+ header_gap: self.header_gap,+ tabs: tab_height,+ search: u16::from(self.is_searchable),+ rows: rows_height,+ side: stacked_side_h,+ },+ )+ } else {+ let [+ header,+ header_gap,+ tabs,+ tab_gap,+ search,+ rows,+ side_gap,+ side,+ ] = Layout::vertical([+ Constraint::Max(header_height),+ Constraint::Max(self.header_gap),+ Constraint::Length(tab_height),+ Constraint::Length(u16::from(tab_height > 0)),+ Constraint::Length(if self.is_searchable { 1 } else { 0 }),+ Constraint::Length(rows_height),+ Constraint::Length(stacked_gap),+ Constraint::Length(stacked_side_h),+ ])+ .areas(content_area);+ [+ header,+ header_gap,+ tabs,+ tab_gap,+ search,+ Rect::default(),+ rows,+ Rect::default(),+ side_gap,+ side,+ ]+ };// -- Header --- if header_area.height < header_height {+ if self.appearance == SelectionAppearance::Legacy && header_area.height < header_height {let [header_area, elision_area] =Layout::vertical([Constraint::Fill(1), Constraint::Length(1)]).areas(header_area);header.render(header_area, buf);@@ -1328,7 +1556,13 @@ impl Renderable for ListSelectionView {// -- Tabs --if tab_height > 0 {- render_tab_bar(&self.tabs, self.active_tab_idx.unwrap_or(0), tabs_area, buf);+ render_tab_bar(+ &self.tabs,+ self.active_tab_idx.unwrap_or(/*default*/ 0),+ tabs_area,+ buf,+ self.tab_appearance(),+ );}// -- Search bar --@@ -1348,7 +1582,7 @@ impl Renderable for ListSelectionView {// -- List rows --if list_area.height > 0 {let render_area = Rect {- x: if rows.is_empty() {+ x: if rows.is_empty() && self.appearance == SelectionAppearance::Legacy {list_area.x} else {list_area.x.saturating_sub(2)@@ -1378,6 +1612,21 @@ impl Renderable for ListSelectionView {),};self.rendered_item_count.set(rendered_rows.items);+ if self.appearance == SelectionAppearance::Picker+ && above_area.height > 0+ && below_area.height > 0+ {+ render_scroll_indicators(+ Rect::new(+ render_area.x,+ above_area.y,+ render_area.width,+ below_area.bottom().saturating_sub(above_area.y),+ ),+ buf,+ rendered_rows,+ );+ }}// -- Side content (preview panel) --@@ -1432,11 +1681,7 @@ impl Renderable for ListSelectionView {if footer_area.height > 0 {let [note_area, hint_area] = Layout::vertical([Constraint::Length(note_height),- Constraint::Length(if self.active_footer_hint().is_some() {- 1- } else {- 0- }),+ Constraint::Length(hint_height),]).areas(footer_area);@@ -1461,14 +1706,21 @@ impl Renderable for ListSelectionView {}}- if let Some(hint) = self.active_footer_hint() {+ if !hint_lines.is_empty() {let hint_area = Rect {x: hint_area.x + 2,y: hint_area.y,width: hint_area.width.saturating_sub(2),height: hint_area.height,};- hint.clone().dim().render(hint_area, buf);+ match self.appearance {+ SelectionAppearance::Legacy => {+ hint_lines[0].clone().dim().render(hint_area, buf)+ }+ SelectionAppearance::Picker => {+ Paragraph::new(hint_lines).dim().render(hint_area, buf);+ }+ }}}}@@ -2474,13 +2726,13 @@ mod tests {assert_eq!(view.selected_actual_idx(), Some(7));let selected = view.state.selected_idx.expect("selection should be set");assert!(view.state.scroll_top <= selected);- assert!(selected < view.state.scroll_top + ListSelectionView::max_visible_rows(/*len*/ 12));+ assert!(selected < view.state.scroll_top + view.visible_rows(/*len*/ 12));view.handle_key_event(KeyEvent::from(KeyCode::End));assert_eq!(view.selected_actual_idx(), Some(7));let selected = view.state.selected_idx.expect("selection should be set");assert!(view.state.scroll_top <= selected);- assert!(selected < view.state.scroll_top + ListSelectionView::max_visible_rows(/*len*/ 12));+ assert!(selected < view.state.scroll_top + view.visible_rows(/*len*/ 12));}#[test]@@ -2999,3 +3251,7 @@ mod tests {assert_eq!(cell.style().bg, Some(Color::Reset));}}++#[cfg(test)]+#[path = "selection_picker_tests.rs"]+mod picker_tests;diff --git a/codex-rs/tui/src/bottom_pane/mod.rs b/codex-rs/tui/src/bottom_pane/mod.rsindex 689ccfef21..0facd39743 100644--- a/codex-rs/tui/src/bottom_pane/mod.rs+++ b/codex-rs/tui/src/bottom_pane/mod.rs@@ -143,6 +143,8 @@ pub(crate) use footer::goal_status_indicator_line;pub(crate) use list_selection_view::ColumnWidthMode;pub(crate) use list_selection_view::ListSelectionView;pub(crate) use list_selection_view::OnSelectionChangedCallback;+pub(crate) use list_selection_view::PickerSurface;+pub(crate) use list_selection_view::SelectionAppearance;pub(crate) use list_selection_view::SelectionDescriptionLayout;pub(crate) use list_selection_view::SelectionRowDisplay;pub(crate) use list_selection_view::SelectionToggle;@@ -174,8 +176,10 @@ pub(crate) use title_setup::preview_line_for_title_items;mod paste_burst;mod pending_input_preview;mod pending_thread_approvals;+mod picker_style;pub(crate) mod popup_consts;mod scroll_state;+mod selection_picker_layout;mod selection_popup_common;mod selection_row_layout;mod selection_tabs;diff --git a/codex-rs/tui/src/bottom_pane/pending_input_preview.rs b/codex-rs/tui/src/bottom_pane/pending_input_preview.rsindex 34ea0990c2..93328d52a6 100644--- a/codex-rs/tui/src/bottom_pane/pending_input_preview.rs+++ b/codex-rs/tui/src/bottom_pane/pending_input_preview.rs@@ -97,11 +97,9 @@ impl PendingInputPreview {if !self.pending_steers.is_empty() {let mut header = vec!["Messages to be submitted after next tool call".into()];if let Some(interrupt_binding) = self.interrupt_binding {- header.extend(vec![- " (press ".dim(),- interrupt_binding.into(),- " to interrupt and send immediately)".dim(),- ]);+ header.push(" (press ".dim());+ header.extend(interrupt_binding.spans());+ header.push(" to interrupt and send immediately)".dim());}Self::push_section_header(&mut lines, width, Line::from(header));@@ -171,14 +169,10 @@ impl PendingInputPreview {&& !has_questions&& let Some(edit_binding) = self.edit_binding{- lines.push(- Line::from(vec![- " ".into(),- edit_binding.into(),- " edit last queued message".into(),- ])- .dim(),- );+ let mut hint = Line::from(" ");+ hint.spans.extend(edit_binding.spans());+ hint.spans.push(" edit last queued message".dim());+ lines.push(hint);}Paragraph::new(lines).into()diff --git a/codex-rs/tui/src/bottom_pane/picker_style.rs b/codex-rs/tui/src/bottom_pane/picker_style.rsnew file mode 100644index 0000000000..1dace86ad8--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/picker_style.rs@@ -0,0 +1,68 @@+//! Shared visual tokens and overflow hints for the picker component.+//!+//! Resolve RGB colors when rendering so terminal palette fallbacks stay effective.++use ratatui::buffer::Buffer;+use ratatui::layout::Rect;+use ratatui::style::Style;+use ratatui::style::Stylize;+use ratatui::text::Line;+use ratatui::widgets::Widget;++use super::selection_popup_common::RenderedRows;+use crate::color::is_light;+pub(crate) use crate::style::selection_style;+use crate::terminal_palette::best_color;+use crate::terminal_palette::default_bg;+use ratatui::style::Color;++/// The shared picker can blend into the transcript or form a shaded browser panel.+#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]+pub(crate) enum PickerSurface {+ #[default]+ Terminal,+ Panel,+}++pub(super) fn active_tab_style() -> Style {+ let fallback = Style::default()+ .fg(Color::Reset)+ .bg(Color::Reset)+ .bold()+ .not_dim()+ .underlined();+ let Some(background) = default_bg() else {+ return fallback;+ };+ let fill = best_color(if is_light(background) {+ (220, 220, 220)+ } else {+ (76, 76, 76)+ });+ if fill == Color::Reset {+ return fallback;+ }+ Style::default()+ .fg(crate::style::readable_color_on(Color::Reset, Some(fill)))+ .bg(fill)+ .bold()+ .not_dim()+ .not_underlined()+}++/// Draw overflow hints against the background already painted beneath each cell.+pub(super) fn render_scroll_indicators(area: Rect, buf: &mut Buffer, rendered: RenderedRows) {+ if area.height < 3 || area.width == 0 {+ return;+ }+ for (visible, symbol, y) in [+ (rendered.has_above, "↑", area.y),+ (rendered.has_below, "↓", area.bottom() - 1),+ ] {+ if visible {+ Line::from(symbol)+ .fg(crate::style::accent_color_on(Some(buf[(area.x, y)].bg)))+ .render(Rect::new(area.x, y, /*width*/ 1, /*height*/ 1), buf);+ }+ }+}diff --git a/codex-rs/tui/src/bottom_pane/popup_consts.rs b/codex-rs/tui/src/bottom_pane/popup_consts.rsindex e2c7c8a56b..7ea945fa40 100644--- a/codex-rs/tui/src/bottom_pane/popup_consts.rs+++ b/codex-rs/tui/src/bottom_pane/popup_consts.rs@@ -1,5 +1,6 @@//! Shared popup-related constants for bottom pane widgets.+use ratatui::style::Stylize;use ratatui::text::Line;use crate::key_hint;@@ -38,24 +39,16 @@ pub(crate) fn accept_cancel_hint_line(cancel: Option<ShortcutHint>,cancel_label: &'static str,) -> Line<'static> {- match (accept, cancel) {- (Some(accept), Some(cancel)) => Line::from(vec![- "Press ".into(),- accept.into(),- format!(" {accept_label} or ").into(),- cancel.into(),- format!(" {cancel_label}").into(),- ]),- (Some(accept), None) => Line::from(vec![- "Press ".into(),- accept.into(),- format!(" {accept_label}").into(),- ]),- (None, Some(cancel)) => Line::from(vec![- "Press ".into(),- cancel.into(),- format!(" {cancel_label}").into(),- ]),- (None, None) => Line::from(""),+ let mut spans = Vec::new();+ if let Some(accept) = accept {+ spans.push("Press ".dim());+ spans.extend(accept.spans());+ spans.push(format!(" {accept_label}").dim());}+ if let Some(cancel) = cancel {+ spans.push(if spans.is_empty() { "Press " } else { " or " }.dim());+ spans.extend(cancel.spans());+ spans.push(format!(" {cancel_label}").dim());+ }+ spans.into()}diff --git a/codex-rs/tui/src/bottom_pane/questions.rs b/codex-rs/tui/src/bottom_pane/questions.rsindex c1053995f8..19f1a87a8c 100644--- a/codex-rs/tui/src/bottom_pane/questions.rs+++ b/codex-rs/tui/src/bottom_pane/questions.rs@@ -62,7 +62,10 @@ impl BottomPane {countdown.dim(),])];if let Some(binding) = self.pending_input_preview.edit_binding {- lines.push(Line::from(vec![" ".into(), binding.into(), " to answer".into()]).dim());+ let mut hint = Line::from(" ");+ hint.spans.extend(binding.spans());+ hint.spans.push(" to answer".dim());+ lines.push(hint);}Some(lines)}diff --git a/codex-rs/tui/src/bottom_pane/request_user_input/mod.rs b/codex-rs/tui/src/bottom_pane/request_user_input/mod.rsindex 06ac2fe6b2..56eeab294b 100644--- a/codex-rs/tui/src/bottom_pane/request_user_input/mod.rs+++ b/codex-rs/tui/src/bottom_pane/request_user_input/mod.rs@@ -2512,7 +2512,7 @@ mod tests {let tip_texts = tips.iter().map(|tip| tip.text.as_str()).collect::<Vec<_>>();assert_eq!(tip_texts,- vec!["ctrl + j to submit answer", "esc to interrupt"]+ vec!["ctrl+j to submit answer", "esc to interrupt"]);}@@ -2521,21 +2521,21 @@ mod tests {for (specs, expected_tips) in [(KeybindingsSpec::One(KeybindingSpec("ctrl-x enter".to_string())),- vec!["ctrl + x enter to submit answer", "esc to interrupt"],+ vec!["ctrl+x enter to submit answer", "esc to interrupt"],),(KeybindingsSpec::Many(vec![KeybindingSpec("ctrl-enter".to_string()),KeybindingSpec("ctrl-x enter".to_string()),]),- vec!["ctrl + enter to submit answer", "esc to interrupt"],+ vec!["ctrl+enter to submit answer", "esc to interrupt"],),(KeybindingsSpec::Many(vec![KeybindingSpec("ctrl-x enter".to_string()),KeybindingSpec("ctrl-enter".to_string()),]),- vec!["ctrl + x enter to submit answer", "esc to interrupt"],+ vec!["ctrl+x enter to submit answer", "esc to interrupt"],),] {let (tx, _rx) = test_sender();@@ -3755,16 +3755,16 @@ mod tests {.collect::<Vec<_>>().join("\n");- insta::assert_snapshot!(snapshot, @r"+ insta::assert_snapshot!(snapshot, @"- Question 1/1 (1 unanswered)- Share details.+ Question 1/1 (1 unanswered)+ Share details.- › Type your answer (optional)+ › Type your answer (optional)- ctrl + x enter to submit answer | esc to interrupt+ ctrl+x enter to submit answer | esc to interrupt");}diff --git a/codex-rs/tui/src/bottom_pane/request_user_input/snapshots/codex_tui__bottom_pane__request_user_input__tests__request_user_input_freeform_remapped_submit.snap b/codex-rs/tui/src/bottom_pane/request_user_input/snapshots/codex_tui__bottom_pane__request_user_input__tests__request_user_input_freeform_remapped_submit.snapindex a2aeaa4d3e..4e357e6fe0 100644--- a/codex-rs/tui/src/bottom_pane/request_user_input/snapshots/codex_tui__bottom_pane__request_user_input__tests__request_user_input_freeform_remapped_submit.snap+++ b/codex-rs/tui/src/bottom_pane/request_user_input/snapshots/codex_tui__bottom_pane__request_user_input__tests__request_user_input_freeform_remapped_submit.snap@@ -10,4 +10,4 @@ expression: "render_snapshot(&overlay, area)"- ctrl + j to submit answer | esc to interrupt+ ctrl+j to submit answer | esc to interruptdiff --git a/codex-rs/tui/src/bottom_pane/selection_picker_layout.rs b/codex-rs/tui/src/bottom_pane/selection_picker_layout.rsnew file mode 100644index 0000000000..40a1a0baa8--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/selection_picker_layout.rs@@ -0,0 +1,49 @@+//! Fit picker chrome before assigning result rows so short panels retain their controls.+//!+//! Optional gaps and previews yield first; headers, tabs, search, and at least one+//! result remain visible whenever the available height can accommodate them.+//! Overflow spacers are reserved separately from the minimum result content.++use ratatui::layout::Rect;++pub(super) struct PickerLayoutSizes {+ pub header: u16,+ pub header_gap: u16,+ pub tabs: u16,+ pub search: u16,+ pub rows: u16,+ pub side: u16,+}++pub(super) fn picker_areas(area: Rect, sizes: PickerLayoutSizes) -> [Rect; 10] {+ let tabs = sizes.tabs.min(area.height);+ let search = sizes.search.min(area.height.saturating_sub(tabs));+ let minimum_rows = sizes.rows.min(if tabs > 0 { 1 } else { 3 });+ let header = sizes+ .header+ .min(area.height.saturating_sub(tabs + search + minimum_rows));+ let mut remaining = area.height.saturating_sub(header + tabs + search);+ let indicators = u16::from(remaining >= minimum_rows + 2);+ remaining = remaining.saturating_sub(indicators * 2);+ let minimum_rows = sizes.rows.min(/*other*/ 3).min(remaining);+ let header_gap = if header > 0 {+ sizes.header_gap.min(remaining.saturating_sub(minimum_rows))+ } else {+ 0+ };+ remaining = remaining.saturating_sub(header_gap);+ let tab_gap = u16::from(tabs > 0 && search > 0 && remaining > minimum_rows);+ remaining = remaining.saturating_sub(tab_gap);+ let side = sizes.side.min(remaining.saturating_sub(minimum_rows + 1));+ let side_gap = u16::from(side > 0);+ let rows = sizes.rows.min(remaining.saturating_sub(side + side_gap));+ let mut y = area.y;+ [+ header, header_gap, tabs, tab_gap, search, indicators, rows, indicators, side_gap, side,+ ]+ .map(|height| {+ let rect = Rect::new(area.x, y, area.width, height);+ y = y.saturating_add(height);+ rect+ })+}diff --git a/codex-rs/tui/src/bottom_pane/selection_picker_tests.rs b/codex-rs/tui/src/bottom_pane/selection_picker_tests.rsnew file mode 100644index 0000000000..6151525ac3--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/selection_picker_tests.rs@@ -0,0 +1,183 @@+//! Opt-in panels retain controls and page by the results that actually fit.++use super::*;+use crate::app_event::AppEvent;+use pretty_assertions::assert_eq;+use ratatui::style::Color;+use tokio::sync::mpsc::unbounded_channel;++fn browser() -> ListSelectionView {+ let (tx, _rx) = unbounded_channel::<AppEvent>();+ ListSelectionView::new(+ SelectionViewParams {+ appearance: SelectionAppearance::Picker,+ picker_surface: PickerSurface::Panel,+ max_visible_rows: 24,+ title: Some("Keymap".to_owned()),+ subtitle: Some("All configurable shortcuts.".to_owned()),+ is_searchable: true,+ search_placeholder: Some("Type to search shortcuts".to_owned()),+ footer_hint: Some("left/right group · enter edit · esc close".into()),+ row_display: SelectionRowDisplay::SingleLine,+ tabs: ["All", "Common", "Customized (3)", "Unbound (4)", "App"]+ .into_iter()+ .map(|label| SelectionTab {+ id: label.to_owned(),+ label: label.to_owned(),+ header: Box::new(()),+ items: (0..30)+ .map(|index| SelectionItem {+ name: format!("Action {index:02}"),+ description: Some(format!("Ctrl+{index}")),+ search_value: Some(format!("Action {index:02}")),+ ..Default::default()+ })+ .collect(),+ })+ .collect(),+ ..Default::default()+ },+ AppEventSender::new(tx),+ crate::keymap::RuntimeKeymap::defaults().list,+ )+}++fn render_browser(view: &ListSelectionView, width: u16, height: u16) -> (String, Buffer) {+ let area = Rect::new(/*x*/ 0, /*y*/ 0, width, height);+ let mut buf = Buffer::empty(area);+ view.render(area, &mut buf);+ let text = (0..height)+ .map(|y| {+ (0..width)+ .map(|x| buf[(x, y)].symbol())+ .collect::<String>()+ .trim_end()+ .to_owned()+ })+ .collect::<Vec<_>>()+ .join("\n");+ (text, buf)+}++#[test]+fn short_browser_keeps_header_tabs_search_and_footer() {+ let view = browser();+ let mut snapshots = Vec::new();+ for (width, height) in [(48, 6), (48, 7), (48, 13), (24, 6), (24, 7)] {+ let (text, _) = render_browser(&view, width, height);+ assert!(text.contains("Keymap"));+ assert!(text.contains("Common"));+ assert!(text.contains("Type to search"));+ assert!(text.contains("left/right group"));+ assert!(view.rendered_item_count() > 0);+ snapshots.push(format!("{width}×{height}:\n{text}"));+ }+ insta::assert_snapshot!(snapshots.join("\n---\n"));+}++#[test]+fn browser_page_navigation_uses_rows_that_fit() {+ let mut view = browser();+ let (_, initial_buf) = render_browser(&view, /*width*/ 60, /*height*/ 18);+ let visible = view.rendered_item_count();+ assert!(visible < view.max_visible_rows);+ view.handle_key_event(KeyEvent::from(KeyCode::PageDown));+ let (text, buf) = render_browser(&view, /*width*/ 60, /*height*/ 18);+ insta::assert_snapshot!(text);+ assert_eq!(view.selected_actual_idx(), Some(visible));+ let selected_row = text+ .lines()+ .position(|line| line.starts_with('›'))+ .expect("focused row");+ assert_eq!(+ buf[(0, selected_row as u16)].bg,+ selection_style().bg.unwrap()+ );+ assert_eq!(buf[(0, 1)].bg, initial_buf[(0, 1)].bg);+}++#[test]+fn shrinking_the_browser_keeps_selection_visible_without_navigation() {+ for row_display in [+ SelectionRowDisplay::SingleLine,+ SelectionRowDisplay::Wrapped,+ ] {+ let mut view = browser();+ view.row_display = row_display;+ view.state.selected_idx = Some(7);+ view.state.scroll_top = 0;+ render_browser(&view, /*width*/ 60, /*height*/ 24);+ let initial_count = view.rendered_item_count();+ assert!(initial_count >= 8);++ let (text, _) = render_browser(&view, /*width*/ 60, /*height*/ 13);+ assert!(view.rendered_item_count() < initial_count);+ assert_eq!(view.selected_actual_idx(), Some(7));+ let focused = text+ .lines()+ .find(|line| line.starts_with('›'))+ .expect("focused row");+ assert!(focused.contains("Action 07"), "{text}");+ }+}++#[test]+fn overflow_arrows_follow_the_painted_picker_surface() {+ for (fg, bg) in [+ ((32, 32, 32), (255, 255, 255)),+ ((240, 240, 240), (24, 24, 24)),+ ((240, 240, 240), (80, 80, 80)),+ ((32, 32, 32), (130, 130, 130)),+ ] {+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors { fg, bg },+ || {+ for surface in [PickerSurface::Panel, PickerSurface::Terminal] {+ let mut view = browser();+ view.picker_surface = surface;+ view.state.selected_idx = Some(15);+ view.state.scroll_top = 12;+ let (text, buf) = render_browser(&view, /*width*/ 60, /*height*/ 18);+ let selected_y = text+ .lines()+ .position(|line| line.starts_with('›'))+ .expect("focused row") as u16;+ let selected_background = selection_style().bg.unwrap();+ assert_eq!(+ (0..buf.area.width)+ .map(|x| buf[(x, selected_y)].bg)+ .collect::<Vec<_>>(),+ vec![selected_background; usize::from(buf.area.width)],+ );+ let background = match surface {+ PickerSurface::Panel => crate::style::user_message_style().bg.unwrap(),+ PickerSurface::Terminal => Color::Reset,+ };+ let arrows = (0..buf.area.height)+ .filter(|&y| matches!(buf[(0, y)].symbol(), "↑" | "↓"))+ .map(|y| (y, buf[(0, y)].clone(), buf[(1, y)].clone()))+ .collect::<Vec<_>>();+ assert_eq!(+ arrows+ .iter()+ .map(|(_, cell, _)| cell.symbol())+ .collect::<Vec<_>>(),+ vec!["↑", "↓"],+ );+ for (y, cell, adjacent) in &arrows {+ assert_ne!(*y, selected_y);+ assert_ne!(cell.bg, selected_background);+ assert_eq!(+ (cell.fg, cell.bg, adjacent.bg),+ (+ crate::style::accent_color_on(Some(background)),+ background,+ background,+ ),+ );+ }+ }+ },+ );+ }+}diff --git a/codex-rs/tui/src/bottom_pane/selection_popup_common.rs b/codex-rs/tui/src/bottom_pane/selection_popup_common.rsindex aceecb92ed..04b799dac7 100644--- a/codex-rs/tui/src/bottom_pane/selection_popup_common.rs+++ b/codex-rs/tui/src/bottom_pane/selection_popup_common.rs@@ -2,6 +2,8 @@ use ratatui::buffer::Buffer;use ratatui::layout::Rect;// Note: Table-based layout previously used Constraint; the manual renderer// below no longer requires it.+use ratatui::style::Modifier;+use ratatui::style::Style;use ratatui::style::Stylize;use ratatui::text::Line;use ratatui::text::Span;@@ -31,6 +33,8 @@ use super::selection_row_layout::wrap_stacked_row;#[derive(Default)]pub(crate) struct GenericDisplayRow {pub name: String,+ /// Optional full-width selection treatment; other rows use the shared text accent.+ pub selection_style: Option<Style>,pub name_prefix_spans: Vec<Span<'static>>,pub display_shortcut: Option<ShortcutHint>,pub match_indices: Option<Vec<usize>>, // indices to bold (char positions)@@ -326,11 +330,36 @@ fn wrap_row_lines(wrap_standard_row(row, desc_col, width, description_layout)}-fn apply_row_state_style(lines: &mut [Line<'static>], selected: bool, is_disabled: bool) {+fn apply_row_state_style(+ lines: &mut [Line<'static>],+ selected: bool,+ is_disabled: bool,+ selection_style: Option<Style>,+) {if selected {for line in lines.iter_mut() {+ if let Some(style) = selection_style {+ line.style = style;+ }line.spans.iter_mut().for_each(|span| {- span.style = accent_style();+ let Some(selected) = selection_style else {+ span.style = accent_style();+ return;+ };+ let secondary = span.style.add_modifier.contains(Modifier::DIM);+ let foreground = span.style.fg.or(selected.fg).unwrap_or_default();+ span.style = selected.patch(span.style).not_dim();+ span.style.bg = selected.bg;+ if selected.add_modifier.contains(Modifier::REVERSED) {+ span.style.fg = selected.fg;+ span.style = span.style.reversed();+ } else {+ span.style.fg = Some(crate::style::readable_color_on(foreground, selected.bg));+ span.style = span.style.not_reversed();+ }+ if secondary {+ span.style = span.style.not_bold();+ }});}}@@ -448,14 +477,15 @@ fn adjust_start_for_wrapped_selection_visibility(start_idx}-/// Render a list of rows using the provided ScrollState, with shared styling-/// and behavior for selection popups.-/// Returns the number of terminal lines actually rendered (including the-/// single-line empty placeholder when shown).+/// Counts painted rows and items and reports content hidden outside the viewport.+/// The line count includes the single-line empty placeholder when shown.#[derive(Clone, Copy, Default)]pub(crate) struct RenderedRows {pub(crate) lines: u16,pub(crate) items: usize,+ pub(crate) has_above: bool,+ /// Includes a description whose final wrapped lines were clipped.+ pub(crate) has_below: bool,}fn render_rows_inner(@@ -475,6 +505,7 @@ fn render_rows_inner(return RenderedRows {lines: u16::from(area.height > 0),items: 0,+ ..Default::default()};}@@ -509,6 +540,7 @@ fn render_rows_inner(let mut cur_y = area.y;let mut rendered_lines: u16 = 0;let mut rendered_items = 0;+ let mut clipped = false;for (i, row) in rows_all.iter().enumerate().skip(start_idx).take(max_items) {if cur_y >= area.y + area.height {break;@@ -516,10 +548,12 @@ fn render_rows_inner(let mut wrapped =wrap_row_lines(row, desc_col, area.width, column_width.description_layout);+ clipped |= wrapped.len() > usize::from(area.bottom().saturating_sub(cur_y));apply_row_state_style(&mut wrapped,Some(i) == state.selected_idx && !row.is_disabled,row.is_disabled,+ row.selection_style,);// Render the wrapped lines.@@ -549,6 +583,8 @@ fn render_rows_inner(RenderedRows {lines: rendered_lines,items: rendered_items,+ has_above: start_idx > 0,+ has_below: clipped || start_idx + rendered_items < rows_all.len(),}}@@ -651,6 +687,7 @@ pub(crate) fn render_rows_single_line_with_col_width_mode(return RenderedRows {lines: u16::from(area.height > 0),items: 0,+ ..Default::default()};}@@ -685,16 +722,12 @@ pub(crate) fn render_rows_single_line_with_col_width_mode(}let mut full_line = build_full_line(row, desc_col, column_width.description_layout);- if Some(i) == state.selected_idx && !row.is_disabled {- full_line.spans.iter_mut().for_each(|span| {- span.style = accent_style();- });- }- if row.is_disabled {- full_line.spans.iter_mut().for_each(|span| {- span.style = span.style.dim();- });- }+ apply_row_state_style(+ std::slice::from_mut(&mut full_line),+ Some(i) == state.selected_idx && !row.is_disabled,+ row.is_disabled,+ row.selection_style,+ );let full_line = truncate_line_with_ellipsis_if_overflow(full_line, area.width as usize);full_line.render(@@ -713,6 +746,8 @@ pub(crate) fn render_rows_single_line_with_col_width_mode(RenderedRows {lines: rendered_lines,items: rendered_lines as usize,+ has_above: start_idx > 0,+ has_below: start_idx + usize::from(rendered_lines) < rows_all.len(),}}@@ -812,6 +847,7 @@ mod tests {use pretty_assertions::assert_eq;use ratatui::buffer::Buffer;use ratatui::layout::Rect;+ use ratatui::style::Color;use ratatui::style::Modifier;#[test]@@ -944,6 +980,109 @@ mod tests {");}+ #[test]+ fn selection_preserves_semantic_spans_and_secondary_hierarchy() {+ for (fg, bg) in [+ ((32, 32, 32), (255, 255, 255)),+ ((230, 230, 230), (18, 20, 30)),+ ] {+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors { fg, bg },+ || {+ for selected in [+ crate::style::selection_style(),+ Style::default()+ .fg(Color::Reset)+ .bg(Color::Reset)+ .bold()+ .reversed(),+ ] {+ for single_line in [true, false] {+ let rows = [GenericDisplayRow {+ name_prefix_spans: vec![+ "L".underlined(),+ "M ".into(),+ "Ready ".green().italic(),+ ],+ name: "provider".into(),+ description: Some("secondary details".into()),+ selection_style: Some(selected),+ ..Default::default()+ }];+ let state = ScrollState {+ selected_idx: Some(0),+ scroll_top: 0,+ };+ let area = Rect::new(+ /*x*/ 0, /*y*/ 0, /*width*/ 48, /*height*/ 1,+ );+ let mut buffer = Buffer::empty(area);+ if single_line {+ render_rows_single_line_with_col_width_mode(+ area,+ &mut buffer,+ &rows,+ &state,+ /*max_results*/ 1,+ "",+ ColumnWidthConfig::default(),+ );+ } else {+ render_rows(+ area,+ &mut buffer,+ &rows,+ &state,+ /*max_results*/ 1,+ "",+ );+ }+ let line = buffer+ .content+ .iter()+ .map(ratatui::buffer::Cell::symbol)+ .collect::<String>();+ let status = &buffer[(3, 0)];+ let description_x =+ line.find("secondary").expect("visible secondary text") as u16;+ assert_eq!(+ (+ buffer[(0, 0)].modifier,+ status.modifier,+ buffer[(description_x, 0)].modifier+ ),+ (+ Modifier::BOLD+ | Modifier::UNDERLINED+ | (selected.add_modifier & Modifier::REVERSED),+ Modifier::BOLD+ | Modifier::ITALIC+ | (selected.add_modifier & Modifier::REVERSED),+ selected.add_modifier & Modifier::REVERSED,+ )+ );+ assert_eq!(+ status.fg,+ if selected.add_modifier.contains(Modifier::REVERSED) {+ Color::Reset+ } else {+ Color::Green+ }+ );+ assert_eq!(buffer[(0, 0)].fg, selected.fg.unwrap());+ assert!(+ buffer+ .content+ .iter()+ .all(|cell| cell.bg == selected.bg.unwrap())+ );+ }+ }+ },+ );+ }+ }+#[test]fn selected_rows_use_the_shared_accent_style() {let rows = vec![GenericDisplayRow {diff --git a/codex-rs/tui/src/bottom_pane/selection_row_layout.rs b/codex-rs/tui/src/bottom_pane/selection_row_layout.rsindex eace3095bf..00b34d2dd0 100644--- a/codex-rs/tui/src/bottom_pane/selection_row_layout.rs+++ b/codex-rs/tui/src/bottom_pane/selection_row_layout.rs@@ -120,7 +120,7 @@ fn build_name_spans(row: &GenericDisplayRow, name_limit: usize) -> Vec<Span<'stafn append_shortcut(row: &GenericDisplayRow, spans: &mut Vec<Span<'static>>) {if let Some(display_shortcut) = row.display_shortcut {spans.push(" (".into());- spans.push(display_shortcut.into());+ spans.extend(display_shortcut.spans());spans.push(")".into());}}diff --git a/codex-rs/tui/src/bottom_pane/selection_tabs.rs b/codex-rs/tui/src/bottom_pane/selection_tabs.rsindex a4c4c42a9d..3ffd224abc 100644--- a/codex-rs/tui/src/bottom_pane/selection_tabs.rs+++ b/codex-rs/tui/src/bottom_pane/selection_tabs.rs@@ -1,3 +1,7 @@+//! Tab headers for selection lists, including a single-row filled picker variant.+//!+//! Filled tabs always retain the active tab and reserve arrows for hidden neighbors.+use ratatui::buffer::Buffer;use ratatui::layout::Rect;use ratatui::style::Styled;@@ -6,13 +10,21 @@ use ratatui::text::Line;use ratatui::text::Span;use ratatui::widgets::Widget;+use crate::line_truncation::truncate_line_with_ellipsis_if_overflow;use crate::render::renderable::Renderable;use crate::style::accent_style;use super::SelectionItem;+use super::picker_style::active_tab_style;const TAB_GAP_WIDTH: usize = 2;+#[derive(Clone, Copy)]+pub(super) enum TabAppearance {+ Legacy,+ Filled,+}+pub(crate) struct SelectionTab {pub(crate) id: String,pub(crate) label: String,@@ -20,22 +32,39 @@ pub(crate) struct SelectionTab {pub(crate) items: Vec<SelectionItem>,}-pub(crate) fn tab_bar_height(tabs: &[SelectionTab], active_idx: usize, width: u16) -> u16 {+pub(super) fn tab_bar_height(+ tabs: &[SelectionTab],+ active_idx: usize,+ width: u16,+ appearance: TabAppearance,+) -> u16 {if tabs.is_empty() {return 0;}+ if matches!(appearance, TabAppearance::Filled) {+ return u16::from(width > 0);+ }tab_bar_lines(tabs, active_idx, width).len().try_into().unwrap_or(u16::MAX)}-pub(crate) fn render_tab_bar(+pub(super) fn render_tab_bar(tabs: &[SelectionTab],active_idx: usize,area: Rect,buf: &mut Buffer,+ appearance: TabAppearance,) {+ if matches!(appearance, TabAppearance::Filled) {+ let labels = tabs+ .iter()+ .map(|tab| tab.label.as_str())+ .collect::<Vec<_>>();+ render_filled_tab_bar(&labels, active_idx, area, buf);+ return;+ }for (offset, line) in tab_bar_lines(tabs, active_idx, area.width).into_iter().take(area.height as usize)@@ -53,6 +82,67 @@ pub(crate) fn render_tab_bar(}}+/// Render a fixed-height tab strip while keeping the active tab visible.+fn render_filled_tab_bar(labels: &[&str], active_idx: usize, area: Rect, buf: &mut Buffer) {+ if labels.is_empty() || area.is_empty() {+ return;+ }+ let active_idx = active_idx.min(labels.len() - 1);+ let widths = labels+ .iter()+ .map(|label| Line::from(*label).width() + 2)+ .collect::<Vec<_>>();+ let occupied = |start: usize, end: usize| {+ widths[start..end].iter().sum::<usize>() + end - start - 1+ + usize::from(start > 0) * 2+ + usize::from(end < labels.len()) * 2+ };+ let mut start = active_idx;+ let mut end = active_idx + 1;+ while start > 0 && occupied(start - 1, end) <= usize::from(area.width) {+ start -= 1;+ }+ while end < labels.len() && occupied(start, end + 1) <= usize::from(area.width) {+ end += 1;+ }++ // Tiny strips prioritize a readable active label over navigation hints.+ let show_left = start > 0 && area.width >= 5;+ let show_right = end < labels.len() && area.width >= 7;+ let mut x = area.x;+ if show_left {+ Line::from("‹")+ .dim()+ .render(Rect::new(x, area.y, /*width*/ 1, /*height*/ 1), buf);+ x += 2;+ }+ let right = area.right().saturating_sub(u16::from(show_right) * 2);+ for idx in start..end {+ let width = widths[idx].min(usize::from(right.saturating_sub(x))) as u16;+ let line = Line::from(format!(" {} ", labels[idx]));+ let line = truncate_line_with_ellipsis_if_overflow(line, usize::from(width));+ let line = if idx == active_idx {+ line.style(active_tab_style())+ } else {+ line.dim()+ };+ let tab = Rect::new(x, area.y, width, /*height*/ 1);+ line.render(tab, buf);+ x = x.saturating_add(width).saturating_add(/*rhs*/ 1);+ }+ if show_right {+ Line::from("›").dim().render(+ Rect::new(+ area.right() - 1,+ area.y,+ /*width*/ 1,+ /*height*/ 1,+ ),+ buf,+ );+ }+}+fn tab_bar_lines(tabs: &[SelectionTab], active_idx: usize, width: u16) -> Vec<Line<'static>> {if tabs.is_empty() {return Vec::new();@@ -104,3 +194,7 @@ fn tab_unit(label: &str, active: bool) -> Vec<Span<'static>> {vec![label.to_string().dim()]}}++#[cfg(test)]+#[path = "selection_tabs_tests.rs"]+mod tests;diff --git a/codex-rs/tui/src/bottom_pane/selection_tabs_tests.rs b/codex-rs/tui/src/bottom_pane/selection_tabs_tests.rsnew file mode 100644index 0000000000..912d7915b4--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/selection_tabs_tests.rs@@ -0,0 +1,85 @@+//! Filled tabs preserve active visibility and Unicode clipping on narrow terminals.++use super::*;+use pretty_assertions::assert_eq;+use ratatui::style::Color;+use ratatui::style::Modifier;+use ratatui::style::Style;++fn rendered_strip(labels: &[&str], active_idx: usize, width: u16) -> (String, Buffer) {+ let area = Rect::new(/*x*/ 0, /*y*/ 0, width, /*height*/ 1);+ let mut buf = Buffer::empty(area);+ buf.set_style(+ area,+ Style::default().red().bg(Color::Yellow).underlined().dim(),+ );+ render_filled_tab_bar(labels, active_idx, area, &mut buf);+ let text = (0..width).map(|x| buf[(x, 0)].symbol()).collect::<String>();+ (text.trim_end().to_owned(), buf)+}++#[test]+fn filled_tabs_window_around_active_tab() {+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (30, 30, 30),+ bg: (255, 255, 255),+ },+ || {+ let labels = [+ "All",+ "Common",+ "Customized (3)",+ "Unbound (4)",+ "App",+ "Composer",+ "Debug",+ ];+ let strips =+ [0, 2, 6].map(|active_idx| rendered_strip(&labels, active_idx, /*width*/ 30).0);+ insta::assert_snapshot!(strips.join("\n"));+ for active_idx in 0..labels.len() {+ let (text, buf) = rendered_strip(&labels, active_idx, /*width*/ 30);+ assert!(text.contains(labels[active_idx]), "{text}");+ let focused = buf+ .content()+ .iter()+ .filter(|cell| cell.bg == active_tab_style().bg.unwrap())+ .map(|cell| {+ assert_eq!(cell.modifier, Modifier::BOLD);+ cell.symbol()+ })+ .collect::<String>();+ assert_eq!(focused, format!(" {} ", labels[active_idx]));+ }+ },+ );+}++#[test]+fn filled_tabs_truncate_unicode_without_hiding_active_tab() {+ let labels = ["All", "文件系统 plugins", "Debug"];+ let strips = [1, 4, 9, 16].map(|width| rendered_strip(&labels, /*active_idx*/ 1, width).0);+ insta::assert_snapshot!(strips.join("\n"));+}++// Non-Windows tests have an unprobed default palette; Windows retains its console probe.+#[cfg(not(windows))]+#[test]+fn filled_tab_unknown_palette_uses_readable_underlined_defaults() {+ let (_, buf) = rendered_strip(&["All"], /*active_idx*/ 0, /*width*/ 5);+ assert_eq!(+ buf.content()+ .iter()+ .map(|cell| (cell.fg, cell.bg, cell.modifier))+ .collect::<Vec<_>>(),+ vec![+ (+ Color::Reset,+ Color::Reset,+ Modifier::BOLD | Modifier::UNDERLINED+ );+ 5+ ],+ );+}diff --git a/codex-rs/tui/src/bottom_pane/skill_popup.rs b/codex-rs/tui/src/bottom_pane/skill_popup.rsindex d70c95423d..f7ca4639c2 100644--- a/codex-rs/tui/src/bottom_pane/skill_popup.rs+++ b/codex-rs/tui/src/bottom_pane/skill_popup.rs@@ -143,6 +143,7 @@ impl SkillPopup {_ => None,};GenericDisplayRow {+ selection_style: None,name,name_prefix_spans: Vec::new(),match_indices: indices,diff --git a/codex-rs/tui/src/bottom_pane/skills_toggle_view.rs b/codex-rs/tui/src/bottom_pane/skills_toggle_view.rsindex e3146db820..d4844dd038 100644--- a/codex-rs/tui/src/bottom_pane/skills_toggle_view.rs+++ b/codex-rs/tui/src/bottom_pane/skills_toggle_view.rs@@ -594,8 +594,8 @@ mod tests {let view = SkillsToggleView::new(Vec::new(), tx, keymap);let rendered = render_lines(&view, /*width*/ 72);- assert!(rendered.contains("ctrl + t"));- assert!(rendered.contains("ctrl + x"));+ assert!(rendered.contains("ctrl+t"));+ assert!(rendered.contains("ctrl+x"));assert!(!rendered.contains("enter"));assert!(!rendered.contains("esc"));}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__approval_overlay__tests__network_exec_prompt.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__approval_overlay__tests__network_exec_prompt.snapindex aad5f89aa4..8783296ad3 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__approval_overlay__tests__network_exec_prompt.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__approval_overlay__tests__network_exec_prompt.snap@@ -24,14 +24,18 @@ Buffer {x: 57, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 10, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: ITALIC,x: 33, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 6, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD,+ x: 0, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 28, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 53, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 53, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 54, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 45, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 45, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 46, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 48, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 48, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 51, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 2, y: 11, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 8, y: 11, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 13, y: 11, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 28, y: 11, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 31, y: 11, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__agents_navigation_help.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__agents_navigation_help.snapindex 5d02395387..67921ef4d3 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__agents_navigation_help.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__agents_navigation_help.snap@@ -10,13 +10,13 @@ expression: terminal.backend()" "" "" "-" / for commands ! for shell commands "-" ctrl + j for newline tab to submit message "-" @ for file paths ctrl + v to paste images "-" ctrl + g to edit in external editor esc esc to edit previous message "-" ctrl + r search history ctrl + c to exit "-" ⌥ + , reasoning down ⌥ + . reasoning up "-" ctrl + t to view transcript "+" / for commands ! for shell commands "+" ctrl+j for newline tab to submit message "+" @ for file paths ctrl+v to paste images "+" ctrl+g to edit in external editor esc esc to edit previous message "+" ctrl+r search history ctrl+c to exit "+" ⌥+, reasoning down ⌥+. reasoning up "+" ctrl+t to view transcript "" ← for agents (empty prompt) "" "" customize shortcuts with /keymap "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_configured_key_chords.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_configured_key_chords.snapindex efad837915..c3b2201056 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_configured_key_chords.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_configured_key_chords.snap@@ -10,12 +10,12 @@ expression: terminal.backend()" "" "" "-" / for commands ! for shell commands "-" ctrl + x enter for newline tab to submit message "-" @ for file paths ctrl + v to paste images "-" ctrl + g ctrl + g to edit in external editor esc esc to edit previous message "-" ctrl + r search history ctrl + c to exit "-" ⌥ + , reasoning down ⌥ + . reasoning up "-" ctrl + t to view transcript "+" / for commands ! for shell commands "+" ctrl+x enter for newline tab to submit message "+" @ for file paths ctrl+v to paste images "+" ctrl+g ctrl+g to edit in external editor esc esc to edit previous message "+" ctrl+r search history ctrl+c to exit "+" ⌥+, reasoning down ⌥+. reasoning up "+" ctrl+t to view transcript "" "" customize shortcuts with /keymap "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_interrupt.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_interrupt.snapindex 7ecc5bba71..e64ff4ff62 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_interrupt.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_interrupt.snap@@ -10,4 +10,4 @@ expression: terminal.backend()" "" "" "-" ctrl + c again to quit "+" ctrl+c again to quit "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_quit.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_quit.snapindex 7ecc5bba71..e64ff4ff62 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_quit.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_ctrl_c_quit.snap@@ -10,4 +10,4 @@ expression: terminal.backend()" "" "" "-" ctrl + c again to quit "+" ctrl+c again to quit "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay.snapindex 5239a34bd2..a38f043b78 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay.snap@@ -10,12 +10,12 @@ expression: terminal.backend()" "" "" "-" / for commands ! for shell commands "-" shift + enter for newline tab to submit message "-" @ for file paths ctrl + v to paste images "-" ctrl + g to edit in external editor esc again to edit previous message "-" ctrl + r search history ctrl + c to exit "-" ⌥ + , reasoning down ⌥ + . reasoning up "-" ctrl + t to view transcript "+" / for commands ! for shell commands "+" shift+enter for newline tab to submit message "+" @ for file paths ctrl+v to paste images "+" ctrl+g to edit in external editor esc again to edit previous message "+" ctrl+r search history ctrl+c to exit "+" ⌥+, reasoning down ⌥+. reasoning up "+" ctrl+t to view transcript "" "" customize shortcuts with /keymap "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay_queue_submissions.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay_queue_submissions.snapindex 582724eea7..ae76e6f2d5 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay_queue_submissions.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__footer_mode_shortcut_overlay_queue_submissions.snap@@ -10,12 +10,12 @@ expression: terminal.backend()" "" "" "-" / for commands ! for shell commands "-" shift + enter for newline tab to queue message "-" @ for file paths ctrl + v to paste images "-" ctrl + g to edit in external editor esc esc to edit previous message "-" ctrl + r search history ctrl + c to exit "-" ⌥ + , reasoning down ⌥ + . reasoning up "-" ctrl + t to view transcript "+" / for commands ! for shell commands "+" shift+enter for newline tab to queue message "+" @ for file paths ctrl+v to paste images "+" ctrl+g to edit in external editor esc esc to edit previous message "+" ctrl+r search history ctrl+c to exit "+" ⌥+, reasoning down ⌥+. reasoning up "+" ctrl+t to view transcript "" "" customize shortcuts with /keymap "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__light_terminal_palette_composer.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__light_terminal_palette_composer.snapindex 413a7347cd..8ef90ddc8e 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__light_terminal_palette_composer.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__chat_composer__tests__light_terminal_palette_composer.snap@@ -19,9 +19,10 @@ Buffer {x: 2, y: 1, fg: Reset, bg: Rgb(244, 244, 244), underline: Reset, modifier: DIM,x: 26, y: 1, fg: Reset, bg: Rgb(244, 244, 244), underline: Reset, modifier: NONE,x: 0, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 2, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 2, y: 5, fg: Rgb(110, 112, 108), bg: Reset, underline: Reset, modifier: BOLD,+ x: 3, y: 5, fg: Rgb(118, 119, 117), bg: Reset, underline: Reset, modifier: NONE,x: 17, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 29, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 29, y: 5, fg: Rgb(118, 119, 117), bg: Reset, underline: Reset, modifier: NONE,x: 46, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_app.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_app.snapindex 51d3ed54a7..dde9247957 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_app.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_app.snap@@ -10,7 +10,7 @@ Buffer {],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 2, y: 0, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD,+ x: 2, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 52, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 3, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 6, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_filter_reset_after_scroll.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_filter_reset_after_scroll.snapindex 424c13151c..0313c5b3cc 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_filter_reset_after_scroll.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_filter_reset_after_scroll.snap@@ -11,7 +11,7 @@ Buffer {],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 2, y: 0, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD,+ x: 2, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 65, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 3, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 5, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_voice.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_voice.snapindex ba3bc2ab73..612778c2f4 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_voice.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__command_popup__tests__command_popup_voice.snap@@ -9,7 +9,7 @@ Buffer {],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 2, y: 0, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD,+ x: 2, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 68, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_ctrl_c_quit_idle.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_ctrl_c_quit_idle.snapindex 31a1b743b8..72de9ee2ac 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_ctrl_c_quit_idle.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_ctrl_c_quit_idle.snap@@ -2,4 +2,4 @@source: tui/src/bottom_pane/footer.rsexpression: terminal.backend()----" ctrl + c again to quit "+" ctrl+c again to quit "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_ctrl_c_quit_running.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_ctrl_c_quit_running.snapindex 31a1b743b8..72de9ee2ac 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_ctrl_c_quit_running.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_ctrl_c_quit_running.snap@@ -2,4 +2,4 @@source: tui/src/bottom_pane/footer.rsexpression: terminal.backend()----" ctrl + c again to quit "+" ctrl+c again to quit "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_collaboration_modes_enabled.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_collaboration_modes_enabled.snapindex 3b67a90683..cdb6a9e673 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_collaboration_modes_enabled.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_collaboration_modes_enabled.snap@@ -2,12 +2,12 @@source: tui/src/bottom_pane/footer.rsexpression: terminal.backend()----" / for commands ! for shell commands "-" ctrl + j for newline tab to submit message "-" @ for file paths ctrl + v to paste images "-" ctrl + g to edit in external editor esc esc to edit previous message "-" ctrl + r search history ctrl + c to exit "-" ⌥ + , reasoning down ⌥ + . reasoning up "-" shift + tab to change mode ctrl + t to view transcript "+" / for commands ! for shell commands "+" ctrl+j for newline tab to submit message "+" @ for file paths ctrl+v to paste images "+" ctrl+g to edit in external editor esc esc to edit previous message "+" ctrl+r search history ctrl+c to exit "+" ⌥+, reasoning down ⌥+. reasoning up "+" shift+tab to change mode ctrl+t to view transcript "" "" customize shortcuts with /keymap "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_running.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_running.snapindex 7c733bd13b..63e2858b65 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_running.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_running.snap@@ -2,12 +2,12 @@source: tui/src/bottom_pane/footer.rsexpression: terminal.backend()----" / for commands ! for shell commands "-" ctrl + j for newline tab to queue message "-" @ for file paths ctrl + v to paste images "-" ctrl + g to edit in external editor esc esc to edit previous message "-" ctrl + r search history ctrl + c to interrupt "-" ⌥ + , reasoning down ⌥ + . reasoning up "-" ctrl + t to view transcript "+" / for commands ! for shell commands "+" ctrl+j for newline tab to queue message "+" @ for file paths ctrl+v to paste images "+" ctrl+g to edit in external editor esc esc to edit previous message "+" ctrl+r search history ctrl+c to interrupt "+" ⌥+, reasoning down ⌥+. reasoning up "+" ctrl+t to view transcript "" "" customize shortcuts with /keymap "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_shift_and_esc.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_shift_and_esc.snapindex 07e9706283..7bf5032eb6 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_shift_and_esc.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__footer_shortcuts_shift_and_esc.snap@@ -2,12 +2,12 @@source: tui/src/bottom_pane/footer.rsexpression: terminal.backend()----" / for commands ! for shell commands "-" shift + enter for newline tab to submit message "-" @ for file paths ctrl + v to paste images "-" ctrl + g to edit in external editor esc again to edit previous message "-" ctrl + r search history ctrl + c to exit "-" ⌥ + , reasoning down ⌥ + . reasoning up "-" ctrl + t to view transcript "+" / for commands ! for shell commands "+" shift+enter for newline tab to submit message "+" @ for file paths ctrl+v to paste images "+" ctrl+g to edit in external editor esc again to edit previous message "+" ctrl+r search history ctrl+c to exit "+" ⌥+, reasoning down ⌥+. reasoning up "+" ctrl+t to view transcript "" "" customize shortcuts with /keymap "diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__voice_footer_rendered_styles.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__voice_footer_rendered_styles.snapindex d71648f1d6..de0b6aed3b 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__voice_footer_rendered_styles.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__footer__tests__voice_footer_rendered_styles.snap@@ -1,33 +1,32 @@---source: tui/src/bottom_pane/footer.rs-assertion_line: 1355expression: "(backend.to_string(), style_runs)"---(- "\" voice ● listen ctrl+m mute \"\n",+ "\" voice ● listen · ctrl+m mute \"\n",[(0,Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset),),(- 3,+ 2,Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold(),),(- 8,+ 7,Style::new().red().bg(Color::Reset).underline_color(Color::Reset),),(- 10,+ 9,Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset),),(- 20,+ 19,Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).bold(),),(- 26,+ 25,Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset),),],diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__list_selection_view__picker_tests__browser_page_navigation_uses_rows_that_fit.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__list_selection_view__picker_tests__browser_page_navigation_uses_rows_that_fit.snapnew file mode 100644index 0000000000..462fce67c9--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__list_selection_view__picker_tests__browser_page_navigation_uses_rows_that_fit.snap@@ -0,0 +1,23 @@+---+source: tui/src/bottom_pane/selection_picker_tests.rs+assertion_line: 79+expression: text+---++ Keymap+ All configurable shortcuts.++ All Common Customized (3) Unbound (4) App++ Type to search shortcuts+↑+ Action 01 Ctrl+1+ Action 02 Ctrl+2+ Action 03 Ctrl+3+ Action 04 Ctrl+4+ Action 05 Ctrl+5+ Action 06 Ctrl+6+ Action 07 Ctrl+7+› Action 08 Ctrl+8+↓+ left/right group · enter edit · esc closediff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__list_selection_view__picker_tests__short_browser_keeps_header_tabs_search_and_footer.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__list_selection_view__picker_tests__short_browser_keeps_header_tabs_search_and_footer.snapnew file mode 100644index 0000000000..b759cb5e7d--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__list_selection_view__picker_tests__short_browser_keeps_header_tabs_search_and_footer.snap@@ -0,0 +1,52 @@+---+source: tui/src/bottom_pane/selection_picker_tests.rs+expression: "snapshots.join(\"\\n---\\n\")"+---+48×6:++ Keymap+ All Common Customized (3) ›+ Type to search shortcuts+› Action 00 Ctrl+0+ left/right group · enter edit · esc close+---+48×7:++ Keymap+ All configurable shortcuts.+ All Common Customized (3) ›+ Type to search shortcuts+› Action 00 Ctrl+0+ left/right group · enter edit · esc close+---+48×13:++ Keymap+ All configurable shortcuts.++ All Common Customized (3) ›++ Type to search shortcuts++› Action 00 Ctrl+0+ Action 01 Ctrl+1+ Action 02 Ctrl+2+↓+ left/right group · enter edit · esc close+---+24×6:++ Keymap+ All Common ›+ Type to search short+› Action 00 Ctrl+0+ left/right group ·+---+24×7:++ Keymap+ All Common ›+ Type to search short+› Action 00 Ctrl+0+ left/right group ·+ enter edit · esc closediff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__mcp_server_elicitation__tests__mcp_server_elicitation_text_configured_key_chords.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__mcp_server_elicitation__tests__mcp_server_elicitation_text_configured_key_chords.snapindex 4a1435d838..e0b35f4c42 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__mcp_server_elicitation__tests__mcp_server_elicitation_text_configured_key_chords.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__mcp_server_elicitation__tests__mcp_server_elicitation_text_configured_key_chords.snap@@ -10,4 +10,4 @@ expression: snapshot› Type your answer- ctrl + x enter to submit | esc to cancel+ ctrl+x enter to submit | esc to canceldiff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_many_line_message.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_many_line_message.snapindex 65c011c26b..5b1fa9576f 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_many_line_message.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_many_line_message.snap@@ -1,6 +1,5 @@---source: tui/src/bottom_pane/pending_input_preview.rs-assertion_line: 282expression: "format!(\"{buf:?}\")"---Buffer {@@ -11,7 +10,7 @@ Buffer {" a message "," with many "," … ",- " ⌥ + ↑ edit last queued message ",+ " ⌥+↑ edit last queued message ",],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,@@ -25,7 +24,8 @@ Buffer {x: 13, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: DIM | ITALIC,x: 5, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,- x: 34, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 4, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 7, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 32, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_more_than_three_messages.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_more_than_three_messages.snapindex f2506a3646..55001e84c1 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_more_than_three_messages.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_more_than_three_messages.snap@@ -1,6 +1,5 @@---source: tui/src/bottom_pane/pending_input_preview.rs-assertion_line: 253expression: "format!(\"{buf:?}\")"---Buffer {@@ -11,7 +10,7 @@ Buffer {" ↳ This is another message "," ↳ This is a third message "," ↳ This is a fourth message ",- " ⌥ + ↑ edit last queued message ",+ " ⌥+↑ edit last queued message ",],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,@@ -28,7 +27,8 @@ Buffer {x: 0, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 4, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: DIM | ITALIC,x: 28, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,- x: 34, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 4, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 7, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 32, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_multiline_pending_steer_uses_single_prefix_and_truncates.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_multiline_pending_steer_uses_single_prefix_and_truncates.snapindex be89f767a8..93c9397ddb 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_multiline_pending_steer_uses_single_prefix_and_truncates.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_multiline_pending_steer_uses_single_prefix_and_truncates.snap@@ -16,6 +16,8 @@ Buffer {x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 2, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 9, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 12, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 47, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 14, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_message.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_message.snapindex 74e39ed514..c13d75009f 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_message.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_message.snap@@ -1,6 +1,5 @@---source: tui/src/bottom_pane/pending_input_preview.rs-assertion_line: 204expression: "format!(\"{buf:?}\")"---Buffer {@@ -8,7 +7,7 @@ Buffer {content: ["• Queued follow-up inputs "," ↳ Hello, world! ",- " ⌥ + ↑ edit last queued message ",+ " ⌥+↑ edit last queued message ",],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,@@ -16,7 +15,8 @@ Buffer {x: 0, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 4, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM | ITALIC,x: 17, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,- x: 34, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 4, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 7, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 32, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_message_with_shift_left_binding.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_message_with_shift_left_binding.snapindex c79ee32506..887f9d20a6 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_message_with_shift_left_binding.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_message_with_shift_left_binding.snap@@ -1,6 +1,5 @@---source: tui/src/bottom_pane/pending_input_preview.rs-assertion_line: 216expression: "format!(\"{buf:?}\")"---Buffer {@@ -8,7 +7,7 @@ Buffer {content: ["• Queued follow-up inputs "," ↳ Hello, world! ",- " shift + ← edit last queued message ",+ " shift+← edit last queued message ",],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,@@ -16,7 +15,8 @@ Buffer {x: 0, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 4, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM | ITALIC,x: 17, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,- x: 38, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 4, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 11, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 36, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_pending_steer.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_pending_steer.snapindex 9a8e3b96d1..84f04952a7 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_pending_steer.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_pending_steer.snap@@ -13,6 +13,8 @@ Buffer {x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 2, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 9, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 12, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 47, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 20, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_pending_steer_with_remapped_interrupt_binding.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_pending_steer_with_remapped_interrupt_binding.snapindex f8a3caa1bf..41dc3ca7a3 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_pending_steer_with_remapped_interrupt_binding.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_one_pending_steer_with_remapped_interrupt_binding.snap@@ -13,6 +13,8 @@ Buffer {x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 2, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 9, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 12, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 47, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 20, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_pending_steers_above_queued_messages.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_pending_steers_above_queued_messages.snapindex 0321b79d6b..b86b009111 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_pending_steers_above_queued_messages.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_pending_steers_above_queued_messages.snap@@ -1,6 +1,5 @@---source: tui/src/bottom_pane/pending_input_preview.rs-assertion_line: 345expression: "format!(\"{buf:?}\")"---Buffer {@@ -16,12 +15,14 @@ Buffer {" ","• Queued follow-up inputs "," ↳ Queued follow-up question ",- " ⌥ + ↑ edit last queued message ",+ " ⌥+↑ edit last queued message ",],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 2, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 9, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 12, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 47, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 20, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,@@ -36,7 +37,8 @@ Buffer {x: 0, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 4, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM | ITALIC,x: 29, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,- x: 34, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 4, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 7, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 32, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_two_messages.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_two_messages.snapindex 90c4fea4a0..6b5d65e161 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_two_messages.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_two_messages.snap@@ -1,6 +1,5 @@---source: tui/src/bottom_pane/pending_input_preview.rs-assertion_line: 233expression: "format!(\"{buf:?}\")"---Buffer {@@ -9,7 +8,7 @@ Buffer {"• Queued follow-up inputs "," ↳ Hello, world! "," ↳ This is another message ",- " ⌥ + ↑ edit last queued message ",+ " ⌥+↑ edit last queued message ",],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,@@ -20,7 +19,8 @@ Buffer {x: 0, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 4, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: DIM | ITALIC,x: 27, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,- x: 34, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 4, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 7, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 32, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_wrapped_message.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_wrapped_message.snapindex b338f880ac..546e1cdc05 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_wrapped_message.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__pending_input_preview__tests__render_wrapped_message.snap@@ -1,6 +1,5 @@---source: tui/src/bottom_pane/pending_input_preview.rs-assertion_line: 269expression: "format!(\"{buf:?}\")"---Buffer {@@ -10,7 +9,7 @@ Buffer {" ↳ This is a longer message that should"," be wrapped "," ↳ This is another message ",- " ⌥ + ↑ edit last queued message ",+ " ⌥+↑ edit last queued message ",],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,@@ -23,7 +22,8 @@ Buffer {x: 0, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 4, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: DIM | ITALIC,x: 27, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,- x: 34, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 4, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 7, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 32, y: 4, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__question_tests__question_collapsed_countdown.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__question_tests__question_collapsed_countdown.snapindex e2c7d1f56e..fca5693129 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__question_tests__question_collapsed_countdown.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__question_tests__question_collapsed_countdown.snap@@ -3,4 +3,4 @@ source: tui/src/bottom_pane/questions_tests.rsexpression: "pane.question_summary(now).unwrap().iter().map(ToString::to_string).collect::<Vec<_>>().join(\"\\n\")"---? 2 questions · 15s- ⌥ + ↑ to answer+ ⌥+↑ to answerdiff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__selection_tabs__tests__filled_tabs_truncate_unicode_without_hiding_active_tab.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__selection_tabs__tests__filled_tabs_truncate_unicode_without_hiding_active_tab.snapnew file mode 100644index 0000000000..ac7621ad56--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__selection_tabs__tests__filled_tabs_truncate_unicode_without_hiding_active_tab.snap@@ -0,0 +1,9 @@+---+source: tui/src/bottom_pane/selection_tabs_tests.rs+assertion_line: 42+expression: "strips.join(\"\\n\")"+---+…+ 文 …+‹ 文 … ›+‹ 文 件 系 统 p… ›diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__selection_tabs__tests__filled_tabs_window_around_active_tab.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__selection_tabs__tests__filled_tabs_window_around_active_tab.snapnew file mode 100644index 0000000000..9137ec7e8b--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__selection_tabs__tests__filled_tabs_window_around_active_tab.snap@@ -0,0 +1,8 @@+---+source: tui/src/bottom_pane/selection_tabs_tests.rs+assertion_line: 24+expression: "strips.join(\"\\n\")"+---+ All Common ›+‹ Common Customized (3) ›+‹ App Composer Debugdiff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_lowercase_expansion.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_lowercase_expansion.snapindex c88b3aa5c2..c82063275d 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_lowercase_expansion.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_lowercase_expansion.snap@@ -14,7 +14,7 @@ Buffer {],styles: [x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 2, y: 0, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD,+ x: 2, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 14, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 3, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 5, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,@@ -28,9 +28,9 @@ Buffer {x: 4, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 7, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 14, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 8, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 8, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 13, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 27, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 27, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 30, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_scrolled.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_scrolled.snapindex 00789eadc1..0d885191d2 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_scrolled.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__skill_popup__tests__skill_popup_scrolled.snap@@ -1,7 +1,6 @@---source: tui/src/bottom_pane/skill_popup.rs-assertion_line: 289-expression: "render_popup(&popup, /*width*/ 72)"+expression: "render_popup(&popup, 72)"---Buffer {area: Rect { x: 0, y: 0, width: 72, height: 10 },@@ -33,11 +32,11 @@ Buffer {x: 36, y: 5, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 14, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 36, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 2, y: 7, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD,+ x: 2, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 36, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 8, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 8, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 13, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 27, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 27, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 30, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__status_line_style__tests__light_status_line_corrects_pale_custom_theme_colors.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__status_line_style__tests__light_status_line_corrects_pale_custom_theme_colors.snapnew file mode 100644index 0000000000..4312950986--- /dev/null+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__status_line_style__tests__light_status_line_corrects_pale_custom_theme_colors.snap@@ -0,0 +1,19 @@+---+source: tui/src/bottom_pane/status_line_style.rs+assertion_line: 377+expression: "format!(\"{buffer:?}\")"+---+Buffer {+ area: Rect { x: 0, y: 0, width: 42, height: 1 },+ content: [+ "gpt-5 · ~/code · Custom permissions ",+ ],+ styles: [+ x: 0, y: 0, fg: Rgb(131, 116, 93), bg: Reset, underline: Reset, modifier: NONE,+ x: 5, y: 0, fg: Rgb(118, 118, 118), bg: Reset, underline: Reset, modifier: NONE,+ x: 8, y: 0, fg: Rgb(105, 123, 100), bg: Reset, underline: Reset, modifier: NONE,+ x: 14, y: 0, fg: Rgb(118, 118, 118), bg: Reset, underline: Reset, modifier: NONE,+ x: 17, y: 0, fg: Rgb(129, 111, 143), bg: Reset, underline: Reset, modifier: NONE,+ x: 35, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ ]+}diff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__queued_messages_visible_when_status_hidden_snapshot.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__queued_messages_visible_when_status_hidden_snapshot.snapindex dbaad63442..55b21ed7ac 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__queued_messages_visible_when_status_hidden_snapshot.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__queued_messages_visible_when_status_hidden_snapshot.snap@@ -1,11 +1,10 @@---source: tui/src/bottom_pane/mod.rs-assertion_line: 1858expression: "render_snapshot(&pane, area)"---• Queued follow-up inputs↳ Queued follow-up question- ⌥ + ↑ edit last queued message+ ⌥+↑ edit last queued message› Ask Codex to do anythingdiff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__status_and_queued_messages_snapshot.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__status_and_queued_messages_snapshot.snapindex 94f462d835..cae3680319 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__status_and_queued_messages_snapshot.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__status_and_queued_messages_snapshot.snap@@ -1,13 +1,12 @@---source: tui/src/bottom_pane/mod.rs-assertion_line: 1889expression: "render_snapshot(&pane, area)"---• Working (0s • esc to interrupt)• Queued follow-up inputs↳ Queued follow-up question- ⌥ + ↑ edit last queued message+ ⌥+↑ edit last queued message› Ask Codex to do anythingdiff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__status_with_details_and_queued_messages_snapshot.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__status_with_details_and_queued_messages_snapshot.snapindex 4e8763c83d..114c209aef 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__status_with_details_and_queued_messages_snapshot.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__tests__status_with_details_and_queued_messages_snapshot.snap@@ -1,6 +1,5 @@---source: tui/src/bottom_pane/mod.rs-assertion_line: 1826expression: "render_snapshot(&pane, area)"---• Working (0s • esc to interrupt)@@ -9,7 +8,7 @@ expression: "render_snapshot(&pane, area)"• Queued follow-up inputs↳ Queued follow-up question- ⌥ + ↑ edit last queued message+ ⌥+↑ edit last queued message› Ask Codex to do anythingdiff --git a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__user_verification__tests__user_verification_full_screen_bottom.snap b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__user_verification__tests__user_verification_full_screen_bottom.snapindex 3aac1636d8..49abaf8928 100644--- a/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__user_verification__tests__user_verification_full_screen_bottom.snap+++ b/codex-rs/tui/src/bottom_pane/snapshots/codex_tui__bottom_pane__user_verification__tests__user_verification_full_screen_bottom.snap@@ -22,6 +22,14 @@ Buffer {x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 0, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 1, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 4, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 17, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 26, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 37, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 0, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 1, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 2, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 8, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/bottom_pane/status_line_style.rs b/codex-rs/tui/src/bottom_pane/status_line_style.rsindex 3e5fcacb1a..8c44ce425b 100644--- a/codex-rs/tui/src/bottom_pane/status_line_style.rs+++ b/codex-rs/tui/src/bottom_pane/status_line_style.rs@@ -1,13 +1,15 @@//! Theme-derived styling for the configurable footer statusline.-use ratatui::prelude::Stylize;use ratatui::style::Color;use ratatui::style::Style;+use ratatui::style::Styled;use ratatui::text::Line;use ratatui::text::Span;use super::status_line_setup::StatusLineItem;use crate::render::highlight::foreground_style_for_scopes;+use crate::style::readable_color_on;+use crate::style::secondary_text_style;use crate::thread_color::thread_color;use codex_protocol::ThreadId;@@ -112,7 +114,7 @@ wherelet mut spans = Vec::new();for (item, text) in segments {if !spans.is_empty() {- spans.push(STATUS_LINE_SEPARATOR.dim());+ spans.push(STATUS_LINE_SEPARATOR.set_style(secondary_text_style()));}let style = if use_theme_colors&& matches!(@@ -128,7 +130,15 @@ wheretheme_style_for_accent(accent).unwrap_or_else(|| accent.fallback_style()),)} else {- Style::default().dim()+ secondary_text_style()+ };+ let style = if use_theme_colors {+ style.fg(readable_color_on(+ style.fg.unwrap_or(Color::Reset),+ /*background*/ None,+ ))+ } else {+ style};let style = if item == StatusLineItem::PullRequestNumber {style.underlined()@@ -231,7 +241,7 @@ mod tests {}#[test]- fn status_line_segments_dim_separators_and_use_theme_styles_first() {+ fn status_line_segments_use_secondary_separators_and_theme_styles_first() {let line = status_line_from_segments_with_resolver([(StatusLineItem::ModelName, "gpt-5".to_string()),@@ -248,13 +258,13 @@ mod tests {assert_eq!(line.spans[0].style.fg, Some(Color::Red));assert!(!line.spans[0].style.add_modifier.contains(Modifier::DIM));- assert!(line.spans[1].style.add_modifier.contains(Modifier::DIM));+ assert_eq!(line.spans[1].style, secondary_text_style());assert_eq!(line.spans[2].style.fg, Some(Color::Green));assert!(!line.spans[2].style.add_modifier.contains(Modifier::DIM));}#[test]- fn thread_usage_items_share_an_accent_and_dim_separator() {+ fn thread_usage_items_share_an_accent_and_secondary_separator() {let line = status_line_from_segments_with_resolver([(StatusLineItem::ThreadCredits, "5.2 credits".to_string()),@@ -268,7 +278,7 @@ mod tests {assert_eq!(line_text(&line), "5.2 credits · ~$0.21");assert_eq!(line.spans[0].style, line.spans[2].style);- assert!(line.spans[1].style.add_modifier.contains(Modifier::DIM));+ assert_eq!(line.spans[1].style, secondary_text_style());}#[test]@@ -282,7 +292,13 @@ mod tests {).expect("status line");- assert_eq!(line.spans[0].style.fg, Some(Color::Rgb(228, 11, 11)));+ assert_eq!(+ line.spans[0].style.fg,+ Some(readable_color_on(+ Color::Rgb(228, 11, 11),+ /*background*/ None+ ))+ );assert!(!line.spans[0].style.add_modifier.contains(Modifier::DIM));}@@ -300,11 +316,9 @@ mod tests {.expect("status line");assert_eq!(line_text(&line), "gpt-5 · Context 12% used");- assert_eq!(line.spans[0].style.fg, None);- assert!(line.spans[0].style.add_modifier.contains(Modifier::DIM));- assert!(line.spans[1].style.add_modifier.contains(Modifier::DIM));- assert_eq!(line.spans[2].style.fg, None);- assert!(line.spans[2].style.add_modifier.contains(Modifier::DIM));+ assert_eq!(line.spans[0].style, secondary_text_style());+ assert_eq!(line.spans[1].style, secondary_text_style());+ assert_eq!(line.spans[2].style, secondary_text_style());}#[test]@@ -317,14 +331,7 @@ mod tests {).expect("status line");- assert_eq!(line.spans[0].style.fg, None);- assert!(line.spans[0].style.add_modifier.contains(Modifier::DIM));- assert!(- line.spans[0]- .style- .add_modifier- .contains(Modifier::UNDERLINED)- );+ assert_eq!(line.spans[0].style, secondary_text_style().underlined());}#[test]@@ -339,4 +346,45 @@ mod tests {None);}++ #[test]+ fn light_status_line_corrects_pale_custom_theme_colors() {+ use ratatui::buffer::Buffer;+ use ratatui::layout::Rect;+ use ratatui::widgets::Widget;++ let colors = crate::terminal_probe::DefaultColors {+ fg: (30, 30, 30),+ bg: (255, 255, 255),+ };+ crate::terminal_palette::with_test_default_colors(colors, || {+ let line = status_line_from_segments_with_resolver(+ [+ (StatusLineItem::ModelName, "gpt-5".to_string()),+ (StatusLineItem::CurrentDir, "~/code".to_string()),+ (+ StatusLineItem::Permissions,+ "Custom permissions".to_string(),+ ),+ ],+ /*use_theme_colors*/ true,+ /*thread_id*/ None,+ |accent| {+ let rgb = match accent {+ StatusLineAccent::Model => (240, 210, 160),+ StatusLineAccent::Path => (190, 230, 180),+ _ => (215, 180, 240),+ };+ Some(Style::default().fg(crate::terminal_palette::rgb_color(rgb)))+ },+ )+ .expect("status line");+ let area = Rect::new(+ /*x*/ 0, /*y*/ 0, /*width*/ 42, /*height*/ 1,+ );+ let mut buffer = Buffer::empty(area);+ line.render(area, &mut buffer);+ insta::assert_snapshot!(format!("{buffer:?}"));+ });+ }}diff --git a/codex-rs/tui/src/bottom_pane/voice_strip.rs b/codex-rs/tui/src/bottom_pane/voice_strip.rsindex 373ef6a049..a165dc1f62 100644--- a/codex-rs/tui/src/bottom_pane/voice_strip.rs+++ b/codex-rs/tui/src/bottom_pane/voice_strip.rs@@ -105,7 +105,7 @@ impl Renderable for VoiceStrip {|hint| {format!("{} {}",- hint.display_label().replace(" + ", "+"),+ hint.display_label(),if self.state.microphone_muted {"unmute"} else {@@ -123,7 +123,8 @@ impl Renderable for VoiceStrip {{status.spans.pop();}- let controls = if can_mute && available > status.width() + full_controls.width() {+ let show_full_controls = can_mute && available > status.width() + full_controls.width();+ let controls = if show_full_controls {full_controls.as_str()} else {"/voice stop"@@ -135,7 +136,16 @@ impl Renderable for VoiceStrip {" ".repeat(available.saturating_sub(status.width() + controls.width())).into(),);- status.spans.push(controls.dim());+ if show_full_controls && let Some(hint) = self.state.mute_hint {+ status.spans.extend(hint.spans());+ status.spans.push(if self.state.microphone_muted {+ " unmute /voice stop".dim()+ } else {+ " mute /voice stop".dim()+ });+ } else {+ status.spans.push(controls.dim());+ }Paragraph::new(status).render(Rect::new(area.x, area.y, area.width, /*height*/ 1), buf);if area.height < 2 {return;diff --git a/codex-rs/tui/src/chatwidget/plugin_catalog.rs b/codex-rs/tui/src/chatwidget/plugin_catalog.rsindex c46d32e0c2..d87b051e08 100644--- a/codex-rs/tui/src/chatwidget/plugin_catalog.rs+++ b/codex-rs/tui/src/chatwidget/plugin_catalog.rs@@ -406,7 +406,8 @@ impl ChatWidget {Span::from(key_hint::plain(KeyCode::Enter))," select".dim()," · ".into(),- "esc close".dim(),+ Span::from(key_hint::plain(KeyCode::Esc)),+ " close".dim(),])),items: vec![SelectionItem {diff --git a/codex-rs/tui/src/chatwidget/rendering.rs b/codex-rs/tui/src/chatwidget/rendering.rsindex 103ea9642c..2b4e7af633 100644--- a/codex-rs/tui/src/chatwidget/rendering.rs+++ b/codex-rs/tui/src/chatwidget/rendering.rs@@ -99,19 +99,16 @@ impl ExternalWriterNotice {} else {quit_keys.insert(/*index*/ 0, escape);}- items.push((quit_keys.join("/").replace(" + ", "+"), "exit".to_string()));+ items.push((quit_keys.join("/"), "exit".to_string()));if let Some(hint) = self.transcript_hint {- items.push((- hint.display_label().replace(" + ", "+"),- "transcript".to_string(),- ));+ items.push((hint.display_label(), "transcript".to_string()));}let mut spans = vec![" ".set_style(crate::style::footer_hint_label_style())];for (idx, (key, label)) in items.into_iter().enumerate() {if idx > 0 {spans.push(" ".set_style(crate::style::footer_hint_label_style()));}- spans.push(key.set_style(crate::style::footer_hint_key_style()));+ spans.extend(crate::key_hint::key_label_spans(&key));spans.push(format!(" {label}").set_style(crate::style::footer_hint_label_style()));}word_wrap_lines(&[Line::from(spans)], usize::from(width))diff --git a/codex-rs/tui/src/chatwidget/rendering_tests.rs b/codex-rs/tui/src/chatwidget/rendering_tests.rsindex 333f3146f6..589f08b13a 100644--- a/codex-rs/tui/src/chatwidget/rendering_tests.rs+++ b/codex-rs/tui/src/chatwidget/rendering_tests.rs@@ -80,12 +80,17 @@ async fn external_writer_view_shows_notice_instead_of_composer() {let (mut widget, _sender, _events, _operations) = make_chatwidget_manual_with_sender().await;widget.show_external_writer_thread();- let frame = crate::terminal_palette::with_test_default_colors(+ let (frame, label_style) = crate::terminal_palette::with_test_default_colors(crate::terminal_probe::DefaultColors {fg: (230, 230, 230),bg: (20, 20, 20),},- || render_frame(&widget, /*width*/ 60),+ || {+ (+ render_frame(&widget, /*width*/ 60),+ crate::style::footer_hint_label_style(),+ )+ },);let rows: Vec<String> = frame.content@@ -100,17 +105,13 @@ async fn external_writer_view_shows_notice_instead_of_composer() {);assert_ne!(frame[(0, 1)].bg, ratatui::style::Color::Reset);assert_eq!(frame[(0, 1)].bg, frame[(59, 4)].bg);- assert!(- !frame[(3, 5)]- .style()- .add_modifier- .intersects(ratatui::style::Modifier::DIM | ratatui::style::Modifier::BOLD)- );- assert!(- frame[(5, 5)]- .style()- .add_modifier- .contains(ratatui::style::Modifier::DIM)+ assert_eq!(frame[(3, 5)].modifier, ratatui::style::Modifier::BOLD);+ assert_eq!(+ (frame[(5, 5)].fg, frame[(5, 5)].modifier),+ (+ label_style.fg.unwrap_or(ratatui::style::Color::Reset),+ ratatui::style::Modifier::empty(),+ ),);assert!(!widget.bottom_pane.composer_input_enabled());}diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__exec_approval_modal_exec.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__exec_approval_modal_exec.snapindex 3086586b11..88c3f51b35 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__exec_approval_modal_exec.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__exec_approval_modal_exec.snap@@ -1,6 +1,5 @@---source: tui/src/chatwidget/tests/exec_flow.rs-assertion_line: 40expression: "format!(\"{buf:?}\")"---Buffer {@@ -31,10 +30,14 @@ Buffer {x: 4, y: 7, fg: Rgb(137, 180, 250), bg: Reset, underline: Reset, modifier: NONE,x: 8, y: 7, fg: Rgb(205, 214, 244), bg: Reset, underline: Reset, modifier: NONE,x: 20, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 9, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD,+ x: 0, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 21, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 48, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 48, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 51, y: 10, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 2, y: 12, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 8, y: 12, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 13, y: 12, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 28, y: 12, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 31, y: 12, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,]}diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup_configured_key_chords.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup_configured_key_chords.snapindex 667b48d69d..e0a3ed0cc3 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup_configured_key_chords.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__experimental_features_popup_configured_key_chords.snap@@ -8,4 +8,4 @@ expression: popup› [x] Shell tool Allow the model to run shell commands.- Press space to select or ctrl + x enter to save+ Press space to select or ctrl+x enter to savediff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__hidden_shell_paste_queued_preview.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__hidden_shell_paste_queued_preview.snapindex 6e4ac1c491..aa68492600 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__hidden_shell_paste_queued_preview.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__hidden_shell_paste_queued_preview.snap@@ -1,12 +1,12 @@---source: tui/src/chatwidget/tests/composer_submission.rs-expression: normalize_snapshot_paths(render_bottom_popup(&chat, 80))+expression: "normalize_snapshot_paths(render_bottom_popup(&chat, 80))"---• Working (0s • esc to interrupt)• Queued follow-up inputs↳ [Pasted Content 1006 chars]- ⌥ + ↑ edit last queued message+ ⌥+↑ edit last queued message› Ask Codex to do anythingdiff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__image_preparation_disconnected.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__image_preparation_disconnected.snapindex a4ffa9634d..2295e42b63 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__image_preparation_disconnected.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__image_preparation_disconnected.snap@@ -1,14 +1,13 @@---source: tui/src/chatwidget/tests/composer_submission.rs-assertion_line: 2750-expression: "normalize_snapshot_paths(render_bottom_popup(&chat, 80))"+expression: "normalize_snapshot_paths(render_bottom_popup(&chat, 80)).replace('◦', \"•\")"---• Reconnect failed — check the endpoint, then relaunch (0s)• Queued follow-up inputs↳ x- ⌥ + ↑ edit last queued message+ ⌥+↑ edit last queued message› describe- ctrl+c quit+ ctrl+c quitdiff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__image_preparation_in_progress.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__image_preparation_in_progress.snapindex c634c4bca6..95cd946f14 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__image_preparation_in_progress.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__image_preparation_in_progress.snap@@ -1,11 +1,10 @@---source: tui/src/chatwidget/tests/composer_submission.rs-assertion_line: 2689expression: "normalize_snapshot_paths(render_bottom_popup(&chat, 80))"---• Queued follow-up inputs↳ Preparing images: describe- ⌥ + ↑ edit last queued message+ ⌥+↑ edit last queued message› xdiff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_preserves_status_line.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_preserves_status_line.snapindex 38142b596c..2729a2ce3e 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_preserves_status_line.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_preserves_status_line.snap@@ -6,4 +6,4 @@ expression: terminal.backend()" ""› Ask a follow-up question "" "-" GPT-5.6-Sol Side from main thread · ctrl + / to switch · ctrl + c to close "+" GPT-5.6-Sol Side from main thread · ctrl+/ to switch · ctrl+c to close "diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_hidden_side.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_hidden_side.snapindex a698e57d44..51133a16e5 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_hidden_side.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_hidden_side.snap@@ -6,4 +6,4 @@ expression: terminal.backend()" ""› Ask Codex to do anything "" "-" GPT-5.6-Sol ctrl + / for side "+" GPT-5.6-Sol ctrl+/ for side "diff --git a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_parent_status.snap b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_parent_status.snapindex b873d754c3..47258c1616 100644--- a/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_parent_status.snap+++ b/codex-rs/tui/src/chatwidget/snapshots/codex_tui__chatwidget__tests__side_context_label_shows_parent_status.snap@@ -6,4 +6,4 @@ expression: terminal.backend()" ""› Ask a follow-up question "" "-" Side from main thread · main needs input · ctrl + / to switch · ctrl + c to cl"+" Side from main thread · main needs input · ctrl+/ to switch · ctrl+c to close "diff --git a/codex-rs/tui/src/chatwidget/tests/side.rs b/codex-rs/tui/src/chatwidget/tests/side.rsindex c4261a3aef..dfff33a65e 100644--- a/codex-rs/tui/src/chatwidget/tests/side.rs+++ b/codex-rs/tui/src/chatwidget/tests/side.rs@@ -389,7 +389,7 @@ async fn side_context_label_preserves_status_line_snapshot() {chat.refresh_status_line();chat.set_side_conversation_active(/*active*/ true);chat.set_side_conversation_context_label(Some(- "Side from main thread · ctrl + / to switch · ctrl + c to close".to_string(),+ "Side from main thread · ctrl+/ to switch · ctrl+c to close".to_string(),));let width = 80;@@ -410,8 +410,7 @@ async fn side_context_label_shows_parent_status_snapshot() {chat.show_welcome_banner = false;chat.set_side_conversation_active(/*active*/ true);chat.set_side_conversation_context_label(Some(- "Side from main thread · main needs input · ctrl + / to switch · ctrl + c to close"- .to_string(),+ "Side from main thread · main needs input · ctrl+/ to switch · ctrl+c to close".to_string(),));let width = 80;@@ -429,7 +428,7 @@ async fn side_context_label_shows_hidden_side_snapshot() {chat.show_welcome_banner = false;chat.local_settings.tui.status_line = Some(vec!["model-name".to_string()]);chat.refresh_status_line();- chat.set_side_conversation_context_label(Some("ctrl + / for side".to_string()));+ chat.set_side_conversation_context_label(Some("ctrl+/ for side".to_string()));let width = 80;let height = chat.desired_height(width);@@ -437,12 +436,19 @@ async fn side_context_label_shows_hidden_side_snapshot() {terminal.draw(|f| chat.render(f.area(), f.buffer_mut())).expect("draw hidden side conversation footer");- let hint_start = width - "ctrl + / for side".len() as u16 - 2;+ let hint_start = width - "ctrl+/ for side".len() as u16 - 2;+ let key_style = crate::key_hint::ctrl(KeyCode::Char('/')).spans()[0].style;+ let secondary_style = crate::style::secondary_text_style();+ let styles = [hint_start, hint_start + 4, hint_start + 5, hint_start + 7].map(|x| {+ let cell = &terminal.backend().buffer()[(x, height - 1)];+ (cell.fg, cell.modifier)+ });assert_eq!(- terminal.backend().buffer()[(hint_start, height - 1)]- .style()- .fg,- Some(ratatui::style::Color::Magenta)+ styles,+ [key_style, key_style, key_style, secondary_style].map(|style| (+ style.fg.unwrap_or(ratatui::style::Color::Reset),+ style.add_modifier,+ )),);assert_chatwidget_snapshot!("side_context_label_shows_hidden_side", terminal.backend());}diff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__approval_requests__exec_approval_modal_exec.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__approval_requests__exec_approval_modal_exec.snapindex fbb12551fd..c4065bddcd 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__approval_requests__exec_approval_modal_exec.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__approval_requests__exec_approval_modal_exec.snap@@ -34,10 +34,14 @@ Buffer {x: 4, y: 9, fg: Rgb(137, 180, 250), bg: Reset, underline: Reset, modifier: NONE,x: 8, y: 9, fg: Rgb(205, 214, 244), bg: Reset, underline: Reset, modifier: NONE,x: 20, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 11, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD,+ x: 0, y: 11, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 21, y: 11, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 48, y: 12, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 48, y: 12, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 51, y: 12, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 2, y: 14, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 8, y: 14, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 13, y: 14, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 28, y: 14, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 31, y: 14, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,]}diff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__approval_requests__write_stdin_approval_modal.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__approval_requests__write_stdin_approval_modal.snapindex e0108c8d80..f0f0860b9d 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__approval_requests__write_stdin_approval_modal.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__approval_requests__write_stdin_approval_modal.snap@@ -1,6 +1,5 @@---source: tui/src/chatwidget/tests/approval_requests.rs-assertion_line: 123expression: "format!(\"{buf:?}\")"---Buffer {@@ -21,10 +20,14 @@ Buffer {x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 2, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 46, y: 2, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 0, y: 6, fg: Cyan, bg: Reset, underline: Reset, modifier: BOLD,+ x: 0, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 21, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,- x: 48, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 48, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,x: 51, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 2, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 8, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 13, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 28, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 31, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,]}diff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__async_question_answered_on_another_client.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__async_question_answered_on_another_client.snapindex f86a62f1aa..e2206d6079 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__async_question_answered_on_another_client.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__async_question_answered_on_another_client.snap@@ -1,6 +1,6 @@---source: tui/src/chatwidget/tests/questions_tests.rs-assertion_line: 859+assertion_line: 937expression: "render_bottom_popup(&chat, 80)"---• Queued follow-up inputs@@ -9,4 +9,4 @@ expression: "render_bottom_popup(&chat, 80)"My draft for the second question- enter submit ctrl + ] skip ⌥ + ↓ main prompt+ enter submit ctrl+] skip ⌥+↓ main promptdiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__freeform_question.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__freeform_question.snapindex b9c75d6b4f..e1c6e93803 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__freeform_question.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__freeform_question.snap@@ -10,4 +10,4 @@ expression: "render_bottom_popup(&chat, 80)"Type your answer- enter submit ctrl + ] skip ⌥ + ↓ main prompt ⌥ + ↑ next question+ enter submit ctrl+] skip ⌥+↓ main prompt ⌥+↑ next questiondiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__last_question_with_queue.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__last_question_with_queue.snapindex ecbc196c65..e905f75705 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__last_question_with_queue.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__last_question_with_queue.snap@@ -12,4 +12,4 @@ expression: "render_bottom_popup(&chat, 80)"› 1. Next2. Other- enter submit ctrl + ] skip ⌥ + ↓ prev question ⌥ + ↑ queued messages+ enter submit ctrl+] skip ⌥+↓ prev question ⌥+↑ queued messagesdiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__named_question.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__named_question.snapindex 87414206b1..80904e34cf 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__named_question.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__named_question.snap@@ -14,4 +14,4 @@ expression: "render_bottom_popup(&chat, 80)"xxxxxxxxxxxxxxxx but do not deploy2. Other- enter submit ctrl + ] skip ⌥ + ↓ main prompt+ enter submit ctrl+] skip ⌥+↓ main promptdiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__oversized_question.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__oversized_question.snapindex b947b63341..90a3db2310 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__oversized_question.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__oversized_question.snap@@ -8,4 +8,4 @@ expression: "render_bottom_popup(&chat, 80)"Type your answer- enter submit ctrl + ] skip ⌥ + ↓ main prompt+ enter submit ctrl+] skip ⌥+↓ main promptdiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_queue_hint_Left.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_queue_hint_Left.snapindex 0f7f959118..156892cad4 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_queue_hint_Left.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_queue_hint_Left.snap@@ -11,4 +11,4 @@ expression: "render_bottom_popup(&chat, 100)"Type your answer- enter submit ctrl + ] skip ⌥ + ↓ main prompt shift + ← next question+ enter submit ctrl+] skip ⌥+↓ main prompt shift+← next questiondiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_queue_hint_Up.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_queue_hint_Up.snapindex b763a8e4d0..0a07dbe628 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_queue_hint_Up.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_queue_hint_Up.snap@@ -11,4 +11,4 @@ expression: "render_bottom_popup(&chat, 100)"Type your answer- enter submit ctrl + ] skip ⌥ + ↓ main prompt ⌥ + ↑ next question+ enter submit ctrl+] skip ⌥+↓ main prompt ⌥+↑ next questiondiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_vim_other.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_vim_other.snapindex edd012bc22..a8d5be4d7c 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_vim_other.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_vim_other.snap@@ -11,7 +11,7 @@ NORMAL› 2. alpha betaalpha gammaVim: Normal- enter submit ctrl + ] skip ⌥ + ↓ main prompt+ enter submit ctrl+] skip ⌥+↓ main promptSEARCH• Queued follow-up inputs@@ -23,4 +23,4 @@ SEARCHalpha gamma/gammaVim: Normal- enter submit ctrl + ] skip ⌥ + ↓ main prompt+ enter submit ctrl+] skip ⌥+↓ main promptdiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_vim_single.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_vim_single.snapindex d3d3a11b84..bc7b8bf14b 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_vim_single.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__question_vim_single.snap@@ -10,7 +10,7 @@ NORMALalpha betaalpha gammaVim: Normal- enter submit ctrl + ] skip ⌥ + ↓ main prompt+ enter submit ctrl+] skip ⌥+↓ main promptSEARCH• Queued follow-up inputs@@ -21,4 +21,4 @@ SEARCHalpha gamma/gammaVim: Normal- enter submit ctrl + ] skip ⌥ + ↓ main prompt+ enter submit ctrl+] skip ⌥+↓ main promptdiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__questions_with_status_and_queue.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__questions_with_status_and_queue.snapindex 4301031993..6ce74d9a83 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__questions_with_status_and_queue.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__questions_with_status_and_queue.snap@@ -11,4 +11,4 @@ OPENONLY QUESTIONS• Queued follow-up inputs? 2 questions- ⌥ + ↑ to answer+ ⌥+↑ to answerdiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__queued_async_question_reply.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__queued_async_question_reply.snapindex e8ca16fffa..ba162e47e1 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__queued_async_question_reply.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__queued_async_question_reply.snap@@ -1,6 +1,6 @@---source: tui/src/chatwidget/tests/questions_tests.rs-assertion_line: 55+assertion_line: 51expression: "render_bottom_popup(&chat, 80)"---• Queued follow-up inputs@@ -12,4 +12,4 @@ expression: "render_bottom_popup(&chat, 80)"Type your answer- enter submit ctrl + ] skip ⌥ + ↓ main prompt ⌥ + ↑ queued messages+ enter submit ctrl+] skip ⌥+↓ main prompt ⌥+↑ queued messagesdiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__single_question_working_spacing.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__single_question_working_spacing.snapindex afab6e15be..be181f5135 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__single_question_working_spacing.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__questions_tests__single_question_working_spacing.snap@@ -10,4 +10,4 @@ expression: renderedA typed answer- enter submit ctrl + ] skip ⌥ + ↓ main prompt+ enter submit ctrl+] skip ⌥+↓ main promptdiff --git a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__status_surface_previews__thread_color_preview_matches_footer_while_auto_naming.snap b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__status_surface_previews__thread_color_preview_matches_footer_while_auto_naming.snapindex b679f1889c..a2a15b229c 100644--- a/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__status_surface_previews__thread_color_preview_matches_footer_while_auto_naming.snap+++ b/codex-rs/tui/src/chatwidget/tests/snapshots/codex_tui__chatwidget__tests__status_surface_previews__thread_color_preview_matches_footer_while_auto_naming.snap@@ -2,7 +2,7 @@source: tui/src/chatwidget/tests/status_surface_previews.rsexpression: "snapshot.join(\"\\n\")"----pending=false colors=true: Line::from_iter([Span::from("Named task").fg(Color::Rgb(242, 205, 205)), Span::from(" · ").dim(), Span::from("Named task").fg(Color::Rgb(242, 205, 205))])-pending=false colors=false: Line::from_iter([Span::from("Named task").dim(), Span::from(" · ").dim(), Span::from("Named task").dim()])-pending=true colors=true: Line::from_iter([Span::from("Named task ⠋").fg(Color::Rgb(242, 205, 205)), Span::from(" · ").dim(), Span::from("Named task ⠋").fg(Color::Rgb(242, 205, 205))])-pending=true colors=false: Line::from_iter([Span::from("Named task ⠋").dim(), Span::from(" · ").dim(), Span::from("Named task ⠋").dim()])+pending=false colors=true: Line::from_iter([Span::from("Named task").fg(Color::Rgb(242, 205, 205)), Span::from(" · ").fg(Color::Rgb(140, 140, 140)).not_bold().not_dim(), Span::from("Named task").fg(Color::Rgb(242, 205, 205))])+pending=false colors=false: Line::from_iter([Span::from("Named task").fg(Color::Rgb(140, 140, 140)).not_bold().not_dim(), Span::from(" · ").fg(Color::Rgb(140, 140, 140)).not_bold().not_dim(), Span::from("Named task").fg(Color::Rgb(140, 140, 140)).not_bold().not_dim()])+pending=true colors=true: Line::from_iter([Span::from("Named task ⠋").fg(Color::Rgb(242, 205, 205)), Span::from(" · ").fg(Color::Rgb(140, 140, 140)).not_bold().not_dim(), Span::from("Named task ⠋").fg(Color::Rgb(242, 205, 205))])+pending=true colors=false: Line::from_iter([Span::from("Named task ⠋").fg(Color::Rgb(140, 140, 140)).not_bold().not_dim(), Span::from(" · ").fg(Color::Rgb(140, 140, 140)).not_bold().not_dim(), Span::from("Named task ⠋").fg(Color::Rgb(140, 140, 140)).not_bold().not_dim()])diff --git a/codex-rs/tui/src/chatwidget/tests/status_surface_previews.rs b/codex-rs/tui/src/chatwidget/tests/status_surface_previews.rsindex df2dfceea7..60c741562a 100644--- a/codex-rs/tui/src/chatwidget/tests/status_surface_previews.rs+++ b/codex-rs/tui/src/chatwidget/tests/status_surface_previews.rs@@ -15,30 +15,38 @@ fn line_text(line: Line<'static>) -> String {#[tokio::test]async fn thread_color_preview_matches_footer_while_auto_naming() {let (mut chat, _rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;- let id = ThreadId::from_u128(/*value*/ 42);- chat.thread_id = Some(id);- chat.local_settings.tui.animations = false;- chat.thread_name = Some("Named task".into());- let items = [StatusLineItem::ThreadName, StatusLineItem::ThreadTitle];- let mut snapshot = Vec::new();- for pending in [false, true] {- chat.set_thread_title_generation_pending(pending);- let preview = chat.status_surface_preview_data();- for use_colors in [true, false] {- let line = preview.status_line_for_items(items, use_colors).unwrap();- let footer = crate::bottom_pane::status_line_from_segments(- items- .into_iter()- .map(|item| (item, chat.status_line_value_for_item(item).unwrap())),- use_colors,- Some(id),- )- .unwrap();- assert_eq!(line, footer);- snapshot.push(format!("pending={pending} colors={use_colors}: {line:?}"));- }- }- insta::assert_snapshot!(snapshot.join("\n"));+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),+ },+ || {+ let id = ThreadId::from_u128(/*value*/ 42);+ chat.thread_id = Some(id);+ chat.local_settings.tui.animations = false;+ chat.thread_name = Some("Named task".into());+ let items = [StatusLineItem::ThreadName, StatusLineItem::ThreadTitle];+ let mut snapshot = Vec::new();+ for pending in [false, true] {+ chat.set_thread_title_generation_pending(pending);+ let preview = chat.status_surface_preview_data();+ for use_colors in [true, false] {+ let line = preview.status_line_for_items(items, use_colors).unwrap();+ let footer = crate::bottom_pane::status_line_from_segments(+ items+ .into_iter()+ .map(|item| (item, chat.status_line_value_for_item(item).unwrap())),+ use_colors,+ Some(id),+ )+ .unwrap();+ assert_eq!(line, footer);+ snapshot.push(format!("pending={pending} colors={use_colors}: {line:?}"));+ }+ }+ insta::assert_snapshot!(snapshot.join("\n"));+ },+ );}fn status_preview_line_option(chat: &mut ChatWidget, items: &[StatusLineItem]) -> Option<String> {diff --git a/codex-rs/tui/src/diff_render.rs b/codex-rs/tui/src/diff_render.rsindex ef7a8a4249..4b38252190 100644--- a/codex-rs/tui/src/diff_render.rs+++ b/codex-rs/tui/src/diff_render.rs@@ -29,8 +29,10 @@//!//! **Wrapping:** long lines are hard-wrapped at the available column width.//! Syntax-highlighted spans are split at character boundaries with styles-//! preserved across the split so that no color information is lost.+//! preserved across the split so that no color information is lost. Theme foregrounds+//! are resolved against the painted diff fill, without dimming corrected syntax colors.+use crate::style::readable_color_on;use diffy::Hunk;use ratatui::buffer::Buffer;use ratatui::layout::Rect;@@ -827,8 +829,8 @@ pub(crate) fn push_wrapped_diff_line_with_style_context(////// Like [`push_wrapped_diff_line_with_style_context`] but overlays/// `syntax_spans` (from [`highlight_code_to_styled_spans`]) onto the diff-/// coloring. Delete lines receive a `DIM` modifier so syntax colors do not-/// overpower the removal cue.+/// coloring. Syntax foregrounds retain their hue while meeting contrast against the+/// painted diff background; dimming is removed so it cannot undo that correction.pub(crate) fn push_wrapped_diff_line_with_syntax_and_style_context(line_number: usize,kind: DiffLineType,@@ -891,19 +893,21 @@ fn push_wrapped_diff_line_inner_with_theme_and_color_level(}// When we have syntax spans, compose them with the diff style for a richer- // view. The sign character keeps the diff color; content gets syntax colors- // with an overlay modifier for delete lines (dim).+ // view. The sign keeps the diff color while syntax foregrounds are resolved+ // against the actual fill. Dimming must not undo their measured contrast.if let Some(syn_spans) = syntax_spans {let gutter = format!("{ln_str:>gutter_width$} ");let sign = format!("{sign_char}");let styled: Vec<RtSpan<'static>> = syn_spans.iter().map(|sp| {- let style = if matches!(kind, DiffLineType::Delete) {- sp.style.add_modifier(Modifier::DIM)- } else {- sp.style- };+ let style = sp+ .style+ .fg(readable_color_on(+ sp.style.fg.unwrap_or(Color::Reset),+ line_bg.bg,+ ))+ .remove_modifier(Modifier::DIM);RtSpan::styled(sp.content.clone().into_owned(), style)}).collect();@@ -935,6 +939,10 @@ fn push_wrapped_diff_line_inner_with_theme_and_color_level(}let available_content_cols = width.saturating_sub(prefix_cols + 1).max(1);+ let content_style = content_style.fg(readable_color_on(+ content_style.fg.unwrap_or(Color::Reset),+ line_bg.bg,+ ));let styled = vec![RtSpan::styled(text.to_string(), content_style)];let wrapped_chunks = wrap_styled_spans(&styled, available_content_cols);@@ -1338,6 +1346,61 @@ mod tests {use ratatui::widgets::Paragraph;use ratatui::widgets::Wrap;+ #[test]+ fn syntax_colors_follow_the_actual_diff_background() {+ use ratatui::buffer::Buffer;+ use ratatui::layout::Rect;+ use ratatui::widgets::Widget;++ let colors = crate::terminal_probe::DefaultColors {+ fg: (30, 30, 30),+ bg: (255, 255, 255),+ };+ crate::terminal_palette::with_test_default_colors(colors, || {+ let spans = [+ RtSpan::from("let value = 1;")+ .fg(rgb_color((235, 210, 170)))+ .dim(),+ RtSpan::from(" plain"),+ RtSpan::from(" reset").fg(Color::Reset),+ ];+ let style = DiffRenderStyleContext {+ theme: DiffTheme::Light,+ color_level: DiffColorLevel::TrueColor,+ diff_backgrounds: ResolvedDiffBackgrounds {+ add: Some(rgb_color((220, 250, 230))),+ del: Some(rgb_color((55, 25, 35))),+ },+ };+ let lines = [DiffLineType::Insert, DiffLineType::Delete]+ .into_iter()+ .flat_map(|kind| {+ push_wrapped_diff_line_with_syntax_and_style_context(+ /*line_number*/ 1,+ kind,+ "let value = 1; plain reset",+ /*width*/ 40,+ /*line_number_width*/ 1,+ &spans,+ style,+ )+ })+ .collect::<Vec<_>>();+ let area = Rect::new(+ /*x*/ 0, /*y*/ 0, /*width*/ 40, /*height*/ 2,+ );+ let mut buffer = Buffer::empty(area);+ Paragraph::new(lines).render(area, &mut buffer);+ assert!(!buffer[(3, 0)].modifier.contains(Modifier::DIM));+ assert!(!buffer[(3, 1)].modifier.contains(Modifier::DIM));+ assert_eq!(buffer[(3, 1)].fg, rgb_color((235, 210, 170)));+ assert_ne!(buffer[(3, 0)].fg, buffer[(3, 1)].fg);+ assert_ne!(buffer[(18, 0)].fg, buffer[(18, 1)].fg);+ assert_ne!(buffer[(24, 0)].fg, buffer[(24, 1)].fg);+ assert_snapshot!(format!("{buffer:?}"));+ });+ }+#[test]fn ansi16_add_style_uses_foreground_only() {let style = style_add(@@ -2248,61 +2311,78 @@ mod tests {#[test]fn add_diff_uses_path_extension_for_highlighting() {- let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();- changes.insert(- PathBuf::from("highlight_add.rs"),- FileChange::Add {- content: "pub fn sum(a: i32, b: i32) -> i32 { a + b }\n".to_string(),+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),},- );+ || {+ let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();+ changes.insert(+ PathBuf::from("highlight_add.rs"),+ FileChange::Add {+ content: "pub fn sum(a: i32, b: i32) -> i32 { a + b }\n".to_string(),+ },+ );- let lines = create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 80);- let has_rgb = lines.iter().any(|line| {- line.spans- .iter()- .any(|s| matches!(s.style.fg, Some(ratatui::style::Color::Rgb(..))))- });- assert!(- has_rgb,- "add diff for .rs file should produce syntax-highlighted (RGB) spans"+ let lines =+ create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 80);+ let has_rgb = lines.iter().any(|line| {+ line.spans+ .iter()+ .any(|s| matches!(s.style.fg, Some(ratatui::style::Color::Rgb(..))))+ });+ assert!(+ has_rgb,+ "add diff for .rs file should produce syntax-highlighted (RGB) spans"+ );+ },);}#[test]fn cpp_module_extensions_use_cpp_highlighting() {- let highlighted_tokens = [- "cpp",- // CUDA source and header extensions use C++ highlighting as a fallback.- "cu", "cuh", "cppm", "CPPM", "cxxm", "CxXm", "ixx", "IXX",- ]- .into_iter()- .map(|extension| {- let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();- changes.insert(- PathBuf::from(format!("math.{extension}")),- FileChange::Add {- content:- "export module math;\nexport int sum(int a, int b) { return a + b; }\n"- .to_string(),- },- );+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),+ },+ || {+ let highlighted_tokens = [+ "cpp",+ // CUDA source and header extensions use C++ highlighting as a fallback.+ "cu", "cuh", "cppm", "CPPM", "cxxm", "CxXm", "ixx", "IXX",+ ]+ .into_iter()+ .map(|extension| {+ let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();+ changes.insert(+ PathBuf::from(format!("math.{extension}")),+ FileChange::Add {+ content:+ "export module math;\nexport int sum(int a, int b) { return a + b; }\n"+ .to_string(),+ },+ );- let lines = create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 80);- let rgb_tokens = lines- .iter()- .flat_map(|line| &line.spans)- .filter(|span| matches!(span.style.fg, Some(ratatui::style::Color::Rgb(..))))- .map(|span| span.content.to_string())+ let lines = create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 80);+ let rgb_tokens = lines+ .iter()+ .flat_map(|line| &line.spans)+ .filter(|span| matches!(span.style.fg, Some(ratatui::style::Color::Rgb(..))))+ .map(|span| span.content.to_string())+ .collect::<Vec<_>>();+ assert!(+ !rgb_tokens.is_empty(),+ "add diff for .{extension} file should produce syntax-highlighted (RGB) spans"+ );+ (extension, rgb_tokens.join("|"))+ }).collect::<Vec<_>>();- assert!(- !rgb_tokens.is_empty(),- "add diff for .{extension} file should produce syntax-highlighted (RGB) spans"- );- (extension, rgb_tokens.join("|"))- })- .collect::<Vec<_>>();- assert_debug_snapshot!("cpp_module_extension_highlighting", highlighted_tokens);+ assert_debug_snapshot!("cpp_module_extension_highlighting", highlighted_tokens);+ },+ );}#[test]@@ -2325,23 +2405,32 @@ mod tests {#[test]fn delete_diff_uses_path_extension_for_highlighting() {- let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();- changes.insert(- PathBuf::from("highlight_delete.py"),- FileChange::Delete {- content: "def scale(x):\n return x * 2\n".to_string(),+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),},- );+ || {+ let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();+ changes.insert(+ PathBuf::from("highlight_delete.py"),+ FileChange::Delete {+ content: "def scale(x):\n return x * 2\n".to_string(),+ },+ );- let lines = create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 80);- let has_rgb = lines.iter().any(|line| {- line.spans- .iter()- .any(|s| matches!(s.style.fg, Some(ratatui::style::Color::Rgb(..))))- });- assert!(- has_rgb,- "delete diff for .py file should produce syntax-highlighted (RGB) spans"+ let lines =+ create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 80);+ let has_rgb = lines.iter().any(|line| {+ line.spans+ .iter()+ .any(|s| matches!(s.style.fg, Some(ratatui::style::Color::Rgb(..))))+ });+ assert!(+ has_rgb,+ "delete diff for .py file should produce syntax-highlighted (RGB) spans"+ );+ },);}@@ -2532,69 +2621,88 @@ mod tests {#[test]fn rename_diff_uses_destination_extension_for_highlighting() {- // A rename from an unknown extension to .rs should highlight as Rust.- // Without the fix, detect_lang_for_path uses the source path (.xyzzy),- // which has no syntax definition, so highlighting is skipped.- let original = "fn main() {}\n";- let modified = "fn main() { println!(\"hi\"); }\n";- let patch = diffy::create_patch(original, modified).to_string();-- let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();- changes.insert(- PathBuf::from("foo.xyzzy"),- FileChange::Update {- unified_diff: patch,- move_path: Some(PathBuf::from("foo.rs")),+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),},- );+ || {+ // A rename from an unknown extension to .rs should highlight as Rust.+ // Without the fix, detect_lang_for_path uses the source path (.xyzzy),+ // which has no syntax definition, so highlighting is skipped.+ let original = "fn main() {}\n";+ let modified = "fn main() { println!(\"hi\"); }\n";+ let patch = diffy::create_patch(original, modified).to_string();++ let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();+ changes.insert(+ PathBuf::from("foo.xyzzy"),+ FileChange::Update {+ unified_diff: patch,+ move_path: Some(PathBuf::from("foo.rs")),+ },+ );- let lines = create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 80);- let has_rgb = lines.iter().any(|line| {- line.spans- .iter()- .any(|s| matches!(s.style.fg, Some(ratatui::style::Color::Rgb(..))))- });- assert!(- has_rgb,- "rename from .xyzzy to .rs should produce syntax-highlighted (RGB) spans"+ let lines =+ create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 80);+ let has_rgb = lines.iter().any(|line| {+ line.spans+ .iter()+ .any(|s| matches!(s.style.fg, Some(ratatui::style::Color::Rgb(..))))+ });+ assert!(+ has_rgb,+ "rename from .xyzzy to .rs should produce syntax-highlighted (RGB) spans"+ );+ },);}#[test]fn update_diff_preserves_multiline_highlight_state_within_hunk() {- let original = "fn demo() {\n let s = \"hello\";\n}\n";- let modified = "fn demo() {\n let s = \"hello\nworld\";\n}\n";- let patch = diffy::create_patch(original, modified).to_string();-- let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();- changes.insert(- PathBuf::from("demo.rs"),- FileChange::Update {- unified_diff: patch,- move_path: None,+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),},- );+ || {+ let original = "fn demo() {\n let s = \"hello\";\n}\n";+ let modified = "fn demo() {\n let s = \"hello\nworld\";\n}\n";+ let patch = diffy::create_patch(original, modified).to_string();++ let mut changes: HashMap<PathBuf, FileChange> = HashMap::new();+ changes.insert(+ PathBuf::from("demo.rs"),+ FileChange::Update {+ unified_diff: patch,+ move_path: None,+ },+ );- let expected_multiline =- highlight_code_to_styled_spans(" let s = \"hello\nworld\";\n", "rust")- .expect("rust highlighting");- let expected_style = expected_multiline- .get(1)- .and_then(|line| {- line.iter()+ let expected_multiline =+ highlight_code_to_styled_spans(" let s = \"hello\nworld\";\n", "rust")+ .expect("rust highlighting");+ let expected_style = expected_multiline+ .get(/*index*/ 1)+ .and_then(|line| {+ line.iter()+ .find(|span| span.content.as_ref().contains("world"))+ })+ .map(|span| span.style)+ .expect("expected highlighted span for second multiline string line");++ let lines =+ create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 120);+ let actual_style = lines+ .iter()+ .flat_map(|line| line.spans.iter()).find(|span| span.content.as_ref().contains("world"))- })- .map(|span| span.style)- .expect("expected highlighted span for second multiline string line");-- let lines = create_diff_summary(&changes, &PathBuf::from("/"), /*wrap_cols*/ 120);- let actual_style = lines- .iter()- .flat_map(|line| line.spans.iter())- .find(|span| span.content.as_ref().contains("world"))- .map(|span| span.style)- .expect("expected rendered diff span containing 'world'");+ .map(|span| span.style)+ .expect("expected rendered diff span containing 'world'");- assert_eq!(actual_style, expected_style);+ assert!(matches!(expected_style.fg, Some(Color::Rgb(..))));+ assert_eq!(actual_style, expected_style.remove_modifier(Modifier::DIM));+ },+ );}}diff --git a/codex-rs/tui/src/footer_hint.rs b/codex-rs/tui/src/footer_hint.rsindex 55be50457b..f253fe60b3 100644--- a/codex-rs/tui/src/footer_hint.rs+++ b/codex-rs/tui/src/footer_hint.rs@@ -1,5 +1,27 @@//! Packs footer hints into rows without separating a shortcut from its label.-//! Callers retain ownership of styling and of clipping or wrapping oversized hints.+//! Shared tips style keyboard tokens separately from their labels; callers own clipping.++use crate::style::secondary_text_style;+use ratatui::style::Styled;+use ratatui::text::Line;+/// A complete hint uses the same styled content for measurement and rendering.+pub(crate) fn shortcut(keys: &str, label: &str) -> Line<'static> {+ let mut spans = crate::key_hint::key_label_spans(keys);+ spans.push(format!(" {label}").set_style(secondary_text_style()));+ Line::from(spans)+}++/// Choose a complete hint variant so narrow surfaces never display half a shortcut.+#[allow(dead_code, reason = "Used by later layers of the TUI refresh stack.")]+pub(crate) fn first_fitting_line(+ candidates: impl IntoIterator<Item = Line<'static>>,+ width: u16,+) -> Line<'static> {+ candidates+ .into_iter()+ .find(|line| line.width() <= usize::from(width))+ .unwrap_or_default()+}pub(crate) fn wrap_hint_rows<T>(hints: impl IntoIterator<Item = T>,diff --git a/codex-rs/tui/src/history_cell/messages.rs b/codex-rs/tui/src/history_cell/messages.rsindex 26cdfec2a4..c5c3002c02 100644--- a/codex-rs/tui/src/history_cell/messages.rs+++ b/codex-rs/tui/src/history_cell/messages.rs@@ -3,6 +3,7 @@use super::markdown_render_cache::MarkdownRenderCache;use super::*;+use crate::style::accent_color_on;use crate::terminal_hyperlinks::annotate_web_urls_in_line;use crate::terminal_hyperlinks::remap_wrapped_line;use crate::wrapping::url_preserving_wrap_options;@@ -187,7 +188,7 @@ impl HistoryCell for UserHistoryCell {.max(1);let style = user_message_style();- let element_style = style.fg(Color::Cyan);+ let element_style = style.fg(accent_color_on(style.bg));let wrapped_remote_images = if self.remote_image_urls.is_empty() {Nonediff --git a/codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__tests__user_image_labels_follow_the_painted_prompt_surface.snap b/codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__tests__user_image_labels_follow_the_painted_prompt_surface.snapnew file mode 100644index 0000000000..ce43b56f63--- /dev/null+++ b/codex-rs/tui/src/history_cell/snapshots/codex_tui__history_cell__tests__user_image_labels_follow_the_painted_prompt_surface.snap@@ -0,0 +1,61 @@+---+source: tui/src/history_cell/tests.rs+expression: "snapshots.join(\"\\n\")"+---+(255, 255, 255): Buffer {+ area: Rect { x: 0, y: 0, width: 32, height: 5 },+ content: [+ " ",+ " [Image #2] ",+ " ",+ "› [Image #1] describe these ",+ " ",+ ],+ styles: [+ x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 0, y: 1, fg: Rgb(28, 100, 200), bg: Rgb(244, 244, 244), underline: Reset, modifier: NONE,+ x: 12, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 0, y: 3, fg: Reset, bg: Rgb(244, 244, 244), underline: Reset, modifier: BOLD | DIM,+ x: 2, y: 3, fg: Rgb(28, 100, 200), bg: Rgb(244, 244, 244), underline: Reset, modifier: NONE,+ x: 12, y: 3, fg: Reset, bg: Rgb(244, 244, 244), underline: Reset, modifier: NONE,+ x: 27, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ ]+}+(18, 20, 30): Buffer {+ area: Rect { x: 0, y: 0, width: 32, height: 5 },+ content: [+ " ",+ " [Image #2] ",+ " ",+ "› [Image #1] describe these ",+ " ",+ ],+ styles: [+ x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 0, y: 1, fg: Rgb(99, 168, 248), bg: Rgb(46, 48, 57), underline: Reset, modifier: NONE,+ x: 12, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 0, y: 3, fg: Reset, bg: Rgb(46, 48, 57), underline: Reset, modifier: BOLD | DIM,+ x: 2, y: 3, fg: Rgb(99, 168, 248), bg: Rgb(46, 48, 57), underline: Reset, modifier: NONE,+ x: 12, y: 3, fg: Reset, bg: Rgb(46, 48, 57), underline: Reset, modifier: NONE,+ x: 27, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ ]+}+(95, 95, 95): Buffer {+ area: Rect { x: 0, y: 0, width: 32, height: 5 },+ content: [+ " ",+ " [Image #2] ",+ " ",+ "› [Image #1] describe these ",+ " ",+ ],+ styles: [+ x: 0, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 0, y: 1, fg: Rgb(243, 248, 254), bg: Rgb(114, 114, 114), underline: Reset, modifier: NONE,+ x: 12, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 0, y: 3, fg: Reset, bg: Rgb(114, 114, 114), underline: Reset, modifier: BOLD | DIM,+ x: 2, y: 3, fg: Rgb(243, 248, 254), bg: Rgb(114, 114, 114), underline: Reset, modifier: NONE,+ x: 12, y: 3, fg: Reset, bg: Rgb(114, 114, 114), underline: Reset, modifier: NONE,+ x: 27, y: 3, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ ]+}diff --git a/codex-rs/tui/src/history_cell/tests.rs b/codex-rs/tui/src/history_cell/tests.rsindex 7e2b43a7f9..8f3958011b 100644--- a/codex-rs/tui/src/history_cell/tests.rs+++ b/codex-rs/tui/src/history_cell/tests.rs@@ -2393,6 +2393,46 @@ fn user_history_cell_renders_remote_image_urls() {insta::assert_snapshot!(rendered);}+#[test]+fn user_image_labels_follow_the_painted_prompt_surface() {+ use ratatui::widgets::Paragraph;+ use ratatui::widgets::Widget;++ let placeholder = "[Image #1]";+ let cell = UserHistoryCell {+ spoken: false,+ message: format!("{placeholder} describe these"),+ text_elements: vec![TextElement::new(+ (0..placeholder.len()).into(),+ Some(placeholder.to_owned()),+ )],+ local_image_paths: Vec::new(),+ remote_image_urls: vec![+ "https://example.com/one.png".to_string(),+ "https://example.com/two.png".to_string(),+ ],+ };+ let mut snapshots = Vec::new();+ for (fg, bg) in [+ ((30, 30, 30), (255, 255, 255)),+ ((235, 235, 235), (18, 20, 30)),+ ((150, 150, 150), (95, 95, 95)),+ ] {+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors { fg, bg },+ || {+ let area = Rect::new(+ /*x*/ 0, /*y*/ 0, /*width*/ 32, /*height*/ 5,+ );+ let mut buffer = Buffer::empty(area);+ Paragraph::new(cell.display_lines(area.width)).render(area, &mut buffer);+ snapshots.push(format!("{bg:?}: {buffer:?}"));+ },+ );+ }+ insta::assert_snapshot!(snapshots.join("\n"));+}+#[test]fn user_history_cell_summarizes_inline_data_urls() {let mut cell = UserHistoryCell {diff --git a/codex-rs/tui/src/inline_visualization_tests.rs b/codex-rs/tui/src/inline_visualization_tests.rsindex 82f91e42cb..bb9e9b259b 100644--- a/codex-rs/tui/src/inline_visualization_tests.rs+++ b/codex-rs/tui/src/inline_visualization_tests.rs@@ -344,7 +344,10 @@ fn finalized_agent_cell_replays_visualization_link() {.flat_map(|line| &line.line.spans).find(|span| span.content.starts_with("file://")).expect("visualization URL span");- assert_eq!(url_span.style, Style::new().cyan().underlined());+ assert_eq!(+ url_span.style,+ Style::new().fg(crate::style::accent_color()).underlined()+ );let destinations = lines.iter().flat_map(|line| &line.hyperlinks)diff --git a/codex-rs/tui/src/insert_history.rs b/codex-rs/tui/src/insert_history.rsindex 9952230823..73027d7581 100644--- a/codex-rs/tui/src/insert_history.rs+++ b/codex-rs/tui/src/insert_history.rs@@ -751,7 +751,13 @@ mod tests {fn vt100_deep_nested_mixed_list_third_level_marker_is_colored() {// Markdown with five levels (ordered → unordered → ordered → unordered → unordered).let md = "1. First\n - Second level\n 1. Third level (ordered)\n - Fourth level (bullet)\n - Fifth level to test indent consistency\n";- let text = render_markdown_text(md);+ let text = crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (240, 240, 240),+ bg: (24, 24, 24),+ },+ || render_markdown_text(md),+ );let lines: Vec<Line<'static>> = text.lines.clone();let width: u16 = 60;diff --git a/codex-rs/tui/src/key_hint.rs b/codex-rs/tui/src/key_hint.rsindex e8fb2fae25..0922e368e6 100644--- a/codex-rs/tui/src/key_hint.rs+++ b/codex-rs/tui/src/key_hint.rs@@ -11,24 +11,23 @@//! `is_plain_text_key_event` gives searchable pickers a shared boundary between//! text input and navigation commands.//!-//! It also supplies rendering helpers that convert bindings into styled-//! `ratatui::text::Span` values for UI hint display.+//! Rendering helpers emphasize each complete shortcut uniformly, including its separators.+//! Plain-text uses share the same compact labels.use crossterm::event::KeyCode;use crossterm::event::KeyEvent;use crossterm::event::KeyEventKind;use crossterm::event::KeyModifiers;+use ratatui::style::Color;use ratatui::style::Style;use ratatui::text::Span;#[cfg(test)]-const ALT_PREFIX: &str = "⌥ + ";+const ALT_LABEL: &str = "⌥";#[cfg(all(not(test), target_os = "macos"))]-const ALT_PREFIX: &str = "⌥ + ";+const ALT_LABEL: &str = "⌥";#[cfg(all(not(test), not(target_os = "macos")))]-const ALT_PREFIX: &str = "alt + ";-const CTRL_PREFIX: &str = "ctrl + ";-const SHIFT_PREFIX: &str = "shift + ";+const ALT_LABEL: &str = "alt";/// One concrete key event that can trigger a TUI action.///@@ -56,6 +55,10 @@ pub(crate) enum ShortcutHint {}impl ShortcutHint {+ pub(crate) fn spans(self) -> Vec<Span<'static>> {+ vec![self.into()]+ }+pub(crate) fn display_label(self) -> String {match self {Self::Single(binding) => binding.display_label(),@@ -77,6 +80,35 @@ impl From<KeyBinding> for ShortcutHint {}impl KeyBinding {+ pub(crate) fn display_label(&self) -> String {+ let mut label = String::new();+ for (modifier, name) in [+ (KeyModifiers::CONTROL, "ctrl"),+ (KeyModifiers::SHIFT, "shift"),+ (KeyModifiers::ALT, ALT_LABEL),+ ] {+ if self.modifiers.contains(modifier) {+ label.push_str(name);+ label.push('+');+ }+ }+ let key = match self.key {+ #[cfg(test)]+ KeyCode::Delete => "del".to_string(),+ KeyCode::Enter => "enter".to_string(),+ KeyCode::Char(' ') => "space".to_string(),+ KeyCode::Up => "↑".to_string(),+ KeyCode::Down => "↓".to_string(),+ KeyCode::Left => "←".to_string(),+ KeyCode::Right => "→".to_string(),+ KeyCode::PageUp => "pgup".to_string(),+ KeyCode::PageDown => "pgdn".to_string(),+ _ => self.key.to_string().to_ascii_lowercase(),+ };+ label.push_str(&key);+ label+ }+pub(crate) const fn new(key: KeyCode, modifiers: KeyModifiers) -> Self {Self { key, modifiers }}@@ -104,22 +136,8 @@ impl KeyBinding {}}- pub(crate) fn display_label(&self) -> String {- let modifiers = modifiers_to_string(self.modifiers);- let key = match self.key {- #[cfg(test)]- KeyCode::Delete => "del".to_string(),- KeyCode::Enter => "enter".to_string(),- KeyCode::Char(' ') => "space".to_string(),- KeyCode::Up => "↑".to_string(),- KeyCode::Down => "↓".to_string(),- KeyCode::Left => "←".to_string(),- KeyCode::Right => "→".to_string(),- KeyCode::PageUp => "pgup".to_string(),- KeyCode::PageDown => "pgdn".to_string(),- _ => self.key.to_string().to_ascii_lowercase(),- };- format!("{modifiers}{key}")+ pub(crate) fn spans(&self) -> Vec<Span<'static>> {+ vec![self.into()]}}@@ -209,20 +227,6 @@ pub(crate) const fn ctrl_alt(key: KeyCode) -> KeyBinding {KeyBinding::new(key, KeyModifiers::CONTROL.union(KeyModifiers::ALT))}-fn modifiers_to_string(modifiers: KeyModifiers) -> String {- let mut result = String::new();- if modifiers.contains(KeyModifiers::CONTROL) {- result.push_str(CTRL_PREFIX);- }- if modifiers.contains(KeyModifiers::SHIFT) {- result.push_str(SHIFT_PREFIX);- }- if modifiers.contains(KeyModifiers::ALT) {- result.push_str(ALT_PREFIX);- }- result-}-impl From<KeyBinding> for Span<'static> {fn from(binding: KeyBinding) -> Self {(&binding).into()@@ -241,7 +245,26 @@ impl From<ShortcutHint> for Span<'static> {}fn key_hint_style() -> Style {- Style::default().dim()+ let preferred = match (+ crate::terminal_palette::default_fg(),+ crate::terminal_palette::default_bg(),+ ) {+ (Some(fg), Some(bg)) if crate::color::is_light(bg) => {+ crate::terminal_palette::rgb_color(crate::color::blend(fg, bg, /*alpha*/ 0.85))+ }+ _ => Color::Reset,+ };+ Style::default()+ .fg(crate::style::readable_color_on(+ preferred, /*background*/ None,+ ))+ .bold()+ .not_dim()+}++/// Emphasize the complete key label, including chords, alternatives, and literal punctuation.+pub(crate) fn key_label_spans(label: &str) -> Vec<Span<'static>> {+ vec![Span::styled(label.to_owned(), key_hint_style())]}pub(crate) fn has_ctrl_or_alt(mods: KeyModifiers) -> bool {@@ -260,6 +283,10 @@ pub(crate) fn is_altgr(_mods: KeyModifiers) -> bool {false}+#[cfg(test)]+#[path = "key_hint_label_tests.rs"]+mod label_tests;+#[cfg(test)]mod tests {use super::*;diff --git a/codex-rs/tui/src/key_hint_label_tests.rs b/codex-rs/tui/src/key_hint_label_tests.rsnew file mode 100644index 0000000000..be15328df9--- /dev/null+++ b/codex-rs/tui/src/key_hint_label_tests.rs@@ -0,0 +1,83 @@+//! Compact shortcut labels stay uniformly emphasized above secondary descriptions.++use super::*;+use pretty_assertions::assert_eq;+use ratatui::Terminal;+use ratatui::backend::TestBackend;+use ratatui::style::Modifier;+use ratatui::widgets::Paragraph;++#[test]+fn modifier_combinations_stay_compact_inside_chords() {+ let cases = [+ (KeyModifiers::CONTROL, "ctrl+t"),+ (KeyModifiers::ALT, "⌥+t"),+ (KeyModifiers::CONTROL | KeyModifiers::SHIFT, "ctrl+shift+t"),+ (KeyModifiers::CONTROL | KeyModifiers::ALT, "ctrl+⌥+t"),+ ];+ for (modifiers, expected) in cases {+ let prefix = KeyBinding::new(KeyCode::Char('t'), modifiers);+ let chord = ShortcutHint::Chord {+ prefix,+ completion: plain(KeyCode::Enter),+ };+ assert_eq!(+ (prefix.display_label(), chord.display_label()),+ (expected.to_owned(), format!("{expected} enter")),+ );+ }+}++#[test]+fn hint_cells_remain_readable_across_terminal_palettes() {+ for (name, fg, bg, key_rgb) in [+ ("light", (32, 32, 32), (255, 255, 255), (65, 65, 65)),+ ("dark", (240, 240, 240), (18, 20, 30), (240, 240, 240)),+ (+ "low contrast",+ (255, 255, 255),+ (255, 255, 255),+ (118, 118, 118),+ ),+ ] {+ crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors { fg, bg },+ || {+ let keys = "ctrl+o t/f4";+ let hint = crate::footer_hint::shortcut(keys, "inspect activity");+ let width = hint.width();+ let mut terminal =+ Terminal::new(TestBackend::new(/*width*/ 32, /*height*/ 1)).unwrap();+ terminal+ .draw(|frame| {+ frame.render_widget(+ Paragraph::new(hint).style(+ Style::default()+ .fg(Color::Green)+ .bg(crate::terminal_palette::rgb_color(bg))+ .bold()+ .dim(),+ ),+ frame.area(),+ );+ })+ .unwrap();+ let cells = &terminal.backend().buffer().content[..width];+ assert_eq!(+ cells[..keys.len()]+ .iter()+ .map(|cell| (cell.fg, cell.modifier))+ .collect::<Vec<_>>(),+ vec![(crate::terminal_palette::rgb_color(key_rgb), Modifier::BOLD); keys.len()],+ "{name}"+ );+ assert!(+ cells[keys.len()..]+ .iter()+ .all(|cell| cell.modifier == Modifier::empty()),+ "{name}"+ );+ },+ );+ }+}diff --git a/codex-rs/tui/src/keymap/voice_tests.rs b/codex-rs/tui/src/keymap/voice_tests.rsindex 7e6e269a5d..45797e3752 100644--- a/codex-rs/tui/src/keymap/voice_tests.rs+++ b/codex-rs/tui/src/keymap/voice_tests.rs@@ -8,10 +8,10 @@ use pretty_assertions::assert_eq;#[test]fn voice_mute_resolves_custom_bindings_unbinding_and_visible_hints() {for (config, expected) in [- ("", Some("ctrl + x")),+ ("", Some("ctrl+x")),("[chat]\ntoggle_voice_mute = 'f8'", Some("f8")),("[chat]\ntoggle_voice_mute = []", None),- ("[chat]\ntoggle_voice_mute = 'ctrl-x m'", Some("ctrl + x m")),+ ("[chat]\ntoggle_voice_mute = 'ctrl-x m'", Some("ctrl+x m")),] {let config = toml::from_str::<TuiKeymap>(config).expect("valid voice keymap config");let runtime = RuntimeKeymap::from_config(&config).expect("valid voice bindings");diff --git a/codex-rs/tui/src/keymap_setup/picker.rs b/codex-rs/tui/src/keymap_setup/picker.rsindex 6133a06b70..1673d464b9 100644--- a/codex-rs/tui/src/keymap_setup/picker.rs+++ b/codex-rs/tui/src/keymap_setup/picker.rs@@ -1,4 +1,5 @@//! Shortcut picker construction for `/keymap`.+//! Reserve the opt-in panel viewport so tab and search changes keep controls anchored.use codex_config::types::TuiKeymap;use ratatui::style::Styled;@@ -9,6 +10,8 @@ use unicode_width::UnicodeWidthStr;use crate::app_event::AppEvent;use crate::bottom_pane::ColumnWidthMode;+use crate::bottom_pane::PickerSurface;+use crate::bottom_pane::SelectionAppearance;use crate::bottom_pane::SelectionItem;use crate::bottom_pane::SelectionRowDisplay;use crate::bottom_pane::SelectionTab;@@ -294,6 +297,10 @@ fn build_keymap_picker_params_for_action(SelectionViewParams {view_id: Some(KEYMAP_PICKER_VIEW_ID),+ appearance: SelectionAppearance::Picker,+ picker_surface: PickerSurface::Panel,+ max_visible_rows: 24,+ reserve_result_rows: true,header: Box::new(()),footer_hint: Some(keymap_picker_hint_line()),tab_footer_hints: vec![(KEYMAP_DEBUG_TAB_ID.to_string(), keymap_debug_hint_line())],@@ -462,27 +469,30 @@ fn action_count_line(count: usize) -> String {}fn keymap_picker_hint_line() -> Line<'static> {- let style = accent_style();- Line::from(vec![- "left/right".set_style(style),- " group · ".dim(),- "enter".set_style(style),- " edit shortcut · ".dim(),- "*".set_style(style),- " custom · ".dim(),- "-".set_style(style),- " unbound · ".dim(),- "esc".set_style(style),- " close".dim(),- ])+ [+ ("left/right", " group · "),+ ("enter", " edit shortcut · "),+ ("*", " custom · "),+ ("-", " unbound · "),+ ("esc", " close"),+ ]+ .into_iter()+ .flat_map(|(key, label)| {+ crate::key_hint::key_label_spans(key)+ .into_iter()+ .chain([label.set_style(crate::style::footer_hint_label_style())])+ })+ .collect::<Line>()}fn keymap_debug_hint_line() -> Line<'static> {- let style = accent_style();- Line::from(vec![- "enter".set_style(style),- " start inspector · ".dim(),- "esc".set_style(style),- " close".dim(),- ])+ let mut spans = crate::key_hint::key_label_spans("enter");+ spans.push(" start inspector · ".set_style(crate::style::footer_hint_label_style()));+ spans.extend(crate::key_hint::key_label_spans("esc"));+ spans.push(" close".set_style(crate::style::footer_hint_label_style()));+ spans.into()}++#[cfg(test)]+#[path = "picker_tests.rs"]+mod tests;diff --git a/codex-rs/tui/src/keymap_setup/picker_tests.rs b/codex-rs/tui/src/keymap_setup/picker_tests.rsnew file mode 100644index 0000000000..00e6235463--- /dev/null+++ b/codex-rs/tui/src/keymap_setup/picker_tests.rs@@ -0,0 +1,84 @@+//! Keep the production shortcut picker's controls anchored while groups and results change.++use super::*;+use crate::app_event_sender::AppEventSender;+use crate::bottom_pane::BottomPaneView;+use crate::bottom_pane::ListSelectionView;+use crossterm::event::KeyCode;+use crossterm::event::KeyEvent;+use pretty_assertions::assert_eq;+use ratatui::buffer::Buffer;+use ratatui::layout::Rect;+use tokio::sync::mpsc::unbounded_channel;++#[test]+fn tabs_and_search_keep_production_picker_geometry_stable() {+ for width in [80, 40] {+ for height_limit in [u16::MAX, 16] {+ let runtime = RuntimeKeymap::defaults();+ let params = build_keymap_picker_params(&runtime, &TuiKeymap::default());+ let tab_count = params.tabs.len();+ let (tx, _rx) = unbounded_channel();+ let mut view = ListSelectionView::new(params, AppEventSender::new(tx), runtime.list);+ let mut geometry = Vec::new();++ for (tab_id, tab_text, hint) in [+ (KEYMAP_ALL_TAB_ID, "Common", "left/right"),+ (KEYMAP_CUSTOM_TAB_ID, "Customized (0)", "left/right"),+ (KEYMAP_DEBUG_TAB_ID, "Debug", "enter"),+ ] {+ for _ in 0..tab_count {+ if BottomPaneView::active_tab_id(&view) == Some(tab_id) {+ break;+ }+ view.handle_key_event(KeyEvent::from(KeyCode::Right));+ }+ assert_eq!(BottomPaneView::active_tab_id(&view), Some(tab_id));++ for query in ["", "zzzz-no-matching-shortcut"] {+ view.set_search_query(query.to_owned());+ let desired_height = view.desired_height(width);+ let height = desired_height.min(height_limit);+ let area = Rect::new(/*x*/ 0, /*y*/ 0, width, height);+ let mut buffer = Buffer::empty(area);+ view.render(area, &mut buffer);+ let lines = (0..height)+ .map(|y| {+ (0..width)+ .map(|x| buffer[(x, y)].symbol())+ .collect::<String>()+ })+ .collect::<Vec<_>>();+ let search_text = if query.is_empty() {+ "Type to search shortcuts"+ } else {+ query+ };+ let header_y = lines+ .iter()+ .position(|line| line.trim() == "Keymap")+ .expect("picker title remains visible");+ let tabs_y = lines+ .iter()+ .position(|line| line.contains(tab_text))+ .expect("active group remains visible");+ let search_y = lines+ .iter()+ .position(|line| line.trim() == search_text)+ .expect("search remains visible");+ let hint_y = lines+ .iter()+ .position(|line| line.trim_start().starts_with(hint))+ .expect("group-specific footer remains visible");+ geometry.push((desired_height, height, header_y, tabs_y, search_y, hint_y));+ }+ }++ assert_eq!(+ geometry,+ vec![geometry[0]; geometry.len()],+ "group and search changes must keep controls anchored at width {width} and height limit {height_limit}"+ );+ }+ }+}diff --git a/codex-rs/tui/src/markdown_render.rs b/codex-rs/tui/src/markdown_render.rsindex 43a111ee76..4cdd619a55 100644--- a/codex-rs/tui/src/markdown_render.rs+++ b/codex-rs/tui/src/markdown_render.rs@@ -44,6 +44,7 @@ use crate::render::highlight::foreground_style_for_scopes;use crate::render::highlight::foreground_style_for_scopes_with_theme;use crate::render::highlight::highlight_code_to_lines;use crate::render::line_utils::line_to_static;+use crate::style::accent_color;use crate::style::table_separator_style;use crate::terminal_hyperlinks::HyperlinkLine;use crate::terminal_hyperlinks::annotate_web_urls_in_line;@@ -53,7 +54,6 @@ use crate::terminal_hyperlinks::web_destination;use crate::width::char_width;use crate::width::display_width;use crate::wrapping::RtOptions;-use crate::wrapping::adaptive_wrap_line;use crate::wrapping::word_wrap_line;use pulldown_cmark::Alignment;use pulldown_cmark::CodeBlockKind;@@ -132,13 +132,13 @@ impl MarkdownStyles {"markup.raw.inline.markdown",],)- .unwrap_or_else(|| Style::new().cyan()),+ .unwrap_or_else(|| Style::new().fg(accent_color())),emphasis: Style::new().italic(),strong: Style::new().bold(),strikethrough: Style::new().crossed_out(),- ordered_list_marker: Style::new().light_blue(),+ ordered_list_marker: Style::new().fg(accent_color()),unordered_list_marker: Style::new(),- link: Style::new().cyan().underlined(),+ link: Style::new().fg(accent_color()).underlined(),blockquote: Style::new().green(),}}@@ -1993,11 +1993,10 @@ wherelet opts = RtOptions::new(width).initial_indent(self.current_initial_indent.clone().into()).subsequent_indent(self.current_subsequent_indent.clone().into());- let wrapped = adaptive_wrap_line(&line.line, opts)- .into_iter()- .map(|wrapped| line_to_static(&wrapped))- .collect();- for wrapped in remap_wrapped_line(&line, wrapped) {+ for wrapped in crate::terminal_hyperlinks::adaptive_wrap_hyperlink_lines(+ std::slice::from_ref(&line),+ opts,+ ) {self.push_output_line(wrapped.style(style));}} else {@@ -2333,7 +2332,13 @@ mod tests {// extracted (first word / comma-separated token) so highlighting works.for info in &["rust,no_run", "rust no_run", "rust title=\"demo\""] {let markdown = format!("```{info}\nfn main() {{}}\n```\n");- let rendered = render_markdown_text(&markdown);+ let rendered = crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),+ },+ || render_markdown_text(&markdown),+ );let has_rgb = rendered.lines.iter().any(|line| {line.spans.iter()diff --git a/codex-rs/tui/src/markdown_render/mermaid_tests.rs b/codex-rs/tui/src/markdown_render/mermaid_tests.rsindex 9609a63077..fc6ee5e0d5 100644--- a/codex-rs/tui/src/markdown_render/mermaid_tests.rs+++ b/codex-rs/tui/src/markdown_render/mermaid_tests.rs@@ -71,7 +71,25 @@ fn mermaid_styles_follow_the_supplied_theme() {("light", themes.get(EmbeddedThemeName::SolarizedLight)),("fallback", &fallback),] {- let lines = super::render("flowchart LR; A[请求] --> B[Reply]", Some(40), theme).unwrap();+ let colors = if name == "light" {+ crate::terminal_probe::DefaultColors {+ fg: (30, 30, 30),+ bg: (255, 255, 255),+ }+ } else {+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),+ }+ };+ let lines = crate::terminal_palette::with_test_default_colors(colors, || {+ super::render(+ "flowchart LR; A[请求] --> B[Reply]",+ /*width*/ Some(40),+ theme,+ )+ .unwrap()+ });let styled = lines.into_iter().map(|line| {diff --git a/codex-rs/tui/src/markdown_render/snapshots/codex_tui__markdown_render__mermaid__tests__mermaid_styles_follow_the_supplied_theme.snap b/codex-rs/tui/src/markdown_render/snapshots/codex_tui__markdown_render__mermaid__tests__mermaid_styles_follow_the_supplied_theme.snapindex 906b21bf3f..ca2f180674 100644--- a/codex-rs/tui/src/markdown_render/snapshots/codex_tui__markdown_render__mermaid__tests__mermaid_styles_follow_the_supplied_theme.snap+++ b/codex-rs/tui/src/markdown_render/snapshots/codex_tui__markdown_render__mermaid__tests__mermaid_styles_follow_the_supplied_theme.snap@@ -1,6 +1,5 @@---source: tui/src/markdown_render/mermaid_tests.rs-assertion_line: 88expression: "cases.join(\"\\n\\n\")"---darkdiff --git a/codex-rs/tui/src/markdown_render/snapshots/codex_tui__markdown_render__web_links__tests__label_only_and_fallback_presentations_snapshot.snap b/codex-rs/tui/src/markdown_render/snapshots/codex_tui__markdown_render__web_links__tests__label_only_and_fallback_presentations_snapshot.snapindex ae0bffb9d5..2c6a1bce21 100644--- a/codex-rs/tui/src/markdown_render/snapshots/codex_tui__markdown_render__web_links__tests__label_only_and_fallback_presentations_snapshot.snap+++ b/codex-rs/tui/src/markdown_render/snapshots/codex_tui__markdown_render__web_links__tests__label_only_and_fallback_presentations_snapshot.snap@@ -6,11 +6,11 @@ expression: presentationsText::from_iter([Line::from_iter([Span::from("plain "),- Span::from("plain").cyan().underlined(),+ Span::from("plain").fg(Color::Reset).underlined(),Span::from(" "),Span::from("code").fg(Color::Rgb(166, 227, 161)),Span::from(" "),- Span::from("code").cyan().underlined(),+ Span::from("code").fg(Color::Reset).underlined(),]),Line::default(),Line::from_iter([@@ -20,23 +20,23 @@ expression: presentationsLine::from(Span::from("━━━━━━━━━━").dim()),Line::from_iter([Span::from(" "),- Span::from("docs").cyan().underlined(),+ Span::from("docs").fg(Color::Reset).underlined(),]),]),Text::from_iter([Line::from_iter([Span::from("plain "),- Span::from("plain").cyan().underlined(),+ Span::from("plain").fg(Color::Reset).underlined(),Span::from(" ("),- Span::from("https://example.com").cyan().underlined(),+ Span::from("https://example.com").fg(Color::Reset).underlined(),Span::from(")"),Span::from(" "),Span::from("code").fg(Color::Rgb(166, 227, 161)),]),Line::from_iter([- Span::from("code").cyan().underlined(),+ Span::from("code").fg(Color::Reset).underlined(),Span::from(" ("),- Span::from("https://example.com").cyan().underlined(),+ Span::from("https://example.com").fg(Color::Reset).underlined(),Span::from(")"),]),Line::default(),@@ -47,9 +47,9 @@ expression: presentationsLine::from(Span::from("━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━").dim()),Line::from_iter([Span::from(" "),- Span::from("docs").cyan().underlined(),+ Span::from("docs").fg(Color::Reset).underlined(),Span::from(" ("),- Span::from("https://example.com/docs").cyan().underlined(),+ Span::from("https://example.com/docs").fg(Color::Reset).underlined(),Span::from(")"),]),]),diff --git a/codex-rs/tui/src/markdown_render/web_links_tests.rs b/codex-rs/tui/src/markdown_render/web_links_tests.rsindex 614b5a6efa..d503f77417 100644--- a/codex-rs/tui/src/markdown_render/web_links_tests.rs+++ b/codex-rs/tui/src/markdown_render/web_links_tests.rs@@ -1,6 +1,7 @@use super::WebLinkDisplay;use crate::markdown_render::render_markdown_lines_with_width_cwd_and_hidden_link_destinations;use crate::markdown_render::render_streaming_markdown_lines_with_width_and_cwd;+use crate::style::accent_color;use crate::terminal_hyperlinks::HyperlinkLine;use crate::terminal_hyperlinks::TerminalHyperlink;use crate::terminal_hyperlinks::visible_lines;@@ -49,23 +50,29 @@ fn supporting_terminals_render_only_the_styled_label_and_keep_its_target() {] {let display = WebLinkDisplay::for_terminal(&terminal(name), /*term*/ None);for (markdown, label) in [- ("[label](https://example.com)", "label".cyan().underlined()),+ (+ "[label](https://example.com)",+ "label".fg(accent_color()).underlined(),+ ),("[`label`](https://example.com)",- "label".cyan().underlined(),+ "label".fg(accent_color()).underlined(),),("[**label**](https://example.com)",- "label".cyan().bold().underlined(),+ "label".fg(accent_color()).bold().underlined(),),("[*label*](https://example.com)",- "label".cyan().italic().underlined(),+ "label".fg(accent_color()).italic().underlined(),+ ),+ (+ "[<b>](https://example.com)",+ "<b>".fg(accent_color()).underlined(),),- ("[<b>](https://example.com)", "<b>".cyan().underlined()),("[https://example.com](https://example.com)",- "https://example.com".cyan().underlined(),+ "https://example.com".fg(accent_color()).underlined(),),] {let label_width = label.width();diff --git a/codex-rs/tui/src/markdown_render_tests.rs b/codex-rs/tui/src/markdown_render_tests.rsindex b1c08d528e..003e63da8e 100644--- a/codex-rs/tui/src/markdown_render_tests.rs+++ b/codex-rs/tui/src/markdown_render_tests.rs@@ -1,4 +1,5 @@use super::MarkdownStyles;+use crate::style::accent_color;use pretty_assertions::assert_eq;use ratatui::style::Modifier;use ratatui::style::Stylize;@@ -248,13 +249,13 @@ fn blockquote_with_ordered_list() {let expected = Text::from_iter([Line::from_iter(vec![Span::from("> "),- "1. ".light_blue(),+ "1. ".fg(accent_color()),Span::from("first"),]).green(),Line::from_iter(vec![Span::from("> "),- "2. ".light_blue(),+ "2. ".fg(accent_color()),Span::from("second"),]).green(),@@ -583,8 +584,8 @@ fn list_unordered_multiple() {fn list_ordered() {let text = render_markdown_text("1. List item 1\n2. List item 2\n");let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "List item 1".into()]),- Line::from_iter(["2. ".light_blue(), "List item 2".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "List item 1".into()]),+ Line::from_iter(["2. ".fg(accent_color()), "List item 2".into()]),]);assert_eq!(text, expected);}@@ -603,8 +604,8 @@ fn list_nested() {fn list_ordered_custom_start() {let text = render_markdown_text("3. First\n4. Second\n");let expected = Text::from_iter([- Line::from_iter(["3. ".light_blue(), "First".into()]),- Line::from_iter(["4. ".light_blue(), "Second".into()]),+ Line::from_iter(["3. ".fg(accent_color()), "First".into()]),+ Line::from_iter(["4. ".fg(accent_color()), "Second".into()]),]);assert_eq!(text, expected);}@@ -614,11 +615,11 @@ fn nested_unordered_in_ordered() {let md = "1. Outer\n - Inner A\n - Inner B\n2. Next\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "Outer".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "Outer".into()]),Line::from_iter([" - ", "Inner A"]),Line::from_iter([" - ", "Inner B"]),Line::default(),- Line::from_iter(["2. ".light_blue(), "Next".into()]),+ Line::from_iter(["2. ".fg(accent_color()), "Next".into()]),]);assert_eq!(text, expected);}@@ -629,8 +630,8 @@ fn nested_ordered_in_unordered() {let text = render_markdown_text(md);let expected = Text::from_iter([Line::from_iter(["- ", "Outer"]),- Line::from_iter([" 1. ".light_blue(), "One".into()]),- Line::from_iter([" 2. ".light_blue(), "Two".into()]),+ Line::from_iter([" 1. ".fg(accent_color()), "One".into()]),+ Line::from_iter([" 2. ".fg(accent_color()), "Two".into()]),Line::default(),Line::from_iter(["- ", "Last"]),]);@@ -642,11 +643,11 @@ fn loose_list_item_multiple_paragraphs() {let md = "1. First paragraph\n\n Second paragraph of same item\n\n2. Next item\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "First paragraph".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "First paragraph".into()]),Line::default(),Line::from_iter([" ", "Second paragraph of same item"]),Line::default(),- Line::from_iter(["2. ".light_blue(), "Next item".into()]),+ Line::from_iter(["2. ".fg(accent_color()), "Next item".into()]),]);assert_eq!(text, expected);}@@ -667,11 +668,11 @@ fn deeply_nested_mixed_three_levels() {let md = "1. A\n - B\n 1. C\n2. D\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "A".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "A".into()]),Line::from_iter([" - ", "B"]),- Line::from_iter([" 1. ".light_blue(), "C".into()]),+ Line::from_iter([" 1. ".fg(accent_color()), "C".into()]),Line::default(),- Line::from_iter(["2. ".light_blue(), "D".into()]),+ Line::from_iter(["2. ".fg(accent_color()), "D".into()]),]);assert_eq!(text, expected);}@@ -681,8 +682,8 @@ fn loose_items_due_to_blank_line_between_items() {let md = "1. First\n\n2. Second\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "First".into()]),- Line::from_iter(["2. ".light_blue(), "Second".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "First".into()]),+ Line::from_iter(["2. ".fg(accent_color()), "Second".into()]),]);assert_eq!(text, expected);}@@ -692,8 +693,8 @@ fn mixed_tight_then_loose_in_one_list() {let md = "1. Tight\n\n2.\n Loose\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "Tight".into()]),- Line::from_iter(["2. ".light_blue(), "Loose".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "Tight".into()]),+ Line::from_iter(["2. ".fg(accent_color()), "Loose".into()]),]);assert_eq!(text, expected);}@@ -703,7 +704,7 @@ fn ordered_item_with_indented_continuation_is_tight() {let md = "1. Foo\n Bar\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "Foo".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "Foo".into()]),Line::from_iter([" ", "Bar"]),]);assert_eq!(text, expected);@@ -736,32 +737,49 @@ fn inline_code_and_file_paths_follow_syntax_theme() {crate::render::highlight::resolve_theme_by_name(name, /*codex_home*/ None).expect("bundled theme")};- let styles = MarkdownStyles::for_theme(&theme);- let code_style = styles.code;- let mut writer = super::Writer::new(- markdown,- pulldown_cmark::Parser::new(markdown).into_offset_iter(),- /*wrap_width*/ Some(24),- /*cwd*/ None,- &|_| false,- );- writer.styles = styles;- writer.run();- let lines = crate::terminal_hyperlinks::visible_lines(writer.text);- let paths = lines- .iter()- .flat_map(|line| &line.spans)- .filter(|span| matches!(span.content.as_ref(), "src/main.rs" | "src/lib.rs"))- .cloned()- .collect::<Vec<_>>();- assert_eq!(- paths,- vec![- Span::styled("src/main.rs", code_style),- Span::styled("src/lib.rs", code_style),- ],- );- rendered.push((name, lines));+ let colors = if name == "catppuccin-latte" {+ crate::terminal_probe::DefaultColors {+ fg: (30, 30, 30),+ bg: (255, 255, 255),+ }+ } else {+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),+ }+ };+ crate::terminal_palette::with_test_default_colors(colors, || {+ let styles = MarkdownStyles::for_theme(&theme);+ let code_style = styles.code;+ let mut writer = super::Writer::new(+ markdown,+ pulldown_cmark::Parser::new(markdown).into_offset_iter(),+ /*wrap_width*/ Some(24),+ /*cwd*/ None,+ &|_| false,+ );+ writer.styles = styles;+ writer.run();+ let lines = crate::terminal_hyperlinks::visible_lines(writer.text);+ let paths = lines+ .iter()+ .flat_map(|line| &line.spans)+ .filter(|span| matches!(span.content.as_ref(), "src/main.rs" | "src/lib.rs"))+ .cloned()+ .collect::<Vec<_>>();+ assert_eq!(+ paths,+ vec![+ Span::styled("src/main.rs", code_style),+ Span::styled("src/lib.rs", code_style),+ ],+ );+ if name == "no-markup-color" {+ assert_eq!(code_style, ratatui::style::Style::new().fg(accent_color()));+ } else {+ rendered.push((name, lines));+ }+ });}assert_debug_snapshot!(rendered);}@@ -804,9 +822,9 @@ fn strong_emphasis() {fn link() {let text = render_markdown_text("[Link](https://example.com)");let expected = Text::from(Line::from_iter([- "Link".cyan().underlined(),+ "Link".fg(accent_color()).underlined()," (".into(),- "https://example.com".cyan().underlined(),+ "https://example.com".fg(accent_color()).underlined(),")".into(),]));assert_eq!(text, expected);@@ -815,10 +833,13 @@ fn link() {#[test]fn web_link_labels_use_link_style_and_preserve_inline_formatting() {for (label, expected_label) in [- ("plain", "plain".cyan().underlined()),- ("`code`", "code".cyan().underlined()),- ("**bold**", "bold".cyan().bold().underlined()),- ("*italic*", "italic".cyan().italic().underlined()),+ ("plain", "plain".fg(accent_color()).underlined()),+ ("`code`", "code".fg(accent_color()).underlined()),+ ("**bold**", "bold".fg(accent_color()).bold().underlined()),+ (+ "*italic*",+ "italic".fg(accent_color()).italic().underlined(),+ ),] {let text = render_markdown_text(&format!("before [{label}](https://example.com) after `code`"@@ -827,7 +848,7 @@ fn web_link_labels_use_link_style_and_preserve_inline_formatting() {"before ".into(),expected_label," (".into(),- "https://example.com".cyan().underlined(),+ "https://example.com".fg(accent_color()).underlined(),")".into()," after ".into(),Span::styled("code", MarkdownStyles::default().code),@@ -856,9 +877,9 @@ fn web_link_labels_keep_link_style_in_wrapped_prose_and_tables() {assert_eq!(labels,vec![- "plain".cyan().underlined(),- "code".cyan().underlined(),- "<b>".cyan().underlined()+ "plain".fg(accent_color()).underlined(),+ "code".fg(accent_color()).underlined(),+ "<b>".fg(accent_color()).underlined()]);}@@ -1170,9 +1191,9 @@ fn file_link_uses_target_path_for_hash_range() {fn url_link_shows_destination() {let text = render_markdown_text("[docs](https://example.com/docs)");let expected = Text::from(Line::from_iter([- "docs".cyan().underlined(),+ "docs".fg(accent_color()).underlined()," (".into(),- "https://example.com/docs".cyan().underlined(),+ "https://example.com/docs".fg(accent_color()).underlined(),")".into(),]));assert_eq!(text, expected);@@ -1685,9 +1706,12 @@ fn nested_five_levels_mixed_lists() {let md = "1. First\n - Second level\n 1. Third level (ordered)\n - Fourth level (bullet)\n - Fifth level to test indent consistency\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "First".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "First".into()]),Line::from_iter([" - ", "Second level"]),- Line::from_iter([" 1. ".light_blue(), "Third level (ordered)".into()]),+ Line::from_iter([+ " 1. ".fg(accent_color()),+ "Third level (ordered)".into(),+ ]),Line::from_iter([" - ", "Fourth level (bullet)"]),Line::from_iter([" - ",@@ -1722,7 +1746,7 @@ fn html_in_tight_ordered_item_soft_breaks_with_space() {let md = "1. Foo\n <i>Bar</i>\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "Foo".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "Foo".into()]),Line::from_iter([" ", "<i>", "Bar", "</i>"]),]);assert_eq!(text, expected);@@ -1770,7 +1794,7 @@ fn ordered_item_continuation_paragraph_is_indented() {let md = "1. Intro\n\n More details about intro\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "Intro".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "Intro".into()]),Line::default(),Line::from_iter([" ", "More details about intro"]),]);@@ -1782,12 +1806,12 @@ fn nested_item_continuation_paragraph_is_indented() {let md = "1. A\n - B\n\n Continuation for B\n2. C\n";let text = render_markdown_text(md);let expected = Text::from_iter([- Line::from_iter(["1. ".light_blue(), "A".into()]),+ Line::from_iter(["1. ".fg(accent_color()), "A".into()]),Line::from_iter([" - ", "B"]),Line::default(),Line::from_iter([" ", "Continuation for B"]),Line::default(),- Line::from_iter(["2. ".light_blue(), "C".into()]),+ Line::from_iter(["2. ".fg(accent_color()), "C".into()]),]);assert_eq!(text, expected);}diff --git a/codex-rs/tui/src/markdown_stream.rs b/codex-rs/tui/src/markdown_stream.rsindex 88d93dccdf..10091d8592 100644--- a/codex-rs/tui/src/markdown_stream.rs+++ b/codex-rs/tui/src/markdown_stream.rs@@ -297,7 +297,7 @@ mod tests {}#[tokio::test]- async fn e2e_stream_nested_mixed_lists_ordered_marker_is_light_blue() {+ async fn e2e_stream_nested_mixed_lists_ordered_marker_uses_shared_accent() {let md = ["1. First\n"," - Second level\n",@@ -316,14 +316,14 @@ mod tests {});let idx = find_idx.expect("expected third-level ordered line");let line = &out[idx];- // Expect at least one span on this line to be styled light blue- let has_light_blue = line+ // Expect at least one span on this line to be styled with the shared accent+ let has_accent = line.spans.iter()- .any(|s| s.style.fg == Some(ratatui::style::Color::LightBlue));+ .any(|s| s.style.fg == Some(crate::style::accent_color()));assert!(- has_light_blue,- "expected an ordered-list marker span with light blue fg on: {line:?}"+ has_accent,+ "expected an ordered-list marker span with the shared accent on: {line:?}");}@@ -587,7 +587,7 @@ mod tests {}#[tokio::test]- async fn e2e_stream_deep_nested_third_level_marker_is_light_blue() {+ async fn e2e_stream_deep_nested_third_level_marker_uses_shared_accent() {let md = "1. First\n - Second level\n 1. Third level (ordered)\n - Fourth level (bullet)\n - Fifth level to test indent consistency\n";let streamed = super::simulate_stream_markdown_for_tests(&[md], /*finalize*/ true);let streamed_strs = lines_to_plain_strings(&streamed);@@ -607,7 +607,7 @@ mod tests {});// The marker (including indent and "1.") is expected to be in the first span- // and colored LightBlue; following content should be default color.+ // and colored with the shared accent; following content should be default color.assert!(!line.spans.is_empty(),"expected non-empty spans for the third-level line"@@ -615,8 +615,8 @@ mod tests {let marker_span = &line.spans[0];assert_eq!(marker_span.style.fg,- Some(Color::LightBlue),- "expected LightBlue 3rd-level ordered marker, got {:?}",+ Some(crate::style::accent_color()),+ "expected shared-accent 3rd-level ordered marker, got {:?}",marker_span.style.fg);// Find the first non-empty non-space content span and verify it is default color.diff --git a/codex-rs/tui/src/pager_overlay.rs b/codex-rs/tui/src/pager_overlay.rsindex 107ea3da19..4cb407363b 100644--- a/codex-rs/tui/src/pager_overlay.rs+++ b/codex-rs/tui/src/pager_overlay.rs@@ -117,9 +117,9 @@ fn render_key_hints(area: Rect, buf: &mut Buffer, pairs: &[(Vec<ShortcutHint>, &}for (i, key) in keys.iter().enumerate() {if i > 0 {- spans.push("/".into());+ spans.extend(crate::key_hint::key_label_spans("/"));}- spans.push(Span::from(*key));+ spans.extend(key.spans());}spans.push(" ".into());spans.push(Span::from(desc.to_string()));diff --git a/codex-rs/tui/src/render/highlight.rs b/codex-rs/tui/src/render/highlight.rsindex f78e45db01..41b1d239c1 100644--- a/codex-rs/tui/src/render/highlight.rs+++ b/codex-rs/tui/src/render/highlight.rs@@ -18,6 +18,9 @@//! swap/snapshot the theme for live preview. All highlighting functions read//! the theme via `theme_lock()`. Unit tests isolate the active theme and its//! revision per thread so parallel tests cannot change each other’s rendering.+//! Generic renderers preserve configured theme foregrounds because callers may paint them on+//! shaded surfaces. Diff rendering separately resolves contrast against its actual row fills.+//! ANSI colors remain owned by the terminal palette.//!//! **Guardrails:** inputs exceeding 512 KB or 10 000 lines, or containing an//! individual line longer than 4 KiB, are rejected early (returns `None`) to@@ -140,7 +143,7 @@ pub(crate) fn validate_theme_name(name: Option<&str>, codex_home: Option<&Path>)// still surface a startup warning so users can diagnose configuration issues.if let Some(home) = codex_home {let custom_path = custom_theme_path(name, home);- if custom_path.try_exists().unwrap_or(true) {+ if custom_path.try_exists().unwrap_or(/*default*/ true) {return Some(format!("Custom theme \"{name}\" at {custom_theme_path_display} could not \be loaded (invalid .tmTheme format). Falling back to the default theme."@@ -397,7 +400,9 @@ pub(crate) fn resolve_theme_by_name(name: &str, codex_home: Option<&Path>) -> Op}// Custom .tmTheme file?if let Some(home) = codex_home- && custom_theme_path(name, home).try_exists().unwrap_or(true)+ && custom_theme_path(name, home)+ .try_exists()+ .unwrap_or(/*default*/ true){return load_custom_theme(name, home);}@@ -559,7 +564,8 @@ pub(crate) fn convert_syntect_color(color: SyntectColor) -> Option<RtColor> {/// Convert a syntect `Style` to a ratatui `Style`.////// Most themes produce RGB colors. The built-in `ansi`/`base16`/`base16-256`-/// themes encode ANSI palette semantics in the alpha channel, matching bat.+/// themes encode ANSI palette semantics in the alpha channel, matching bat. Preserve+/// the decoded foreground so the final renderer can use its actual background.fn convert_style(syn_style: SyntectStyle) -> Style {let mut rt_style = Style::default();@@ -728,6 +734,7 @@ fn highlight_to_line_spans(code: &str, lang: &str) -> Option<Vec<Vec<Span<'stati/// input exceeds safety guardrails. Callers can always render the result/// directly -- the fallback path produces equivalent plain-text lines.///+/// Preserves theme foregrounds: callers may apply a shaded background after rendering./// Used by `markdown_render` for fenced code blocks and by `exec_cell` for bash/// command highlighting.pub(crate) fn highlight_code_to_lines(code: &str, lang: &str) -> Vec<Line<'static>> {@@ -758,8 +765,8 @@ pub(crate) fn highlight_bash_to_lines(script: &str) -> Vec<Line<'static>> {/// plain diff coloring.////// Each inner `Vec<Span>` corresponds to one source line. Styles are derived-/// from the active theme but backgrounds are intentionally omitted so the-/// terminal's own background shows through.+/// from the active theme without contrast correction or backgrounds. The diff+/// renderer corrects them against the background it paints for each row.pub(crate) fn highlight_code_to_styled_spans(code: &str,lang: &str,@@ -901,13 +908,6 @@ mod tests {}}- fn assert_rgb(color: Option<RtColor>, expected: (u8, u8, u8)) {- let Some(RtColor::Rgb(r, g, b)) = color else {- panic!("expected RGB color {expected:?}, got {color:?}");- };- assert_eq!((r, g, b), expected);- }-#[test]fn highlight_rust_has_keyword_style() {let code = "fn main() {}";@@ -1006,7 +1006,10 @@ mod tests {font_style: FontStyle::BOLD | FontStyle::ITALIC,};let rt = convert_style(syn);- assert_eq!(rt.fg, Some(RtColor::Rgb(255, 128, 0)));+ assert_eq!(+ rt.fg,+ Some(crate::terminal_palette::rgb_color((255, 128, 0)))+ );// Background is intentionally skipped.assert_eq!(rt.bg, None);assert!(rt.add_modifier.contains(Modifier::BOLD));@@ -1083,7 +1086,10 @@ mod tests {font_style: FontStyle::empty(),};let rt = convert_style(syn);- assert!(matches!(rt.fg, Some(RtColor::Indexed(0x9a))));+ assert_eq!(+ rt.fg,+ Some(crate::terminal_palette::indexed_color(/*index*/ 0x9a))+ );}#[test]@@ -1125,7 +1131,10 @@ mod tests {font_style: FontStyle::empty(),};let rt = convert_style(syn);- assert!(matches!(rt.fg, Some(RtColor::Rgb(10, 20, 30))));+ assert_eq!(+ rt.fg,+ Some(crate::terminal_palette::rgb_color((10, 20, 30)))+ );}#[test]@@ -1366,7 +1375,10 @@ mod tests {let style = foreground_style_for_scopes_with_theme(&theme, &["keyword"]).expect("expected keyword foreground style");- assert_rgb(style.fg, (10, 20, 30));+ assert_eq!(+ style.fg,+ Some(crate::terminal_palette::rgb_color((10, 20, 30)))+ );}#[test]@@ -1380,7 +1392,10 @@ mod tests {let style = foreground_style_for_scopes_with_theme(&theme, &["keyword", "string"]).expect("expected string foreground style");- assert_rgb(style.fg, (40, 50, 60));+ assert_eq!(+ style.fg,+ Some(crate::terminal_palette::rgb_color((40, 50, 60)))+ );}#[test]diff --git a/codex-rs/tui/src/render/snapshots/codex_tui__render__highlight__tests__ansi_family_foreground_palette.snap b/codex-rs/tui/src/render/snapshots/codex_tui__render__highlight__tests__ansi_family_foreground_palette.snapindex 79e130916c..e0b7f6acba 100644--- a/codex-rs/tui/src/render/snapshots/codex_tui__render__highlight__tests__ansi_family_foreground_palette.snap+++ b/codex-rs/tui/src/render/snapshots/codex_tui__render__highlight__tests__ansi_family_foreground_palette.snap@@ -1,5 +1,6 @@---source: tui/src/render/highlight.rs+assertion_line: 1196expression: out---ansi:diff --git a/codex-rs/tui/src/resume_picker.rs b/codex-rs/tui/src/resume_picker.rsindex 8219c21c4a..b054e8db4c 100644--- a/codex-rs/tui/src/resume_picker.rs+++ b/codex-rs/tui/src/resume_picker.rs@@ -20,7 +20,6 @@ use crate::legacy_core::config::edit::ConfigEditsBuilder;use crate::markdown_render::render_streaming_markdown_lines_with_width_and_cwd as render_assistant;use crate::pager_overlay::Overlay;use crate::status::format_directory_display;-use crate::style::footer_hint_key_style;use crate::style::footer_hint_label_style;use crate::terminal_palette::best_color;use crate::terminal_palette::default_bg;@@ -2691,7 +2690,7 @@ fn fit_footer_hint_refs(if idx > 0 {spans.push(" ".repeat(gap_width).set_style(footer_hint_label_style()));}- spans.push(hint.key.clone().set_style(footer_hint_key_style()));+ spans.extend(crate::key_hint::key_label_spans(&hint.key));let label = match mode {FooterHintLabelMode::Wide => Some(hint.wide_label.as_str()),FooterHintLabelMode::Compact => Some(hint.compact_label.as_str()),@@ -4547,7 +4546,7 @@ mod tests {state.list_keymap.move_right = vec![crate::key_hint::ctrl(KeyCode::Char('l'))];let remapped_footer = footer_lines_text(&state, /*width*/ 220);assert!(- remapped_footer.contains("ctrl + h/ctrl + l change option"),+ remapped_footer.contains("ctrl+h/ctrl+l change option"),"{remapped_footer}");state.list_keymap.move_left.clear();diff --git a/codex-rs/tui/src/snapshots/codex_tui__app__tests__patch_approval_tests__patch_approval_pager_bottom.snap b/codex-rs/tui/src/snapshots/codex_tui__app__tests__patch_approval_tests__patch_approval_pager_bottom.snapindex 6fe82ff124..65c5f23184 100644--- a/codex-rs/tui/src/snapshots/codex_tui__app__tests__patch_approval_tests__patch_approval_pager_bottom.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__app__tests__patch_approval_tests__patch_approval_pager_bottom.snap@@ -34,6 +34,14 @@ Buffer {x: 4, y: 6, fg: Red, bg: Reset, underline: Reset, modifier: NONE,x: 12, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 1, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 4, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 17, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 26, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 37, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 45, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 1, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 2, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 8, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/snapshots/codex_tui__app__tests__patch_approval_tests__patch_approval_pager_top.snap b/codex-rs/tui/src/snapshots/codex_tui__app__tests__patch_approval_tests__patch_approval_pager_top.snapindex 8f87674d9f..f02fa7b834 100644--- a/codex-rs/tui/src/snapshots/codex_tui__app__tests__patch_approval_tests__patch_approval_pager_top.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__app__tests__patch_approval_tests__patch_approval_pager_top.snap@@ -35,6 +35,14 @@ Buffer {x: 18, y: 6, fg: Red, bg: Reset, underline: Reset, modifier: NONE,x: 20, y: 6, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,x: 0, y: 7, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 1, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 4, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 17, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 26, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 37, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 45, y: 8, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,+ x: 1, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: BOLD,+ x: 2, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: DIM,x: 8, y: 9, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,]}diff --git a/codex-rs/tui/src/snapshots/codex_tui__app__tests__path_backed_agent_picker.snap b/codex-rs/tui/src/snapshots/codex_tui__app__tests__path_backed_agent_picker.snapindex c6fd5fdde5..cde2620e65 100644--- a/codex-rs/tui/src/snapshots/codex_tui__app__tests__path_backed_agent_picker.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__app__tests__path_backed_agent_picker.snap@@ -3,7 +3,7 @@ source: tui/src/app/tests.rsexpression: "render_bottom_popup(&app.chat_widget, 80)"---Subagents- Select an agent to watch. ⌥ + ← previous, ⌥ + → next.+ Select an agent to watch. ⌥+← previous, ⌥+→ next.› 1. • /root/worker 00000000-0000-0000-0000-000000000123diff --git a/codex-rs/tui/src/snapshots/codex_tui__app__tests__untracked_thread_notifications_agent_picker.snap b/codex-rs/tui/src/snapshots/codex_tui__app__tests__untracked_thread_notifications_agent_picker.snapindex d15daf8957..a6418e1e27 100644--- a/codex-rs/tui/src/snapshots/codex_tui__app__tests__untracked_thread_notifications_agent_picker.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__app__tests__untracked_thread_notifications_agent_picker.snap@@ -3,7 +3,7 @@ source: tui/src/app/tests.rsexpression: "render_bottom_popup(&app.chat_widget, 80)"---Subagents- Select an agent to watch. ⌥ + ← previous, ⌥ + → next.+ Select an agent to watch. ⌥+← previous, ⌥+→ next.› 1. • Main [default] (current) 00000000-0000-0000-0000-000000000123diff --git a/codex-rs/tui/src/snapshots/codex_tui__diff_render__tests__syntax_colors_follow_the_actual_diff_background.snap b/codex-rs/tui/src/snapshots/codex_tui__diff_render__tests__syntax_colors_follow_the_actual_diff_background.snapnew file mode 100644index 0000000000..8b4ba2419d--- /dev/null+++ b/codex-rs/tui/src/snapshots/codex_tui__diff_render__tests__syntax_colors_follow_the_actual_diff_background.snap@@ -0,0 +1,23 @@+---+source: tui/src/diff_render.rs+expression: "format!(\"{buffer:?}\")"+---+Buffer {+ area: Rect { x: 0, y: 0, width: 40, height: 2 },+ content: [+ "1 +let value = 1; plain reset ",+ "1 -let value = 1; plain reset ",+ ],+ styles: [+ x: 0, y: 0, fg: Rgb(31, 35, 40), bg: Rgb(172, 238, 187), underline: Reset, modifier: NONE,+ x: 2, y: 0, fg: Green, bg: Rgb(220, 250, 230), underline: Reset, modifier: NONE,+ x: 3, y: 0, fg: Rgb(122, 109, 88), bg: Rgb(220, 250, 230), underline: Reset, modifier: NONE,+ x: 17, y: 0, fg: Rgb(30, 30, 30), bg: Rgb(220, 250, 230), underline: Reset, modifier: NONE,+ x: 29, y: 0, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ x: 0, y: 1, fg: Rgb(31, 35, 40), bg: Rgb(255, 206, 203), underline: Reset, modifier: NONE,+ x: 2, y: 1, fg: Red, bg: Rgb(55, 25, 35), underline: Reset, modifier: NONE,+ x: 3, y: 1, fg: Rgb(235, 210, 170), bg: Rgb(55, 25, 35), underline: Reset, modifier: NONE,+ x: 17, y: 1, fg: Rgb(137, 137, 137), bg: Rgb(55, 25, 35), underline: Reset, modifier: NONE,+ x: 29, y: 1, fg: Reset, bg: Reset, underline: Reset, modifier: NONE,+ ]+}diff --git a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_debug_view_match.snap b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_debug_view_match.snapindex 95c9a47866..476ec82427 100644--- a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_debug_view_match.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_debug_view_match.snap@@ -6,7 +6,7 @@ Keypress InspectorPress any key to see what Codex receives. Esc is inspected; Ctrl+C closes.Tip: Codex can only inspect keys your terminal sends.-Detected: ctrl + o+Detected: ctrl+oConfig key: ctrl-oRaw event: code=Char('o'), modifiers=ctrl, kind=Pressdiff --git a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_custom.snap b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_custom.snapindex 31d3b5cf9a..860169dfd9 100644--- a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_custom.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_custom.snap@@ -7,9 +7,10 @@ expression: "render_picker(params, 120)"All configurable shortcuts.147 actions, 1 customized, 5 unbound.- [All] Common Customized (1) Unbound (5) App Composer Editor Vim Navigation Agents Approval Debug+ All Common Customized (1) Unbound (5) App Composer Editor Vim Navigation Agents Approval ›Type to search shortcuts+› Global - Open Agents unboundGlobal Open Transcript ctrl-tGlobal Open External Editor ctrl-g@@ -18,5 +19,21 @@ expression: "render_picker(params, 120)"Global - Toggle Vim Mode unboundGlobal Toggle Raw Output alt-rGlobal Toggle Side Conversation ctrl-/-+ Chat Interrupt Turn esc+ Chat Decrease Reasoning Effort alt-,, shift-down+ Chat Increase Reasoning Effort alt-., shift-up+ Chat - Previous Permission Mode unbound+ Chat - Next Permission Mode unbound+ Chat Edit Queued Message alt-up, shift-left+ Chat Prompt Stack Back alt-down, shift-right+ Chat Skip Question ctrl-]+ Chat Toggle Voice f8+ Chat Toggle Voice Mute ctrl-x+ Composer * Submit ctrl-enter+ Composer Queue tab+ Composer Toggle Shortcuts ?, shift-?+ Composer History Search Previous ctrl-r+ Composer History Search Next ctrl-s+ Editor Insert Newline ctrl-j, ctrl-m, enter, shift-enter, alt-enter+↓left/right group · enter edit shortcut · * custom · - unbound · esc closediff --git a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_fast_mode_enabled.snap b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_fast_mode_enabled.snapindex 7eb43c0ffd..edbf20a7cd 100644--- a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_fast_mode_enabled.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_fast_mode_enabled.snap@@ -7,9 +7,10 @@ expression: "render_picker(params, 120)"All configurable shortcuts.148 actions, 0 customized, 6 unbound.- [All] Common Customized (0) Unbound (6) App Composer Editor Vim Navigation Agents Approval Debug+ All Common Customized (0) Unbound (6) App Composer Editor Vim Navigation Agents Approval ›Type to search shortcuts+› Global - Open Agents unboundGlobal Open Transcript ctrl-tGlobal Open External Editor ctrl-g@@ -18,5 +19,21 @@ expression: "render_picker(params, 120)"Global - Toggle Vim Mode unboundGlobal - Toggle Fast Mode unboundGlobal Toggle Raw Output alt-r-+ Global Toggle Side Conversation ctrl-/+ Chat Interrupt Turn esc+ Chat Decrease Reasoning Effort alt-,, shift-down+ Chat Increase Reasoning Effort alt-., shift-up+ Chat - Previous Permission Mode unbound+ Chat - Next Permission Mode unbound+ Chat Edit Queued Message alt-up, shift-left+ Chat Prompt Stack Back alt-down, shift-right+ Chat Skip Question ctrl-]+ Chat Toggle Voice f8+ Chat Toggle Voice Mute ctrl-x+ Composer Submit enter+ Composer Queue tab+ Composer Toggle Shortcuts ?, shift-?+ Composer History Search Previous ctrl-r+ Composer History Search Next ctrl-s+↓left/right group · enter edit shortcut · * custom · - unbound · esc closediff --git a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_global_chord.snap b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_global_chord.snapindex b8b07e81ac..5fd043dec5 100644--- a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_global_chord.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_global_chord.snap@@ -7,9 +7,10 @@ expression: "render_picker(params, 120)"All configurable shortcuts.147 actions, 1 customized, 6 unbound.- [All] Common Customized (1) Unbound (6) App Composer Editor Vim Navigation Agents Approval Debug+ All Common Customized (1) Unbound (6) App Composer Editor Vim Navigation Agents Approval ›Type to search shortcuts+› Global - Open Agents unboundGlobal * Open Transcript ctrl-t, ctrl-x ctrl-tGlobal Open External Editor ctrl-g@@ -18,5 +19,21 @@ expression: "render_picker(params, 120)"Global - Toggle Vim Mode unboundGlobal Toggle Raw Output alt-rGlobal Toggle Side Conversation ctrl-/-+ Chat Interrupt Turn esc+ Chat Decrease Reasoning Effort alt-,, shift-down+ Chat Increase Reasoning Effort alt-., shift-up+ Chat - Previous Permission Mode unbound+ Chat - Next Permission Mode unbound+ Chat Edit Queued Message alt-up, shift-left+ Chat Prompt Stack Back alt-down, shift-right+ Chat Skip Question ctrl-]+ Chat Toggle Voice f8+ Chat - Toggle Voice Mute unbound+ Composer Submit enter+ Composer Queue tab+ Composer Toggle Shortcuts ?, shift-?+ Composer History Search Previous ctrl-r+ Composer History Search Next ctrl-s+ Editor Insert Newline ctrl-j, ctrl-m, enter, shift-enter, alt-enter+↓left/right group · enter edit shortcut · * custom · - unbound · esc closediff --git a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_narrow.snap b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_narrow.snapindex b5223dd452..df8f1966d4 100644--- a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_narrow.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_narrow.snap@@ -7,10 +7,10 @@ expression: "render_picker(params, 78)"All configurable shortcuts.147 actions, 0 customized, 5 unbound.- [All] Common Customized (0) Unbound (5) App Composer Editor Vim- Navigation Agents Approval Debug+ All Common Customized (0) Unbound (5) App Composer Editor ›Type to search shortcuts+› Global - Open Agents unboundGlobal Open Transcript ctrl-tGlobal Open External Editor ctrl-g@@ -19,5 +19,21 @@ expression: "render_picker(params, 78)"Global - Toggle Vim Mode unboundGlobal Toggle Raw Output alt-rGlobal Toggle Side Conversation ctrl-/-+ Chat Interrupt Turn esc+ Chat Decrease Reasoning Effort alt-,, shift-down+ Chat Increase Reasoning Effort alt-., shift-up+ Chat - Previous Permission Mode unbound+ Chat - Next Permission Mode unbound+ Chat Edit Queued Message alt-up, shift-left+ Chat Prompt Stack Back alt-down, shift-right+ Chat Skip Question ctrl-]+ Chat Toggle Voice f8+ Chat Toggle Voice Mute ctrl-x+ Composer Submit enter+ Composer Queue tab+ Composer Toggle Shortcuts ?, shift-?+ Composer History Search Previous ctrl-r+ Composer History Search Next ctrl-s+ Editor Insert Newline ctrl-j, ctrl-m, enter, shift-ente…+↓left/right group · enter edit shortcut · * custom · - unbound · esc closediff --git a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_wide.snap b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_wide.snapindex dd888c732d..39f9c50966 100644--- a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_wide.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_picker_wide.snap@@ -7,9 +7,10 @@ expression: "render_picker(params, 120)"All configurable shortcuts.147 actions, 0 customized, 5 unbound.- [All] Common Customized (0) Unbound (5) App Composer Editor Vim Navigation Agents Approval Debug+ All Common Customized (0) Unbound (5) App Composer Editor Vim Navigation Agents Approval ›Type to search shortcuts+› Global - Open Agents unboundGlobal Open Transcript ctrl-tGlobal Open External Editor ctrl-g@@ -18,5 +19,21 @@ expression: "render_picker(params, 120)"Global - Toggle Vim Mode unboundGlobal Toggle Raw Output alt-rGlobal Toggle Side Conversation ctrl-/-+ Chat Interrupt Turn esc+ Chat Decrease Reasoning Effort alt-,, shift-down+ Chat Increase Reasoning Effort alt-., shift-up+ Chat - Previous Permission Mode unbound+ Chat - Next Permission Mode unbound+ Chat Edit Queued Message alt-up, shift-left+ Chat Prompt Stack Back alt-down, shift-right+ Chat Skip Question ctrl-]+ Chat Toggle Voice f8+ Chat Toggle Voice Mute ctrl-x+ Composer Submit enter+ Composer Queue tab+ Composer Toggle Shortcuts ?, shift-?+ Composer History Search Previous ctrl-r+ Composer History Search Next ctrl-s+ Editor Insert Newline ctrl-j, ctrl-m, enter, shift-enter, alt-enter+↓left/right group · enter edit shortcut · * custom · - unbound · esc closediff --git a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_question_actions.snap b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_question_actions.snapindex 259f8fddc9..a1ee16cb55 100644--- a/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_question_actions.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__keymap_setup__tests__keymap_question_actions.snap@@ -7,9 +7,18 @@ expression: "render_picker(params, 120)"All configurable shortcuts.147 actions, 0 customized, 5 unbound.- [All] Common Customized (0) Unbound (5) App Composer Editor Vim Navigation Agents Approval Debug+ All Common Customized (0) Unbound (5) App Composer Editor Vim Navigation Agents Approval ›Type to search shortcuts++ Global - Open Agents unbound+ Global Open Transcript ctrl-t+ Global Open External Editor ctrl-g+ Global Copy ctrl-o+ Global Clear Terminal ctrl-l+ Global - Toggle Vim Mode unbound+ Global Toggle Raw Output alt-r+ Global Toggle Side Conversation ctrl-/Chat Interrupt Turn escChat Decrease Reasoning Effort alt-,, shift-downChat Increase Reasoning Effort alt-., shift-up@@ -18,5 +27,13 @@ expression: "render_picker(params, 120)"Chat Edit Queued Message alt-up, shift-leftChat Prompt Stack Back alt-down, shift-right› Chat Skip Question ctrl-]-+ Chat Toggle Voice f8+ Chat Toggle Voice Mute ctrl-x+ Composer Submit enter+ Composer Queue tab+ Composer Toggle Shortcuts ?, shift-?+ Composer History Search Previous ctrl-r+ Composer History Search Next ctrl-s+ Editor Insert Newline ctrl-j, ctrl-m, enter, shift-enter, alt-enter+↓left/right group · enter edit shortcut · * custom · - unbound · esc closediff --git a/codex-rs/tui/src/snapshots/codex_tui__markdown_render__markdown_render_tests__inline_code_and_file_paths_follow_syntax_theme.snap b/codex-rs/tui/src/snapshots/codex_tui__markdown_render__markdown_render_tests__inline_code_and_file_paths_follow_syntax_theme.snapindex e5f6ff5aa1..ba3a99050c 100644--- a/codex-rs/tui/src/snapshots/codex_tui__markdown_render__markdown_render_tests__inline_code_and_file_paths_follow_syntax_theme.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__markdown_render__markdown_render_tests__inline_code_and_file_paths_follow_syntax_theme.snap@@ -48,19 +48,4 @@ expression: rendered]),],),- (- "no-markup-color",- [- Line::from_iter([- Span::from("Use "),- Span::from("src/main.rs").cyan(),- Span::from(" and "),- Span::from("./").cyan(),- ]),- Line::from_iter([- Span::from("src/lib.rs").cyan(),- Span::from("."),- ]),- ],- ),]diff --git a/codex-rs/tui/src/snapshots/codex_tui__markdown_render__markdown_render_tests__web_link_labels_have_a_visible_underline_snapshot.snap b/codex-rs/tui/src/snapshots/codex_tui__markdown_render__markdown_render_tests__web_link_labels_have_a_visible_underline_snapshot.snapindex fa0281ad31..a0e0732aee 100644--- a/codex-rs/tui/src/snapshots/codex_tui__markdown_render__markdown_render_tests__web_link_labels_have_a_visible_underline_snapshot.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__markdown_render__markdown_render_tests__web_link_labels_have_a_visible_underline_snapshot.snap@@ -2,4 +2,4 @@source: tui/src/markdown_render_tests.rsexpression: text----Text::from(Line::from_iter([Span::from("plain "), Span::from("plain").cyan().underlined(), Span::from(" ("), Span::from("https://example.com").cyan().underlined(), Span::from(")"), Span::from(" "), Span::from("code").fg(Color::Rgb(166, 227, 161)), Span::from(" "), Span::from("code").cyan().underlined(), Span::from(" ("), Span::from("https://example.com").cyan().underlined(), Span::from(")")]))+Text::from(Line::from_iter([Span::from("plain "), Span::from("plain").fg(Color::Reset).underlined(), Span::from(" ("), Span::from("https://example.com").fg(Color::Reset).underlined(), Span::from(")"), Span::from(" "), Span::from("code").fg(Color::Rgb(166, 227, 161)), Span::from(" "), Span::from("code").fg(Color::Reset).underlined(), Span::from(" ("), Span::from("https://example.com").fg(Color::Reset).underlined(), Span::from(")")]))diff --git a/codex-rs/tui/src/snapshots/codex_tui__theme_picker__model_tests__model_theme_files_preview_select_and_restore.snap b/codex-rs/tui/src/snapshots/codex_tui__theme_picker__model_tests__model_theme_files_preview_select_and_restore.snapindex 779bd7afcc..b39ed46786 100644--- a/codex-rs/tui/src/snapshots/codex_tui__theme_picker__model_tests__model_theme_files_preview_select_and_restore.snap+++ b/codex-rs/tui/src/snapshots/codex_tui__theme_picker__model_tests__model_theme_files_preview_select_and_restore.snap@@ -1,6 +1,5 @@---source: tui/src/theme_picker_model_tests.rs-assertion_line: 64expression: snapshot---ada: accent=Style::new().fg(Color::Rgb(95, 175, 255)).bold()@@ -8,40 +7,40 @@ ada: accent=Style::new().fg(Color::Rgb(95, 175, 255)).bold()13 - format!("Hello, {}!", name)13 + format!("Hello, {name}!")14 }-preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(135, 255, 135)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(135, 255, 135)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(175, 135, 255)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(175, 135, 255)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(95, 175, 255)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().green().bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().red().bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)"}+preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(135, 255, 135)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(135, 255, 135)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(175, 135, 255)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(175, 135, 255)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(95, 175, 255)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().green().bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().red().bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)"}syntax: [Line::from_iter([Span::from("let").fg(Color::Rgb(95, 175, 255)), Span::from(" answer ").fg(Color::Rgb(208, 208, 208)), Span::from("=").fg(Color::Rgb(188, 188, 188)), Span::from(" ").fg(Color::Rgb(208, 208, 208)), Span::from("42").fg(Color::Rgb(175, 135, 255)), Span::from(";").fg(Color::Rgb(188, 188, 188))])]babbage: accent=Style::new().fg(Color::Rgb(0, 135, 0)).bold()12 fn greet(name: &str) -> String {13 - format!("Hello, {}!", name)13 + format!("Hello, {name}!")14 }-preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 135, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 135, 0)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 135, 0)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(135, 0, 135)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(135, 0, 135)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Rgb(172, 238, 187)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Rgb(255, 206, 203)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset).dim()", "Style::new().green().bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().red().bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)"}+preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 127, 0)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 129, 0)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 135, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(135, 0, 135)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(135, 0, 135)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Rgb(172, 238, 187)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Rgb(255, 206, 203)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().green().bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().red().bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)"}syntax: [Line::from_iter([Span::from("let").fg(Color::Rgb(0, 135, 0)), Span::from(" answer ").fg(Color::Rgb(68, 68, 68)), Span::from("=").fg(Color::Rgb(88, 88, 88)), Span::from(" ").fg(Color::Rgb(68, 68, 68)), Span::from("42").fg(Color::Rgb(135, 0, 135)), Span::from(";").fg(Color::Rgb(88, 88, 88))])]curie: accent=Style::new().fg(Color::Rgb(215, 175, 0)).bold()12 fn greet(name: &str) -> String {13 - format!("Hello, {}!", name)13 + format!("Hello, {name}!")14 }-preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(215, 175, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(215, 175, 95)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(215, 175, 95)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(255, 175, 95)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(255, 175, 95)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().green().bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().red().bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)"}+preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(215, 175, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(215, 175, 95)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(215, 175, 95)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(255, 175, 95)).bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(255, 175, 95)).bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)", "Style::new().green().bg(Color::Rgb(33, 58, 43)).underline_color(Color::Reset)", "Style::new().red().bg(Color::Rgb(74, 34, 29)).underline_color(Color::Reset)"}syntax: [Line::from_iter([Span::from("let").fg(Color::Rgb(215, 175, 0)), Span::from(" answer ").fg(Color::Rgb(208, 208, 208)), Span::from("=").fg(Color::Rgb(188, 188, 188)), Span::from(" ").fg(Color::Rgb(208, 208, 208)), Span::from("42").fg(Color::Rgb(215, 175, 95)), Span::from(";").fg(Color::Rgb(188, 188, 188))])]cushman: accent=Style::new().fg(Color::Rgb(0, 135, 255)).bold()12 fn greet(name: &str) -> String {13 - format!("Hello, {}!", name)13 + format!("Hello, {name}!")14 }-preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 135, 0)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 135, 0)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(0, 95, 175)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(135, 0, 135)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(135, 0, 135)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Rgb(172, 238, 187)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Rgb(255, 206, 203)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset).dim()", "Style::new().green().bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().red().bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)"}+preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Reset).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 127, 0)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 129, 0)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(0, 95, 175)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(135, 0, 135)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(135, 0, 135)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Rgb(172, 238, 187)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Rgb(255, 206, 203)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)", "Style::new().green().bg(Color::Rgb(218, 251, 225)).underline_color(Color::Reset)", "Style::new().red().bg(Color::Rgb(255, 235, 233)).underline_color(Color::Reset)"}syntax: [Line::from_iter([Span::from("let").fg(Color::Rgb(0, 95, 175)), Span::from(" answer ").fg(Color::Rgb(68, 68, 68)), Span::from("=").fg(Color::Rgb(88, 88, 88)), Span::from(" ").fg(Color::Rgb(68, 68, 68)), Span::from("42").fg(Color::Rgb(135, 0, 135)), Span::from(";").fg(Color::Rgb(88, 88, 88))])]dali: accent=Style::new().fg(Color::Rgb(215, 175, 0)).bold()12 fn greet(name: &str) -> String {13 - format!("Hello, {}!", name)13 + format!("Hello, {name}!")14 }-preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(215, 175, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(255, 135, 255)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(255, 135, 255)).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(255, 95, 255)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(255, 95, 255)).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().green().bg(Color::Reset).underline_color(Color::Reset)", "Style::new().red().bg(Color::Reset).underline_color(Color::Reset)"}+preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(188, 188, 188)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(208, 208, 208)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(215, 175, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(255, 135, 255)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(255, 95, 255)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().green().bg(Color::Reset).underline_color(Color::Reset)", "Style::new().red().bg(Color::Reset).underline_color(Color::Reset)"}syntax: [Line::from_iter([Span::from("let").fg(Color::Rgb(215, 175, 0)), Span::from(" answer ").fg(Color::Rgb(208, 208, 208)), Span::from("=").fg(Color::Rgb(188, 188, 188)), Span::from(" ").fg(Color::Rgb(208, 208, 208)), Span::from("42").fg(Color::Rgb(255, 95, 255)), Span::from(";").fg(Color::Rgb(188, 188, 188))])]davinci: accent=Style::new().fg(Color::Rgb(215, 95, 0)).bold()12 fn greet(name: &str) -> String {13 - format!("Hello, {}!", name)13 + format!("Hello, {name}!")14 }-preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(175, 135, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(175, 135, 0)).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(175, 95, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(175, 95, 0)).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().green().bg(Color::Reset).underline_color(Color::Reset)", "Style::new().red().bg(Color::Reset).underline_color(Color::Reset)"}+preview styles: {"Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Reset).bg(Color::Reset).underline_color(Color::Reset).dim()", "Style::new().fg(Color::Rgb(148, 114, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(175, 95, 0)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(31, 35, 40)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(68, 68, 68)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().fg(Color::Rgb(88, 88, 88)).bg(Color::Reset).underline_color(Color::Reset)", "Style::new().green().bg(Color::Reset).underline_color(Color::Reset)", "Style::new().red().bg(Color::Reset).underline_color(Color::Reset)"}syntax: [Line::from_iter([Span::from("let").fg(Color::Rgb(175, 95, 0)), Span::from(" answer ").fg(Color::Rgb(68, 68, 68)), Span::from("=").fg(Color::Rgb(88, 88, 88)), Span::from(" ").fg(Color::Rgb(68, 68, 68)), Span::from("42").fg(Color::Rgb(175, 135, 0)), Span::from(";").fg(Color::Rgb(88, 88, 88))])]diff --git a/codex-rs/tui/src/status_indicator_widget.rs b/codex-rs/tui/src/status_indicator_widget.rsindex a6cfe78f7b..f7d9fa5845 100644--- a/codex-rs/tui/src/status_indicator_widget.rs+++ b/codex-rs/tui/src/status_indicator_widget.rs@@ -246,11 +246,9 @@ impl StatusIndicator<'_> {if row.show_interrupt_hint&& let Some(interrupt_binding) = row.interrupt_binding{- spans.extend(vec![- format!("({pretty_elapsed} • ").dim(),- interrupt_binding.into(),- " to interrupt)".dim(),- ]);+ spans.push(format!("({pretty_elapsed} • ").dim());+ spans.extend(interrupt_binding.spans());+ spans.push(" to interrupt)".dim());} else {spans.push(format!("({pretty_elapsed})").dim());}diff --git a/codex-rs/tui/src/streaming/render_tests.rs b/codex-rs/tui/src/streaming/render_tests.rsindex 55aefd1c9c..2a0bbc54a0 100644--- a/codex-rs/tui/src/streaming/render_tests.rs+++ b/codex-rs/tui/src/streaming/render_tests.rs@@ -102,7 +102,13 @@ fn incremental_render_keeps_final_block_mutable_and_matches_full_render() {"| --- | --- |\n","| alpha | beta |\n",];- let (source, render) = assert_rich_stream_matches_full_render(&chunks, Some(48));+ let (source, render) = crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),+ },+ || assert_rich_stream_matches_full_render(&chunks, /*width*/ Some(48)),+ );assert!(render.stable_source_len > 0);assert!(render.stable_source_len < source.len());@@ -122,7 +128,13 @@ fn incremental_file_citations_preserve_metadata_unicode_and_markdown() {.map(|(filename, prefix)| {let tail = format!("path=\"{}\"}}\n", cwd.join(filename).display());let chunks = ["# Output\n\n", prefix, &tail, "\n", "Continue.\n"];- let (_, render) = assert_rich_stream_matches_full_render(&chunks, Some(80));+ let (_, render) = crate::terminal_palette::with_test_default_colors(+ crate::terminal_probe::DefaultColors {+ fg: (220, 220, 220),+ bg: (20, 20, 20),+ },+ || assert_rich_stream_matches_full_render(&chunks, /*width*/ Some(80)),+ );render.lines});diff --git a/codex-rs/tui/src/streaming/snapshots/codex_tui__streaming__render__tests__incremental_render_representative_stream.snap b/codex-rs/tui/src/streaming/snapshots/codex_tui__streaming__render__tests__incremental_render_representative_stream.snapindex 59fe18f1c8..08bd4e48d5 100644--- a/codex-rs/tui/src/streaming/snapshots/codex_tui__streaming__render__tests__incremental_render_representative_stream.snap+++ b/codex-rs/tui/src/streaming/snapshots/codex_tui__streaming__render__tests__incremental_render_representative_stream.snap@@ -1,5 +1,6 @@---source: tui/src/streaming/render_tests.rs+assertion_line: 115expression: render.lines---[@@ -17,7 +18,7 @@ expression: render.linesHyperlinkLine {line: Line::from_iter([Span::from("First paragraph with a "),- Span::from("link").cyan().underlined(),+ Span::from("link").fg(Color::Rgb(99, 168, 248)).underlined(),]),hyperlinks: [TerminalHyperlink {@@ -30,7 +31,7 @@ expression: render.linesHyperlinkLine {line: Line::from_iter([Span::from("("),- Span::from("https://example.com").cyan().underlined(),+ Span::from("https://example.com").fg(Color::Rgb(99, 168, 248)).underlined(),Span::from(")"),Span::from("."),]),@@ -52,14 +53,14 @@ expression: render.lines},HyperlinkLine {line: Line::from_iter([- Span::from("1. ").light_blue(),+ Span::from("1. ").fg(Color::Rgb(99, 168, 248)),Span::from("First item"),]),hyperlinks: [],},HyperlinkLine {line: Line::from_iter([- Span::from("2. ").light_blue(),+ Span::from("2. ").fg(Color::Rgb(99, 168, 248)),Span::from("Second item"),]),hyperlinks: [],diff --git a/codex-rs/tui/src/style.rs b/codex-rs/tui/src/style.rsindex 47279c16be..32e64ca6b8 100644--- a/codex-rs/tui/src/style.rs+++ b/codex-rs/tui/src/style.rs@@ -1,3 +1,8 @@+//! Shared TUI colors and semantic styles, including the picker and transcript accent.+//! Informative accents meet minimum contrast on known backgrounds and supported palettes.++mod contrast;+use crate::color::blend;use crate::color::is_light;use crate::terminal_palette::StdoutColorLevel;@@ -10,7 +15,16 @@ use crate::terminal_palette::stdout_color_level;use ratatui::style::Color;use ratatui::style::Style;-const LIGHT_BG_ACCENT_RGB: (u8, u8, u8) = (0, 95, 135);+const LIGHT_BG_ACCENT_RGB: (u8, u8, u8) = (28, 100, 200);++/// ChatGPT Blue 100 (#A4CDFB), used for selection fills on light backgrounds.+pub(crate) const CHATGPT_BLUE_100: (u8, u8, u8) = (164, 205, 251);++/// ChatGPT Blue 200 (#63A8F8).+pub(crate) const CHATGPT_BLUE_200: (u8, u8, u8) = (99, 168, 248);++/// Shared accent for picker selection backgrounds and transcript foreground emphasis.+pub(crate) const UI_ACCENT: (u8, u8, u8) = CHATGPT_BLUE_200;#[derive(Clone, Copy)]pub(crate) enum StatusTone {@@ -47,6 +61,20 @@ pub fn user_message_style() -> Style {user_message_style_for(default_bg())}+/// Submitted prompts use a lighter fill than the editable composer in either theme.+#[allow(dead_code, reason = "Used by later layers of the TUI refresh stack.")]+pub(crate) fn history_prompt_style() -> Style {+ let Some(background) = default_bg() else {+ return Style::default();+ };+ let (foreground, alpha) = if is_light(background) {+ ((0, 0, 0), 0.02)+ } else {+ ((255, 255, 255), 0.16)+ };+ Style::default().bg(best_color(blend(foreground, background, alpha)))+}+pub fn proposed_plan_style() -> Style {proposed_plan_style_for(default_bg())}@@ -72,20 +100,112 @@ pub(crate) fn accent_style() -> Style {accent_style_for(default_bg())}-pub(crate) fn footer_hint_key_style() -> Style {- if default_bg().is_some_and(is_light) {- Style::default().fg(Color::Black)- } else {- Style::default()+/// Returns the foreground accent without imposing bold or dim text modifiers.+pub(crate) fn accent_color() -> Color {+ accent_color_for(default_bg())+}++/// Resolve emphasis against the fill actually painted behind it.+pub(crate) fn accent_color_on(background: Option<Color>) -> Color {+ accent_color_for(background_rgb(background))+}++fn background_rgb(background: Option<Color>) -> Option<(u8, u8, u8)> {+ match background {+ Some(Color::Rgb(r, g, b)) => Some((r, g, b)),+ Some(Color::Indexed(index)) if index >= 16 => {+ Some(crate::terminal_palette::XTERM_COLORS[usize::from(index)])+ }+ None | Some(Color::Reset) => default_bg(),+ _ => None,}}-pub(crate) fn footer_hint_label_style() -> Style {- if default_bg().is_some_and(is_light) {- Style::default().fg(Color::DarkGray)+/// Keep theme-derived text readable on its painted surface, preserving terminal-owned ANSI colors.+pub(crate) fn readable_color_on(preferred: Color, background: Option<Color>) -> Color {+ let preferred = match preferred {+ Color::Rgb(r, g, b) => Some((r, g, b)),+ Color::Indexed(index) if index >= 16 => {+ Some(crate::terminal_palette::XTERM_COLORS[usize::from(index)])+ }+ Color::Reset => default_fg(),+ _ => return preferred,+ };+ preferred.map_or(Color::Reset, |preferred| {+ contrast::foreground(+ preferred,+ background_rgb(background),+ effective_stdout_color_level(),+ )+ })+}++/// Secondary text uses a measured foreground instead of terminal-dependent dimming.+pub(crate) fn secondary_text_style() -> Style {+ let preferred = default_fg()+ .zip(default_bg())+ .map_or(Color::Reset, |(fg, bg)| {+ rgb_color(blend(fg, bg, /*alpha*/ 0.6))+ });+ Style::default()+ .fg(readable_color_on(preferred, /*background*/ None))+ .not_dim()+ .not_bold()+}++pub(crate) fn selection_style() -> Style {+ contrast::selection_style(default_bg(), effective_stdout_color_level())+}++/// Resolve emphasis on the shaded prompt surface, including its quantized background.+#[allow(dead_code, reason = "Used by later layers of the TUI refresh stack.")]+pub(crate) fn user_message_accent_color() -> Color {+ user_message_accent_color_for(default_bg(), effective_stdout_color_level())+}++#[allow(dead_code, reason = "Used by later layers of the TUI refresh stack.")]+fn user_message_accent_color_for(+ background: Option<(u8, u8, u8)>,+ level: StdoutColorLevel,+) -> Color {+ let preferred = if background.is_some_and(is_light) {+ LIGHT_BG_ACCENT_RGB} else {- Style::default().dim()- }+ UI_ACCENT+ };+ let surface = background.and_then(|background| {+ match crate::terminal_palette::best_color_for_level(user_message_bg_rgb(background), level)+ {+ Color::Rgb(r, g, b) => Some((r, g, b)),+ Color::Indexed(index) => {+ Some(crate::terminal_palette::XTERM_COLORS[usize::from(index)])+ }+ _ => None,+ }+ });+ contrast::foreground(preferred, surface, level)+}++/// Muted amber keeps the passive warning count visible without looking like an error.+#[allow(dead_code, reason = "Used by later layers of the TUI refresh stack.")]+pub(crate) fn warning_notice_style() -> Style {+ warning_notice_style_for(default_bg(), effective_stdout_color_level())+}++#[allow(dead_code, reason = "Used by later layers of the TUI refresh stack.")]+fn warning_notice_style_for(background: Option<(u8, u8, u8)>, level: StdoutColorLevel) -> Style {+ let preferred = if background.is_some_and(is_light) {+ (139, 98, 20)+ } else {+ (196, 167, 103)+ };+ Style::default()+ .fg(contrast::foreground(preferred, background, level))+ .remove_modifier(ratatui::style::Modifier::DIM)+}++pub(crate) fn footer_hint_label_style() -> Style {+ secondary_text_style()}/// Returns the style for a user-authored message using the provided terminal background.@@ -105,11 +225,16 @@ pub fn proposed_plan_style_for(terminal_bg: Option<(u8, u8, u8)>) -> Style {/// Returns the shared accent style for the provided terminal background.pub(crate) fn accent_style_for(terminal_bg: Option<(u8, u8, u8)>) -> Style {- if terminal_bg.is_some_and(is_light) {- Style::default().fg(best_color(LIGHT_BG_ACCENT_RGB)).bold()+ Style::default().fg(accent_color_for(terminal_bg)).bold()+}++fn accent_color_for(terminal_bg: Option<(u8, u8, u8)>) -> Color {+ let preferred = if terminal_bg.is_some_and(is_light) {+ LIGHT_BG_ACCENT_RGB} else {- Style::default().fg(Color::Cyan).bold()- }+ UI_ACCENT+ };+ contrast::foreground(preferred, terminal_bg, effective_stdout_color_level())}fn table_separator_style_for(@@ -151,7 +276,6 @@ pub fn proposed_plan_bg(terminal_bg: (u8, u8, u8)) -> Color {mod tests {use super::*;use pretty_assertions::assert_eq;- use ratatui::style::Modifier;#[test]fn status_colors_preserve_light_terminal_themes() {@@ -227,31 +351,33 @@ mod tests {let theme =crate::render::highlight::resolve_theme_by_name("ada", /*codex_home*/ None).unwrap();crate::render::highlight::set_syntax_theme(theme);- let expected = match level.as_str() {- "3" => Style::default().fg(rgb_color((95, 175, 255))).bold(),- "2" => Style::default()- .fg(crate::terminal_palette::indexed_color(/*index*/ 75))- .bold(),- "0" | "1" => accent_style_for(default_bg()),+ let (expected_level, expected_foreground) = match level.as_str() {+ "3" => (StdoutColorLevel::TrueColor, rgb_color((95, 175, 255))),+ "2" => (+ StdoutColorLevel::Ansi256,+ crate::terminal_palette::indexed_color(/*index*/ 75),+ ),+ "1" => (StdoutColorLevel::Ansi16, Color::Reset),+ "0" => (StdoutColorLevel::Unknown, Color::Reset),_ => unreachable!(),};- assert_eq!(accent_style(), expected);- }-- #[test]- fn accent_style_uses_darker_cyan_on_light_backgrounds() {- let style = accent_style_for(Some((255, 255, 255)));-- assert_eq!(style.fg, Some(best_color(LIGHT_BG_ACCENT_RGB)));- assert!(style.add_modifier.contains(Modifier::BOLD));- }-- #[test]- fn accent_style_uses_cyan_on_dark_or_unknown_backgrounds() {- let expected = Style::default().fg(Color::Cyan).bold();-- assert_eq!(accent_style_for(Some((0, 0, 0))), expected);- assert_eq!(accent_style_for(/*terminal_bg*/ None), expected);+ assert_eq!(effective_stdout_color_level(), expected_level);+ crate::terminal_palette::set_default_colors_from_startup_probe(/*colors*/ None);+ // Preserve configured theme accents when the terminal can represent their palette.+ assert_eq!(+ accent_style(),+ Style::default().fg(expected_foreground).bold()+ );+ assert_eq!(+ readable_color_on(rgb_color((95, 175, 255)), /*background*/ None),+ expected_foreground,+ );+ // An explicit surface exercises the real child-process depth without the truecolor+ // override used by widget palette fixtures.+ assert_eq!(+ readable_color_on(rgb_color((95, 175, 255)), Some(rgb_color((24, 24, 24)))),+ expected_foreground,+ );}#[test]diff --git a/codex-rs/tui/src/style/contrast.rs b/codex-rs/tui/src/style/contrast.rsnew file mode 100644index 0000000000..8400f6ddea--- /dev/null+++ b/codex-rs/tui/src/style/contrast.rs@@ -0,0 +1,155 @@+//! Resolve informative foregrounds against their actual background before palette reduction.+//! Missing background samples preserve the requested palette color; unknown color capabilities+//! and user-defined ANSI palettes retain the terminal's default foreground.++use crate::color::blend;+use crate::color::is_light;+use crate::color::perceptual_distance;+use crate::terminal_palette::StdoutColorLevel;+use crate::terminal_palette::XTERM_COLORS;+use crate::terminal_palette::best_color_for_level;+use crate::terminal_palette::indexed_color;+use crate::terminal_palette::rgb_color;+use ratatui::style::Color;+use ratatui::style::Style;+use std::cell::RefCell;+use std::collections::HashMap;++const MIN_TEXT_CONTRAST: f64 = 4.5;+const MAX_CACHED_FOREGROUNDS: usize = 512;++#[derive(Clone, Copy, Eq, Hash, PartialEq)]+struct ForegroundKey {+ preferred: (u8, u8, u8),+ background: Option<(u8, u8, u8)>,+ level: StdoutColorLevel,+}++thread_local! {+ // Diff spans reuse a small palette. Bound storage even when themes contain many colors.+ // Resolved backgrounds and capabilities are part of the key, so probe/theme changes cannot+ // reuse a result for the previous surface.+ static FOREGROUNDS: RefCell<HashMap<ForegroundKey, Color>> = RefCell::default();+}++pub(super) fn selection_style(background: Option<(u8, u8, u8)>, level: StdoutColorLevel) -> Style {+ let fallback = Style::default()+ .fg(Color::Reset)+ .bg(Color::Reset)+ .bold()+ .not_dim()+ .reversed();+ let Some(background) = background else {+ return fallback;+ };+ let (preferred, alternate) = if is_light(background) {+ (super::CHATGPT_BLUE_100, super::CHATGPT_BLUE_200)+ } else {+ (super::CHATGPT_BLUE_200, super::CHATGPT_BLUE_100)+ };+ let mut fill = best_color_for_level(preferred, level);+ let resolve = |color| match color {+ Color::Rgb(r, g, b) => Some((r, g, b)),+ Color::Indexed(index) if index >= 16 => Some(XTERM_COLORS[usize::from(index)]),+ _ => None,+ };+ let Some(mut fill_rgb) = resolve(fill) else {+ return fallback;+ };+ // A subtle fill is intentional, but it must not disappear into a similarly blue canvas.+ if ratio(fill_rgb, background) < 1.25 {+ let alternate_fill = best_color_for_level(alternate, level);+ let alternate_rgb = resolve(alternate_fill).unwrap_or(alternate);+ if ratio(alternate_rgb, background) > ratio(fill_rgb, background) {+ fill = alternate_fill;+ fill_rgb = alternate_rgb;+ }+ }+ Style::default()+ .fg(foreground(+ /*preferred*/ (0, 0, 46),+ Some(fill_rgb),+ level,+ ))+ .bg(fill)+ .bold()+ .not_dim()+ .not_reversed()+}++pub(super) fn foreground(+ preferred: (u8, u8, u8),+ background: Option<(u8, u8, u8)>,+ level: StdoutColorLevel,+) -> Color {+ FOREGROUNDS.with(|cache| {+ let key = ForegroundKey {+ preferred,+ background,+ level,+ };+ let mut cache = cache.borrow_mut();+ if let Some(color) = cache.get(&key) {+ return *color;+ }+ let color = match (background, level) {+ (None, _) => best_color_for_level(preferred, level),+ (Some(background), StdoutColorLevel::TrueColor) => {+ if ratio(preferred, background) >= MIN_TEXT_CONTRAST {+ rgb_color(preferred)+ } else {+ let black = (0, 0, 0);+ let white = (255, 255, 255);+ let endpoint = if ratio(black, background) >= ratio(white, background) {+ black+ } else {+ white+ };+ // Bounded search preserves as much of the requested hue as the surface allows.+ (1..=255)+ .map(|step| blend(endpoint, preferred, step as f32 / 255.0))+ .find(|candidate| ratio(*candidate, background) >= MIN_TEXT_CONTRAST)+ .map_or_else(|| rgb_color(endpoint), rgb_color)+ }+ }+ (Some(background), StdoutColorLevel::Ansi256) => XTERM_COLORS+ .iter()+ .enumerate()+ .skip(/*n*/ 16)+ .filter(|(_, color)| ratio(**color, background) >= MIN_TEXT_CONTRAST)+ .min_by(|(_, a), (_, b)| {+ perceptual_distance(**a, preferred)+ .total_cmp(&perceptual_distance(**b, preferred))+ })+ .map_or(Color::Reset, |(index, _)| indexed_color(index as u8)),+ (Some(_), StdoutColorLevel::Ansi16 | StdoutColorLevel::Unknown) => Color::Reset,+ };+ if cache.len() >= MAX_CACHED_FOREGROUNDS {+ cache.clear();+ }+ cache.insert(key, color);+ color+ })+}++fn ratio(a: (u8, u8, u8), b: (u8, u8, u8)) -> f64 {+ let a = luminance(a);+ let b = luminance(b);+ (a.max(b) + 0.05) / (a.min(b) + 0.05)+}++fn luminance(rgb: (u8, u8, u8)) -> f64 {+ let [r, g, b] = [rgb.0, rgb.1, rgb.2].map(|channel| {+ let value = f64::from(channel) / 255.0;+ if value <= 0.04045 {+ value / 12.92+ } else {+ ((value + 0.055) / 1.055).powf(/*n*/ 2.4)+ }+ });+ 0.2126 * r + 0.7152 * g + 0.0722 * b+}++#[cfg(test)]+#[path = "contrast_tests.rs"]+mod tests;diff --git a/codex-rs/tui/src/style/contrast_tests.rs b/codex-rs/tui/src/style/contrast_tests.rsnew file mode 100644index 0000000000..ebf6df0ad8--- /dev/null+++ b/codex-rs/tui/src/style/contrast_tests.rs@@ -0,0 +1,162 @@+//! Check rendered foregrounds after color conversion, including mid-tone backgrounds.++use super::*;+use pretty_assertions::assert_eq;+use ratatui::buffer::Buffer;+use ratatui::layout::Rect;+use ratatui::style::Modifier;+use ratatui::text::Line;+use ratatui::widgets::Widget;++#[test]+fn selection_text_stays_readable_after_palette_conversion() {+ for background in [+ (255, 255, 255),+ (245, 240, 220),+ (130, 130, 130),+ super::super::CHATGPT_BLUE_100,+ (132, 184, 248),+ (18, 20, 30),+ ] {+ for level in [StdoutColorLevel::TrueColor, StdoutColorLevel::Ansi256] {+ let area = Rect::new(+ /*x*/ 0, /*y*/ 0, /*width*/ 8, /*height*/ 1,+ );+ let mut buffer = Buffer::empty(area);+ buffer.set_style(area, Style::default().dim());+ Line::from("› resume")+ .style(selection_style(Some(background), level))+ .render(area, &mut buffer);+ let cell = &buffer[(0, 0)];+ let resolve = |color| match color {+ Color::Rgb(r, g, b) => (r, g, b),+ Color::Indexed(index) => XTERM_COLORS[usize::from(index)],+ _ => panic!("expected an explicit color: {color:?}"),+ };+ assert!(ratio(resolve(cell.fg), resolve(cell.bg)) >= MIN_TEXT_CONTRAST);+ let preferred = if is_light(background) {+ super::super::CHATGPT_BLUE_100+ } else {+ super::super::CHATGPT_BLUE_200+ };+ assert!(+ ratio(resolve(cell.bg), background)+ >= ratio(resolve(best_color_for_level(preferred, level)), background)+ );+ assert_eq!(cell.modifier, Modifier::BOLD);+ }+ }+}++#[test]+fn selection_uses_terminal_defaults_without_a_known_palette() {+ for (background, level) in [+ (None, StdoutColorLevel::TrueColor),+ (Some((255, 255, 255)), StdoutColorLevel::Ansi16),+ (Some((255, 255, 255)), StdoutColorLevel::Unknown),+ ] {+ let area = Rect::new(+ /*x*/ 0, /*y*/ 0, /*width*/ 1, /*height*/ 1,+ );+ let mut buffer = Buffer::empty(area);+ buffer.set_style(area, Style::default().red().bg(Color::Yellow).dim());+ Line::from("›")+ .style(selection_style(background, level))+ .render(area, &mut buffer);+ let cell = &buffer[(0, 0)];+ assert_eq!(+ (cell.fg, cell.bg, cell.modifier),+ (+ Color::Reset,+ Color::Reset,+ Modifier::BOLD | Modifier::REVERSED+ )+ );+ }+}++#[test]+fn foreground_meets_minimum_after_palette_conversion() {+ for background in [+ (255, 255, 255),+ (245, 240, 220),+ (130, 130, 130),+ (18, 20, 30),+ ] {+ for preferred in [+ super::super::LIGHT_BG_ACCENT_RGB,+ super::super::UI_ACCENT,+ (139, 98, 20),+ (196, 167, 103),+ ] {+ for level in [StdoutColorLevel::TrueColor, StdoutColorLevel::Ansi256] {+ let color = foreground(preferred, Some(background), level);+ let rgb = match color {+ Color::Rgb(r, g, b) => (r, g, b),+ Color::Indexed(index) => XTERM_COLORS[usize::from(index)],+ _ => panic!("expected an explicit color: {color:?}"),+ };+ assert!(+ ratio(rgb, background) >= MIN_TEXT_CONTRAST,+ "{rgb:?} on {background:?}"+ );+ }+ }+ }+}++#[test]+fn shaded_surface_contrast_uses_its_rendered_palette_background() {+ for background in [+ (255, 255, 255),+ (225, 220, 205),+ (130, 130, 130),+ (95, 95, 95),+ (18, 20, 30),+ ] {+ for level in [StdoutColorLevel::TrueColor, StdoutColorLevel::Ansi256] {+ let color = super::super::user_message_accent_color_for(Some(background), level);+ let surface = crate::terminal_palette::best_color_for_level(+ super::super::user_message_bg_rgb(background),+ level,+ );+ let resolve = |color| match color {+ Color::Rgb(r, g, b) => (r, g, b),+ Color::Indexed(index) => XTERM_COLORS[usize::from(index)],+ _ => panic!("expected explicit palette color"),+ };+ assert!(ratio(resolve(color), resolve(surface)) >= MIN_TEXT_CONTRAST);+ }+ }+}++#[test]+fn repeated_colors_follow_palette_changes_and_remain_bounded() {+ let preferred = (95, 175, 255);+ let backgrounds = [None, Some((24, 24, 24)), Some((245, 245, 245))];+ let levels = [+ StdoutColorLevel::TrueColor,+ StdoutColorLevel::Ansi256,+ StdoutColorLevel::Ansi16,+ StdoutColorLevel::Unknown,+ ];+ let expected =+ backgrounds.map(|background| levels.map(|level| foreground(preferred, background, level)));+ for index in 0..MAX_CACHED_FOREGROUNDS * 2 {+ let varied = (index as u8, (index / 256) as u8, 42);+ foreground(+ varied,+ /*background*/ None,+ StdoutColorLevel::TrueColor,+ );+ assert_eq!(+ backgrounds+ .map(|background| { levels.map(|level| foreground(preferred, background, level)) }),+ expected,+ );+ FOREGROUNDS.with(|cache| assert!(cache.borrow().len() <= MAX_CACHED_FOREGROUNDS));+ }+ assert_ne!(expected[1][0], expected[2][0]);+ assert_eq!(expected[0][0], rgb_color(preferred));+ assert_eq!(expected[0][2..], [Color::Reset, Color::Reset]);+}diff --git a/codex-rs/tui/src/terminal_palette.rs b/codex-rs/tui/src/terminal_palette.rsindex 9c4b4eb696..7ff9b968f9 100644--- a/codex-rs/tui/src/terminal_palette.rs+++ b/codex-rs/tui/src/terminal_palette.rs@@ -3,7 +3,7 @@ use codex_terminal_detection::TerminalName;use codex_terminal_detection::terminal_info;use ratatui::style::Color;-#[derive(Clone, Copy, Debug, Eq, PartialEq)]+#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]pub enum StdoutColorLevel {TrueColor,Ansi256,diff --git a/codex-rs/tui/src/theme_picker.rs b/codex-rs/tui/src/theme_picker.rsindex a03d6f8a3c..493b9f84f7 100644--- a/codex-rs/tui/src/theme_picker.rs+++ b/codex-rs/tui/src/theme_picker.rs@@ -413,7 +413,6 @@ pub(crate) fn build_theme_picker_params(mod tests {use super::*;use pretty_assertions::assert_eq;- use ratatui::style::Modifier;fn render_buffer(renderable: &dyn Renderable, width: u16, height: u16) -> Buffer {let area = Rect::new(0, 0, width, height);@@ -440,17 +439,6 @@ mod tests {.collect()}- fn first_non_space_style_after_marker(buf: &Buffer, row: u16, width: u16) -> Option<Modifier> {- let marker_col = (0..width)- .find(|&col| buf[(col, row)].symbol() == "-" || buf[(col, row)].symbol() == "+")?;- for col in marker_col + 1..width {- if buf[(col, row)].symbol() != " " {- return Some(buf[(col, row)].style().add_modifier);- }- }- None- }-fn preview_line_number(line: &str) -> Option<usize> {let trimmed = line.trim_start();let digits_len = trimmed.chars().take_while(char::is_ascii_digit).count();@@ -578,25 +566,6 @@ mod tests {);}- #[test]- fn deleted_preview_code_uses_dim_overlay_like_real_diff_renderer() {- let width = 80;- let height = 6;- let buf = render_buffer(&ThemePreviewNarrowRenderable, width, height);- let lines = render_lines(&ThemePreviewNarrowRenderable, width, height);- let deleted_row = lines- .iter()- .enumerate()- .find_map(|(row, line)| (preview_line_marker(line) == Some('-')).then_some(row as u16))- .expect("expected a deleted preview row");- let modifiers = first_non_space_style_after_marker(&buf, deleted_row, width)- .expect("expected code text after diff marker");- assert!(- modifiers.contains(Modifier::DIM),- "expected deleted preview code to be dimmed"- );- }-#[test]fn subtitle_uses_tilde_path_when_codex_home_under_home_directory() {let home = dirs::home_dir().expect("home directory should be available");diff --git a/codex-rs/tui/styles.md b/codex-rs/tui/styles.mdindex 378970ada7..3fc3e99890 100644--- a/codex-rs/tui/styles.md+++ b/codex-rs/tui/styles.md@@ -2,19 +2,34 @@- **Headers:** Use `bold`. For markdown with various header levels, leave in the `#` signs.- **Primary text:** Default.-- **Secondary text:** Use `dim`.+- **Secondary text:** Use `style::secondary_text_style()` for shared footer descriptions and+ status lines. It resolves a readable muted foreground when the terminal palette is known+ and clears inherited dim/bold modifiers. Other secondary surfaces may still use `dim`.++- **Keyboard hints:** Use `key_hint` span helpers for compact, uniformly bold shortcut labels+ and readable secondary descriptions. Include `+`, `/`, and chord separators in the label's+ emphasis. The `?` shortcut reference uses readable accent-colored keys+ without bold. Separate composer footer actions with ` · `.# Foreground colors- **Default:** Most of the time, just use the default foreground color. `reset` can help get it back.-- **User input tips, selection, and status indicators:** Use ANSI `cyan`.+- **Active controls and input emphasis:** Use `style::accent_style()` or+ `style::accent_color_on(background)` for text on a painted surface.+- **Semantic statuses:** Use `style::status_style(StatusTone)`; terminal-owned ANSI+ colors remain the fallback for limited palettes.- **Success and additions:** Use ANSI `green`.- **Errors, failures and deletions:** Use ANSI `red`.- **Codex:** Use ANSI `magenta`.# Avoid-- Avoid custom colors because there's no guarantee that they'll contrast well or look good in various terminal color themes. (`shimmer.rs` is an exception that works well because we take the default colors and just adjust their levels.)+- Avoid unchecked custom foreground colors. Use `style::readable_color_on(color, background)`+ for theme-derived text, passing the background actually painted behind it. `None` means+ the terminal background; color reduction is included in the contrast check. When the+ background is unknown, supported theme colors are preserved rather than guessed.+ Generic code renderers preserve configured syntax foregrounds; diff rendering resolves+ them against its add/delete fills.- Avoid ANSI `black` & `white` as foreground colors because the default terminal theme color will do a better job. (Use `reset` if you need to in order to get those.) The exception is if you need contrast rendering over a manually colored background.- Avoid ANSI `blue` and `yellow` because for now the style guide doesn't use them. Prefer a foreground color mentioned above.