File tree Expand file tree Collapse file tree 4 files changed +0
-42
lines changed Expand file tree Collapse file tree 4 files changed +0
-42
lines changed Original file line number Diff line number Diff line change @@ -5,12 +5,6 @@ use ratatui::layout::Rect;
5
5
6
6
use super :: BottomPane ;
7
7
8
- /// Type to use for a method that may require a redraw of the UI.
9
- pub ( crate ) enum ConditionalUpdate {
10
- NeedsRedraw ,
11
- NoRedraw ,
12
- }
13
-
14
8
/// Trait implemented by every view that can be shown in the bottom pane.
15
9
pub ( crate ) trait BottomPaneView < ' a > {
16
10
/// Handle a key event while the view is active. A redraw is always
@@ -28,11 +22,6 @@ pub(crate) trait BottomPaneView<'a> {
28
22
/// Render the view: this will be displayed in place of the composer.
29
23
fn render ( & self , area : Rect , buf : & mut Buffer ) ;
30
24
31
- /// Update the status indicator text.
32
- fn update_status_text ( & mut self , _text : String ) -> ConditionalUpdate {
33
- ConditionalUpdate :: NoRedraw
34
- }
35
-
36
25
/// Called when task completes to check if the view should be hidden.
37
26
fn should_hide_when_task_is_done ( & mut self ) -> bool {
38
27
false
Original file line number Diff line number Diff line change 1
1
//! Bottom pane: shows the ChatComposer or a BottomPaneView, if one is active.
2
2
3
3
use bottom_pane_view:: BottomPaneView ;
4
- use bottom_pane_view:: ConditionalUpdate ;
5
4
use crossterm:: event:: KeyEvent ;
6
5
use ratatui:: buffer:: Buffer ;
7
6
use ratatui:: layout:: Rect ;
@@ -78,21 +77,6 @@ impl BottomPane<'_> {
78
77
}
79
78
}
80
79
81
- /// Update the status indicator text (only when the `StatusIndicatorView` is
82
- /// active).
83
- pub ( crate ) fn update_status_text ( & mut self , text : String ) {
84
- if let Some ( view) = & mut self . active_view {
85
- match view. update_status_text ( text) {
86
- ConditionalUpdate :: NeedsRedraw => {
87
- self . request_redraw ( ) ;
88
- }
89
- ConditionalUpdate :: NoRedraw => {
90
- // No redraw needed.
91
- }
92
- }
93
- }
94
- }
95
-
96
80
/// Update the UI to reflect whether this `BottomPane` has input focus.
97
81
pub ( crate ) fn set_input_focus ( & mut self , has_focus : bool ) {
98
82
self . has_input_focus = has_focus;
Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ use crate::app_event_sender::AppEventSender;
6
6
use crate :: status_indicator_widget:: StatusIndicatorWidget ;
7
7
8
8
use super :: BottomPaneView ;
9
- use super :: bottom_pane_view:: ConditionalUpdate ;
10
9
11
10
pub ( crate ) struct StatusIndicatorView {
12
11
view : StatusIndicatorWidget ,
@@ -18,18 +17,9 @@ impl StatusIndicatorView {
18
17
view : StatusIndicatorWidget :: new ( app_event_tx, height) ,
19
18
}
20
19
}
21
-
22
- pub fn update_text ( & mut self , text : String ) {
23
- self . view . update_text ( text) ;
24
- }
25
20
}
26
21
27
22
impl < ' a > BottomPaneView < ' a > for StatusIndicatorView {
28
- fn update_status_text ( & mut self , text : String ) -> ConditionalUpdate {
29
- self . update_text ( text) ;
30
- ConditionalUpdate :: NeedsRedraw
31
- }
32
-
33
23
fn should_hide_when_task_is_done ( & mut self ) -> bool {
34
24
true
35
25
}
Original file line number Diff line number Diff line change @@ -83,11 +83,6 @@ impl StatusIndicatorWidget {
83
83
pub ( crate ) fn get_height ( & self ) -> u16 {
84
84
self . height
85
85
}
86
-
87
- /// Update the line that is displayed in the widget.
88
- pub ( crate ) fn update_text ( & mut self , text : String ) {
89
- self . text = text. replace ( [ '\n' , '\r' ] , " " ) ;
90
- }
91
86
}
92
87
93
88
impl Drop for StatusIndicatorWidget {
You can’t perform that action at this time.
0 commit comments