aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/mobile.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/mobile.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/mobile.rs')
-rw-r--r--src/client/shell/mobile.rs22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/client/shell/mobile.rs b/src/client/shell/mobile.rs
index abe50590..95036de5 100644
--- a/src/client/shell/mobile.rs
+++ b/src/client/shell/mobile.rs
@@ -367,7 +367,7 @@ pub(super) fn render_mobile_switcher(
endpoints: &[ClientShellEndpoint],
active_endpoint_id: &ClientEndpointId,
config: &ClientShellConfig,
- selected_workspace_id: Option<&str>,
+ selected_workspace_id: Option<&WorkspaceNavigationTarget>,
scroll: &mut usize,
reveal_workspace: &mut bool,
hits: &mut ShellHitMap,
@@ -457,7 +457,7 @@ pub(super) fn render_mobile_switcher(
Some(ClientMobileTarget::Workspace {
endpoint_id,
workspace_id,
- }) if endpoint_id == active_endpoint_id && workspace_id == selected_workspace_id
+ }) if selected_workspace_id.matches(endpoint_id, workspace_id)
) {
if start < *scroll {
*scroll = start;
@@ -577,7 +577,7 @@ fn mobile_items(
endpoints: &[ClientShellEndpoint],
active_endpoint_id: &ClientEndpointId,
config: &ClientShellConfig,
- selected_workspace_id: Option<&str>,
+ selected_workspace_id: Option<&WorkspaceNavigationTarget>,
content_width: u16,
) -> Vec<MobileItem> {
let palette = &config.palette;
@@ -755,10 +755,15 @@ fn mobile_items(
let Some(workspace) = endpoint.snapshot.workspaces.get(entry.index) else {
continue;
};
- let selected = endpoint.endpoint_id == active_endpoint_id
- && selected_workspace_id == Some(workspace.workspace_id.as_str());
+ let selected = selected_workspace_id.is_some_and(|target| {
+ target.matches(endpoint.endpoint_id, &workspace.workspace_id)
+ });
let background = if selected {
- palette.surface0
+ if palette.surface0 == ratatui::style::Color::Reset {
+ palette.active_row_bg
+ } else {
+ palette.surface0
+ }
} else if endpoint.endpoint_id == active_endpoint_id && workspace.focused {
palette.surface_dim
} else {
@@ -950,10 +955,7 @@ impl ClientShellState {
self.mobile_switcher_scroll = 0;
self.reveal_mobile_workspace = false;
self.mode = ClientShellMode::Navigate;
- self.navigate_workspace_id = self
- .snapshot
- .as_deref()
- .and_then(|snapshot| snapshot.focused_workspace_id.clone());
+ self.navigate_workspace_id = self.focused_navigation_target();
outcome.repaint = true;
return true;
}