## Summary This PR fixes long-text rendering in the `request_user_input` TUI overlay while preserving a clear two-column option layout. (Issue https://github.com/openai/codex/issues/11093) Before: - very long option labels could push description text into a narrow right-edge strip - option labels were effectively single-line when descriptions were present, causing truncation/poor readability - label and description wrapping interacted in one combined wrapped line <img width="504" height="409" alt="Screenshot 2026-02-08 at 2 27 25 PM" src="https://github.com/user-attachments/assets/a9afd108-d792-4522-bce1-e43b3cce882b" /> After: - option labels wrap inside the left column - descriptions wrap independently inside the right column - row measurement and row rendering use the same wrapping path, so layout stays stable <img width="582" height="211" alt="Screenshot 2026-02-09 at 10 28 02 AM" src="https://github.com/user-attachments/assets/47885a1c-07e5-4b0f-b992-032b149f1b0d" /> ## Problem `request_user_input` needs to handle verbose prompts/options. With oversized labels: - descriptions could collapse into a thin, hard-to-read column - important label context was lost ## Root Cause In shared row rendering (`selection_popup_common`): - rows were wrapped as a single combined line - auto column sizing could still place `desc_col` too far right for long labels - `request_user_input` rows did not provide wrap metadata to align continuation lines after the option prefix ## What Changed ### 1) `request_user_input` rows opt into wrapped labels File: `codex-rs/tui/src/bottom_pane/request_user_input/mod.rs` - In `option_rows()`, compute the rendered option prefix (`› 1. ` / ` 2. `) and set `wrap_indent` from its display width. - Apply the same behavior to the synthetic “None of the above” row. - Add long-text snapshot test coverage (`question_with_very_long_option_text` + `request_user_input_long_option_text_snapshot`). ### 2) Shared renderer now has an opt-in two-column wrapping path File: `codex-rs/tui/src/bottom_pane/selection_popup_common.rs` - Add focused helpers: - `should_wrap_name_in_column` - `wrap_two_column_row` - `wrap_standard_row` - `wrap_row_lines` - `apply_row_state_style` - For opted-in rows (plain option rows with `wrap_indent` + description), wrap label and description independently in their own columns. - Keep the legacy standard wrapping path for non-opted rows. - Use the same `wrap_row_lines` function in both rendering and height measurement to keep them in sync. ### 3) Keep column sizing simple and derived from existing fixed split constants File: `codex-rs/tui/src/bottom_pane/selection_popup_common.rs` - Keep fixed mode at `3/10` left column (`30/70` split). - In auto modes, cap label width using those same fixed constants (max 70% label, min 30% description), instead of extra special-case constants/branches. - Add/keep narrow-width safety guard in `wrap_two_column_row` so extremely small widths do not panic. ### 4) Snapshot coverage File: `codex-rs/tui/src/bottom_pane/request_user_input/snapshots/ codex_tui__bottom_pane__request_user_input__tests__request_user_input_long_option_text.snap` - Add snapshot for long-label/long-description two-column rendering behavior. |
||
|---|---|---|
| .. | ||
| frames | ||
| src | ||
| tests | ||
| BUILD.bazel | ||
| Cargo.toml | ||
| prompt_for_init_command.md | ||
| styles.md | ||
| tooltips.txt | ||