Conversation
Created _worktree-dropdown.scss for toolbar button styling and _worktrees.scss for list component styling. Updated WorktreeListItem to use specific worktrees-list-item class. Styling follows existing design system patterns from branches UI. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Added WorktreeDropdown rendering, onWorktreeDropdownStateChanged handler, and AddWorktreeDialog popup rendering. Toolbar button positioned between Branch and PushPull buttons. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
The worktree list was missing height: 100% on its container, causing the SectionList inside to collapse to zero height. The filter input was visible but no list items appeared below it. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
onWorktreeSelected was wired to onWorktreeClick, which closes the foldout and switches repository. SectionFilterList fires onSelectionChanged on every filter keystroke as the selected row shifts, so typing in the filter would immediately close the dropdown. Separated selection tracking (no-op) from click navigation. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Worktree repos added via the dropdown are now tracked and automatically removed from the repository list when the user switches to a different worktree or back to the original repo, keeping the sidebar clean. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
Thanks for the detailed review! I've addressed the following in the latest push:
Regarding the remaining items:
Happy to discuss further if you feel strongly about any of these! |
- Wire worktreeDropdownWidth through app-state, app-store, and dispatcher - Wrap worktree toolbar button in Resizable with drag-to-resize support - Allocate toolbar space with branch-first priority to prevent layout overflow - Set foldout min-width independently from button constraints Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
- Render '+ New Worktree' via renderPostFilter alongside the filter input - Remove unused isCurrentRepoLinkedWorktree state field - Reorder members to place memoized getGroups before render helpers Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
89d7faf to
f21f8aa
Compare
|
@pol-rivero My bad, apologies. I didn't test enough for the additional works. I've fixed the layout issues.
|
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
@pol-rivero Thanks for the detailed review. Implement them all.
|
|
@pol-rivero I've applied all the changes and tested them. Here are demos showing everything working on my end. If the issues persist on your side, please provide me the steps to reproduce so that I can investigate. newworktree.movdelworktree.movOn a more personal note: I think we might have different expectations about the contribution process. I see open source as a hobby, and PRs as a starting point that maintainers and contributors refine together. I'm happy to iterate on feedback, and it's also totally fine if you want to adjust things yourself. But the "last warning" framing felt off to me. I originally built this for my own use and submitted it upstream (desktop#21607) first. And others suggested I contribute it here, so I did in good faith. I'm already happy with my own build, so if this PR doesn't meet your standards or feels like more trouble than it's worth, feel free to close it. No hard feelings. |
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
btw, I found a scenario where worktree deletion messes up the repo: when deleting the currently selected worktree. The latest commit fixes this. |
|
@devxoul I apologize for my previous comment, I was having a bad day and was feeling frustrated and stressed. I shouldn't have said that. I will review the PR properly in a few days, once everything has calmed down. If there are any errors afterwards I'll fix them myself, no worries. |
|
@pol-rivero I totally understand. We all have those days. No worries at all, and thank you for saying that. Take your time with the review. I'll be around if anything comes up. |
This conflict prevents the app from opening on Linux
The previous flow required entering the new directory and optionally the branch name. However, the last directory fragment cannot contain spaces if the branch name is empty. The new flow requires for a PARENT directory (auto-populated) that can contain spaces and a mandatory branch name. This should be much simpler, as it only requires entering the branch name in a RefNameTextBox, which auto-converts spaces into dashes.
|
Thank you for your understanding and for your patience :) Also, sorry once again for the completely out-of-place comment. I honestly don't know what I was thinking. |
|
Excited to see this merged in! |
|
@pol-rivero No worries at all. You came back and we started something constructive together, that's all good 👍 I reviewed your branch and I think it's definitely better than my version. I rebased your branch and pushed. Please tell me if you prefer merging instead. And for the display option - that makes sense. What about adding an option to toggle worktree UI? We can consider adding it to menu or preferences.
|
Either is good. I usually merge for simplicity, but I have no preference for one over the other.
Yes, the Appearance settings page seems like the right place, as you suggest. |
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
|
@pol-rivero Done! I set
|
|
@devxoul kudos for the work on this PR! |
|
I've published the stable release, so let's merge this into main for v3.5.6-beta1 🎉 |
|
@pol-rivero Thanks for your time for reviewing this! |
Monumental PR! One issue, however. Upon fresh install, there is a conflict between the menu and this setting toggle. I was looking for my cursor-linked worktrees, and saw in menu: View – Show Worktree list (Cmd-E). But, nothing was happening. I had to find this note in the PR to know that I had to first enable this in settings. Suggest keeping the menu for easy worktree discoverability, but probably need to add a note there like "enable in settings" or similar. |
|
@plpxsk Nice catch! That's a missing scenario. I'm think of automatically turning on the worktree settings when user hits "Show Worktress List". This is simple patch so I created PR: #72. Let's wait for @pol-rivero's idea. |

















Summary
Add full git worktree support to GitHub Desktop, allowing users to create, switch between, rename, and delete working trees directly from the toolbar.
Upstream PR: desktop#21607
Changes
lib/git/worktree.ts,models/worktree.ts):listWorktrees,addWorktree,removeWorktree,moveWorktreewith porcelain parser and unit tests.ui/toolbar/worktree-dropdown.tsx): NewWorktreeDropdowncomponent with searchable foldout, accessible via ⌘E / Ctrl+E.ui/worktrees/worktree-list.tsx,worktree-list-item.tsx): Grouped display (Main/Linked) usingSectionFilterList.ui/worktrees/worktree-list-item-context-menu.ts): Rename, Copy Name, Copy Path, Delete actions.FoldoutType.Worktree, popup types, menu event, dispatcher methods.Screenshots