# sidebar: Fixes around multi-root projects \(\#53276\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/082950d878ed33ee4aa279fefb4cf6462ad0c5ab)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 082950d878ed33ee4aa279fefb4cf6462ad0c5ab

Requested commit: 082950d878ed33ee4aa279fefb4cf6462ad0c5ab

Commit: 082950d878ed33ee4aa279fefb4cf6462ad0c5ab

Tree: 32f1c71f27f45215d750ab6308fc49650586f101

Author: Eric Holk

Committer: GitHub

## Message

```
sidebar: Fixes around multi-root projects (#53276)

When a project mixes main repo worktrees (e.g. `extensions`) with linked
git worktrees (e.g. `zed4`, a linked worktree of `zed`), two things were
broken:

1. **Threads appeared under the wrong sidebar heading.** A thread
created in a workspace with both `extensions` and `zed4` would show
under the "zed" group instead of the "extensions, zed" group. This
happened because `main_worktree_paths` in `ThreadMetadata` was only
populated with paths from linked worktrees, omitting regular repos
entirely. The fix uses `project_group_key()` to normalize all visible
worktrees to their main repo paths — the same normalization the sidebar
uses for group headers.

2. **The worktree chip tooltip only showed linked worktree paths**,
missing main repo paths like `extensions`. This happened because
`worktree_info_from_thread_paths` filtered out main worktree paths
entirely. The fix introduces a `WorktreeKind` enum (`Main` / `Linked`)
on `ThreadItemWorktreeInfo`, so all worktrees are included in the data
model. Chips still only render for `Linked` worktrees (main worktrees
are redundant with the group header), but the tooltip now shows all
paths.

Release Notes:

- N/A
```

## Parents

- [70d6c2bdc4e6238d55b147555a1e3a06c8c8fc71](https://git.cafe/gitcafe/zed/commit/70d6c2bdc4e6238d55b147555a1e3a06c8c8fc71?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/082950d878ed33ee4aa279fefb4cf6462ad0c5ab?format=markdown)
