Skip to content

Add "Request Changes" button on analyzed PRs to generate contributor feedback#247

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-comment-button-on-prs
Draft

Add "Request Changes" button on analyzed PRs to generate contributor feedback#247
Copilot wants to merge 3 commits intomainfrom
copilot/add-comment-button-on-prs

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 24, 2026

PRs with completed analysis lacked a quick way to communicate required changes back to contributors. This adds a "Request Changes" action button that appears on analyzed PR rows and opens a modal with pre-formatted review text — clicking the primary CTA copies the text to clipboard and opens the PR's Files Changed tab on GitHub so the reviewer can paste it into the review form and submit as "Request changes".

Changes

Frontend (public/index.html)

  • Request Changes button — hidden comment-btn (amber, clipboard-list icon, tooltip "Request changes on this PR") added to each PR row's action cell; becomes visible only after analysis runs
  • prAnalysisCache — in-memory map keyed by PR ID to retain readiness/reviewHealth data between updateInlineCells calls and modal open
  • currentCommentReviewUrl — module-level variable set to {pr_url}/files when the modal opens, used by the combined CTA button
  • updateInlineCells — now stores data into prAnalysisCache and un-hides the request changes button for that row
  • Request Changes modal (#commentModal) — displays generated review text in a <textarea> with:
    • Copy & Open Review — copies markdown to clipboard and opens the PR's Files Changed tab ({pr_url}/files) in a new tab in one click
    • Dismissable via close button, Escape key, or outside click
  • buildContributorComment — generates structured markdown with sections for 🚫 Blockers, ⚠️ Warnings, 💡 Recommendations, and 📊 scores; null-safe score formatting via a fmtScore helper
  • copyAndOpenReview — copies review text and opens the GitHub Files Changed tab in a single action
  • Event listeners wired in both renderPrList (initial render) and updateSinglePrRow (post-refresh row replacement)

Generated review text structure

## 🔍 PR Analysis for @username

### 🚫 Blockers (must be resolved before merge)
- CI checks failing

### ⚠️ Warnings (should be addressed)
- PR is behind base branch by 3 commits

### 📊 Analysis Scores
- **Overall Readiness:** 42%
- **CI Score:** 0%
- **Review Score:** 75%

---
*Generated by [BLT-Leaf PR Analyzer](...)*

Workflow

  1. Run analysis on a PR — the amber clipboard-list button appears in the row's action cell
  2. Click the button — the Request Changes modal opens with pre-filled review text
  3. Click Copy & Open Review — text is copied to clipboard and the PR's Files Changed tab opens in a new tab
  4. Paste into GitHub's review comment field, select "Request changes", and submit

Request Changes modal


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages bot commented Feb 24, 2026

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
blt-leaf f0adfb4 Commit Preview URL

Branch Preview URL
Feb 24 2026, 03:11 AM

Copilot AI changed the title [WIP] Add tiny button for comment analysis on PRs Add comment button on analyzed PRs to generate contributor feedback Feb 24, 2026
Copilot AI requested a review from DonnieBLT February 24, 2026 03:07
@DonnieBLT
Copy link
Copy Markdown
Contributor

@copilot make it more of a request changes button that opens the request changes field on the pull request review page and its filled out with a list of what the contributor should do

Co-authored-by: DonnieBLT <128622481+DonnieBLT@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Feb 24, 2026

@copilot make it more of a request changes button that opens the request changes field on the pull request review page and its filled out with a list of what the contributor should d...

Done in commit f0adfb4. The button is now a "Request Changes" action (amber clipboard-list icon, tooltip "Request changes on this PR") that appears on each PR row once analysis has run.

Clicking it opens a modal that:

  1. Shows the pre-formatted review text (blockers, warnings, recommendations, scores)
  2. Has a single "Copy & Open Review" button that copies the text to clipboard and opens the PR's Files Changed tab ({pr_url}/files) in a new tab — that's where GitHub's review form lives with the "Request changes" radio option

Request Changes modal

Copilot AI changed the title Add comment button on analyzed PRs to generate contributor feedback Add "Request Changes" button on analyzed PRs to generate contributor feedback Feb 24, 2026
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.

2 participants