Commit b451b05
committed
feat(sidebar): show worktrees under their repository
Add an opt-in sidebar mode that lists linked worktrees beneath their main repository so repository switching can stay in the main sidebar instead of requiring the worktree dropdown.
Changes:
- add a secondary appearance setting to show worktrees in the repository sidebar when worktree support is enabled
- group linked worktrees under their main repository and synthesize sidebar rows for worktrees that are not already stored as repositories
- render nested rows with the worktree folder name, keep alias styling behavior unchanged, and avoid duplicate pull-all work for linked worktrees
- persist sidebar worktree metadata in repository state and expose main worktree path helpers needed for grouping
- preload main-repository worktree state for the sidebar, show a loading hint while discovery is in flight, and refresh the parent row when a linked worktree is selected
- use preloaded parent worktree metadata so stored linked worktree rows show their branch pill on first render instead of waiting for an explicit refresh
- add unit coverage for grouped, synthetic, loading, and stored-linked branch-label cases and throttle sidebar worktree refreshes to reduce repeated git worktree list churn during indicator updates
Testing:
- yarn test:unit app/test/unit/repositories-list-grouping-test.ts
- yarn eslint app/src/lib/stores/app-store.ts app/src/models/repository.ts app/src/ui/repositories-list/group-repositories.ts app/src/ui/repositories-list/repositories-list.tsx app/src/ui/repositories-list/repository-list-item.tsx app/test/unit/repositories-list-grouping-test.ts
- yarn compile:dev1 parent bce9f0a commit b451b05
15 files changed
Lines changed: 1021 additions & 69 deletions
File tree
- .github/actions/setup-ci-environment
- app
- src
- lib
- git
- stores
- helpers
- models
- ui
- dispatcher
- preferences
- repositories-list
- styles/ui
- test/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
37 | 52 | | |
38 | 53 | | |
39 | 54 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
324 | 327 | | |
325 | 328 | | |
326 | 329 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
8 | 17 | | |
9 | 18 | | |
10 | 19 | | |
| |||
140 | 149 | | |
141 | 150 | | |
142 | 151 | | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
143 | 159 | | |
144 | | - | |
| 160 | + | |
145 | 161 | | |
146 | 162 | | |
147 | | - | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
148 | 197 | | |
149 | | - | |
| 198 | + | |
150 | 199 | | |
151 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
0 commit comments