You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(sidebar): keep linked worktree rows as leaf nodes
Linked worktrees should never become alternate parents for a worktree family in the sidebar. After the earlier synthetic-row support, orphan linked worktrees could still synthesize sibling children underneath themselves, which made grouping unstable and produced confusing results when a saved linked worktree also had custom alias or group metadata.
Changes:
- stop synthesizing sibling worktree rows underneath orphan linked worktree entries so only main worktrees can own nested children
- use the linked worktree alias when present, otherwise fall back to the worktree basename, so saved linked rows can keep their explicit label without becoming a second group root
- treat both saved and synthetic linked worktree rows as `Delete…` targets in the sidebar context menu while keeping alias and group actions available only for saved rows
- extend the delete-worktree popup payload so deleting a saved linked worktree also removes its stored Desktop repository entry, and so deleting the currently selected synthetic worktree still switches away safely before removal
- add regression coverage for orphan linked rows staying flat and for the saved-vs-virtual linked worktree context menu behavior
Behavioral effect:
Known linked worktrees now remain leaf rows unless they are displayed under their actual main worktree. Saved linked worktrees no longer sprout sibling children under custom groups, and deleting either a saved or synthetic linked worktree uses the same linked-worktree action while keeping Desktop's repository store in sync.
Testing:
- yarn test:unit app/test/unit/repositories-list-grouping-test.ts
- yarn test:unit app/test/unit/repository-list-item-context-menu-test.ts
- yarn eslint app/src/ui/repositories-list/worktree-list-items.ts app/src/ui/repositories-list/repository-list-item-context-menu.ts app/src/ui/repositories-list/repositories-list.tsx app/src/ui/worktrees/delete-worktree-dialog.tsx app/src/ui/app.tsx app/src/models/popup.ts app/test/unit/repositories-list-grouping-test.ts app/test/unit/repository-list-item-context-menu-test.ts
- yarn compile:prod
0 commit comments