Skip to content
Source
Sign inSign up
pingdotgg/t3code

Git integration: branch picker + worktrees #3

Mergedjuliusmarmingemerged 32 commits intomain fromrefs/pull/3/headmerged by juliusmarminge View on GitHub

Showing 54 changed files with 173 additions and 0 deletions (loading 52).

x
0 of 54 viewed, 54 left
74 additions and 0 deletions.plans/branch-environment-picker-in-chatview-input.mdAdded
View file
@@ -0,0 +1,74 @@
+# Branch/Environment Picker in ChatView Input
+​
+## Summary
+​
+Add a secondary toolbar below the ChatView input area (similar to Codex UI) that lets users select the target branch and environment mode (Local vs New worktree) before sending their first message.
+​
+## UX
+​
+- A toolbar appears **below** the input form (always visible when it's a git repo)
+- Two controls:
+ 1. **Environment mode** (left side): toggles between "Local" and "New worktree" — **locked after first message** (no longer clickable, just shows current mode as label)
+ 2. **Branch picker** (right side): dropdown showing local branches — **always changeable**, even after messages are sent
+- If not a git repo, the toolbar is hidden entirely (thread uses project cwd as-is)
+​
+## Changes
+​
+### 0. Install `@tanstack/react-query` in `apps/renderer`
+​
+Add dependency + wrap app in `QueryClientProvider`.
+​
+### 1. `apps/renderer/src/store.ts` — MODIFY
+​
+Add a new action to the reducer:
+​
+```ts
+| { type: "SET_THREAD_BRANCH"; threadId: string; branch: string | null; worktreePath: string | null }
+```
+​
+Reducer case updates `branch` and `worktreePath` on the thread.
+​