diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-21 20:19:54 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-21 20:22:57 +0300 |
| commit | 866aaf740e10fcfce169aaf81380ea0257fbe272 (patch) | |
| tree | f815392b7c6b24a7c0de14e655bd635656383813 /src/persist/snapshot.rs | |
| parent | ca579c402d5668560ca13059f82c03178be18b2a (diff) | |
refactor: separate server client boundaries
Diffstat (limited to 'src/persist/snapshot.rs')
| -rw-r--r-- | src/persist/snapshot.rs | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/persist/snapshot.rs b/src/persist/snapshot.rs index 96b6074a..a3811c36 100644 --- a/src/persist/snapshot.rs +++ b/src/persist/snapshot.rs @@ -5,6 +5,7 @@ use ratatui::layout::Direction; use serde::{Deserialize, Serialize}; use crate::layout::Node; +use crate::terminal::TerminalRuntimeRegistry; use crate::workspace::Workspace; /// Current snapshot format version. @@ -201,10 +202,7 @@ pub fn capture( crate::terminal::TerminalId, crate::terminal::TerminalState, >, - terminal_runtimes: &std::collections::HashMap< - crate::terminal::TerminalId, - crate::terminal::TerminalRuntime, - >, + terminal_runtimes: &TerminalRuntimeRegistry, active: Option<usize>, selected: usize, agent_panel_scope: crate::app::state::AgentPanelScope, @@ -231,10 +229,7 @@ fn capture_workspace( crate::terminal::TerminalId, crate::terminal::TerminalState, >, - terminal_runtimes: &std::collections::HashMap< - crate::terminal::TerminalId, - crate::terminal::TerminalRuntime, - >, + terminal_runtimes: &TerminalRuntimeRegistry, ) -> WorkspaceSnapshot { WorkspaceSnapshot { id: Some(ws.id.clone()), @@ -257,10 +252,7 @@ fn capture_tab( crate::terminal::TerminalId, crate::terminal::TerminalState, >, - terminal_runtimes: &std::collections::HashMap< - crate::terminal::TerminalId, - crate::terminal::TerminalRuntime, - >, + terminal_runtimes: &TerminalRuntimeRegistry, ) -> TabSnapshot { let mut panes = HashMap::new(); for id in tab.panes.keys() { @@ -373,10 +365,11 @@ mod tests { } fn capture_from_state(state: &AppState) -> SessionSnapshot { + let terminal_runtimes = TerminalRuntimeRegistry::new(); capture( &state.workspaces, &state.terminals, - &state.terminal_runtimes, + &terminal_runtimes, state.active, state.selected, state.agent_panel_scope, |
