Skip to content

fix(review): baseline worktree review at the actual parent branch (DAN-14)#39

Merged
danielss-dev merged 2 commits into
mainfrom
fix/review-baseline-parent-branch
Jul 7, 2026
Merged

fix(review): baseline worktree review at the actual parent branch (DAN-14)#39
danielss-dev merged 2 commits into
mainfrom
fix/review-baseline-parent-branch

Conversation

@danielss-dev

Copy link
Copy Markdown
Owner

Summary

  • DAN-14: the worktree Review flow hard-coded the base as the main worktree's branch, so a branch cut from portal30 was baselined at master's (older) fork point and the review swallowed all of portal30's own work (709 files instead of 3).
  • New Repo::detect_base_branch(target) in strand-core resolves the real parent: the branch reflog's branch: Created from <ref> entry when git recorded one (survives the parent being merged back in), else the local branch with the nearest merge-base. Candidates that contain the target (children / already-merged integration branches) rank last, since baselining at the target's own tip would review nothing. Exposed as repo_detect_base_branch; Worktrees.review() now uses it and toasts which base it picked.
  • New branch context-menu item "Review <current> vs this": right-click any non-HEAD branch to pin the baseline at merge-base(HEAD, branch) and jump to the Review view — an explicit base choice when auto-detection isn't what you want.

Test plan

  • cargo test -p strand-core — 98/98, including new detect_base_branch_prefers_the_actual_parent_over_main covering: fork from a non-main branch, parent-merged-back-in (reflog beats scan), fresh branch with no commits, and a branch whose only nearer neighbor is its own child.
  • cargo check -p strand-tauri — clean.
  • pnpm lint (tsc -b) and pnpm test (vitest, 200/200) in ui/.

🤖 Generated with Claude Code

…N-14)

The worktree Review flow hard-coded the base as the main worktree's
branch, so a worktree cut from portal30 was reviewed against master's
fork point and the diff swallowed all of portal30's own work.

New Repo::detect_base_branch resolves the real parent: the branch
reflog's 'Created from <ref>' entry when git recorded one (it survives
graph shapes the scan can't disambiguate, e.g. the parent merged back
in), else the local branch with the nearest merge-base. Candidates that
contain the target rank last — baselining at the target's own tip would
review nothing. Worktrees.review() now uses it and toasts which base
it picked.
Right-clicking a non-HEAD branch can now pin the review baseline at
merge-base(HEAD, that branch) and jump to the Review view — an explicit
base choice that sidesteps auto-detection entirely.
@danielss-dev danielss-dev merged commit bba0889 into main Jul 7, 2026
2 checks passed
@danielss-dev danielss-dev deleted the fix/review-baseline-parent-branch branch July 7, 2026 17:18
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