Commit 43a2ddc
committed
fix(sidebar): let sidebar parent rows open the main worktree explicitly
Upstream now restores the last selected linked worktree when reselecting a repository, which is useful for normal repo switching but conflicts with the sidebar parent-row interaction. After visiting a synthetic child row, clicking the parent row should open the parent repository itself instead of bouncing back into the remembered worktree.
Changes:
- add an explicit `followPreferredWorktree` selection flag through dispatcher and app-store repository selection paths
- keep the upstream preferred-worktree restore behavior enabled by default for existing selection flows
- make repository sidebar row clicks opt out of preferred-worktree restoration so an explicit parent-row click opens the main worktree
Behavioral effect:
When a user clicks a repository parent row in the sidebar after visiting a linked worktree, the app now opens the parent repository directly instead of restoring the previously selected child worktree behind the user's back.
Testing:
- yarn eslint app/src/ui/dispatcher/dispatcher.ts app/src/lib/stores/app-store.ts app/src/ui/app.tsx
- yarn compile:prod1 parent f0b2324 commit 43a2ddc
3 files changed
Lines changed: 11 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2176 | 2176 | | |
2177 | 2177 | | |
2178 | 2178 | | |
2179 | | - | |
| 2179 | + | |
| 2180 | + | |
2180 | 2181 | | |
2181 | 2182 | | |
2182 | 2183 | | |
| |||
2212 | 2213 | | |
2213 | 2214 | | |
2214 | 2215 | | |
2215 | | - | |
| 2216 | + | |
2216 | 2217 | | |
2217 | 2218 | | |
2218 | 2219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3827 | 3827 | | |
3828 | 3828 | | |
3829 | 3829 | | |
3830 | | - | |
| 3830 | + | |
3831 | 3831 | | |
3832 | 3832 | | |
3833 | 3833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
| 318 | + | |
318 | 319 | | |
319 | | - | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
320 | 325 | | |
321 | 326 | | |
322 | 327 | | |
| |||
0 commit comments