aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-25 23:36:31 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-25 23:36:31 +0300
commit14d8e93391ed688c1adbd19d964666bb5451ca29 (patch)
tree01cbc02a90b5811caa3cbd6943aec7abb7fc9487 /src/app
parent292a98a91e35662fd65993956278787ee0ca9840 (diff)
feat: render worktrees as a tree in the mobile switcher
Diffstat (limited to 'src/app')
-rw-r--r--src/app/actions.rs9
1 files changed, 8 insertions, 1 deletions
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<usize> {
- 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,