Skip to content

Update PR row: primary View Preview button + actions dropdown (view PR, agent workflows, close linked issue)#1373

Open
issuetopr-dev[bot] wants to merge 3 commits intomainfrom
feature/pr-preview-main-button-dropdown
Open

Update PR row: primary View Preview button + actions dropdown (view PR, agent workflows, close linked issue)#1373
issuetopr-dev[bot] wants to merge 3 commits intomainfrom
feature/pr-preview-main-button-dropdown

Conversation

@issuetopr-dev
Copy link
Copy Markdown

@issuetopr-dev issuetopr-dev Bot commented Nov 5, 2025

Summary

  • If a preview link exists for a PR, the main (primary) button on each row now opens that preview. Otherwise, it falls back to the PR URL.
  • Added an adjacent dropdown with additional actions: View PR, Review PR, Analyze PR Goals, Run AlignmentCheck, Resolve Merge Conflicts, Create Dependent PR, and Close linked issue.
  • We detect preview links by using the GitHub API to scan the PR body and comments for a likely preview URL (heuristic: contains preview keywords like "vercel.app", "netlify.app", etc.).
  • Added ability to close the linked issue for the PR directly from the dropdown (takes the first linked issue).

Implementation details

  • New helper findPreviewUrlForPR and getPullRequestListWithExtras in lib/github/pullRequests.ts:
    • findPreviewUrlForPR scans PR body and comments for a likely preview URL.
    • getPullRequestListWithExtras enriches each PR with previewUrl and linkedIssues (via a GraphQL call).
  • PullRequestTable now fetches enriched PRs and passes previewUrl + linkedIssues to PullRequestRow.
  • PullRequestRow UI:
    • Primary button: View Preview (or View PR if none).
    • Dropdown menu for other actions, preserving existing agent workflows.
    • Added a dropdown item to close the first linked issue.
  • New API route: PATCH /api/issues/[issueId] to close an issue via GitHub REST (lib/github/issues.ts: closeIssue).

Notes

  • ESLint passes locally (next lint). Prettier check is not used in CI and shows unrelated existing formatting warnings across the repo, so it was not included as a required gate.
  • TypeScript full-project check (tsc --noEmit) is known to fail in this repo due to cross-workspace references; this change keeps the same behavior and does not introduce new TS errors within the modified files.

How it works

  • On the PR list page, the server fetches PRs, discovers preview URLs + linked issues, and renders rows accordingly.
  • If a preview URL is discovered, the main button says "View Preview" and links to it; otherwise it says "View PR" and links to GitHub.
  • Closing a linked issue calls the new API route to update the issue state to closed via GitHub.

Edge cases & fallback

  • If no preview-like link is found, the row simply renders the "View PR" button as before.
  • If there are multiple linked issues, the first one is used for the close action.

Screens/Components touched

  • components/pull-requests/PullRequestRow.tsx
  • components/pull-requests/PullRequestTable.tsx
  • lib/github/pullRequests.ts
  • lib/github/issues.ts
  • app/api/issues/[issueId]/route.ts

Let me know if you'd like the preview URL detection expanded (e.g., support for specific deployment providers or reading deployment statuses), or if the close-issue action should confirm or handle multiple linked issues.

Closes #1372

…down\n\n- Discover preview URL via GitHub API heuristics (scan PR body and comments)\n- Show primary “View Preview” button when found, otherwise “View PR”\n- Add actions dropdown with: View PR, AI workflows (Review/Analyze/Alignment/Resolve Conflicts/Create Dependent PR)\n- Add ability to close the linked issue from the dropdown (first linked issue)\n- Server API: PATCH /api/issues/:issueId to close an issue\n- Server helpers to enrich PR list with preview URL and linked issues
@issuetopr-dev issuetopr-dev Bot added the AI generated AI-generated Pull Requests label Nov 5, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 5, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Note

Free review on us!

CodeRabbit is offering free reviews until Thu Nov 06 2025 to showcase some of the refinements we've made.

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

AI generated AI-generated Pull Requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update main button to link preview on PRs with dropdown actions

1 participant