mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
tui: avoid no-op status-line redraws (#11155)
Rate-limit snapshots are polled every 60s, which causes unconditional redraws. This causes spurious "tab changed" indicators in terminal apps.
This commit is contained in:
committed by
GitHub
Unverified
parent
383b45279e
commit
4e9e6ca243
@@ -3141,12 +3141,20 @@ impl ChatComposer {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn set_status_line(&mut self, status_line: Option<Line<'static>>) {
|
||||
pub(crate) fn set_status_line(&mut self, status_line: Option<Line<'static>>) -> bool {
|
||||
if self.status_line_value == status_line {
|
||||
return false;
|
||||
}
|
||||
self.status_line_value = status_line;
|
||||
true
|
||||
}
|
||||
|
||||
pub(crate) fn set_status_line_enabled(&mut self, enabled: bool) {
|
||||
pub(crate) fn set_status_line_enabled(&mut self, enabled: bool) -> bool {
|
||||
if self.status_line_enabled == enabled {
|
||||
return false;
|
||||
}
|
||||
self.status_line_enabled = enabled;
|
||||
true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -905,13 +905,15 @@ impl BottomPane {
|
||||
}
|
||||
|
||||
pub(crate) fn set_status_line(&mut self, status_line: Option<Line<'static>>) {
|
||||
self.composer.set_status_line(status_line);
|
||||
self.request_redraw();
|
||||
if self.composer.set_status_line(status_line) {
|
||||
self.request_redraw();
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn set_status_line_enabled(&mut self, enabled: bool) {
|
||||
self.composer.set_status_line_enabled(enabled);
|
||||
self.request_redraw();
|
||||
if self.composer.set_status_line_enabled(enabled) {
|
||||
self.request_redraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -865,10 +865,9 @@ impl ChatWidget {
|
||||
self.set_status(header, None);
|
||||
}
|
||||
|
||||
/// Sets the currently rendered footer status-line value and schedules a redraw.
|
||||
/// Sets the currently rendered footer status-line value.
|
||||
pub(crate) fn set_status_line(&mut self, status_line: Option<Line<'static>>) {
|
||||
self.bottom_pane.set_status_line(status_line);
|
||||
self.request_redraw();
|
||||
}
|
||||
|
||||
/// Recomputes footer status-line content from config and current runtime state.
|
||||
|
||||
Reference in New Issue
Block a user