Repository navigation
Git integration: branch picker + worktrees - #3
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds end-to-end Git integration: new contracts and WS API, server & desktop git utilities, renderer IPC and React Query wiring, per-thread branch/worktree state and persistence, BranchToolbar UI, ChatView worktree creation on first message, tests, and build/tooling/script updates. Changes
Sequence DiagramsequenceDiagram
participant User as User
participant ChatView as ChatView (UI)
participant BranchToolbar as BranchToolbar (UI)
participant Store as Renderer Store
participant NativeAPI as Native API (preload/WS)
participant WebSocket as WebSocket Transport
participant Server as Server (git module)
User->>ChatView: open chat / branch controls
ChatView->>BranchToolbar: render (envMode, envLocked)
BranchToolbar->>NativeAPI: git.listBranches({ cwd })
NativeAPI->>WebSocket: invoke "git:list-branches"
WebSocket->>Server: WS_METHODS.gitListBranches
Server-->>WebSocket: return branches
WebSocket-->>NativeAPI: branches
NativeAPI-->>BranchToolbar: branches list
User->>ChatView: send first message
alt envMode == "worktree" && no worktreePath
ChatView->>NativeAPI: git.createWorktree({ branch, cwd })
NativeAPI->>WebSocket: invoke "git:create-worktree"
WebSocket->>Server: WS_METHODS.gitCreateWorktree
Server->>Server: runTerminalCommand("git worktree add ...")
Server-->>WebSocket: { worktreePath, branch }
WebSocket-->>NativeAPI: result
NativeAPI-->>ChatView: worktreePath
ChatView->>Store: dispatch SET_THREAD_BRANCH(threadId, branch, worktreePath)
else
ChatView->>Store: dispatch SET_THREAD_BRANCH(threadId, branch, null)
end
Store->>Store: update thread.branch & thread.worktreePath
ChatView->>NativeAPI: ensure/start session(cwd = worktreePath ?? project.cwd)
NativeAPI->>WebSocket: start session
WebSocket->>Server: establish session in selected cwd
Server-->>WebSocket: session ready
WebSocket-->>NativeAPI: session active
NativeAPI-->>ChatView: session active
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
Add branch picker and worktree flow to ChatView and expose
|
| .filter((line) => line.length > 0) | ||
| .map((line) => ({ | ||
| name: line.replace(/^[*+]\s+/, ""), | ||
| current: line.startsWith("* "), |
There was a problem hiding this comment.
🟡 Medium
src/git.ts:45 The child.killed flag becomes true immediately after child.kill("SIGTERM") is called, so the SIGKILL fallback is unreachable. Consider tracking process exit separately (e.g., with a flag set in the close event) instead of relying on child.killed.
🚀 Want me to fix this? Reply ex: "fix it for me".
adf6a26 to
bc70cc4
Compare
| }, input.timeoutMs ?? 30_000); | ||
|
|
||
| child.stdout?.on("data", (chunk: Buffer) => { | ||
| stdout += chunk.toString(); |
There was a problem hiding this comment.
🟢 Low
src/git.ts:55 Multi-byte UTF-8 characters split across chunks will corrupt to �. Consider using StringDecoder from node:string_decoder to properly handle partial characters.
🚀 Want me to fix this? Reply ex: "fix it for me".
🤖 Prompt for AI
In file apps/server/src/git.ts around line 55:
Multi-byte UTF-8 characters split across chunks will corrupt to `�`. Consider using `StringDecoder` from `node:string_decoder` to properly handle partial characters.
Allows users to right-click "+ New thread" to create threads from specific git branches, with optional worktree creation for isolated work. Includes branch sorting (current/default first), graceful handling of non-git repos, and ability to initialize git repos. - New git IPC contract (listBranches, createWorktree, removeWorktree, init) - Branch context menu with worktree sub-option in Sidebar - Thread model extended with branch/worktreePath fields - Session cwd uses worktree path when available - Branch sorting: current > main/master > alphabetical Co-Authored-By: Claude Haiku 4.5 <[email protected]>
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 <[email protected]>
Wire up git:checkout IPC channel across the full stack so branch selection actually checks out the branch. Clear error banners when a subsequent checkout or branch creation succeeds. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Add non-null assertion for activeProject in worktree creation path (guarded by earlier check) and add missing branch/worktreePath to test fixture. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace hardcoded dark-mode colors with theme-aware semantic classes (bg-popover, text-foreground, bg-accent, etc.) so the branch picker works in both light and dark mode. Detect the real default branch via git symbolic-ref and show a "default" label (with "current" taking precedence when both apply). Co-Authored-By: Claude Opus 4.6 <[email protected]>
Move git operations (listGitBranches, checkoutGitBranch, createGitWorktree, etc.) from main.ts into git.ts for testability. Add 20 integration tests that run real git commands against temporary repos covering checkout, branch creation, worktrees, conflicts, and thread-switching flows. Also fix: branch checkout now runs regardless of envMode, worktree creation passes cwd to ensureSession to avoid stale closure bug, and current branch auto-fills on new threads. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Both openInEditor and the Cmd+O shortcut now use the thread's worktreePath when available instead of always using activeProject.cwd. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Use worktree path instead of project cwd for git branch queries so worktree threads correctly report their branch as current. Also update error banner to use semantic color tokens for light mode support. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Verifies that querying branches from a worktree directory correctly reports the worktree's branch as current, while the main repo still shows its own branch — the assumption the BranchToolbar fix relies on. Co-Authored-By: Claude Opus 4.6 <[email protected]>
Co-authored-by: codex <[email protected]>
Co-authored-by: codex <[email protected]>
6465e69 to
9fc5ad2
Compare
…ate build configs
- Move BranchToolbar below the chat input box to match Codex app layout
- Change worktree path to ~/.t3code/worktrees/{repo}/{branch}
- Split desktop tsdown config into separate main/preload builds to prevent
code-splitting from leaking node:os into the sandboxed preload script
- Migrate turbo scripts to turbo watch, add desktop start/smoke-test tasks
- Update server output to .mjs, add CJS format, remove tsx dependency
Co-Authored-By: Claude Opus 4.6 <[email protected]>
The PR added the @t3tools/provider-omp workspace package without a lockfile entry, and PR pingdotgg#3 left the lockfile with Clerk overrides, so frozen installs failed. The lockfile is regenerated: Clerk is gone and provider-omp is linked. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01UQVvNkj2KZQ1BN4QqLcHGm
|
Claude re-review: approve (prior findings fixed). On-host ss-host-1: i18n-check pass, 23 files/513 tests pass, typecheck 4/4, build 2/2. Blacksmith CI unavailable on fork; merging on review + on-host verification. |
Polish Web/Desktop scroll chrome and Task Board split-view hierarchy: - Hide native scrollbars globally in index.css (--app-scrollbar-width: 0px, scrollbar-width: none, ::-webkit-scrollbar hidden) and remove per-component visible scrollbar overrides (markdown code blocks/tables, attachment strip, pending approval detail, embedded document preview). - Keep ScrollArea's native viewport scrollbar hidden and overlay ScrollBar permanently invisible (pointer-events-none opacity-0) while preserving Base UI layout geometry. - Flatten the Task Board docked left column in split-pane mode so session cards render directly beneath the column tabs without a nested outer column card border/padding or redundant column header (preserving column containers in the full 4-column board view). - Record Lock pingdotgg#14 and update Lock pingdotgg#3 in T4_CUSTOMIZATIONS.md, with Chromium browser test coverage.
… colors Without the nested outer column container in docked split-view mode, session cards across Working, Needs attention, Active, and Settled all rendered as plain white cards with no visual status cue. - Apply each column's semantic status color tint (`info` blue, `warning` amber, `accent` neutral, `success` emerald) directly to docked split-view cards, selected rings, empty state placeholders, and active status switcher tabs while preserving crisp `bg-card` cards inside the full 4-column board view. - Add Chromium browser assertions verifying docked status tint classes vs full-board `bg-card` styling and update `T4_CUSTOMIZATIONS.md` Lock pingdotgg#3.
…-only) Surgical Web-only port of upstream pingdotgg#42576 customizable sidebar thread row layout (Settings → Appearance → Sidebar thread layout), strictly preserving all T4 locked modules: - Zero changes to Mobile (Lock pingdotgg#5 untouched), right-sidebar ThreadDetailsPanel (Lock pingdotgg#12 untouched), Lock pingdotgg#3, Lock pingdotgg#14, Server, or telemetry - Preserves Lock pingdotgg#8 (pinned All tab, drag-to-reorder environment filter chips, top Working shelf), Lock pingdotgg#7 (agentMessageSenderNote default off), and pingdotgg#44794 Web overlapped provider icon stack - Includes independent gpt-6.2-astra blind-review fixes: rem-scaled card height & contain-intrinsic-size for larger UI font sizes, right padding on provider icon slot so custom instance badges are never clipped, disabled live issues.detail queries on preview card hover, keyboard activation on preview cards, horizontal lane bounds & accurate screen-reader drop announcements, plus optional pendingImageCount TS guard in promptStashStore.ts.
…s (Deep Review closing #xc1) Base UI keeps some closed popups mounted with role="dialog": the mobile sidebar under 768px and the PR review composer. The Board's J/K/arrow region check and its Escape check treated them as open, so every Board key went dead. Both now match only [data-open] or [data-ending-style] layers, from one list in boardPanel.logic.ts (also closing simplify #3).
…#2) * feat(fork): Board domain and label filters, and group by domain A desk can now tag its items with a domain and labels. The Board page and the Board tab show domain chips (color dot, ready count) and label chips above Needs me, multi-select with an All reset, kept on this device. Group gains Domain, in the desk's domain order. Rows and the open item show each item's domain and labels. Desks without tags look exactly as before. * Board: share one item view between the Board page and tab (Deep Review r1 #s1-1) * Board: count domain chips under the label picks and label chips under the domain picks (Deep Review r1 #x1-1) * Board: count bot chips under the domain and label picks (Deep Review r1 #1) * Board: order domain groups by the shown desks' domains (Deep Review r1 #2) * Board: hide an item's domain only under its domain's heading (Deep Review r1 #3) * Board: reuse ChipCount for the bot chips (Deep Review r1 #s1-4) * Board: one fallback gray for desks and domains (Deep Review r1 #s1-5) * Board: type the bot chip count test's picks (Deep Review r1 #1) * Board: clip a row's badges before its time column (Deep Review r2 #v1) * Board: say nothing filtered is ready when folds hold matches (Deep Review closing #1)
… agent-settable A user-editable phase catalog (label + color + icon) shown as the pingdotgg#2 bar plus a real row icon, settable from the menu, the t3 CLI and by agents over MCP. Phase rides the existing thread.tag.set pipeline as a reserved phase:<slug> tag instead of a new field: a clean-context refute pass (2026-12-02) verified the command is client-dispatchable and the shell already carries tags, so the whole server pipeline is reused untouched — a dedicated field would touch ~20 core sites and conflict on every rebase. The pass also inverted one planned decision: phase writes hit the server, so read-only connections see the menu items disabled (unlike pingdotgg#2's local colors). Co-Authored-By: Claude Code <[email protected]>
…> tag (pingdotgg#3 M1) Agents set a thread's own workflow phase over the existing MCP surface and the t3 CLI: `t3 thread phase <threadId> <slug|none>`. The phase is one reserved tag `phase:<slug>` riding the existing thread.tag.set pipeline — no contract, orchestrator or projection edits. A swap clears every stale phase tag before the new one lands (two commands, the same non-atomic class as upstream pin); re-setting the current phase stores no event. Slug is lowercase [a-z0-9-], max 58, because ThreadTag caps at 64 and the prefix costs 6. Tests: swap order and non-phase-tag survival, clear, idempotence, slug refusal (core.test); CLI grammar, --json, local refusal of a bad slug (thread.test). Eval case thread-phase.ndjson added; the live mcp-tool-use eval was NOT run (needs a provider key). agentContextBudget.json bumps the MCP tool-list ledger by the new tool's 459 bytes. Co-Authored-By: Claude Code <[email protected]>
…M1: t3_thread_phase (server MCP + CLI)
…pingdotgg#3 M2) The pingdotgg#2 "Color" submenu becomes "Phase", built from the new server setting `threadPhaseCatalog`: one item per catalog entry, checked on the thread's current `phase:<id>` tag, "Clear phase" last. Picking a phase clears the old tag then sets the new one (state/threadPhase.ts, the swap M3's migration reuses); the write rides the existing v2.dispatchCommand atom, so read-only clients get the items disabled by the Operate guard — pingdotgg#2's color* exemption is deleted, not mirrored. Each sidebar row with a phase paints the catalog color in the pingdotgg#2 3px bar and a real Lucide glyph before the title (tooltip = phase label, aria-label for screen readers). The settings editor (ThreadPhasesSettings) edits label/color/icon per entry: ids are immutable, the label stays a draft until blur, 12-icon pick-list, MAX_THREAD_PHASES gate, reset hidden when the catalog is the untouched default. Default catalog = the owner's hue map: designing/green/palette, planning/violet/compass, implementing/blue/code, blocked/orange/octagon-alert, urgent/red/flame. i18n: 8 keys hand-added to all 11 catalogs (never gt generate, per FORK.md); the stale pingdotgg#2 Color key removed. knip.jsonc scopes a temporary ignore to threadColors' now-dead export — the migration milestone (M3) retires it with the enum. Deviations disclosed by the implementer and accepted in review: the settings-search entry ships without searchTerms; the "New phase" placeholder label is user content, not chrome (oxlint-disable with reason). Co-Authored-By: Claude Code <[email protected]>
…order (pingdotgg#3 M2 refute) The M2 diff-refuter held the design but found two claims no test pinned and one doc comment that overpromised. Now pinned: a single bad catalog element drops alone while its neighbors survive, while a non-array value or a catalog past MAX_THREAD_PHASES rejects the whole ServerSettings decode — and the server discards the settings file on that (serverSettings.ts, measured) — which the field comment now states exactly. And setThreadPhase's contract that M3's migration leans on: swap order clear-then-set with fresh command ids, the SET's outcome reported, a failed clear never followed by a set, idempotent zero-dispatch, clear-only single dispatch (state/threadPhase.test.ts, 7 tests; settings.test.ts +4). Verified: contracts settings.test 39/39, web state/threadPhase.test 7/7, both typechecks exit 0, check:changed green (24 files; the shiftGuard browser timeout in the first run was load flake — solo rerun 9/9 in 4s, prior gate green). Co-Authored-By: Claude Code <[email protected]>
pingdotgg#3 M3) Each stored pingdotgg#2 hue becomes one server phase tag: red→urgent, orange→blocked, blue→implementing, violet→planning, green→designing. Hues park in `t3code:thread-hue-pending:v1` first — the ui-state store rewrites its whole blob from its own (now field-less) state, so an unlanded label parked in that blob would vanish on any unrelated UI change. A pending entry is deleted only once its own dispatch reports Success, so offline or read-only rows keep their hue and retry on the next connect; a thread whose server already carries a phase, or a value that maps to no phase, drops without dispatch — neither ever painted a row. Retires pingdotgg#2's plumbing: the ThreadColorId enum, the store's threadColorById field, its sanitizer and setThreadColor action, and the scoped knip ignore whose own comment assigned its removal to this migration. threadColorBarClassName survives, fed by the catalog color (pingdotgg#2's bar stays). Refute pass (2026-12-02): holds. Byte-identical keying with the pingdotgg#2 writer (both scopedThreadKey over the same branded shell ids), no bulk-delete path, and the store's debounced persist cannot fire before the synchronous adopt at appInit startup (no-op flush, no pre-call mutators). Co-Authored-By: Claude Code <[email protected]>
pingdotgg#3 M3 review) The retry test's mid-flight assertion counted dispatches while the first attempt's `.finally` chain was settling — deterministic today, but it held only by microtask-tick arithmetic between the mock's ~6-8 settlement ticks and vitest's ~2-4 (diff-refute, 2026-12-02). A vitest or engine bump would flip it red for no product reason. The mock can now hold one outcome unsettled on demand, so the test proves the guard skips a provably-unsettled attempt. Proven red with the `inFlight` check removed (1 failed, the other 11 green). Also refreshes FORK.md: pingdotgg#3 is built and merged, pingdotgg#2's row is retired, and the migration paragraph now names the pending key and its drop-without-dispatch rule, which is the part a rebase or a reader must not "simplify". Co-Authored-By: Claude Code <[email protected]>
…stale search cursors, and expose operator proposal priority Addresses the final 3 findings from the Wave 10 review (M8, L3, and Coordinator pingdotgg#3): - M8: Propagate optional memoryRecallScope alongside memoryRecall on private thread launches so the server rejects before thread creation if effective recall was disabled or broadened beyond the operator's displayed consent, prompting Web and Mobile to refresh policy; legacy Boolean payloads stay compatible. - L3: Clear paginated memory-search cursor stack back to page 1 on Refresh or cursor invalidation in both Web and Mobile. - Expose operator-owned Optimization Proposal priority (0-3) in Web, Mobile, and t3 proposals CLI (submit/triage/list/get) across all 10 locales while keeping priority excluded from agent MCP proposals_submit. Verified: contracts, client-runtime, server, web, mobile, and desktop effect-tsgo tsrs --noEmit (0 errors), focused server/CLI/client-runtime/Web-browser/Mobile/React-Compiler tests + 36/36 coordinator re-verification tests, fmt, lint, i18n:check, knip:check:files, git diff --check. Model: gpt-6.2-sol (Codex Fast) + Antigravity coordinator audit
feat(team): add RBAC, server-enforced Views, posting rules, and thread locking
Closes #7 (Does not implement multiple threads per worktree)
Summary
Users can now right-click on "+ New thread" to create threads from specific git branches, with optional worktree creation for isolated agent work.
Features
Test Plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests