diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-01 23:31:53 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-06-01 23:32:44 +0300 |
| commit | 36a4608603a82dbf32ec8a013dd47047cf02c6a3 (patch) | |
| tree | 8a9242974ad45dd6dc22b66f576dd9adcc36d996 /src/app/mod.rs | |
| parent | 5bd21b7ed468b5ff4d1a5b2ed7e211f401eb138a (diff) | |
fix: restore agents through pane shells
Diffstat (limited to 'src/app/mod.rs')
| -rw-r--r-- | src/app/mod.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index 0dcd0372..5a39b8e2 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -5,6 +5,7 @@ //! - `input.rs` — key/mouse → action translation pub(crate) mod actions; +mod agent_resume; mod agents; mod api; mod api_helpers; @@ -34,6 +35,7 @@ pub(crate) const SELECTION_AUTOSCROLL_INTERVAL: Duration = Duration::from_millis const RESIZE_POLL_INTERVAL: Duration = Duration::from_millis(100); const GIT_REMOTE_STATUS_REFRESH_INTERVAL: Duration = Duration::from_millis(1500); const AUTO_UPDATE_CHECK_INTERVAL: Duration = Duration::from_secs(30 * 60); +const PENDING_AGENT_RESUME_THEME_WAIT: Duration = Duration::from_millis(750); const SESSION_SAVE_DEBOUNCE: Duration = Duration::from_secs(5); const SIDEBAR_DOUBLE_CLICK_WINDOW: Duration = Duration::from_millis(350); const PANE_DOUBLE_CLICK_WINDOW: Duration = Duration::from_millis(350); @@ -105,6 +107,7 @@ pub struct App { pub(crate) next_animation_tick: Option<Instant>, pub(crate) next_auto_update_check: Option<Instant>, pub(crate) agent_metadata_deadline: Option<Instant>, + pub(crate) pending_agent_resume_deadline: Option<Instant>, pub(crate) selection_autoscroll_deadline: Option<Instant>, pub(crate) selection_highlight_clear_deadline: Option<Instant>, pub(crate) session_save_deadline: Option<Instant>, @@ -576,6 +579,7 @@ impl App { next_auto_update_check: auto_updates_enabled(no_session) .then_some(Instant::now() + AUTO_UPDATE_CHECK_INTERVAL), agent_metadata_deadline: None, + pending_agent_resume_deadline: None, session_save_deadline: None, selection_autoscroll_deadline: None, selection_highlight_clear_deadline: None, @@ -698,7 +702,7 @@ impl App { self.sync_session_save_schedule(); let now = Instant::now(); - if self.handle_scheduled_tasks(now) { + if self.handle_scheduled_tasks(now, needs_render) { needs_render = true; } @@ -813,6 +817,11 @@ impl App { cell_size, )?; } + self.sync_pending_agent_resume_deadline(now); + if self.start_pending_agent_resumes(self.pending_agent_resume_due(now)) { + self.render_dirty.store(true, Ordering::Release); + self.render_notify.notify_one(); + } self.last_render_at = Some(now); needs_render = false; continue; @@ -3000,7 +3009,7 @@ mod tests { let mut app = test_app(); app.session_save_deadline = Some(Instant::now() - Duration::from_secs(1)); - app.handle_scheduled_tasks(Instant::now()); + app.handle_scheduled_tasks(Instant::now(), false); assert!(app.session_save_deadline.is_none()); } |
