Skip to content

feat(diff): show worktree changes for a draft + fix review to use the live branch - #64

Merged
enisze merged 2 commits into
mainfrom
feature/show-worktree-changes-without-submitting-chat
Aug 20, 2026
Merged

feat(diff): show worktree changes for a draft + fix review to use the live branch#64
enisze merged 2 commits into
mainfrom
feature/show-worktree-changes-without-submitting-chat

Conversation

@enisze

@enisze enisze commented Aug 20, 2026

Copy link
Copy Markdown
Owner

Summary

Two related worktree-review fixes:

  1. Show worktree changes for a not-yet-sent draft. The diff panel required a server-backed thread to load worktree data, so a worktree holding only a composer draft showed an empty diff/git-status/branch-preview until the first message promoted the draft to a real thread. It now resolves the worktree/environment/project directly from a worktree-targeting draft, loading immediately on open. Drafts with no worktree keep their empty per-chat panel.

  2. Review the worktree's live branch, not the stored ref. The Review button (and "new chat in this worktree") targeted the thread's persisted branch field, which drifts from the worktree's actually checked-out branch after a checkout, PR checkout, or branch switch. The footer branch chip already prefers the live git ref, so the two diverged and a review could run against a stale reference. The new-chat branch is now resolved the same way the footer does — live gitStatus.refName, falling back to the stored branch — for worktree-backed chats, so a review always follows the branch shown in the chat.

Changes

  • DiffPanel.tsx: resolve the worktree data source from a real thread when one exists, otherwise from the worktree-targeting composer draft; all downstream queries key off the resolved environment/source.
  • ChatView.tsx: derive newChatWorktreeBranch from the live git ref (footer's resolution) instead of the stored activeThread.branch, so the Review button and new-worktree-chat action follow the branch currently checked out.

🤖 Generated with Claude Code

enisze and others added 2 commits August 20, 2026 11:28
Read a not-yet-sent composer draft's worktree/environment/project so the
shared diff, git status, and branch preview load when the panel opens,
instead of only after the first message promotes the draft to a server
thread. Drafts with no worktree keep the empty per-chat panel, matching
the pre-draft behavior.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Review button (and "new chat in this worktree") targeted the thread's
persisted `branch` field, which drifts from the worktree's actually
checked-out branch after a checkout, PR checkout, or branch switch. The
footer branch chip already prefers the live git ref, so the two diverged
and a review could run against a stale reference.

Resolve the new-chat branch the same way the footer does — live
`gitStatus.refName`, falling back to the stored branch — for
worktree-backed chats, so a review always follows the branch shown in the
chat. Local chats keep the stored value.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@enisze enisze changed the title feat(diff): show worktree changes for a draft before sending feat(diff): show worktree changes for a draft + fix review to use the live branch Aug 20, 2026
@enisze
enisze merged commit febc865 into main Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant