aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/endpoint_sidebar.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-09-15 15:02:07 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-09-15 15:02:09 +0300
commit9bd5f4ed37d9b087aa4e89d17f2d5ee74c69beae (patch)
tree1b38565f0c20d5f3109a8773f8bacb9c3457c45b /src/client/shell/endpoint_sidebar.rs
parent052779c4159ed851ae78ed1271130811986d1166 (diff)
fix: reveal newly focused workspaces in the machines sidebar
Diffstat (limited to 'src/client/shell/endpoint_sidebar.rs')
-rw-r--r--src/client/shell/endpoint_sidebar.rs18
1 files changed, 14 insertions, 4 deletions
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::<Vec<_>>();
- 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,