Drop legacy way

This commit is contained in:
jif-oai
2025-10-29 20:56:28 +00:00
parent 27b1991588
commit e7de8118ce
2 changed files with 6 additions and 39 deletions

View File

@@ -40,9 +40,6 @@ use std::time::Duration;
use tokio::select;
use tokio::sync::mpsc::unbounded_channel;
#[cfg(not(debug_assertions))]
use crate::history_cell::UpdateAvailableHistoryCell;
#[derive(Debug, Clone)]
pub struct AppExitInfo {
pub token_usage: TokenUsage,
@@ -149,9 +146,6 @@ impl App {
};
let file_search = FileSearchManager::new(config.cwd.clone(), app_event_tx.clone());
#[cfg(not(debug_assertions))]
let upgrade_version = crate::updates::get_upgrade_version(&config);
let mut app = Self {
server: conversation_manager,
app_event_tx,
@@ -175,20 +169,6 @@ impl App {
app.handle_event(tui, event).await?;
}
// TODO(jif) clean this
#[cfg(not(debug_assertions))]
if let Some(latest_version) = upgrade_version {
app.handle_event(
tui,
AppEvent::InsertHistoryCell(Box::new(UpdateAvailableHistoryCell::new(
crate::version::CODEX_CLI_VERSION,
latest_version,
crate::updates::get_update_action(),
))),
)
.await?;
}
let tui_events = tui.event_stream();
tokio::pin!(tui_events);

View File

@@ -316,25 +316,12 @@ async fn run_ratatui_app(
let mut initial_events = Vec::new();
if let Some(status) = cached_update_status
&& status.update_available {
let update_action = {
#[cfg(not(debug_assertions))]
{
crate::updates::get_update_action()
}
#[cfg(debug_assertions)]
{
None
}
};
initial_events.push(AppEvent::InsertHistoryCell(Box::new(
UpdateAvailableHistoryCell::new(
status.current_version,
status.latest_version,
update_action,
),
)));
}
&& status.update_available
{
initial_events.push(AppEvent::InsertHistoryCell(Box::new(
UpdateAvailableHistoryCell::new(status.current_version, status.latest_version, None),
)));
}
// Forward panic reports through tracing so they appear in the UI status
// line, but do not swallow the default/color-eyre panic handler.