File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 const button = document . createElement ( 'button' ) ;
2222 button . id = 'copy-pr-link-btn' ;
2323 button . className = 'btn btn-sm' ;
24- button . style . marginLeft = '8px' ;
25- button . style . verticalAlign = 'middle' ;
24+ button . style . cssText = 'margin-left: 8px; vertical-align: middle; display: inline-flex; align-items: center; gap: 4px;' ;
2625 button . innerHTML = `
27- <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16" style="display:inline-block;vertical-align:middle;margin-right:4px;" >
26+ <svg aria-hidden="true" height="16" viewBox="0 0 16 16" version="1.1" width="16">
2827 <path fill="currentColor" d="M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25Zm5.22-1.72a.75.75 0 0 1 1.06 0l3.97 3.97V4.25a.75.75 0 0 1 1.5 0v6.5a.75.75 0 0 1-.75.75h-6.5a.75.75 0 0 1 0-1.5H9.44L5.47 5.53a.75.75 0 0 1 0-1.06Z"></path>
2928 </svg>
30- Copy PR Link
29+ <span> Copy PR Link</span>
3130 ` ;
3231 button . title = 'Copy PR title and link to clipboard' ;
3332
7776 } ) ;
7877
7978 // Insert button after the PR number
80- const titleContainer = titleElement . parentElement ;
81- if ( titleContainer ) {
82- titleContainer . style . display = 'flex' ;
83- titleContainer . style . alignItems = 'center' ;
84- // Find the PR number element (span with issue number after title)
85- const prNumberElement = titleContainer . querySelector ( '.gh-header-number' ) ;
86- if ( prNumberElement ) {
87- prNumberElement . after ( button ) ;
88- } else {
89- titleElement . after ( button ) ;
90- }
79+ const prNumberElement = document . querySelector ( '.gh-header-number' ) ;
80+ if ( prNumberElement ) {
81+ prNumberElement . after ( button ) ;
9182 return true ;
9283 }
9384
9485 return false ;
86+
87+ return false ;
9588 }
9689
9790 // Feature 2: Add "Request Review" button next to Copilot reviewer for draft PRs
You can’t perform that action at this time.
0 commit comments