Fix CI test failures

Eric Holk created

Remove the has_unbacked_linked_worktree filter that was too aggressively
hiding threads whose folder_paths included linked worktree paths not yet
discovered by git state. Since threads are already correctly grouped via
their main_worktree_paths column, this filter was unnecessary and caused
threads belonging to open workspace roots and closed worktree workspaces
to be hidden.

Update test_git_worktree_added_live_updates_sidebar to expect the thread
visible from the start (the chip name is derived from the path heuristic
even before git discovery).

Fix test_worktree_add_key_collision_removes_duplicate_workspace to switch
back to workspace A before the collision, since the collision code keeps
the active workspace and drops the incoming duplicate.

Change summary

crates/sidebar/src/sidebar.rs       | 15 ---------------
crates/sidebar/src/sidebar_tests.rs | 13 +++++++++++--
2 files changed, 11 insertions(+), 17 deletions(-)

Detailed changes

crates/sidebar/src/sidebar.rs 🔗

@@ -1024,18 +1024,6 @@ impl Sidebar {
                         }
                     };
 
-                let main_path_list = group_key.path_list();
-
-                // Skip threads whose folder_paths include a linked worktree
-                // that hasn't been discovered by any workspace's git state.
-                let has_unbacked_linked_worktree = |row: &ThreadMetadata| -> bool {
-                    let main_paths = main_path_list.paths();
-                    row.folder_paths.paths().iter().any(|path| {
-                        let is_main = main_paths.iter().any(|mp| mp.as_path() == path.as_path());
-                        !is_main && !linked_to_main.contains_key(&**path)
-                    })
-                };
-
                 // Main code path: one query per group via main_worktree_paths.
                 // The main_worktree_paths column is set on all new threads and
                 // points to the group's canonical paths regardless of which
@@ -1048,9 +1036,6 @@ impl Sidebar {
                     if !seen_session_ids.insert(row.session_id.clone()) {
                         continue;
                     }
-                    if has_unbacked_linked_worktree(&row) {
-                        continue;
-                    }
                     let workspace = resolve_workspace(&row);
                     threads.push(make_thread_entry(row, workspace));
                 }

crates/sidebar/src/sidebar_tests.rs 🔗

@@ -2808,6 +2808,14 @@ async fn test_worktree_add_key_collision_removes_duplicate_workspace(cx: &mut Te
     });
     cx.run_until_parked();
 
+    // Switch back to workspace A so it's the active workspace when the collision happens.
+    let workspace_a =
+        multi_workspace.read_with(cx, |mw, _| mw.workspaces().next().unwrap().clone());
+    multi_workspace.update_in(cx, |mw, window, cx| {
+        mw.activate(workspace_a, window, cx);
+    });
+    cx.run_until_parked();
+
     // Save a thread against workspace B [/project-a, /project-b].
     save_named_thread_metadata("thread-b", "Thread B", &project_b, cx).await;
 
@@ -3594,13 +3602,14 @@ async fn test_git_worktree_added_live_updates_sidebar(cx: &mut TestAppContext) {
     multi_workspace.update_in(cx, |_, _window, cx| cx.notify());
     cx.run_until_parked();
 
-    // Thread is not visible yet — the linked worktree hasn't been
-    // discovered by any workspace's git state.
+    // Thread is visible because its main_worktree_paths match the group.
+    // The chip name is derived from the path even before git discovery.
     assert_eq!(
         visible_entries_as_strings(&sidebar, cx),
         vec![
             //
             "v [project]",
+            "  Worktree Thread {rosewood}",
         ]
     );