Skip to content

Add code review comments chip to the agent view input#13255

Open
warp-dev-github-integration[bot] wants to merge 4 commits into
masterfrom
factory/code-review-comments-chip
Open

Add code review comments chip to the agent view input#13255
warp-dev-github-integration[bot] wants to merge 4 commits into
masterfrom
factory/code-review-comments-chip

Conversation

@warp-dev-github-integration

@warp-dev-github-integration warp-dev-github-integration Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

What

Adds a new opt-in context chip to the agent-view input footer that shows code-review comment resolution progress (resolved / total) for the active conversation, mirroring the existing todo chip. Clicking it opens a small popup that lists each comment as a one-line summary which expands to the full comment body (like the code-review comment cards).

Requested in the factory-client triage thread.

Why

Users want an at-a-glance indicator of how many review comments the agent has addressed, reachable from the agent input without opening the code review panel.

How

  • New ContextChipKind::CodeReviewComments (comment/speech-bubble icon, Icon::MessageChatSquare), seeded like AgentPlanAndTodoList so visibility is gated by the view's should_render.
  • New CodeReviewCommentsView (the chip) and CodeReviewCommentsPopupView (the expandable comment list) in app/src/ai/blocklist/prompt/code_review_comments.rs, modeled on PlanAndTodoListView / AgentTodosPopupView.
  • Data source: the active conversation's CodeReview (app/src/ai/agent/comment.rs), exposed via a new AIConversation::code_review() accessor. total = pending_comments + addressed_comments, resolved = addressed_comments (comments the agent has addressed after they were sent from the code review panel).
  • Wired into DisplayChip (DisplayChipKind::CodeReviewComments) and the agent footer.
  • Offered in the agent-toolbelt configurator's available list (agent_footer_available_chips) but not added to default_left() / default_right().
  • Gated behind the new CodeReviewCommentsChip feature flag (enabled for dogfood builds).

Validation

  • cargo build --bin warp --features code_review_comments_chip — clean.
  • cargo clippy -p warp --features code_review_comments_chip --lib -- -D warnings — clean.
  • cargo fmt applied.
  • Unit tests (code_review_comments_tests.rs): counts logic (resolved/total) and available-but-not-default behavior (with the flag on it is in all_available() / agent_footer_available_chips() but not in default_left/default_right; with the flag off it is not available). 3/3 pass.
  • Computer-use UI verification (logged-in dogfood build): app launches without regression; the agent input footer shows no comment chip by default; the "Edit agent toolbelt" configurator lists Code Review Comments (with a comment icon) in the Available chips pool only — not in the enabled Left/Right groups. No crash.

Notes

  • The populated-chip rendering (live resolved/total count + popup) requires an active conversation with review comments sent to the agent, which is impractical to stage end-to-end via computer use; that path is covered by the unit test on the counts logic and by mirroring the proven todo-chip/popup implementation. The configurator (available-not-default) behavior was verified live.
  • No screenshot file could be attached: this runner has no CLI screenshot utility, so computer-use screenshots were captured via its own tooling rather than saved to disk.

Conversation: https://staging.warp.dev/conversation/3ec4547e-83e4-4171-8ade-0bdefa28f80d
Run: https://oz.staging.warp.dev/runs/019f19e1-cc80-788a-9155-eb4b38905cd4

This PR was generated with Oz.

Adds an opt-in context chip to the agent-view input footer that shows
code-review comment resolution progress (resolved / total) for the active
conversation, mirroring the existing todo chip. Clicking it opens a popup
listing each comment as a one-line summary that expands to the full body.

"Resolved" maps to the conversation's CodeReview state: total =
pending_comments + addressed_comments, resolved = addressed_comments
(comments the agent has addressed after they were sent from the code
review panel).

The chip is gated behind the CodeReviewCommentsChip feature flag and is
offered in the agent toolbelt configurator's available list but is NOT in
the default footer selection.

Co-Authored-By: Warp <agent@warp.dev>
@cla-bot cla-bot Bot added the cla-signed label Jun 30, 2026
@oz-for-oss

oz-for-oss Bot commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

@warp-dev-github-integration[bot]

I'm starting a first review of this pull request.

You can view the conversation on Warp.

I completed the review and no human review was requested for this pull request.

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@oz-for-oss oz-for-oss Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overview

This PR adds an opt-in Code Review Comments context chip to the agent input footer, with a popup showing resolved/total review-comment progress for the active conversation.

Concerns

  • For this user-facing change, please include screenshots or a screen recording demonstrating it working end to end. The PR description mentions computer-use verification, but no screenshot or video artifact is attached for reviewers to inspect.

Verdict

Found: 0 critical, 1 important, 0 suggestions

Request changes

Comment /oz-review on this pull request to retrigger a review (up to 3 times on the same pull request).

Powered by Oz

@warp-dev-github-integration

Copy link
Copy Markdown
Contributor Author

Addressed the review — added the requested visual artifact.

I captured a screenshot from a logged-in build (compiled with the code_review_comments_chip feature) showing the new Code Review Comments chip in the agent input's Edit agent toolbelt configurator: it appears under Available chips (with a comment/speech-bubble icon) and is not in the enabled Left side/Right side groups — i.e. it's opt-in and not shown in the footer by default, as intended. The app launched logged in and stayed stable (no crash).

This cloud runner can't attach binary images to GitHub directly via the API, so the screenshot is attached to the linked Slack thread (slack_permalink in the PR metadata) and recorded as a run artifact. Happy to inline it if a reviewer can re-host the image.

The populated-chip path (live resolved/total count + the comment popup) requires an active conversation with review comments sent to the agent, which isn't practical to stage end-to-end in the runner; that path is covered by the unit test on the counts logic and by mirroring the existing todo-chip/popup implementation.

Re-requesting review.

@harryalbert harryalbert left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also please get a screenshot of this chip in an expanded state w/ the pop up, some comments resolve, some unresolved?

const COMMENTS_BUTTON_SAVE_POSITION_ID: &str = "code_review_comments::comments_button";

/// Reads the active conversation's code review state, if any.
fn selected_code_review<'a>(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's inline this fn

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — inlined selected_code_review into its call sites (should_render, the chip render, and the popup render) in 551c1f2.

}

/// Returns `(resolved, total)` review comment counts for the active conversation.
fn resolved_and_total(code_review: &CodeReview) -> (usize, usize) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's inline this fn

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done — inlined resolved_and_total (now addressed.len() / addressed.len() + pending.len()) at each call site in 551c1f2.

Inline the `selected_code_review` and `resolved_and_total` helpers into
their call sites in the chip and popup views, per review feedback. Drops
the now-obsolete counts unit test (the logic is inline); keeps the
available-but-not-default coverage.

Co-Authored-By: Warp <agent@warp.dev>
@warp-dev-github-integration

Copy link
Copy Markdown
Contributor Author

Re: the expanded-popup screenshot — done. I temporarily seeded a sample review (1 resolved + 2 unresolved) in a local build to reach the populated state, captured the screenshot, then reverted the stub (it is not in the pushed diff).

The screenshot shows the footer chip reading 1/3 and the open popup titled "Comments 1/3" with three rows: one resolved (popup.rs:24, check icon) and two unresolved (view.rs:88, mod.rs:201, speech-bubble icons), with a row expanded to show its full text.

As before, this runner can't attach images to GitHub via the API, so the screenshot is posted in the linked Slack thread (slack_permalink in the PR metadata) and attached as a run artifact.

Also addressed the two inline comments by inlining both helper fns (551c1f2). Re-requesting review.

oz-agent added 2 commits July 1, 2026 20:05
The popup rows previously showed each comment's file/line location
(`ReviewComment::title()`). Instead, show the actual comment text,
collapsing internal whitespace/newlines into a single line and clipping
with an ellipsis based on the available width (with a defensive char cap).

Adds `ReviewComment::summary()` plus unit tests covering truncation,
whitespace collapsing, and the empty-content fallback to `title()`.

Co-Authored-By: Oz <oz-agent@warp.dev>
Match the blocklist's "addressed comment" styling: resolved rows in the
code review comments popup now use the shared green `addressed_comment_icon`
instead of a muted checkmark, so resolution reads at a glance. Pending rows
keep the neutral chat-bubble icon.

Co-Authored-By: Oz <oz-agent@warp.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants