@@ -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));
}
@@ -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}",
]
);