Skip to content

Conversation

@slkzgm
Copy link
Contributor

@slkzgm slkzgm commented Jan 16, 2026

Fixes #9361

Context

Split out from #9059 per review: #9059 (comment)

Summary

The shortcut overlay renders different paste-image bindings on WSL (Ctrl+Alt+V) vs non-WSL (Ctrl+V), which makes snapshot tests non-deterministic when run under WSL.

Changes

  • Gate WSL detection behind cfg(not(test)) so snapshot tests are deterministic across environments.
  • Add a focused unit test that still asserts the WSL-specific paste-image binding.

Testing

  • just fmt
  • just fix -p codex-tui
  • just fix -p codex-tui2
  • cargo test -p codex-tui
  • cargo test -p codex-tui2

@etraut-openai
Copy link
Collaborator

@codex review

@chatgpt-codex-connector
Copy link
Contributor

Codex Review: Didn't find any major issues. 🎉

ℹ️ 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".

joshka-oai added a commit that referenced this pull request Jan 18, 2026
Fixes #9058

## Summary
When the transcript backtrack preview is armed (press `Esc`), allow
navigating to newer user messages with the `→` arrow, in addition to
navigating backwards with `Esc`/`←`, before confirming with `Enter`.

## Changes
- Backtrack preview navigation: `Esc`/`←` steps to older user messages,
`→` steps to newer ones, `Enter` edits the selected message (clamped at
bounds, no wrap-around).
- Transcript overlay footer hints updated to advertise `esc/←`, `→`, and
`enter` when a message is highlighted.

## Related
- WSL shortcut-overlay snapshot determinism: #9359

## Testing
- `just fmt`
- `just fix -p codex-tui`
- `just fix -p codex-tui2`
- `cargo test -p codex-tui app_backtrack::`
- `cargo test -p codex-tui pager_overlay::`
- `cargo test -p codex-tui2 app_backtrack::`
- `cargo test -p codex-tui2 pager_overlay::`

---------

Co-authored-by: Josh McKinney <joshka@openai.com>
//! hint. The owning widgets schedule redraws so time-based hints can expire even if the UI is
//! otherwise idle.
#[cfg(target_os = "linux")]
#[cfg(all(target_os = "linux", not(test)))]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't like having test related cfg checks in non-test code like this. It makes it difficult to reason about how the behavior works as different behavior under tests is usually not something that most people will anticipate. Likely this instead should be separate test behavior that triggers based on the test environment.

This probably means that we need to investing in actually setting up our CI to have a WSL specific test in the matrix.

@etraut-openai etraut-openai added the needs-response Additional information is requested label Jan 20, 2026
zeekay pushed a commit to hanzoai/dev that referenced this pull request Jan 24, 2026
Fixes openai#9058

## Summary
When the transcript backtrack preview is armed (press `Esc`), allow
navigating to newer user messages with the `→` arrow, in addition to
navigating backwards with `Esc`/`←`, before confirming with `Enter`.

## Changes
- Backtrack preview navigation: `Esc`/`←` steps to older user messages,
`→` steps to newer ones, `Enter` edits the selected message (clamped at
bounds, no wrap-around).
- Transcript overlay footer hints updated to advertise `esc/←`, `→`, and
`enter` when a message is highlighted.

## Related
- WSL shortcut-overlay snapshot determinism: openai#9359

## Testing
- `just fmt`
- `just fix -p codex-tui`
- `just fix -p codex-tui2`
- `cargo test -p codex-tui app_backtrack::`
- `cargo test -p codex-tui pager_overlay::`
- `cargo test -p codex-tui2 app_backtrack::`
- `cargo test -p codex-tui2 pager_overlay::`

---------

Co-authored-by: Josh McKinney <joshka@openai.com>
@etraut-openai etraut-openai removed the needs-response Additional information is requested label Jan 26, 2026
@joshka-oai joshka-oai self-assigned this Jan 27, 2026
@joshka-oai joshka-oai force-pushed the fix/tui-wsl-shortcut-overlay-snapshots branch from 4e35d38 to 1f92b9e Compare January 27, 2026 23:20
@joshka-oai
Copy link
Collaborator

joshka-oai commented Jan 27, 2026

I resolved the jj git fetch bookmark conflict by selecting the correct branch tip and cleaning up the remaining footer.rs conflict; I also dropped the obsolete tui2 footer file (since tui2 has been deleted).

I made the WSL-specific shortcut overlay behavior deterministic for snapshots, while keeping a unit test that still asserts the WSL paste-image binding (Ctrl+Alt+V vs Ctrl+V).

I also ran clippy (just fix -p codex-tui) and fixed the macOS lint issue around WSL detection.

Updated commit: c5c847d

I’ve pushed the updated branch to your fork (slkzgm).

Gate WSL detection behind cfg(not(test)) so shortcut-overlay snapshots stay deterministic across environments. Add a focused unit test that still asserts the WSL-specific paste-image binding.
@joshka-oai joshka-oai force-pushed the fix/tui-wsl-shortcut-overlay-snapshots branch from 1f92b9e to c5c847d Compare January 27, 2026 23:29
@joshka-oai joshka-oai enabled auto-merge (squash) January 27, 2026 23:33
@joshka-oai joshka-oai merged commit 3f3916e into openai:main Jan 28, 2026
45 of 53 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 28, 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.

WSL: shortcut overlay snapshot tests are non-deterministic

3 participants