feat: add configurable base-branch review mode#8
Draft
werkamsus wants to merge 1 commit intobadlogic:mainfrom
Draft
feat: add configurable base-branch review mode#8werkamsus wants to merge 1 commit intobadlogic:mainfrom
werkamsus wants to merge 1 commit intobadlogic:mainfrom
Conversation
Extend the native diff review window with a branch-aware review scope that compares merge-base(baseRef, HEAD) to HEAD. This adds a base-branch scope, persisted base-ref config, one-off base-ref overrides, and UI updates that surface the active base ref in the review window. Users can now set an explicit base ref or use the special 'default' setting, which resolves to the repository's default remote branch. The implementation preserves the existing Glimpse/Monaco review workflow while making branch review the primary path, defaulting the UI to changed regions only with wrap disabled for a cleaner review surface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds a branch-aware review mode to
pi-diff-reviewby introducing a newbase branchscope that comparesmerge-base(baseRef, HEAD)toHEAD.The main goal is to make the tool useful not just for working tree review, but also for reviewing the actual delta a branch introduces relative to a chosen base branch.
What's included
base-branchreview scope/diff-review-set-base/diff-review <base-ref>defaultbase-ref setting that resolves to the repository's default remote branch/diff-review-configNotes on base-ref resolution
When the saved base ref is
default, the extension attempts to resolve the repository's default remote branch by:originIf it still can't resolve a default branch, it asks the user to set one explicitly.
Why this seems useful
Right now the package is great for reviewing:
HEADBut a lot of the time the thing I actually want to review is:
This adds that path without changing the overall Glimpse + Monaco review workflow.
Implementation details
Files changed:
src/config.ts— persisted config loading/savingsrc/git.ts— base-ref resolution + merge-base diff/file loadingsrc/index.ts— commands, effective config wiring, message renderingsrc/prompt.ts— base-ref-aware prompt textsrc/types.ts— base-branch scope/typesweb/app.js— scope selection/defaults/UI stateweb/index.html— base ref badge + new scope buttonREADME.md— command/config documentationOpen questions
A few defaults are intentionally opinionated, but easy to change if you'd prefer a more conservative rollout:
base-branchHappy to split those defaults out or gate them differently if the underlying branch-aware scope/config pieces seem worthwhile but the UX defaults feel too aggressive.
Testing
npm run checkdefaultbase-ref resolution pathpi -e ...