Repository navigation
Let PR line selections stack in the composer, like thread diff selections #16658
lucasnetto
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Problem
In a pull request's Code tab, selecting lines, typing a question, and clicking Add to agent puts the question and a line chip in the composer. Doing it again before sending removes the first question and its chip. You can only hold one selection at a time. To ask about several spots in one message, you have to send after each one or edit every question so it counts as your own text.
Selecting lines in a thread's own diff works differently.
AnnotatableCodeViewadds each one withaddReviewComment, so they stack. The PR Code tab builds its chip with the samebuildDiffReviewComment("the gesture is the same one", per the comment inPullRequestCodeTab.tsx). But it goes through the handoff path (writeTaskToComposer→handoffPrompt/handoffReviewComments), which replaces whatever an earlier handoff left. So the same gesture behaves differently depending on which diff you're in.Why replacement exists, and why it doesn't fit here
Handoff replacement was added so that Ask followed by Explain doesn't stack into a question nobody wrote, and so a question about one PR doesn't carry another PR's context. Both reasons hold for whole-PR handoffs. Neither applies to two line questions on the same PR: the user wrote both, and both are about that PR.
Proposal
When the incoming handoff is a line selection from the same PR, add to the composer instead of replacing:
pull-request-selection:chips whosesectionIdmatches the PR, and add the new one.Everything else stays as it is. Ask, Explain, and Fix findings still replace what earlier handoffs left, selections included. A selection from a different PR still clears the previous PR's chips.
The change would stay inside the PR panel's handoff merge rule and its tests: "replaces what the last one left, chips included" gains a same-PR selection case. No contract, server, or mobile changes.
All reactions