-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
208 lines (191 loc) · 7.2 KB
/
test.html
File metadata and controls
208 lines (191 loc) · 7.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GitHub UI Mods - Test Page</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background-color: #0d1117;
color: #c9d1d9;
}
h1, h2 {
color: #58a6ff;
}
.test-section {
background-color: #161b22;
border: 1px solid #30363d;
border-radius: 6px;
padding: 20px;
margin: 20px 0;
}
.pr-title-container {
display: flex;
align-items: center;
margin: 20px 0;
}
.js-issue-title {
font-size: 32px;
font-weight: 600;
color: #c9d1d9;
}
.State {
padding: 4px 12px;
border-radius: 24px;
font-size: 14px;
font-weight: 500;
margin-right: 10px;
}
.State[title="Status: Draft"] {
background-color: #6e7681;
color: #f0f6fc;
}
.copilot-section {
margin: 20px 0;
display: flex;
align-items: center;
}
a[href="/apps/copilot-pull-request-reviewer"] {
color: #58a6ff;
text-decoration: none;
display: flex;
align-items: center;
}
a[href="/apps/copilot-pull-request-reviewer"]:hover {
text-decoration: underline;
}
.btn {
background-color: #21262d;
border: 1px solid #30363d;
color: #c9d1d9;
padding: 5px 16px;
border-radius: 6px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
}
.btn:hover {
background-color: #30363d;
}
.btn-sm {
padding: 3px 12px;
font-size: 12px;
}
.instructions {
background-color: #1f2937;
border-left: 4px solid #58a6ff;
padding: 15px;
margin: 20px 0;
}
.success {
color: #3fb950;
font-weight: 500;
}
code {
background-color: #161b22;
padding: 2px 6px;
border-radius: 3px;
font-family: ui-monospace, monospace;
}
</style>
</head>
<body>
<h1>GitHub UI Mods - Test Page</h1>
<div class="instructions">
<h2>Installation & Testing Instructions</h2>
<ol>
<li>Load the extension in Chrome:
<ul>
<li>Go to <code>chrome://extensions/</code></li>
<li>Enable "Developer mode" (top right)</li>
<li>Click "Load unpacked"</li>
<li>Select the extension directory</li>
</ul>
</li>
<li>Test on this page first (simulated GitHub PR page)</li>
<li>Then test on an actual GitHub PR page</li>
</ol>
</div>
<div class="test-section">
<h2>Feature 1: Copy PR Link Button</h2>
<p>This simulates a GitHub PR title. The extension should add a "Copy PR Link" button next to it.</p>
<div class="pr-title-container">
<span class="js-issue-title">Fix: Update authentication flow to support OAuth 2.0</span>
</div>
<p class="success" id="feature1-status">⏳ Waiting for extension to load...</p>
</div>
<div class="test-section">
<h2>Feature 2: Request Copilot Review Button (Draft PR)</h2>
<p>This simulates a draft PR with Copilot reviewer. The extension should add a "Request Review" button.</p>
<div style="margin: 20px 0;">
<span class="State" title="Status: Draft">Draft</span>
</div>
<div class="copilot-section">
<a href="/apps/copilot-pull-request-reviewer">
<svg height="16" width="16" viewBox="0 0 16 16" style="fill: currentColor; margin-right: 4px;">
<path d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0ZM1.5 8a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0Z"></path>
</svg>
copilot-pull-request-reviewer
</a>
</div>
<p class="success" id="feature2-status">⏳ Waiting for extension to load...</p>
</div>
<div class="test-section">
<h2>Testing Checklist</h2>
<ul>
<li>✓ Extension loads without errors (check console)</li>
<li>✓ "Copy PR Link" button appears next to PR title</li>
<li>✓ Clicking "Copy PR Link" copies text to clipboard</li>
<li>✓ Button shows "Copied!" feedback</li>
<li>✓ "Request Review" button appears next to Copilot link (on draft PRs)</li>
<li>✓ Buttons have proper styling (GitHub theme)</li>
<li>✓ Icons display correctly</li>
</ul>
</div>
<div class="instructions">
<h2>Next Steps</h2>
<p>After verifying on this test page, test on actual GitHub PR pages:</p>
<ul>
<li>Test on a regular (non-draft) PR - should only show Feature 1</li>
<li>Test on a draft PR - should show both features</li>
<li>Verify the copied text format matches: <code>"PR Title: https://link-to-pr"</code></li>
</ul>
</div>
<script>
// Monitor for button additions
const observer = new MutationObserver((mutations) => {
const copyBtn = document.getElementById('copy-pr-link-btn');
const reviewBtn = document.getElementById('copilot-request-review-btn');
if (copyBtn) {
document.getElementById('feature1-status').textContent = '✅ Feature 1 button detected!';
document.getElementById('feature1-status').style.color = '#3fb950';
}
if (reviewBtn) {
document.getElementById('feature2-status').textContent = '✅ Feature 2 button detected!';
document.getElementById('feature2-status').style.color = '#3fb950';
}
});
observer.observe(document.body, {
childList: true,
subtree: true
});
// Timeout check
setTimeout(() => {
const copyBtn = document.getElementById('copy-pr-link-btn');
const reviewBtn = document.getElementById('copilot-request-review-btn');
if (!copyBtn) {
document.getElementById('feature1-status').textContent = '❌ Feature 1 button NOT detected. Check if extension is loaded.';
document.getElementById('feature1-status').style.color = '#f85149';
}
if (!reviewBtn) {
document.getElementById('feature2-status').textContent = '❌ Feature 2 button NOT detected. Check if extension is loaded.';
document.getElementById('feature2-status').style.color = '#f85149';
}
}, 5000);
</script>
</body>
</html>