aboutsummaryrefslogtreecommitdiff
path: root/src/app/runtime.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/runtime.rs')
-rw-r--r--src/app/runtime.rs46
1 files changed, 6 insertions, 40 deletions
diff --git a/src/app/runtime.rs b/src/app/runtime.rs
index bd7830b9..ef0a452d 100644
--- a/src/app/runtime.rs
+++ b/src/app/runtime.rs
@@ -1,11 +1,13 @@
-use std::time::{Duration, Instant};
+use std::time::Instant;
+
+#[cfg(test)]
+use std::time::Duration;
use crossterm::terminal;
use super::{
- background_update_check_enabled, pressed_key_identity, App, ANIMATION_INTERVAL,
- AUTO_UPDATE_CHECK_INTERVAL, MIN_RENDER_INTERVAL, RESIZE_POLL_INTERVAL,
- SELECTION_AUTOSCROLL_INTERVAL,
+ background_update_check_enabled, pressed_key_identity, App, AUTO_UPDATE_CHECK_INTERVAL,
+ MIN_RENDER_INTERVAL, RESIZE_POLL_INTERVAL, SELECTION_AUTOSCROLL_INTERVAL,
};
fn retain_custom_command_after_wait(
pid: u32,
@@ -224,8 +226,6 @@ impl App {
let mut changed = false;
let mut resized = false;
- self.sync_animation_timer(now);
-
if now >= self.next_resize_poll {
resized = self.handle_resize_poll();
changed |= resized;
@@ -287,15 +287,6 @@ impl App {
}
if self
- .next_animation_tick
- .is_some_and(|deadline| now >= deadline)
- {
- self.state.spinner_tick = self.state.spinner_tick.wrapping_add(1);
- self.next_animation_tick = Some(now + ANIMATION_INTERVAL);
- changed = true;
- }
-
- if self
.selection_autoscroll_deadline
.is_some_and(|deadline| now >= deadline)
{
@@ -336,7 +327,6 @@ impl App {
self.sync_pending_agent_resume_deadline(now);
changed |= self.start_pending_agent_resumes(self.pending_agent_resume_due(now));
}
- self.sync_animation_timer(now);
changed
}
@@ -393,29 +383,6 @@ impl App {
self.sync_agent_metadata_deadline();
}
- pub(crate) fn sync_animation_timer(&mut self, now: Instant) {
- self.sync_animation_timer_with_interval(now, ANIMATION_INTERVAL);
- }
-
- pub(crate) fn sync_headless_animation_timer(&mut self, now: Instant) {
- self.sync_animation_timer_with_interval(now, crate::app::HEADLESS_ANIMATION_INTERVAL);
- }
-
- fn sync_animation_timer_with_interval(&mut self, now: Instant, interval: Duration) {
- if self.agent_panel_has_animation() {
- self.next_animation_tick.get_or_insert(now + interval);
- } else {
- self.next_animation_tick = None;
- }
- }
-
- fn agent_panel_has_animation(&self) -> bool {
- self.state
- .workspaces
- .iter()
- .any(|ws| ws.has_working_pane(&self.state.terminals))
- }
-
pub(crate) fn tick_selection_autoscroll(&mut self, now: Instant) {
let Some(autoscroll) = self.state.selection_autoscroll.clone() else {
// Self-heal: state cleared but deadline leaked
@@ -568,7 +535,6 @@ impl App {
self.state.next_pending_agent_notification_deadline(),
self.state.next_managed_agent_deadline(),
self.copy_feedback_deadline,
- self.next_animation_tick,
include_git_refresh
.then(|| self.git_refresh_deadline())
.flatten(),