Skip to content

Mark imported PR comments added to code review#9648

Open
dhruvac29 wants to merge 2 commits intowarpdotdev:masterfrom
dhruvac29:fix-imported-comment-code-review-state
Open

Mark imported PR comments added to code review#9648
dhruvac29 wants to merge 2 commits intowarpdotdev:masterfrom
dhruvac29:fix-imported-comment-code-review-state

Conversation

@dhruvac29
Copy link
Copy Markdown

Summary

  • Track when an imported PR comment has already been opened in the code review panel.
  • Update the source imported-comment card from “Open in code review” to a disabled “Added to code review” state after the action is used.
  • Preserve the existing repo/CWD disabled-state behavior separately from the already-added state.

Fixes #9627

Testing

  • cargo check -p warp
  • cargo fmt -- --check
  • git diff --check

Copilot AI review requested due to automatic review settings April 30, 2026 19:07
@cla-bot
Copy link
Copy Markdown

cla-bot Bot commented Apr 30, 2026

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have the users @dhruvac29 on file. In order for us to review and merge your code, each contributor must visit https://cla.warp.dev to read and agree to our CLA. Once you have done so, please comment @cla-bot check to trigger another check.

@oz-for-oss
Copy link
Copy Markdown
Contributor

oz-for-oss Bot commented Apr 30, 2026

@dhruvac29

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

I reviewed this pull request and requested human review from: @zachbai.

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

I completed the review and posted feedback on this pull request.

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

I'm re-reviewing this pull request in response to a review request.

I reviewed this pull request and requested human review from: @zachbai.

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

I reviewed this pull request and requested human review from: @zachbai.

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

You can view the conversation on Warp.

I reviewed this pull request and requested human review from: @zachbai.

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

Powered by Oz

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the imported PR comments UI so a comment card reflects when its “Open in code review” action has already been used, preventing repeated adds and clarifying state for the user (Fixes #9627).

Changes:

  • Adds per-imported-comment state to track whether a comment has been added to the code review panel.
  • Updates the per-comment “Open in code review” button to switch to a disabled “Added to code review” state after use.
  • Refactors repo/CWD-based disabling to flow through a single per-comment button update method.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/ai/blocklist/block.rs
Comment thread app/src/ai/blocklist/block.rs Outdated
Comment thread app/src/ai/blocklist/block.rs
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Overview

This PR adds per-imported-comment UI state so a comment card's button changes from "Open in code review" to a disabled "Added to code review" state after the per-comment import action is used, while preserving the existing repository/CWD disabled behavior.

Concerns

  • No blocking correctness, security, or error-handling concerns found in the changed diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

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 requested a review from zachbai April 30, 2026 19:14
@dhruvac29 dhruvac29 force-pushed the fix-imported-comment-code-review-state branch from 2435b0c to 5dfffce Compare April 30, 2026 19:24
@cla-bot cla-bot Bot added the cla-signed label Apr 30, 2026
@dhruvac29 dhruvac29 requested a review from Copilot April 30, 2026 19:28
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Overview

This PR tracks per-imported-comment UI state so cards switch from Open in code review to disabled Added to code review after they are opened, while keeping the repository/CWD disabled state separate.

Concerns

  • The bulk open action only marks comments owned by the AI block that handled the click, but the existing bulk import path collects comments from every AI block in the current thread. If the footer is rendered on a later block that does not own the imported comments, earlier source cards remain enabled after the comments are imported.

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

Comment thread app/src/ai/blocklist/block.rs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds UI state tracking so imported PR comment cards reflect when they’ve already been added to the code review panel, while keeping the existing repo/CWD-based disabled behavior.

Changes:

  • Add an added_to_code_review flag to imported-comment element state and centralize label/disabled/tooltip derivation.
  • Update imported-comment actions to mark comments as “Added to code review” after opening in the review panel (single and bulk).
  • Add unit tests for the button state logic and precedence rules.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
app/src/ai/blocklist/block.rs Adds per-imported-comment “added” state, updates button state computation, and marks state on open actions.
app/src/ai/blocklist/block_tests.rs Adds tests covering button label/disabled/tooltip behavior for repo-disabled vs already-added states.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/ai/blocklist/block_tests.rs Outdated
Comment thread app/src/ai/blocklist/block.rs Outdated
@dhruvac29 dhruvac29 force-pushed the fix-imported-comment-code-review-state branch from 5dfffce to b068f0b Compare April 30, 2026 19:39
@dhruvac29 dhruvac29 requested a review from Copilot April 30, 2026 19:41
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Overview

This PR tracks imported PR comments that have already been opened in the code review panel, updates per-comment button state to "Added to code review", and preserves the existing CWD/repo disabled behavior.

Concerns

  • No blocking correctness, security, or error-handling concerns found in the changed diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

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

Powered by Oz

Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Overview

This PR tracks imported PR comments that have already been opened in the code review panel and updates the source cards to a disabled "Added to code review" state while preserving the existing repository/CWD disabled behavior.

Concerns

  • No blocking correctness or security concerns found in the changed diff.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

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

Powered by Oz

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves the imported PR comments UI by tracking when an imported comment has already been opened/added to the code review panel, and updating the source comment card to reflect that state (while preserving the existing repo/CWD-based disabled behavior).

Changes:

  • Track an added_to_code_review state per imported comment and update the “Open in code review” button to a disabled “Added to code review” state after use.
  • When importing all comments for a conversation thread, mark the originating blocks’ imported comments as “added to code review”.
  • Add unit tests for the imported comment button state logic (label/disabled/tooltip precedence).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
app/src/terminal/view.rs Collects source AI blocks when importing all comments and marks their imported comment buttons as “added”.
app/src/ai/blocklist/block.rs Adds added_to_code_review state + button state computation and updates single-comment open to mark the button as added.
app/src/ai/blocklist/block_tests.rs Adds tests for button-state logic (added-state vs repo-disabled/tooltip).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/src/ai/blocklist/block_tests.rs Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

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

Choose a reason for hiding this comment

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

Overview

This PR tracks imported PR comment cards after they are opened in code review, updates the per-comment button label/disabled state, and marks source blocks after bulk import.

Concerns

  • No blocking correctness concerns found in the changed lines.
  • Supplemental security pass found no security findings.

Verdict

Found: 0 critical, 0 important, 0 suggestions

Approve

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

Powered by Oz

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.

Open in code review button remains after a PR comment is added to the code review panel

2 participants