Commit 0cd4fad
committed
feat(sidebar): show worktrees under their repository
Add an optional sidebar mode that shows linked worktrees nested under their repository in the main repository list 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 in the sidebar
- synthesize child rows for linked worktrees discovered from `git worktree list` even when those worktrees were never added as repositories
- support linked-only setups by synthesizing sibling worktree rows even when the stored entry is itself a linked worktree instead of the main worktree
- use worktree folder names for child row labels while preserving existing alias styling for saved repository entries
- use the same displayed-title logic for sorting and disambiguation so nested rows sort and label consistently with what the user sees
- preload main-repository worktree state for the sidebar so nested rows are available on first render instead of only after opening the worktree dropdown or clicking around
- show a lightweight loading hint while linked worktrees are still being discovered for a repository
- refresh parent sidebar rows when linked worktrees are selected so nested rows stay in sync with the active repository view
- use preloaded parent worktree metadata so stored linked worktree rows show their branch pill on first render instead of waiting for a later refresh
- surface nested worktree rows from both saved worktree repositories and synthetic virtual rows without duplicating entries already stored in Desktop
- avoid duplicate `Pull all` work for linked worktrees while still including orphan linked worktrees when the main repo is absent from the stored repository list
- route virtual worktree open failures through the normal app error path instead of silently failing
- persist sidebar worktree metadata in repository state and extract the sidebar-specific state shaping into a dedicated helper to keep `app-store.ts` smaller
- throttle sidebar worktree refreshes during repository indicator updates and cap preload concurrency to reduce repeated `git worktree list` churn
- prune sidebar worktree refresh timestamps when repository lists change so stale cache entries do not accumulate
- harden the shared CI setup action by retrying the `yarn` install step to absorb transient Electron download failures in Actions
- tighten TypeScript null/undefined handling in repository and sidebar list code so production webpack builds pass across the full CI matrix
- add and extend unit coverage for grouped rows, synthetic rows, loading state, linked-only setups, and stored linked-worktree branch labels
Behavioral effect:
Users can opt into seeing and switching linked worktrees directly from the main repository sidebar, including unstored Git worktrees, with branch labels and parent-child grouping available on initial render.
Testing:
- yarn test:unit app/test/unit/repositories-list-grouping-test.ts
- yarn lint
- yarn compile:dev
- yarn compile:prod1 parent bce9f0a commit 0cd4fad
15 files changed
Lines changed: 1185 additions & 76 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 | + | |
| 52 | + | |
| 53 | + | |
37 | 54 | | |
38 | 55 | | |
39 | 56 | | |
| 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 | | |
| |||
136 | 145 | | |
137 | 146 | | |
138 | 147 | | |
139 | | - | |
140 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
141 | 151 | | |
142 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
143 | 160 | | |
144 | | - | |
| 161 | + | |
145 | 162 | | |
146 | 163 | | |
147 | | - | |
| 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 | + | |
| 197 | + | |
148 | 198 | | |
149 | | - | |
| 199 | + | |
150 | 200 | | |
151 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
0 commit comments