mirror of
https://github.com/openai/codex.git
synced 2026-11-25 07:23:22 +00:00
Refine request_user_input TUI interactions and option UX (#10025)
## Summary Overhaul the ask‑user‑questions TUI to support “Other/None” answers, better notes handling, improved option selection UX, and a safer submission flow with confirmation for unanswered questions. Multiple choice (number keys for quick selection, up/down or jk for cycling through options): <img width="856" height="169" alt="Screenshot 2026-01-27 at 7 22 29 PM" src="https://github.com/user-attachments/assets/cabd1b0e-25e0-4859-bd8f-9941192ca274" /> Tab to add notes: <img width="856" height="197" alt="Screenshot 2026-01-27 at 7 22 45 PM" src="https://github.com/user-attachments/assets/a807db5e-e966-412c-af91-6edc60062f35" /> Freeform (also note enter tooltip is highlighted on last question to indicate questions UI will be exited upon submission): <img width="854" height="112" alt="Screenshot 2026-01-27 at 7 23 13 PM" src="https://github.com/user-attachments/assets/2e7b88bf-062b-4b9f-a9da-c9d8c8a59643" /> Confirmation dialogue (submitting with unanswered questions): <img width="854" height="126" alt="Screenshot 2026-01-27 at 7 23 29 PM" src="https://github.com/user-attachments/assets/93965c8f-54ac-45bc-a660-9625bcd101f8" /> ## Key Changes - **Options UI refresh** - Render options as numbered entries; allow number keys to select & submit. - Remove “Option X/Y” header and allow the question UI height to expand naturally. - Keep spacing between question, options, and notes even when notes are visible. - Hide the title line and render the question prompt in cyan **only when uncommitted**. - **“Other / None of the above” support** - Wire `isOther` to add “None of the above”. - Add guidance text: “Optionally, add details in notes (tab).” - **Notes composer UX** - Remove “Notes” heading; place composer directly under the selected option. - Preserve pending paste placeholders across question navigation and after submission. - Ctrl+C clears notes **only when the notes composer has focus**. - Ctrl+C now triggers an immediate redraw so the clear is visible. - **Committed vs uncommitted state** - Introduce a unified `answer_committed` flag per question. - Editing notes (including adding text or pastes) marks the answer uncommitted. - Changing the option highlight (j/k, up/down) marks the answer uncommitted. - Clearing options (Backspace/Delete) also clears pending notes. - Question prompt turns cyan only when the answer is uncommitted. - **Submission safety & confirmation** - Only submit notes/freeform text once explicitly committed. - Last-question submit with unanswered questions shows a confirmation dialog. - Confirmation options: 1. **Proceed** (default) 2. **Go back** - Description reflects count: “Submit with N unanswered question(s).” - Esc/Backspace in confirmation returns to first unanswered question. - Ctrl+C in confirmation interrupts and exits the overlay. - **Footer hints** - Cyan highlight restored for “enter to submit answer” / “enter to submit all”. ## Codex author `codex fork 019c00ed-323a-7000-bdb5-9f9c5a635bd9`
This commit is contained in:
1 parent
74bd6d7178
commit
96386755b6
17 files changed
+1164
-407
No files matched your search
@@ -653,6 +653,18 @@ impl ChatComposer {
|
||||
text
|
||||
}
|
||||
|
||||
pub(crate) fn pending_pastes(&self) -> Vec<(String, String)> {
|
||||
self.pending_pastes.clone()
|
||||
}
|
||||
|
||||
pub(crate) fn set_pending_pastes(&mut self, pending_pastes: Vec<(String, String)>) {
|
||||
let text = self.textarea.text().to_string();
|
||||
self.pending_pastes = pending_pastes
|
||||
.into_iter()
|
||||
.filter(|(placeholder, _)| text.contains(placeholder))
|
||||
.collect();
|
||||
}
|
||||
|
||||
/// Override the footer hint items displayed beneath the composer. Passing
|
||||
/// `None` restores the default shortcut footer.
|
||||
pub(crate) fn set_footer_hint_override(&mut self, items: Option<Vec<(String, String)>>) {
|
||||
@@ -1431,7 +1443,7 @@ impl ChatComposer {
|
||||
}
|
||||
|
||||
/// Expand large-paste placeholders using element ranges and rebuild other element spans.
|
||||
fn expand_pending_pastes(
|
||||
pub(crate) fn expand_pending_pastes(
|
||||
text: &str,
|
||||
mut elements: Vec<TextElement>,
|
||||
pending_pastes: &[(String, String)],
|
||||
|
||||
Reference in new issue
Block a user