(frame: &mut Frame<'_>, app: &mut App, area: Rect)
| 71 | // --------------------------------------------------------------------------- |
| 72 | |
| 73 | fn draw_sandbox_screen(frame: &mut Frame<'_>, app: &mut App, area: Rect) { |
| 74 | let chunks = Layout::default() |
| 75 | .direction(Direction::Vertical) |
| 76 | .constraints([ |
| 77 | Constraint::Percentage(20), // metadata |
| 78 | Constraint::Percentage(80), // policy or logs |
| 79 | ]) |
| 80 | .split(area); |
| 81 | |
| 82 | sandbox_detail::draw(frame, app, chunks[0]); |
| 83 | |
| 84 | match app.focus { |
| 85 | Focus::SandboxLogs => sandbox_logs::draw(frame, app, chunks[1]), |
| 86 | Focus::SandboxDraft => sandbox_draft::draw(frame, app, chunks[1]), |
| 87 | _ => match app.sandbox_policy_tab { |
| 88 | app::SandboxPolicyTab::Settings => sandbox_settings::draw(frame, app, chunks[1]), |
| 89 | app::SandboxPolicyTab::Policy => sandbox_policy::draw(frame, app, chunks[1]), |
| 90 | }, |
| 91 | } |
| 92 | |
| 93 | // Log detail popup renders over the full frame (not constrained to pane). |
| 94 | if app.focus == Focus::SandboxLogs |
| 95 | && let Some(detail_idx) = app.log_detail_index |
| 96 | { |
| 97 | let filtered: Vec<&app::LogLine> = app.filtered_log_lines(); |
| 98 | if let Some(log) = filtered.get(detail_idx) { |
| 99 | sandbox_logs::draw_detail_popup(frame, log, frame.size(), &app.theme); |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | // Draft detail popup renders over the full frame. |
| 104 | if app.focus == Focus::SandboxDraft && app.draft_detail_open { |
| 105 | let abs = app.draft_scroll + app.draft_selected; |
| 106 | if let Some(chunk) = app.draft_chunks.get(abs) { |
| 107 | sandbox_draft::draw_detail_popup(frame, chunk, frame.size(), &app.theme); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | // Approve-all confirmation popup renders over everything. |
| 112 | if app.approve_all_confirm_open && !app.approve_all_confirm_chunks.is_empty() { |
| 113 | sandbox_draft::draw_approve_all_popup( |
| 114 | frame, |
| 115 | &app.approve_all_confirm_chunks, |
| 116 | frame.size(), |
| 117 | &app.theme, |
| 118 | ); |
| 119 | } |
| 120 | } |
| 121 | |
| 122 | // --------------------------------------------------------------------------- |
| 123 | // Chrome: title bar, nav bar, command bar |
no test coverage detected