Fix transcript pager page continuity #7363
Open
+98
−4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What
Fix PageUp/PageDown behaviour in the Ctrl+T transcript overlay so that paging is continuous and reversible, and add tests to lock in the expected behaviour.
Why
Today, paging in the transcript overlay uses the raw viewport height instead of the effective content height after layout. Because the overlay reserves some rows for chrome (header/footer), this can cause:
This shows up when inspecting longer transcripts via Ctrl+T; see #7356 for context.
How
PagerView::page_stephelper that computes the page size from the last rendered content height and falls back tocontent_area(viewport_area).heightwhen that is not yet available.page_step(...)for both PageUp and PageDown (including SPACE) so the scroll step always matches the actual content area height, not the full viewport height.transcript_overlay_paging_is_continuous_and_round_tripsthat:line-NNrows.The change is limited to
codex-rs/tui/src/pager_overlay.rsand only affects the transcript overlay paging semantics.Related issue
Testing
On Windows 11, using PowerShell 7 in the repo root:
cargo clippy --testsreported some pre-existing warnings that are unrelated to this change; no new lints were introduced in the modified code.Environment notes (Windows / PowerShell)
While running the tests on Windows / PowerShell, I ran into a couple of environment-specific issues that may be helpful to document:
PowerShell profile startup noise can break shell history tests
$PROFILE) prints anything to stdout on startup (banners, logging,Write-Host, etc.), tests that assert on exact shell output (for exampleuser_shell_command_history_is_persisted_and_shared_with_model) can fail because the extra lines get captured as part of the shell output.python3must be callable from PowerShellSome tests (e.g.
suite::codex_tool::test_shell_command_approval_triggers_elicitation) expect apython3command to be available when invoked viapwsh.exe.On many Windows setups only
pythonexists on PATH andpython3is missing, which causes these tests to fail.Mitigation: either install Python such that
python3.exeis on PATH, or add an alias in PowerShell for the test environment, for example:Set-Alias python3 pythonMake sure this alias is visible to the PowerShell instance that Codex uses, and that it does not introduce extra stdout output (to avoid the issue in point 1).