tui: tweaks to dialog display (#4622)

- prefix command approval reasons with "Reason:"
- show keyboard shortcuts for some ListSelectionItems
- remove "description" lines for approval options, and make the labels
more verbose
- add a spacer line in diff display after the path

and some other minor refactors that go along with the above.

<img width="859" height="508" alt="Screenshot 2025-10-02 at 1 24 50 PM"
src="https://github.com/user-attachments/assets/4fa7ecaf-3d3a-406a-bb4d-23e30ce3e5cf"
/>
This commit is contained in:
Jeremy Rose
2025-10-02 14:41:29 -07:00
committed by GitHub
parent 62cc8a4b8d
commit 25a2e15ec5
13 changed files with 159 additions and 150 deletions

View File

@@ -1630,7 +1630,7 @@ impl ChatWidget {
is_current,
actions,
dismiss_on_select: true,
search_value: None,
..Default::default()
});
}
@@ -1749,7 +1749,7 @@ impl ChatWidget {
is_current: is_current_model && choice.stored == highlight_choice,
actions,
dismiss_on_select: true,
search_value: None,
..Default::default()
});
}
@@ -1793,7 +1793,7 @@ impl ChatWidget {
is_current,
actions,
dismiss_on_select: true,
search_value: None,
..Default::default()
});
}
@@ -1917,7 +1917,6 @@ impl ChatWidget {
items.push(SelectionItem {
name: "Review against a base branch".to_string(),
description: Some("(PR Style)".into()),
is_current: false,
actions: vec![Box::new({
let cwd = self.config.cwd.clone();
move |tx| {
@@ -1925,13 +1924,11 @@ impl ChatWidget {
}
})],
dismiss_on_select: false,
search_value: None,
..Default::default()
});
items.push(SelectionItem {
name: "Review uncommitted changes".to_string(),
description: None,
is_current: false,
actions: vec![Box::new(
move |tx: &AppEventSender| {
tx.send(AppEvent::CodexOp(Op::Review {
@@ -1943,14 +1940,12 @@ impl ChatWidget {
},
)],
dismiss_on_select: true,
search_value: None,
..Default::default()
});
// New: Review a specific commit (opens commit picker)
items.push(SelectionItem {
name: "Review a commit".to_string(),
description: None,
is_current: false,
actions: vec![Box::new({
let cwd = self.config.cwd.clone();
move |tx| {
@@ -1958,18 +1953,16 @@ impl ChatWidget {
}
})],
dismiss_on_select: false,
search_value: None,
..Default::default()
});
items.push(SelectionItem {
name: "Custom review instructions".to_string(),
description: None,
is_current: false,
actions: vec![Box::new(move |tx| {
tx.send(AppEvent::OpenReviewCustomPrompt);
})],
dismiss_on_select: false,
search_value: None,
..Default::default()
});
self.bottom_pane.show_selection_view(SelectionViewParams {
@@ -1991,8 +1984,6 @@ impl ChatWidget {
let branch = option.clone();
items.push(SelectionItem {
name: format!("{current_branch} -> {branch}"),
description: None,
is_current: false,
actions: vec![Box::new(move |tx3: &AppEventSender| {
tx3.send(AppEvent::CodexOp(Op::Review {
review_request: ReviewRequest {
@@ -2005,6 +1996,7 @@ impl ChatWidget {
})],
dismiss_on_select: true,
search_value: Some(option),
..Default::default()
});
}
@@ -2030,8 +2022,6 @@ impl ChatWidget {
items.push(SelectionItem {
name: subject.clone(),
description: None,
is_current: false,
actions: vec![Box::new(move |tx3: &AppEventSender| {
let hint = format!("commit {short}");
let prompt = format!(
@@ -2046,6 +2036,7 @@ impl ChatWidget {
})],
dismiss_on_select: true,
search_value: Some(search_val),
..Default::default()
});
}
@@ -2255,8 +2246,6 @@ pub(crate) fn show_review_commit_picker_with_entries(
items.push(SelectionItem {
name: subject.clone(),
description: None,
is_current: false,
actions: vec![Box::new(move |tx3: &AppEventSender| {
let hint = format!("commit {short}");
let prompt = format!(
@@ -2271,6 +2260,7 @@ pub(crate) fn show_review_commit_picker_with_entries(
})],
dismiss_on_select: true,
search_value: Some(search_val),
..Default::default()
});
}