diff --git a/codex-rs/tui/src/bottom_pane/bottom_pane_view.rs b/codex-rs/tui/src/bottom_pane/bottom_pane_view.rs index 6abf5399f5..1ff7205144 100644 --- a/codex-rs/tui/src/bottom_pane/bottom_pane_view.rs +++ b/codex-rs/tui/src/bottom_pane/bottom_pane_view.rs @@ -5,12 +5,6 @@ use ratatui::layout::Rect; use super::BottomPane; -/// Type to use for a method that may require a redraw of the UI. -pub(crate) enum ConditionalUpdate { - NeedsRedraw, - NoRedraw, -} - /// Trait implemented by every view that can be shown in the bottom pane. pub(crate) trait BottomPaneView<'a> { /// Handle a key event while the view is active. A redraw is always @@ -28,11 +22,6 @@ pub(crate) trait BottomPaneView<'a> { /// Render the view: this will be displayed in place of the composer. fn render(&self, area: Rect, buf: &mut Buffer); - /// Update the status indicator text. - fn update_status_text(&mut self, _text: String) -> ConditionalUpdate { - ConditionalUpdate::NoRedraw - } - /// Called when task completes to check if the view should be hidden. fn should_hide_when_task_is_done(&mut self) -> bool { false diff --git a/codex-rs/tui/src/bottom_pane/mod.rs b/codex-rs/tui/src/bottom_pane/mod.rs index c654581ccd..0fb46fa1ea 100644 --- a/codex-rs/tui/src/bottom_pane/mod.rs +++ b/codex-rs/tui/src/bottom_pane/mod.rs @@ -1,7 +1,6 @@ //! Bottom pane: shows the ChatComposer or a BottomPaneView, if one is active. use bottom_pane_view::BottomPaneView; -use bottom_pane_view::ConditionalUpdate; use crossterm::event::KeyEvent; use ratatui::buffer::Buffer; use ratatui::layout::Rect; @@ -78,21 +77,6 @@ impl BottomPane<'_> { } } - /// Update the status indicator text (only when the `StatusIndicatorView` is - /// active). - pub(crate) fn update_status_text(&mut self, text: String) { - if let Some(view) = &mut self.active_view { - match view.update_status_text(text) { - ConditionalUpdate::NeedsRedraw => { - self.request_redraw(); - } - ConditionalUpdate::NoRedraw => { - // No redraw needed. - } - } - } - } - /// Update the UI to reflect whether this `BottomPane` has input focus. pub(crate) fn set_input_focus(&mut self, has_focus: bool) { self.has_input_focus = has_focus; diff --git a/codex-rs/tui/src/bottom_pane/status_indicator_view.rs b/codex-rs/tui/src/bottom_pane/status_indicator_view.rs index d9ac57d7b9..27bf6fd914 100644 --- a/codex-rs/tui/src/bottom_pane/status_indicator_view.rs +++ b/codex-rs/tui/src/bottom_pane/status_indicator_view.rs @@ -6,7 +6,6 @@ use crate::app_event_sender::AppEventSender; use crate::status_indicator_widget::StatusIndicatorWidget; use super::BottomPaneView; -use super::bottom_pane_view::ConditionalUpdate; pub(crate) struct StatusIndicatorView { view: StatusIndicatorWidget, @@ -18,18 +17,9 @@ impl StatusIndicatorView { view: StatusIndicatorWidget::new(app_event_tx, height), } } - - pub fn update_text(&mut self, text: String) { - self.view.update_text(text); - } } impl<'a> BottomPaneView<'a> for StatusIndicatorView { - fn update_status_text(&mut self, text: String) -> ConditionalUpdate { - self.update_text(text); - ConditionalUpdate::NeedsRedraw - } - fn should_hide_when_task_is_done(&mut self) -> bool { true } diff --git a/codex-rs/tui/src/status_indicator_widget.rs b/codex-rs/tui/src/status_indicator_widget.rs index f9b71a23cb..1fe5022ee0 100644 --- a/codex-rs/tui/src/status_indicator_widget.rs +++ b/codex-rs/tui/src/status_indicator_widget.rs @@ -83,11 +83,6 @@ impl StatusIndicatorWidget { pub(crate) fn get_height(&self) -> u16 { self.height } - - /// Update the line that is displayed in the widget. - pub(crate) fn update_text(&mut self, text: String) { - self.text = text.replace(['\n', '\r'], " "); - } } impl Drop for StatusIndicatorWidget {