aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/mobile.rs
diff options
context:
space:
mode:
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;
}