diff options
| author | akbash <akbash@herdr.dev> | 2026-09-10 13:20:44 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-10 13:20:44 +0300 |
| commit | e1bb3df0ac4dd80d7a324deb53cd91d13b942800 (patch) | |
| tree | 9a4088d6dd044878f893e922978f380f9946f689 /src/client/shell/composition.rs | |
| parent | 0911056d7eb8fe40bd66acab7e0b7cc71acd4f6a (diff) | |
fix: keep spaces sidebar stable during resize (#3862)
refs #3817
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Diffstat (limited to 'src/client/shell/composition.rs')
| -rw-r--r-- | src/client/shell/composition.rs | 96 |
1 files changed, 59 insertions, 37 deletions
diff --git a/src/client/shell/composition.rs b/src/client/shell/composition.rs index 523cec87..92cf3c46 100644 --- a/src/client/shell/composition.rs +++ b/src/client/shell/composition.rs @@ -40,35 +40,55 @@ impl ClientShellState { .navigate_workspace_id .as_ref() .is_some_and(|target| self.navigation_target_valid(target)); - super::endpoint_sidebar::render_expanded( - &mut buffer, - sidebar, - self.snapshot.as_deref(), - &self.config, - &mut render::ShellRenderState { - endpoints: &self.endpoints, - active_endpoint_id: &self.active_endpoint_id, - collapsed_endpoints: &self.collapsed_endpoints, - collapsed_groups: &self.collapsed_groups, - remote_collapsed_groups: &self.remote_collapsed_groups, - workspace_scroll: &mut self.workspace_scroll, - agent_scroll: &mut self.agent_scroll, - tab_scroll: &mut self.tab_scroll, - reveal_focused_workspace: &mut self.reveal_focused_workspace, - reveal_focused_tab: &mut self.reveal_focused_tab, - sidebar_collapsed: false, - sidebar_section_split: self.sidebar_section_split, - tab_drag_insert_index: None, - 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, - }, - &mut self.hits, - ); + // A resize invalidates pane geometry, not the healthy Local workspace chrome. + let local_snapshot = self.snapshot.as_deref().filter(|_| { + self.endpoints.len() == 1 + && !self.sidebar_collapsed + && layout.sidebar.width > 0 + && self.endpoint_status(&self.active_endpoint_id) + == Some(ClientEndpointStatus::Online) + }); + let mut render_state = render::ShellRenderState { + endpoints: &self.endpoints, + active_endpoint_id: &self.active_endpoint_id, + collapsed_endpoints: &self.collapsed_endpoints, + collapsed_groups: &self.collapsed_groups, + remote_collapsed_groups: &self.remote_collapsed_groups, + workspace_scroll: &mut self.workspace_scroll, + agent_scroll: &mut self.agent_scroll, + tab_scroll: &mut self.tab_scroll, + reveal_focused_workspace: &mut self.reveal_focused_workspace, + reveal_focused_tab: &mut self.reveal_focused_tab, + sidebar_collapsed: false, + sidebar_section_split: self.sidebar_section_split, + tab_drag_insert_index: None, + 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, + }; + if let Some(snapshot) = local_snapshot { + render::render_sidebar( + &mut buffer, + sidebar, + snapshot, + &self.config, + &mut render_state, + &mut self.hits, + ); + } else { + super::endpoint_sidebar::render_expanded( + &mut buffer, + sidebar, + self.snapshot.as_deref(), + &self.config, + &mut render_state, + &mut self.hits, + ); + } if !self.config.mouse_capture { self.hits = ShellHitMap::default(); } @@ -87,14 +107,16 @@ impl ClientShellState { } else { Rect::new(0, 0, cols, 1) }; - render::put_text( - &mut buffer, - message_area.x, - message_area.y, - message_area.width, - &message, - Style::default().fg(self.config.palette.overlay0), - ); + if local_snapshot.is_none() || self.endpoint_error.is_some() { + render::put_text( + &mut buffer, + message_area.x, + message_area.y, + message_area.width, + &message, + Style::default().fg(self.config.palette.overlay0), + ); + } render::render_mode_bar( &mut buffer, Rect::new(0, 0, cols, rows), |
