Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary:
It would be useful to have the ability to switch branches in a workspace chat directly from the Desktop App UI as shown in the image below:
this would be beneficial for workflow as you would just be able to create a new chat in a workspace and switch branches right from the UI instead of having to start a new chat and open the terminal to switch branches. This ticket could also be extended in the future to integrate some other basic git functionality in the UI like fetching, pulling, creating a new branch etc.
This is not a duplicate as other issues have described this functionality as apart of a larger git system but those issues were closed without the implementation going through. This issue simply focuses on the ability to change branches.
Proposed Implementation
Server
- packages/core/src/git.ts — Add listBranches(dir) to Git.Interface that runs git branch --format='%(refname:short)'
- packages/opencode/src/project/vcs.ts — Add branches() and switchBranch(branch) methods to Vcs.Interface (reuses existing git.checkout())
- packages/opencode/src/server/routes/instance/httpapi/ — Add two new endpoints: GET /vcs/branches and POST /vcs/switch
Client
- New: packages/tui/src/component/dialog-branch-switch.tsx — A DialogSelect-based component that lists branches and switches on selection
- packages/tui/src/routes/session/sidebar.tsx — Show current branch next to workspace label; clicking opens the branch dialog
- Regenerate SDK via ./packages/sdk/js/script/build.ts
Branch changes are automatically reflected in the UI via the existing vcs.branch.updated event.
Feature hasn't been suggested before.
Describe the enhancement you want to request
Summary:
It would be useful to have the ability to switch branches in a workspace chat directly from the Desktop App UI as shown in the image below:
this would be beneficial for workflow as you would just be able to create a new chat in a workspace and switch branches right from the UI instead of having to start a new chat and open the terminal to switch branches. This ticket could also be extended in the future to integrate some other basic git functionality in the UI like fetching, pulling, creating a new branch etc.
This is not a duplicate as other issues have described this functionality as apart of a larger git system but those issues were closed without the implementation going through. This issue simply focuses on the ability to change branches.
Proposed Implementation
Server
Client
Branch changes are automatically reflected in the UI via the existing vcs.branch.updated event.