feat(review): Add Approve & Next for stacked PR reviews#1025
Open
leoreisdias wants to merge 2 commits into
Open
feat(review): Add Approve & Next for stacked PR reviews#1025leoreisdias wants to merge 2 commits into
leoreisdias wants to merge 2 commits into
Conversation
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.
Context
Stacked PR review already had good navigation and scope support: users could inspect the stack, switch PRs, and choose layer vs full-stack diffs. The missing workflow was the fast review path: after approving one open PR in a stack, the reviewer had to reopen or manually navigate to the next one.
This PR adds a platform-only
Approve & Nextsplit action for GitHub/GitLab PR review mode. It approves the current PR through the existing platform review flow, keeps the Plannotator session alive, and switches to the next open PR in the stack.Screenshots
What Changed
Approvewhen a next open stacked PR is available.Approve & Nextfor the split action./api/pr-switchpath for the next PR.Approveis unchanged: it still approves the current PR and finishes the review session.Post Commentskeeps the existing multi-PR batching behavior.Approve & Nextbehaves like normal approve for the PR being approved: it clears the approved PR review notes, selected note IDs, external annotations for that PR, and the persisted draft before switching.Approve & Nextout of the VS Code webview because editor annotations are not PR-scoped yet.Decisions Captured
Approvestays terminal. The arrow action is explicit and reversible in the UI model./api/draftfor draft cleanup rather than bending/api/feedback./api/feedbackstill means resolving the whole review session; approve-next only needs to discard the approved PR draft and continue.prUrl, this PR hidesApprove & Nextthere rather than deleting editor annotations bluntly or pretending they are scoped.Review Focus
packages/review-editor/App.tsx: the approve-next success path, especially the ordering of platform approval, approved-PR cleanup, andhandlePRSwitch.packages/review-editor/hooks/useApproveAndNextAffordance.ts: visibility rules for the split action, next-open-PR selection, one-time toast behavior, and VS Code gating.packages/review-editor/components/ReviewSubmissionDialog.tsx: confirm-label override without changing normal approve/comment behavior.packages/review-editor/hooks/usePRStack.ts: returning switch success/failure while preserving existing callers that ignore the return value.Verification
PATH="$PWD/apps/review/node_modules/.bin:$PATH" bun run typecheckbun test packages/review-editor/utils/exportFeedback.test.ts packages/review-editor/utils/exportFeedback.workspace.test.tsbun run build:reviewbun run build:hook