mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
cleanup
This commit is contained in:
@@ -187,7 +187,7 @@ impl DiffOverlay {
|
||||
if self.attempts.is_empty() {
|
||||
self.attempts.push(AttemptView::default());
|
||||
}
|
||||
self.attempts.get_mut(0).expect("base attempt present")
|
||||
&mut self.attempts[0]
|
||||
}
|
||||
|
||||
pub fn set_view(&mut self, view: DetailView) {
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
use codex_backend_client::Client as BackendClient;
|
||||
use codex_cloud_tasks::util::extract_chatgpt_account_id;
|
||||
use codex_cloud_tasks::util::normalize_base_url;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
use codex_backend_client::Client as BackendClient;
|
||||
use codex_core::config::find_codex_home;
|
||||
use codex_core::default_client::get_codex_user_agent;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
use base64::Engine;
|
||||
use clap::Parser;
|
||||
use codex_core::config::find_codex_home;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
use base64::Engine;
|
||||
use clap::Parser;
|
||||
use codex_core::config::find_codex_home;
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
mod app;
|
||||
mod cli;
|
||||
pub mod env_detect;
|
||||
|
||||
@@ -343,8 +343,7 @@ fn draw_diff_overlay(frame: &mut Frame, area: Rect, app: &mut App) {
|
||||
let mut content_area = content_full;
|
||||
if let Some(ov) = app.diff_overlay.as_mut() {
|
||||
let has_text = ov.current_attempt().is_some_and(AttemptView::has_text);
|
||||
let has_diff =
|
||||
ov.current_attempt().is_some_and(AttemptView::has_diff) || ov.base_can_apply;
|
||||
let has_diff = ov.current_attempt().is_some_and(AttemptView::has_diff) || ov.base_can_apply;
|
||||
if has_diff || has_text {
|
||||
let rows = Layout::default()
|
||||
.direction(Direction::Vertical)
|
||||
@@ -381,15 +380,15 @@ fn draw_diff_overlay(frame: &mut Frame, area: Rect, app: &mut App) {
|
||||
} else {
|
||||
Some(ov.attempts.len())
|
||||
}
|
||||
})
|
||||
&& total > 1 {
|
||||
spans.extend(vec![
|
||||
" ".into(),
|
||||
format!("Attempt {}/{}", ov.selected_attempt + 1, total).dim(),
|
||||
" ".into(),
|
||||
"(Tab/Shift-Tab or [ ] to cycle attempts)".dim(),
|
||||
]);
|
||||
}
|
||||
}) && total > 1
|
||||
{
|
||||
spans.extend(vec![
|
||||
" ".into(),
|
||||
format!("Attempt {}/{}", ov.selected_attempt + 1, total).dim(),
|
||||
" ".into(),
|
||||
"(Tab/Shift-Tab or [ ] to cycle attempts)".dim(),
|
||||
]);
|
||||
}
|
||||
frame.render_widget(Paragraph::new(Line::from(spans)), rows[0]);
|
||||
ov.sd.set_width(rows[1].width);
|
||||
ov.sd.set_viewport(rows[1].height);
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used)]
|
||||
|
||||
use codex_cloud_tasks_client::CloudBackend;
|
||||
use codex_cloud_tasks_client::MockClient;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user