Skip to content

Conversation

@charley-oai
Copy link
Collaborator

@charley-oai charley-oai commented Feb 8, 2026

Summary

This PR fixes long-text rendering in the request_user_input TUI overlay while preserving a clear two-column option layout. (Issue #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
Screenshot 2026-02-08 at 2 27 25 PM

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
Screenshot 2026-02-09 at 10 28 02 AM

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.

@charley-oai
Copy link
Collaborator Author

@codex review this

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f58e3bbf28

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Collaborator

@aibrahim-oai aibrahim-oai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: let's order functions by visibility and importance. Important functions should be up

@charley-oai
Copy link
Collaborator Author

@codex review this

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@charley-oai charley-oai merged commit f886670 into main Feb 9, 2026
30 of 31 checks passed
@charley-oai charley-oai deleted the fix/request-user-input-wrap-long-labels branch February 9, 2026 20:23
@github-actions github-actions bot locked and limited conversation to collaborators Feb 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants