[feat] Simplfy command approval UI (#2708)
- Removed the plain "No" option, which confused the model, since we already have the "No, provide feedback" option, which works better. # Before <img width="476" height="168" alt="image" src="https://github.com/user-attachments/assets/6e783d9f-dec9-4610-9cad-8442eb377a90" /> # After <img width="553" height="175" alt="image" src="https://github.com/user-attachments/assets/3cdae582-3366-47bc-9753-288930df2324" />
This commit is contained in:
@@ -530,7 +530,7 @@ mod tests {
|
|||||||
// Push an approval modal (e.g., command approval) which should hide the status view.
|
// Push an approval modal (e.g., command approval) which should hide the status view.
|
||||||
pane.push_approval_request(exec_request());
|
pane.push_approval_request(exec_request());
|
||||||
|
|
||||||
// Simulate pressing 'n' (deny) on the modal.
|
// Simulate pressing 'n' (No) on the modal.
|
||||||
use crossterm::event::KeyCode;
|
use crossterm::event::KeyCode;
|
||||||
use crossterm::event::KeyEvent;
|
use crossterm::event::KeyEvent;
|
||||||
use crossterm::event::KeyModifiers;
|
use crossterm::event::KeyModifiers;
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ expression: terminal.backend()
|
|||||||
"Model wants to run a command "
|
"Model wants to run a command "
|
||||||
" "
|
" "
|
||||||
"▌Allow command? "
|
"▌Allow command? "
|
||||||
"▌ Yes Always No No, provide feedback "
|
"▌ Yes Always No, provide feedback "
|
||||||
"▌ Approve and run the command "
|
"▌ Approve and run the command "
|
||||||
" "
|
" "
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ expression: terminal.backend()
|
|||||||
"This will grant write access to /tmp for the remainder of this session. "
|
"This will grant write access to /tmp for the remainder of this session. "
|
||||||
" "
|
" "
|
||||||
"▌Apply changes? "
|
"▌Apply changes? "
|
||||||
"▌ Yes No No, provide feedback "
|
"▌ Yes No, provide feedback "
|
||||||
"▌ Approve and apply the changes "
|
"▌ Approve and apply the changes "
|
||||||
" "
|
" "
|
||||||
|
|||||||
@@ -8,6 +8,6 @@ expression: terminal.backend()
|
|||||||
"Codex wants to run a command "
|
"Codex wants to run a command "
|
||||||
" "
|
" "
|
||||||
"▌Allow command? "
|
"▌Allow command? "
|
||||||
"▌ Yes Always No No, provide feedback "
|
"▌ Yes Always No, provide feedback "
|
||||||
"▌ Approve and run the command "
|
"▌ Approve and run the command "
|
||||||
" "
|
" "
|
||||||
|
|||||||
@@ -69,20 +69,9 @@ static COMMAND_SELECT_OPTIONS: LazyLock<Vec<SelectOption>> = LazyLock::new(|| {
|
|||||||
decision: ReviewDecision::ApprovedForSession,
|
decision: ReviewDecision::ApprovedForSession,
|
||||||
},
|
},
|
||||||
SelectOption {
|
SelectOption {
|
||||||
label: Line::from(vec!["N".underlined(), "o".into()]),
|
label: Line::from(vec!["N".underlined(), "o, provide feedback".into()]),
|
||||||
description: "Do not run the command",
|
|
||||||
key: KeyCode::Char('n'),
|
|
||||||
decision: ReviewDecision::Denied,
|
|
||||||
},
|
|
||||||
SelectOption {
|
|
||||||
label: Line::from(vec![
|
|
||||||
"No, ".into(),
|
|
||||||
"provide ".into(),
|
|
||||||
"f".underlined(),
|
|
||||||
"eedback".into(),
|
|
||||||
]),
|
|
||||||
description: "Do not run the command; provide feedback",
|
description: "Do not run the command; provide feedback",
|
||||||
key: KeyCode::Char('f'),
|
key: KeyCode::Char('n'),
|
||||||
decision: ReviewDecision::Abort,
|
decision: ReviewDecision::Abort,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
@@ -97,20 +86,9 @@ static PATCH_SELECT_OPTIONS: LazyLock<Vec<SelectOption>> = LazyLock::new(|| {
|
|||||||
decision: ReviewDecision::Approved,
|
decision: ReviewDecision::Approved,
|
||||||
},
|
},
|
||||||
SelectOption {
|
SelectOption {
|
||||||
label: Line::from(vec!["N".underlined(), "o".into()]),
|
label: Line::from(vec!["N".underlined(), "o, provide feedback".into()]),
|
||||||
description: "Do not apply the changes",
|
|
||||||
key: KeyCode::Char('n'),
|
|
||||||
decision: ReviewDecision::Denied,
|
|
||||||
},
|
|
||||||
SelectOption {
|
|
||||||
label: Line::from(vec![
|
|
||||||
"No, ".into(),
|
|
||||||
"provide ".into(),
|
|
||||||
"f".underlined(),
|
|
||||||
"eedback".into(),
|
|
||||||
]),
|
|
||||||
description: "Do not apply the changes; provide feedback",
|
description: "Do not apply the changes; provide feedback",
|
||||||
key: KeyCode::Char('f'),
|
key: KeyCode::Char('n'),
|
||||||
decision: ReviewDecision::Abort,
|
decision: ReviewDecision::Abort,
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user