From b9ce96869e89937278d673d70ae4c135dd318469 Mon Sep 17 00:00:00 2001 From: akbash Date: Wed, 9 Sep 2026 02:35:31 +0300 Subject: feat: navigate and highlight workspaces across machines (#3755) * fix: highlight workspace navigation with saved machines refs #3754 * feat: navigate workspaces across connected machines refs #3754 * feat: navigate workspaces across machines refs #3754 --------- Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com> Co-authored-by: Ogulcan Celik --- src/client/shell/state.rs | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/client/shell/state.rs') diff --git a/src/client/shell/state.rs b/src/client/shell/state.rs index f4050feb..4ac49680 100644 --- a/src/client/shell/state.rs +++ b/src/client/shell/state.rs @@ -927,7 +927,8 @@ pub(crate) struct ClientShellState { pub(super) active_endpoint_id: ClientEndpointId, pub(super) collapsed_endpoints: HashSet, pub(super) mode: ClientShellMode, - pub(super) navigate_workspace_id: Option, + pub(super) navigate_workspace_id: Option, + pub(super) reveal_navigation_workspace: bool, pub(super) overlay: Option, pub(super) previous_pane_id: Option, pub(super) pane_mouse_gesture: Option, @@ -1082,6 +1083,7 @@ impl ClientShellState { collapsed_endpoints: HashSet::new(), mode: ClientShellMode::Terminal, navigate_workspace_id: None, + reveal_navigation_workspace: false, overlay, previous_pane_id: None, pane_mouse_gesture: None, @@ -1361,7 +1363,12 @@ impl ClientShellState { self.hits = ShellHitMap::default(); } if boot_changed { + // A reboot must not turn Enter on a stale preview into focus on a reused ID. + let preview = (self.mode == ClientShellMode::Navigate) + .then(|| self.navigate_workspace_id.take()) + .flatten(); self.reset_endpoint_projection(); + self.navigate_workspace_id = preview; } else if let Some(previous) = self .snapshot .as_deref() @@ -1477,15 +1484,11 @@ impl ClientShellState { } } } - if self.mode == ClientShellMode::Navigate - && self.navigate_workspace_id.as_ref().is_none_or(|selected| { - !snapshot - .workspaces - .iter() - .any(|workspace| &workspace.workspace_id == selected) - }) - { - self.navigate_workspace_id = snapshot.focused_workspace_id.clone(); + if self.mode == ClientShellMode::Navigate && self.navigate_workspace_id.is_none() { + self.navigate_workspace_id = snapshot + .focused_workspace_id + .as_deref() + .and_then(|id| self.navigation_target(&self.active_endpoint_id, id)); self.reveal_mobile_workspace = self.mobile_layout_active(); } let pane_exists = -- cgit v1.2.3