Make transcript mouse scroll speed configurable (#50209)

## What changed

Add `tui.mouse_scroll_speed` as a finite positive multiplier for transcript mouse wheel scrolling, including transcript overlays and session previews. Change the default from three rows to one row per wheel event; set the multiplier to `3.0` to retain the previous speed.

Fractional values accumulate movement across events and discard the remainder when direction reverses. For example, `0.5` scrolls one row every two events. Following the latest output pauses only when a whole row moves.

## Testing

Add tests for configuration validation, integer and fractional scroll speeds, direction changes, decimal accumulation, and following behavior. Extend local settings coverage to include a command-line override for the new setting.

GitOrigin-RevId: d355e246fd943415f0ce5a6affe849f77f3615e6
This commit is contained in:
Eric Traut
2026-10-02 06:50:10 +00:00
committed by copyberry
parent e3c2a83937
commit 4dd51f4a5f
22 changed files with 256 additions and 13 deletions
+2
View File
@@ -1269,6 +1269,7 @@ fn config_toml_deserializes_model_availability_nux() {
question_esc_back: true,
raw_output_mode: false,
fullscreen_transcript: true,
mouse_scroll_speed: None,
copy_on_select: Default::default(),
right_click_paste: Default::default(),
alternate_screen: AltScreenMode::default(),
@@ -4410,6 +4411,7 @@ fn tui_config_missing_notifications_field_defaults_to_enabled() {
question_esc_back: true,
raw_output_mode: false,
fullscreen_transcript: true,
mouse_scroll_speed: None,
copy_on_select: Default::default(),
right_click_paste: Default::default(),
alternate_screen: AltScreenMode::Auto,
+4
View File
@@ -803,6 +803,9 @@ pub struct Config {
/// Own the fullscreen transcript when the alternate screen is enabled.
pub tui_fullscreen_transcript: bool,
/// Mouse wheel speed multiplier for transcript scrolling; defaults to one row per event.
pub tui_mouse_scroll_speed: Option<f64>,
/// Override the terminal-specific default for copying transcript mouse selections.
pub tui_copy_on_select: codex_config::types::CopyOnSelect,
@@ -4533,6 +4536,7 @@ impl Config {
.tui
.as_ref()
.is_none_or(|tui| tui.fullscreen_transcript),
tui_mouse_scroll_speed: cfg.tui.as_ref().and_then(|tui| tui.mouse_scroll_speed),
tui_copy_on_select: cfg
.tui
.as_ref()