Transcript Overlay (Ctrl+T) Over-Allocates User Message Background Height

Resolved 💬 0 comments Opened Feb 8, 2026 by Chriss4123 Closed Apr 11, 2026

In the transcript overlay (Ctrl+T), the user-message background fill can extend far below the actual user message content. This is especially noticeable for longer prompts and prompts containing blank lines, where the shaded block can grow so large that the screen is filled by it and scrolling shows large empty shaded regions.

Normal view:
<img width="1920" height="826" alt="Image" src="https://github.com/user-attachments/assets/3ab678be-be20-4af4-bad8-5fc7d820a2da" />

Transcript view:
<img width="1920" height="932" alt="Image" src="https://github.com/user-attachments/assets/3be51990-3f64-488e-a951-06b8bffd8316" />

Impact

  • Makes transcript view harder to read and navigate.
  • Can create large "empty" shaded regions that look like layout corruption.

Repro

  1. Run codex and send a user message that includes multiple blank lines (or a long prompt with blank lines).
  2. Enter transcript view with Ctrl+T.
  3. Observe that the shaded user-message background extends significantly below the message content.

Root Cause

The transcript overlay computes each cell's height using HistoryCell::desired_transcript_height. The default implementation used ratatui's Paragraph::line_count with Wrap { trim: false }.

With trim: false, ratatui's WordWrapper can overcount whitespace-only lines, which causes the transcript overlay to over-allocate height for user-message cells. Because the user cell is rendered with a background style, the extra allocated area is filled with the background color, producing the oversized shaded panel.

Fix

I've implemented a fix and a regression test locally:

  • Change HistoryCell::desired_transcript_height to match what transcript rendering actually draws: transcript_lines(width).len() (no ratatui wrapping-based line_count).
  • Add a regression test that fails under the old behavior and passes with the fix by asserting a UserHistoryCell with blank lines has desired_transcript_height(width) equal to transcript_lines(width).len(). Under the buggy implementation, whitespace-only lines could be overcounted.

<img width="1920" height="930" alt="Image" src="https://github.com/user-attachments/assets/aa0689e5-16fe-4e51-a614-53579c997973" />

Testing

  1. Verified the regression test fails when the fix is not present.
  2. Verified the full codex-tui test suite passes with the fix:
  • cargo test -p codex-tui

Request

This repo states external PRs are by invitation only. I have the fix ready and I've already had a couple PRs merged into this repository in the past; can I get permission to open a PR for this change @etraut-openai @joshka-oai?

View original on GitHub ↗