Skip to content

gln/out-of-diff-comment-anchoring-zrxz - #413

Merged
glehmann merged 4 commits into
mainfrom
gln/out-of-diff-comment-anchoring-zrxz
Sep 23, 2026
Merged

glehmann merged 4 commits into
mainfrom
gln/out-of-diff-comment-anchoring-zrxz

Conversation

@glehmann

Copy link
Copy Markdown
Collaborator
  • 7118a273 feat: render out-of-diff threads with real code context in the overview

    File-level comments (out-of-diff lines) rendered with L=null and no code
    context. The position marker now carries the anchor commit, and the
    thread synthesizes an all-context hunk from the file content at that
    commit (base version for LEFT-side markers) covering exactly the marked
    range, so the overview shows the referenced range with syntax
    highlighting like a normal diff comment. The header link targets the
    real line, and the blob permalink (only there for GitHub's embedded
    snippet) is stripped from pulldash's rendered body.
  • 38517fca fix: keep out-of-diff drafts on failed standalone posts

    If the GraphQL review submitted but a standalone file-level comment post
    failed, the error was swallowed and clearReviewState wiped the still
    -unposted draft. The posting now runs as a single post-submit step (also
    reached by the dedup branches on retry), strips each pending comment as
    it lands, and throws before the refetch so drafts survive retries. The
    pending-review recovery loop only matches line comments, since
    file-level ones cannot exist in a pending review.
  • e4a3adcf feat: submit out-of-diff comments as file-level comments with exact-range permalinks

    GitHub's API rejects out-of-diff line anchors in every path, so instead
    of snapping those comments to the nearest diff line they now go out as
    standalone file-level review comments (subject_type: file). The body
    carries a hidden marker with the real position (line/start_line/side)
    plus a blob permalink that GitHub renders as an embedded code snippet.

    In pulldash, the marker re-anchors the comment (and its replies) to the
    exact range while that commit is being viewed, so it reads as a comment
    made on the chosen code. Drafts on out-of-diff lines skip the doomed
    pending-review sync, and the group marker for multi-commit sessions
    always lands on a line comment.
  • 1ccca9f0 fix: link exact lines in moved-comment notes

    Comments anchored to lines outside the diff hunks are rejected by every
    public GitHub API path (422 "Line could not be resolved" on REST review
    batches, standalone comments and GraphQL thread creation — verified by
    probing), while GitHub's web UI anchors them exactly via an internal
    endpoint. Pulldash therefore must keep snapping to the nearest diff
    line, but the moved-comment note now links the original lines at the
    target commit so readers can navigate to where the comment belongs.

Comments anchored to lines outside the diff hunks are rejected by every
public GitHub API path (422 "Line could not be resolved" on REST review
batches, standalone comments and GraphQL thread creation — verified by
probing), while GitHub's web UI anchors them exactly via an internal
endpoint. Pulldash therefore must keep snapping to the nearest diff
line, but the moved-comment note now links the original lines at the
target commit so readers can navigate to where the comment belongs.
…ange permalinks

GitHub's API rejects out-of-diff line anchors in every path, so instead
of snapping those comments to the nearest diff line they now go out as
standalone file-level review comments (subject_type: file). The body
carries a hidden marker with the real position (line/start_line/side)
plus a blob permalink that GitHub renders as an embedded code snippet.

In pulldash, the marker re-anchors the comment (and its replies) to the
exact range while that commit is being viewed, so it reads as a comment
made on the chosen code. Drafts on out-of-diff lines skip the doomed
pending-review sync, and the group marker for multi-commit sessions
always lands on a line comment.
If the GraphQL review submitted but a standalone file-level comment post
failed, the error was swallowed and clearReviewState wiped the still
-unposted draft. The posting now runs as a single post-submit step (also
reached by the dedup branches on retry), strips each pending comment as
it lands, and throws before the refetch so drafts survive retries. The
pending-review recovery loop only matches line comments, since
file-level ones cannot exist in a pending review.
File-level comments (out-of-diff lines) rendered with L=null and no code
context. The position marker now carries the anchor commit, and the
thread synthesizes an all-context hunk from the file content at that
commit (base version for LEFT-side markers) covering exactly the marked
range, so the overview shows the referenced range with syntax
highlighting like a normal diff comment. The header link targets the
real line, and the blob permalink (only there for GitHub's embedded
snippet) is stripped from pulldash's rendered body.
@glehmann
glehmann merged commit 7118a27 into main Sep 23, 2026
6 checks passed
@glehmann
glehmann deleted the gln/out-of-diff-comment-anchoring-zrxz branch September 23, 2026 19:24

This branch was successfully deployed

1 active deployment
github-pages — 7118a273 Deployed Sep 23, 2026 by glehmann via deploy #250
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