From 9bd5f4ed37d9b087aa4e89d17f2d5ee74c69beae Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Tue, 15 Sep 2026 15:02:07 +0300 Subject: fix: reveal newly focused workspaces in the machines sidebar --- src/client/shell/endpoint_sidebar.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/client/shell/endpoint_sidebar.rs') diff --git a/src/client/shell/endpoint_sidebar.rs b/src/client/shell/endpoint_sidebar.rs index bce484a3..34d2ccdc 100644 --- a/src/client/shell/endpoint_sidebar.rs +++ b/src/client/shell/endpoint_sidebar.rs @@ -328,7 +328,9 @@ pub(super) fn render_expanded( _ => 0, }) .collect::>(); - if std::mem::take(state.reveal_navigation_workspace) { + let reveal_navigation = !body.is_empty() && std::mem::take(state.reveal_navigation_workspace); + let reveal_focus = !body.is_empty() && std::mem::take(state.reveal_focused_workspace); + if reveal_navigation || reveal_focus { let selected_row = rows.iter().position(|row| match row { Row::Workspace { endpoint, entry } => { let endpoint = &state.endpoints[*endpoint]; @@ -337,9 +339,17 @@ pub(super) fn render_expanded( .as_deref() .and_then(|snapshot| snapshot.workspaces.get(entry.index)) .is_some_and(|workspace| { - state.selected_workspace_id.is_some_and(|target| { - target.matches(&endpoint.endpoint_id, &workspace.workspace_id) - }) + if reveal_navigation { + state.selected_workspace_id.is_some_and(|target| { + target.matches(&endpoint.endpoint_id, &workspace.workspace_id) + }) + } else { + &endpoint.endpoint_id == state.active_endpoint_id + && active_snapshot.is_some_and(|snapshot| { + snapshot.focused_workspace_id.as_deref() + == Some(workspace.workspace_id.as_str()) + }) + } }) } Row::Endpoint(_) => false, -- cgit v1.2.3