authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-08 22:57:15-08:00
committergravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-11 09:00:18-08:00
log3047974fdc759674eeac3969456656e3b8bf40d1
tree32396cde7ddebcd8a35bbad327a7cbb329b4665e
parentd64f78a9498ae017db7efde4cc5fbbfd07091a79

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 <noreply@anthropic.com>

2 files changed, 8 insertions(+), 0 deletions(-)

packages/contracts/src/git.ts+6
...@@ -17,6 +17,11 @@ export const gitRemoveWorktreeInputSchema = z.object({...@@ -17,6 +17,11 @@ export const gitRemoveWorktreeInputSchema = z.object({
17 path: z.string().min(1),17 path: z.string().min(1),
18});18});
1919
20export const gitCreateBranchInputSchema = z.object({
21 cwd: z.string().min(1),
22 branch: z.string().min(1),
23});
24
20export const gitInitInputSchema = z.object({25export const gitInitInputSchema = z.object({
21 cwd: z.string().min(1),26 cwd: z.string().min(1),
22});27});
...@@ -44,6 +49,7 @@ export type GitWorktree = z.infer<typeof gitWorktreeSchema>;...@@ -44,6 +49,7 @@ export type GitWorktree = z.infer<typeof gitWorktreeSchema>;
44export type GitRemoveWorktreeInput = z.infer<49export type GitRemoveWorktreeInput = z.infer<
45 typeof gitRemoveWorktreeInputSchema50 typeof gitRemoveWorktreeInputSchema
46>;51>;
52export type GitCreateBranchInput = z.infer<typeof gitCreateBranchInputSchema>;
47export type GitInitInput = z.infer<typeof gitInitInputSchema>;53export type GitInitInput = z.infer<typeof gitInitInputSchema>;
4854
49export interface GitListBranchesResult {55export interface GitListBranchesResult {
packages/contracts/src/ipc.ts+2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1import type { AgentConfig, AgentExit, OutputChunk } from "./agent";1import type { AgentConfig, AgentExit, OutputChunk } from "./agent";
2import type {2import type {
3 GitCreateBranchInput,
3 GitCreateWorktreeInput,4 GitCreateWorktreeInput,
4 GitCreateWorktreeResult,5 GitCreateWorktreeResult,
5 GitInitInput,6 GitInitInput,
...@@ -74,6 +75,7 @@ export interface NativeApi {...@@ -74,6 +75,7 @@ export interface NativeApi {
74 listBranches: (input: GitListBranchesInput) => Promise<GitListBranchesResult>;75 listBranches: (input: GitListBranchesInput) => Promise<GitListBranchesResult>;
75 createWorktree: (input: GitCreateWorktreeInput) => Promise<GitCreateWorktreeResult>;76 createWorktree: (input: GitCreateWorktreeInput) => Promise<GitCreateWorktreeResult>;
76 removeWorktree: (input: GitRemoveWorktreeInput) => Promise<void>;77 removeWorktree: (input: GitRemoveWorktreeInput) => Promise<void>;
78 createBranch: (input: GitCreateBranchInput) => Promise<void>;
77 init: (input: GitInitInput) => Promise<void>;79 init: (input: GitInitInput) => Promise<void>;
78 };80 };
79}81}