From 14d8e93391ed688c1adbd19d964666bb5451ca29 Mon Sep 17 00:00:00 2001 From: Ogulcan Celik Date: Thu, 25 Jun 2026 23:36:31 +0300 Subject: feat: render worktrees as a tree in the mobile switcher --- src/app/actions.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/app/actions.rs') diff --git a/src/app/actions.rs b/src/app/actions.rs index f9bc4d88..92027b6a 100644 --- a/src/app/actions.rs +++ b/src/app/actions.rs @@ -1122,7 +1122,14 @@ impl AppState { } pub(crate) fn visible_workspace_order(&self) -> Vec { - let order = crate::ui::workspace_list_entries(self) + // Mobile always shows the worktree tree expanded, so its visible order + // must ignore collapse state to match what the switcher renders. + let entries = if self.view.layout == ViewLayout::Mobile { + crate::ui::workspace_list_entries_expanded(self) + } else { + crate::ui::workspace_list_entries(self) + }; + let order = entries .into_iter() .map(|entry| match entry { crate::ui::WorkspaceListEntry::Workspace { ws_idx, .. } => ws_idx, -- cgit v1.2.3