|
1 | 1 | use crate::app_backtrack::BacktrackState;
|
2 | 2 | use crate::app_event::AppEvent;
|
3 | 3 | use crate::app_event_sender::AppEventSender;
|
| 4 | +use crate::bottom_pane::ApprovalRequest; |
4 | 5 | use crate::chatwidget::ChatWidget;
|
| 6 | +use crate::diff_render::DiffSummary; |
| 7 | +use crate::exec_command::strip_bash_lc_and_escape; |
5 | 8 | use crate::file_search::FileSearchManager;
|
6 | 9 | use crate::history_cell::HistoryCell;
|
7 | 10 | use crate::pager_overlay::Overlay;
|
| 11 | +use crate::render::highlight::highlight_bash_to_lines; |
8 | 12 | use crate::resume_picker::ResumeSelection;
|
9 | 13 | use crate::tui;
|
10 | 14 | use crate::tui::TuiEvent;
|
@@ -292,7 +296,7 @@ impl App {
|
292 | 296 | } else {
|
293 | 297 | text.lines().map(ansi_escape_line).collect()
|
294 | 298 | };
|
295 |
| - self.overlay = Some(Overlay::new_static_with_title( |
| 299 | + self.overlay = Some(Overlay::new_static_with_lines( |
296 | 300 | pager_lines,
|
297 | 301 | "D I F F".to_string(),
|
298 | 302 | ));
|
@@ -324,12 +328,18 @@ impl App {
|
324 | 328 | Ok(()) => {
|
325 | 329 | if let Some(profile) = profile {
|
326 | 330 | self.chat_widget.add_info_message(
|
327 |
| - format!("Model changed to {model} for {profile} profile"), |
| 331 | + format!("Model changed to {model}{reasoning_effort} for {profile} profile", reasoning_effort = effort.map(|e| format!(" {e}")).unwrap_or_default()), |
328 | 332 | None,
|
329 | 333 | );
|
330 | 334 | } else {
|
331 |
| - self.chat_widget |
332 |
| - .add_info_message(format!("Model changed to {model}"), None); |
| 335 | + self.chat_widget.add_info_message( |
| 336 | + format!( |
| 337 | + "Model changed to {model}{reasoning_effort}", |
| 338 | + reasoning_effort = |
| 339 | + effort.map(|e| format!(" {e}")).unwrap_or_default() |
| 340 | + ), |
| 341 | + None, |
| 342 | + ); |
333 | 343 | }
|
334 | 344 | }
|
335 | 345 | Err(err) => {
|
@@ -363,6 +373,25 @@ impl App {
|
363 | 373 | AppEvent::OpenReviewCustomPrompt => {
|
364 | 374 | self.chat_widget.show_review_custom_prompt();
|
365 | 375 | }
|
| 376 | + AppEvent::FullScreenApprovalRequest(request) => match request { |
| 377 | + ApprovalRequest::ApplyPatch { cwd, changes, .. } => { |
| 378 | + let _ = tui.enter_alt_screen(); |
| 379 | + let diff_summary = DiffSummary::new(changes, cwd); |
| 380 | + self.overlay = Some(Overlay::new_static_with_renderables( |
| 381 | + vec![diff_summary.into()], |
| 382 | + "P A T C H".to_string(), |
| 383 | + )); |
| 384 | + } |
| 385 | + ApprovalRequest::Exec { command, .. } => { |
| 386 | + let _ = tui.enter_alt_screen(); |
| 387 | + let full_cmd = strip_bash_lc_and_escape(&command); |
| 388 | + let full_cmd_lines = highlight_bash_to_lines(&full_cmd); |
| 389 | + self.overlay = Some(Overlay::new_static_with_lines( |
| 390 | + full_cmd_lines, |
| 391 | + "E X E C".to_string(), |
| 392 | + )); |
| 393 | + } |
| 394 | + }, |
366 | 395 | }
|
367 | 396 | Ok(true)
|
368 | 397 | }
|
|
0 commit comments