Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat: Comment on diff to give agent context #79

Closedjuliusmarminge opened this issue 3 comments
juliusmarmingecommented

No description provided.

  1. juliusmarminge closed this

  2. juliusmarminge reopened this

  3. maria-rcks added labelsenhancement

  4. maskdotdev(GitHub profile, opens in a new tab)commented

    I gave this a shot but ended with around 1.5k LOC, which seems to be a big no no per Contributing.md @juliusmarminge @maria-rcks

    Below is what this would look like, let me know if you want me to still open a PR.

    https://github.com/user-attachments/assets/99f47bd9-4db1-46cc-9f82-772ff647a010

    This PR would cover:

    • Select lines in the diff panel and attach draft comments to a specific file and line range.
    • Those pending diff comments show up in the composer as attached context, just like we do with images.
    • Sending a message includes the diff comments as structured prompt context for the model, with line range, file path, etc.
    • The chat timeline hides that raw structured block and shows it as a compact "comments attached" indicator instead.
    • Pending diff comments can be edited or deleted from the diff view before send.
    • Draft comments persist in composer draft state and recover correctly across failed sends.
  5. If you have it done open the PR. Can't promise we'll merge it now but may serve as a basis when we do get there :)

  6. @juliusmarminge I think this one can be closed — it looks like this shipped a while back and the issue just went stale.

    The web/desktop implementation landed in #3115 (merged 2026-06-16, a week after #35 was closed with "web/desktop still pending"), survived the #2978 client rewrite, and was consolidated into AnnotatableCodeView in #3488.

    I verified the full loop end-to-end today on current main (23c18fda7) in a clean environment:

    • Click/drag line numbers in the Diff panel → inline "Local comment" editor on the selected line range
    • Saved drafts render inline in the diff and as a removable path +N chip in the composer
    • Sending appends the structured <review_comment> blocks (file path, range label, fenced diff hunk) to the outgoing prompt; the timeline parses them back into a compact card instead of showing raw XML
    • The agent fixed exactly the commented line (expect(4 - 2).toBe(1) → .toBe(2)), leaving an identical un-commented assertion elsewhere untouched

    Mobile has had its equivalent since #2013, and the two serializers share the same format (reviewCommentContext.ts on web mirrors mobile's reviewCommentSelection.ts).

    One small thing I noticed while testing, in case it's known: the Diff panel's "Working tree" scope showed "No net changes" for uncommitted edits that existed before the thread was created, while turn-scoped diffs rendered fine. Happy to file that separately if it reproduces for others.

  7. juliusmarminge closed this

Sign in to join this conversation.