aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/state.rs
diff options
context:
space:
mode:
authorakbash <akbash@herdr.dev>2026-09-09 02:35:31 +0300
committerGitHub <noreply@github.com>2026-09-09 02:35:31 +0300
commitb9ce96869e89937278d673d70ae4c135dd318469 (patch)
treefea7e39dad42f8cad1f1846af6babda546c1fa78 /src/client/shell/state.rs
parent8be4cf765afddfd9cf3206602ba4dab682a29fa1 (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/state.rs')
-rw-r--r--src/client/shell/state.rs23
1 files changed, 13 insertions, 10 deletions
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<ClientEndpointId>,
pub(super) mode: ClientShellMode,
- pub(super) navigate_workspace_id: Option<String>,
+ pub(super) navigate_workspace_id: Option<WorkspaceNavigationTarget>,
+ pub(super) reveal_navigation_workspace: bool,
pub(super) overlay: Option<ClientShellOverlay>,
pub(super) previous_pane_id: Option<String>,
pub(super) pane_mouse_gesture: Option<ClientPaneMouseGesture>,
@@ -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 =