Skip to content

[FEATURE]: Inline review comments in the V2 TUI diff viewer #50561

Open

Description

@samuelbriole

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

When reviewing changes in OpenCode’s TUI diff viewer, I’d like to comment directly on a line or range and send the collected feedback back to the agent. Currently, I have to return to the conversation and manually describe the file, lines, and code I’m referring to.

I’ve tried tuicr and herdr-reviewr, and I like their select-lines → comment → collect-feedback workflow. Having this inside OpenCode would make reviewing and iterating on the agent’s changes much easier.

Suggested workflow:

  1. Select a line or range in the diff with the keyboard or mouse.
  2. Add a comment, with a visible marker beside the relevant code.
  3. Continue reviewing other files, with a summary for navigating, editing, and deleting comments.
  4. Choose Add review to prompt to return to the conversation with the comments, file locations, and relevant code excerpts.
  5. Edit the resulting prompt and submit it normally.

Draft comments should survive closing and reopening the viewer. If the code changes during review, the original excerpt should remain available and the comment should be marked as referring to an older diff.

I’d like to contribute this for the V2 TUI. Would this workflow fit the product direction, and what scope would maintainers prefer for an initial contribution?

Activity

  1. Codestz commented on Sep 25, 2026

    @Codestz

    A working version of this exists as a plugin: opencode-cockpit's Review bay (https://github.com/Codestz/opencode-cockpit), on OpenCode 1 and 2. You comment on lines of the diff, submit, and the agent answers each thread through tools (review_list, review_reply), with the conversation shown under the line. Two lessons that apply to a built-in version:

    • Threads need to follow their code as the agent edits it. Anchor by the quoted text, not the line number; line numbers drift on the first answer.
    • The agent works better reading the threads through a tool than as one long prompt.

    Happy to help if this gets picked up.

  2. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the detailed proposal, @samuelbriole! You're asking for inline review comments in the v2 TUI diff viewer: select a line or range, comment on it, and then send the collected comments, with file locations and code excerpts, back into the prompt to edit and submit. Drafts would survive reopening the viewer and be flagged when the code they refer to has changed.

    For context: the desktop/web review panel already supports line comments (packages/gui-plugins/src/review/panel.tsx and the SessionReview* components in packages/session-ui). Matching how that works and the format it adds to the prompt would probably make a TUI version easier to review. The TUI diff viewer itself is packages/tui/src/feature-plugins/system/diff-viewer.tsx.

    Maintainers will consider whether this fits the product direction and what scope they'd want for a first contribution. I can't promise anything on their behalf, so it's worth waiting for their input before you put a lot of work into a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions