diff options
| author | akbash <akbash@herdr.dev> | 2026-09-09 02:35:31 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-09 02:35:31 +0300 |
| commit | b9ce96869e89937278d673d70ae4c135dd318469 (patch) | |
| tree | fea7e39dad42f8cad1f1846af6babda546c1fa78 /src/client/shell/composition.rs | |
| parent | 8be4cf765afddfd9cf3206602ba4dab682a29fa1 (diff) | |
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 <ogulcancelik@gmail.com>
Diffstat (limited to 'src/client/shell/composition.rs')
| -rw-r--r-- | src/client/shell/composition.rs | 32 |
1 files changed, 27 insertions, 5 deletions
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<FrameData> { + 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, |
