From 3047974fdc759674eeac3969456656e3b8bf40d1 Mon Sep 17 00:00:00 2001 From: Julius Marminge Date: Sun, 8 Feb 2026 22:57:15 -0800 Subject: [PATCH] Add branch/env picker toolbar and create branch flow Move branch picking from sidebar context menu into ChatView input toolbar. Add env mode toggle (local/worktree) that locks after first message, branch dropdown with create-new-branch inline form, and wire up git:create-branch IPC channel. Co-Authored-By: Claude Opus 4.6 --- packages/contracts/src/git.ts | 6 ++++++ packages/contracts/src/ipc.ts | 2 ++ 2 files changed, 8 insertions(+) diff --git a/packages/contracts/src/git.ts b/packages/contracts/src/git.ts index aa2f72e67a9b4d7eba90d0090279138b1ff9fcf4..6f1e4ea90c3e313f8a7cf13a59fb3b0c53b47705 100644 --- a/packages/contracts/src/git.ts +++ b/packages/contracts/src/git.ts @@ -17,6 +17,11 @@ export const gitRemoveWorktreeInputSchema = z.object({ path: z.string().min(1), }); +export const gitCreateBranchInputSchema = z.object({ + cwd: z.string().min(1), + branch: z.string().min(1), +}); + export const gitInitInputSchema = z.object({ cwd: z.string().min(1), }); @@ -44,6 +49,7 @@ export type GitWorktree = z.infer; export type GitRemoveWorktreeInput = z.infer< typeof gitRemoveWorktreeInputSchema >; +export type GitCreateBranchInput = z.infer; export type GitInitInput = z.infer; export interface GitListBranchesResult { diff --git a/packages/contracts/src/ipc.ts b/packages/contracts/src/ipc.ts index 45aa5f1d63bbbd64ac4006aab7a906a7adf680ee..d0b843d322fd9bcc266a10b9ea96f3af85e62a50 100644 --- a/packages/contracts/src/ipc.ts +++ b/packages/contracts/src/ipc.ts @@ -1,5 +1,6 @@ import type { AgentConfig, AgentExit, OutputChunk } from "./agent"; import type { + GitCreateBranchInput, GitCreateWorktreeInput, GitCreateWorktreeResult, GitInitInput, @@ -74,6 +75,7 @@ export interface NativeApi { listBranches: (input: GitListBranchesInput) => Promise; createWorktree: (input: GitCreateWorktreeInput) => Promise; removeWorktree: (input: GitRemoveWorktreeInput) => Promise; + createBranch: (input: GitCreateBranchInput) => Promise; init: (input: GitInitInput) => Promise; }; } -- 2.54.0