mirror of
https://github.com/openai/codex.git
synced 2026-05-02 12:21:26 +03:00
1.8 KiB
1.8 KiB
Task 07: Undo Feedback Decision with Esc Key
This task is specific to codex-rs.
Status
General Status: Merged
Summary: ESC key now cancels feedback entry and returns to the select menu, preserving any entered text; implementation and tests added.
Goal
Enhance the user-approval dialog so that if the user opted to leave feedback (“No, enter feedback”) they can press Esc to cancel the feedback flow and return to the previous approval choice menu (e.g. “Yes, proceed” vs. “No, enter feedback”).
Acceptance Criteria
- While the feedback-entry textarea is active, pressing
Esccloses the feedback editor and reopens the yes/no confirmation dialog. - The cancellation must restore the dialog state without losing any partially entered feedback text.
Implementation
How it was implemented
- In
tui/src/user_approval_widget.rs, updatedUserApprovalWidget::handle_input_keyso that pressingEscin input mode switchesmodeback toSelect(rather than sending a deny decision), and restoresselected_optionto the feedback entry item without clearing the input buffer. - Added a unit test in the same module to verify that
Esccancels input mode, preserves the feedback text, and does not emit any decision event.
How it works
- When the widget is in
Mode::Input(feedback-entry), receivingKeyCode::EscresetsmodetoSelectand setsselected_optionto the index of the “Edit or give feedback” option. - The
inputbuffer remains intact, so any partially typed feedback is preserved for if/when the user re-enters feedback mode. - No approval decision is sent on
Esc, so the modal remains active and the user can still approve, deny, or re-enter feedback.
Notes
- Changes in
tui/src/user_approval_widget.rsto treatEscin input mode as a cancel-feedback action and added corresponding tests.