feat(web): add PR Link to thread copy menu - #10710
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Adds a small, explicit Copy → PR Link action using existing thread metadata and clipboard infrastructure. Threads without a PR are unchanged, and the focused test covers conditional menu visibility. You can add or adjust custom eligibility rules. Learn more. |
There was a problem hiding this comment.
All clear
Posted via Macroscope — Effect Service Conventions
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughThe thread context menu now includes a conditional “PR Link” action. The action resolves pull-request URLs from thread metadata, copies the URL to the clipboard, and displays success or failure toasts. ChangesThread PR link copying
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Thread menus now conditionally offer PR-link copying with success and failure feedback. The supplied coverage and wiring indicate the feature is ready to merge without an identified user or production risk. Sequence Diagram(s)sequenceDiagram
participant ThreadContextMenu
participant useThreadActionMenu
participant Clipboard
participant Toast
ThreadContextMenu->>useThreadActionMenu: select copy-pr-link
useThreadActionMenu->>Clipboard: copy PR URL
Clipboard-->>useThreadActionMenu: success or failure
useThreadActionMenu->>Toast: show copy result
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Note
🤖 GPT-6 on behalf of Oliver
ELI5
Copy a thread's pull request URL from Copy → PR Link.
Problem
The thread Copy submenu offers its path, branch, and ID, but no PR URL.
Implementation
Add PR Link to the shared sidebar and chat-header menu when a linked or branch PR exists. Prefer the explicitly linked PR and reuse the clipboard helper and success/error toasts. Add the link icon to the web context-menu renderer.
Validated with 19 focused tests, web typecheck, targeted lint, and browser checks for linked PRs, branch PRs, no-PR visibility, and the chat header. Lint reports existing Sidebar warnings. Independent code review found no remaining issues.
UI Changes
Before
After
Made with GPT-6 in Codex.
Note
Add
copy-PR-linkaction to thread context menuThreadActionMenuStatewith a nullableprUrlfield and conditionally adds the PR Link item to the Copy submenu when a URL is presentuseThreadActionMenuhook resolve the PR URL from the thread's linked pull request, falling back to its branch pull request, and copy it with success/failure toastsThreadActionMenuStateadds a requiredprUrlfield; in-tree consumers are updated, but external consumers of this shared builder must provide itMacroscope summarized 6084827.
Summary by CodeRabbit
New Features
Tests