Repository navigation
feat(service,features,desktop): comment on lines in Files changed, and count and discard the pending review - #3646
Merged
Conversation
…om the foot of its Conversation The Conversation ends in a comment box, as GitHub's own does: Markdown with Write and Preview, sent as a new `comment` action on the member-writes seam (`addComment` on the pull request), so GitHub hears it as the member on their own sign-in, never the Luke GitHub App. Once GitHub takes it the box lets its words go and the conversation is read again; a refusal stands under the box in GitHub's words, the words kept. The review panel's Write and Preview move into `markdown-field.tsx`, which both now draw. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…ails The comment box is drawn only while the conversation stands read, so a refresh that failed took it away and Retry brought back an empty one. The tab now holds the box's words (`usePullRequestComment`), so they stand again once the conversation is read. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…e retired aliases #3524 retired `--space-*` and `--text-*`, so the comment box's gap and its refusal's colour fell back to nothing on main. They now read `--luke-space-8`, `--luke-color-text-muted`, and `--luke-type-caption-size`, as the thread's own note does. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
… as the member, and read their pending review beside the conversation Two actions join the member-writes union. `add-review-comment` comments on lines of a changed file at the head the diff was read at: `single` publishes it at once as a review of its own (`addPullRequestReview` with one thread), and `review` adds it to the member's own pending review, starting one where they hold none, which is the review the Review panel submits. `discard-review` deletes the member's own pending review, found by the pull request and `viewerDidAuthor`, and is refused in words where they hold none. The conversation's read carries the member's pending review beside it, read in parallel on their own token (`memberReadToken`, as the reactions read does) and never on the App's, null where they hold none, have no sign-in, or GitHub would not answer. The changes answer names the head its files were read at (`headSha`), read from the pull request beside them, as #3638 names it. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…rd the pending review in Review Files changed's list turns on Pierre's own line picking: the gutter's + on a line, or dragged across lines, or on lines picked by their numbers, opens a comment under the last of them, its lines lit, as GitHub's own diff does. The comment offers Add single comment and Start a review, or Add review comment where the member holds a pending review, and sends `add-review-comment` at the head the files were read at. Lines GitHub would take no comment on (a file drawn without lines of its own, a range across hunks) open nothing (`commentLines`). GitHub's refusal stands under the comment in its words beside Refresh changes, its words kept; a file's words outlive the comment scrolling away. The Review press counts the pending review's comments, its panel says they will be published, and Discard, offered only while one is held, asks first in the destructive tone, then sends `discard-review`. The review panel's and the comment's fields are the shared `MarkdownField`. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
luke-agent
Bot
changed the base branch from
main
to
feat/pull-request-comment
October 18, 2026 17:56
luke-agent Bot
added a commit
that referenced
this pull request
Oct 18, 2026
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
…ne held on another commit, and let Discard wait on GitHub A review a line comment starts is now made with that comment in one `addPullRequestReview`, so a comment GitHub refuses leaves no empty pending review behind. A comment for a review held pending on a commit other than the one the diff was read at is refused in words saying so, rather than given lines counted on another commit. Discard's question stands busy until GitHub answers and says its refusal in GitHub's words, `usePullRequestWrites.write` answering how the change went. The Refresh changes test asserts the files as drawn again, not how often they were read. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
#3568 draws a write's refusal as `ErrorState`, so the comment box's own `.failure-note-words` rule draws nothing and its test read no words. The rule goes, and the test reads the refusal by its alert, as the thread's does. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
The line comment's refusal is drawn by main's `ErrorState` now, so its own `.failure-note-words` rule and the Review panel's note rules go, and its test reads the refusal by its alert. Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
Co-authored-by: luke-agent[bot] <339870089+luke-agent[bot]@users.noreply.github.com>
7 tasks done
This branch was successfully deployed
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.
B3b of the "Review and comment" stack, after #3313 (B3a, merged). The task: comment on a line or range from Files changed, offering "Add single comment" and "Start a review" as GitHub does. Started reviews go into the pending review that B1's Review panel submits. As the orchestrator decided, it also adds a small read of the member's own pending review and a Discard action for it.
Wire
Two new members on the action union in
pull-request-write-wire.ts, both running throughmemberPullRequestWrite, so they act as the member pressing the button and never fall back to the App:add-review-comment { mode: "single" | "review", path, line, side, startLine?, startSide?, body, headSha }. Sides areleftorright, lines count from 1, the body can't be blank, andheadShais the commit the diff was read at.discard-review.Two answers gain an optional field:
pendingReview: { comments } | null: the member's own pending review,nullwhen they have none, have no sign-in, or GitHub didn't answer.headSha, taken from feat(desktop,service,features): draw changed images before and after in Files changed #3638's own read (imageCommits), now onmain.Service
addLineComment:singlesends oneaddPullRequestReview(commitOID: headSha, event: COMMENT, threads: [ … ]). That publishes immediately, as GitHub's own "Add single comment" does.reviewfinds the member's own pending review (viewerDidAuthor, the same lookup B1's submit now shares throughownPendingReview). If there is none, it starts one atheadSha. Then it sendsaddPullRequestReviewThreadto that review.discardPendingReviewdeletes only the member's own pending review on this PR. If they have none, it is refused with the words "You have no pending review on this pull request."viewerPendingReviewOf): runs in parallel with the conversation read, on the member's own token (memberReadToken, the same as feat(desktop,service,features): add and remove a reaction in the Pull request tab's Conversation #3619's, now merged) and never the App's. Any failure comes back asnull, and the hosted answer staysprivate, no-store.headSha. If that read doesn't land,headShais left out.UI
CodeViewlist now uses Pierre's own line picking (enableLineSelection,enableGutterUtility,onGutterUtilityClick). You can press the gutter "+" on one line, drag it across lines, or pick lines by their numbers and then press "+". Files with no lines of their own (binary, too large, or images feat(desktop,service,features): draw changed images before and after in Files changed #3638 draws as pictures) never offer a comment. Ranges GitHub won't take, such as one spanning two hunks or a line with no diff row, open nothing (commentLinesinchanges-model.ts).line-comment.tsx) is drawn as a note under the last picked line, with those lines lit:discard-review.Screenshots from the real diff bundle (




diff-view/index.ts), driven with Playwright:Tests
coding-agents-app.test.ts):addPullRequestReviewwith the thread, atheadSha, on the member's token;reviewstarts a pending review when there is none, or joins the member's own and nobody else's;null, and the App's token is never used;headSha.commentLinesgets the right sides, a one-line pick, a cross-hunk pick, a line with no row, and a binary file.LUKE_UPDATE_FIXTURES=1:headSha;pendingReview.Evidence
pnpm check:affectedruns out of memory in this sandbox, so I ran the parts separately and all passed:tscfor desktop and servicecoding-agents-appandgithub/(1,470 tests)./scripts/oxlint.sh,biome,pnpm knipand./scripts/repository-checks.shThe desktop build fits the bundle budget #3305 re-recorded.
Made with Luke
Summary by cubic
Adds line commenting to Files changed, as GitHub's diff offers it, with comments published at once or held in the member's pending review, which Review now counts and can discard.
New Features
Service
add-review-commentanddiscard-reviewrun as the member on their own GitHub token: single publishes at the head sha the diff was read at, review joins the member's pending review and starts one, with its first comment, if none.discard-reviewrefuses in words when the member holds no pending review.pendingReviewand the changes answer gainsheadSha.Written for commit ca69a7d. Summary will update on new commits.