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/composition.rs | 32 +++++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) (limited to 'src/client/shell/composition.rs') diff --git a/src/client/shell/composition.rs b/src/client/shell/composition.rs index c54a56e2..523cec87 100644 --- a/src/client/shell/composition.rs +++ b/src/client/shell/composition.rs @@ -35,6 +35,11 @@ impl ClientShellState { } else { Rect::new(0, 1, cols, rows.saturating_sub(2)) }; + let valid_navigation_target = self.mode == ClientShellMode::Navigate + && self + .navigate_workspace_id + .as_ref() + .is_some_and(|target| self.navigation_target_valid(target)); super::endpoint_sidebar::render_expanded( &mut buffer, sidebar, @@ -54,7 +59,11 @@ impl ClientShellState { sidebar_collapsed: false, sidebar_section_split: self.sidebar_section_split, tab_drag_insert_index: None, - selected_workspace_id: self.navigate_workspace_id.as_deref(), + selected_workspace_id: self + .navigate_workspace_id + .as_ref() + .filter(|_| valid_navigation_target), + reveal_navigation_workspace: &mut self.reveal_navigation_workspace, dragged_workspace_id: None, workspace_drop_indicator_row: None, }, @@ -100,7 +109,16 @@ impl ClientShellState { } pub(crate) fn compose(&mut self, cols: u16, rows: u16) -> Option { + if self.last_composed_size != Some((cols, rows)) && self.mode == ClientShellMode::Navigate { + self.reveal_navigation_workspace = true; + self.reveal_mobile_workspace = true; + } self.last_composed_size = Some((cols, rows)); + let valid_navigation_target = self.mode == ClientShellMode::Navigate + && self + .navigate_workspace_id + .as_ref() + .is_some_and(|target| self.navigation_target_valid(target)); if self.snapshot.is_none() || self.pane_surface.is_none() { return Some(self.compose_unavailable(cols, rows)); } @@ -153,9 +171,11 @@ impl ClientShellState { sidebar_collapsed: self.sidebar_collapsed, sidebar_section_split: self.sidebar_section_split, tab_drag_insert_index, - selected_workspace_id: (self.mode == ClientShellMode::Navigate) - .then_some(self.navigate_workspace_id.as_deref()) - .flatten(), + selected_workspace_id: self + .navigate_workspace_id + .as_ref() + .filter(|_| valid_navigation_target), + reveal_navigation_workspace: &mut self.reveal_navigation_workspace, dragged_workspace_id, workspace_drop_indicator_row, }, @@ -511,7 +531,9 @@ impl ClientShellState { &self.endpoints, &self.active_endpoint_id, &self.config, - self.navigate_workspace_id.as_deref(), + self.navigate_workspace_id + .as_ref() + .filter(|_| valid_navigation_target), &mut self.mobile_switcher_scroll, &mut self.reveal_mobile_workspace, &mut self.hits, -- cgit v1.2.3