opencode
opencode copied to clipboard
feat(web): show recent git branches in new session dropdown
Summary
- Add recent git branches to the "New session" dropdown for quick branch switching
- Users can now see and checkout recent branches without leaving the web UI
Changes
-
Backend: Added
GET /vcs/branchesendpoint to list recent branches sorted by commit date -
Backend: Added
POST /vcs/checkoutendpoint to switch branches - Frontend: Updated session-new-view dropdown to show up to 6 recent branches
- Frontend: Handle branch selection with checkout API and toast notifications
-
SDK: Regenerated with new types (
BranchInfo,CheckoutInput,CheckoutResult)
Testing
- Start API server:
cd packages/opencode && bun dev -- serve --port 5556 - Start Vite:
cd packages/app && VITE_API_URL=http://127.0.0.1:5556 bun dev - Open http://localhost:3001, click "New session"
- Click branch dropdown - should show recent branches
- Select a different branch - should checkout and show toast
Notes
- The pre-existing TypeScript "type instantiation excessively deep" error in server.ts was triggered by adding more routes. This is a known issue (see TODO at line 77) and exists independently of these changes.