Skip to content

Commit 52ac9fc

Browse files
authored
Merge branch 'master' into name-rog
2 parents 37a728f + 6f7b349 commit 52ac9fc

File tree

6 files changed

+405
-118
lines changed

6 files changed

+405
-118
lines changed

README.md

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,41 @@ Scrum Helper is not limited to the [FOSSASIA](https://github.com/fossasia) organ
116116
* Save your changes.
117117
* For Chrome: Rebuild or reload the extension in your browser (`chrome://extensions` → Refresh your extension).
118118
* For Firefox: Reload the temporary add-on by going to `about:debugging`"This Firefox" → Click "Reload" next to your extension.
119-
4. **Get Customized SCRUM Reports**
120-
- The reports will now be generated using contributions from your organization.
119+
120+
4. **How to Obtain a GitHub Personal Access Token**
121+
122+
- To use Scrum Helper with authenticated requests (for higher rate limits and private repositories), you need a GitHub personal access token.
123+
124+
#### Steps to Generate a Token
125+
126+
1. **Go to GitHub Developer Settings:**
127+
Visit [https://github.com/settings/tokens](https://github.com/settings/tokens) while logged in to your GitHub account.
128+
129+
2. **Choose Token Type:**
130+
- Select **"Personal access tokens (classic)"**.
131+
132+
3. **Generate a New Token:**
133+
- Click **"Generate new token"**.
134+
- Give your token a descriptive name (e.g., "Scrum Helper Extension").
135+
- Set an expiration date if desired.
136+
137+
4. **Create and Copy the Token:**
138+
- Click **"Generate token"** at the bottom.
139+
- **Copy the token** and save it securely. You will not be able to see it again!
140+
141+
5. **Paste the Token in Scrum Helper:**
142+
- Open the Scrum Helper extension popup.
143+
- Paste your token into the "GitHub Token" field.
144+
145+
> **Keep your token secret!** Never share it or commit it to public repositories.
146+
147+
**Why use a token?**
148+
GitHub tokens allow the extension to make authenticated requests, increasing your API rate limit and enabling access to private repositories if you grant those permissions.
149+
150+
---
151+
5. **Get Customized SCRUM Reports**
152+
- The reports will now be generated using contributions from your organization.
153+
121154

122155

123156
## About contributing

src/index.css

Lines changed: 85 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -287,93 +287,103 @@ hr,
287287
}
288288

289289
.tooltip-bubble {
290-
visibility: hidden;
291-
opacity: 0;
292-
position: absolute;
293-
background-color: #1f2937;
294-
color: white;
295-
text-align: left;
296-
padding: 12px;
297-
border-radius: 8px;
298-
font-size: 12px;
299-
line-height: 1.4;
290+
position: fixed !important;
291+
z-index: 9999;
292+
background: #f9fafb;
293+
color: #222;
294+
border-radius: 10px;
295+
border: 1px solid #e5e7eb;
296+
box-shadow: 0 4px 24px 0 rgba(0,0,0,0.12), 0 1.5px 4px 0 rgba(0,0,0,0.08);
297+
padding: 14px 18px;
298+
font-size: 13px;
299+
line-height: 1.5;
300+
min-width: 220px;
301+
max-width: 320px;
300302
white-space: normal;
301-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
302-
z-index: 1000;
303-
transition: opacity 0.3s ease, visibility 0.3s ease;
304-
width: 280px;
303+
opacity: 0;
304+
pointer-events: none;
305+
transition: opacity 0.18s;
305306
}
306307

307-
.tooltip-bubble {
308-
bottom: 125%;
309-
left: 150%;
310-
transform: translateX(-50%);
308+
.tooltip-container:hover .tooltip-bubble,
309+
.tooltip-container:focus-within .tooltip-bubble {
310+
opacity: 1;
311+
pointer-events: auto;
312+
}
313+
314+
.tooltip-bubble a {
315+
color: #2563eb;
316+
text-decoration: underline;
311317
}
312318

313319
.tooltip-bubble::after {
314320
content: "";
315321
position: absolute;
316-
top: 100%;
317-
left: 50%;
318-
margin-left: -5px;
319-
border-width: 5px;
322+
width: 0; height: 0;
320323
border-style: solid;
321-
border-color: #1f2937 transparent transparent transparent;
322324
}
323325

324-
.tooltip-container.tooltip-bottom .tooltip-bubble {
325-
top: 125%;
326-
bottom: auto;
327-
}
328326

329-
.tooltip-container.tooltip-bottom .tooltip-bubble::after {
330-
top: -10px;
331-
border-color: transparent transparent #1f2937 transparent;
327+
.dark-mode .tooltip-bubble {
328+
background: #f3f4f6;
329+
color: #222;
330+
border: 1px solid #374151;
332331
}
333332

334-
.tooltip-container.tooltip-right .tooltip-bubble {
335-
top: -5px;
336-
left: 125%;
337-
bottom: auto;
338-
transform: none;
333+
.dark-mode .tooltip-bubble::after {
334+
border-color: #374151 transparent transparent transparent;
339335
}
340336

341-
.tooltip-container.tooltip-right .tooltip-bubble::after {
342-
top: 15px;
343-
left: -10px;
344-
border-color: transparent #1f2937 transparent transparent;
337+
.dark-mode .tooltip-container.tooltip-bottom .tooltip-bubble::after {
338+
border-color: transparent transparent #374151 transparent;
345339
}
346340

347-
.tooltip-container:hover .tooltip-bubble {
348-
visibility: visible;
349-
opacity: 1;
341+
.dark-mode .tooltip-container.tooltip-right .tooltip-bubble::after {
342+
border-color: transparent #374151 transparent transparent;
350343
}
351-
352-
.dark-mode .question-icon {
353-
color: #9ca3af;
344+
#toggleTokenVisibility {
345+
background: none;
346+
border: none;
347+
cursor: pointer;
348+
margin-left: 8px;
349+
padding: 0;
350+
line-height: 1;
354351
}
355-
356-
.dark-mode .question-icon:hover {
357-
color: #60a5fa;
352+
#tokenEyeIcon {
353+
font-size: 18px;
354+
vertical-align: middle;
358355
}
359-
360-
.dark-mode .tooltip-bubble {
361-
background-color: #374151;
362-
border: 1px solid #4b5563;
356+
@keyframes eye-rotate {
357+
0% { transform: rotate(0deg);}
358+
60% { transform: rotate(180deg);}
359+
100% { transform: rotate(180deg);}
360+
}
361+
.eye-animating {
362+
animation: eye-rotate 0.4s cubic-bezier(0.4,0,0.2,1);
363+
}
364+
.token-animating {
365+
transition: box-shadow 0.3s, background 0.3s, color 0.3s, opacity 0.3s, transform 0.3s;
366+
box-shadow: 0 0 0 2px #3b82f6;
367+
opacity: 0.7;
368+
transform: translateX(8px) scale(1.03);
363369
}
364370

365-
.dark-mode .tooltip-bubble::after {
366-
border-color: #374151 transparent transparent transparent;
371+
.dark-mode #githubToken,
372+
.dark-mode .token-preview-char {
373+
background: #404040 !important;
374+
border-color: #505050 !important;
375+
color: #fff !important;
367376
}
368377

369-
.dark-mode .tooltip-container.tooltip-bottom .tooltip-bubble::after {
370-
border-color: transparent transparent #374151 transparent;
378+
.dark-mode .token-preview-dot {
379+
background: #9ca3af !important;
371380
}
372381

373382
.dark-mode .tooltip-container.tooltip-right .tooltip-bubble::after {
374383
border-color: transparent #374151 transparent transparent;
375384
}
376385

386+
377387
/* Custom Toast Styles for Materialize */
378388
.toast {
379389
color: #fff !important;
@@ -427,4 +437,23 @@ hr,
427437
.dark-mode .toast.toast-error {
428438
background: #b71c1c !important;
429439
color: #fff !important;
440+
441+
#homeButton {
442+
background: none;
443+
border: none;
444+
outline: none;
445+
cursor: pointer;
446+
display: flex;
447+
align-items: center;
448+
font-size: 1.5rem;
449+
}
450+
#homeButton:active {
451+
background: #e5e7eb;
452+
}
453+
.dark-mode #homeButton:active {
454+
background: #374151;
455+
456+
.dark-mode .token-preview-char {
457+
box-shadow: 0 1px 4px rgba(0,0,0,0.18);
458+
430459
}

src/popup.html

Lines changed: 48 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,32 @@
2323
<body>
2424
<div class="pl-1 py-4 rounded-2xl">
2525
<div class="bg-white px-4 py-4 mx-2 mb-2 rounded-3xl">
26-
<div class="flex justify-between py-2">
27-
<h3 class="text-3xl font-semibold ">Scrum Helper</h3>
28-
<img src="icons/night-mode.png" alt="Night Mode" class="w-7 h-7 mx-3 cursor-pointer">
29-
</div>
30-
<div>
31-
<p class="">Report your development progress by auto-fetching your Git activity for a selected period</p>
32-
</div>
3326

27+
<div class="flex justify-between py-2">
28+
<h3 id="scrumHelperHeading" class="text-3xl font-semibold cursor-pointer">Scrum Helper</h3>
29+
<img src="icons/night-mode.png" alt="Night Mode" class="w-7 h-7 mx-3 cursor-pointer">
30+
</div>
31+
<div>
32+
<p class="">Report your development progress by auto-fetching your Git activity for a selected period</p>
33+
</div>
34+
3435
<div class="center mt-2 flex justify-between">
35-
<label class="flex items-center justify-center gap-2 ">
36-
Disable
37-
<input type="checkbox" value="" id="enable" class="sr-only peer">
38-
<div
39-
class="relative w-11 h-6 bg-gray-200 rounded-full peer peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600 dark:peer-checked:bg-blue-600">
36+
<label class="flex items-center justify-center gap-2 ">
37+
Disable
38+
<input type="checkbox" value="" id="enable" class="sr-only peer" >
39+
<div class="relative w-11 h-6 bg-gray-200 rounded-full peer peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 dark:bg-gray-700 peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:start-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600 dark:peer-checked:bg-blue-600"></div>
40+
<span class=""></span>
41+
Enable
42+
</label>
43+
<div class="flex">
44+
<button id="homeButton" title="Go to Report" class="ml-1 p-2 rounded hover:bg-gray-200 dark:hover:bg-gray-700 transition">
45+
<i class="fa fa-home text-2xl text-gray-600 dark:text-gray-300"></i>
46+
</button>
47+
<button id="settingsToggle">
48+
<img id="settingsIcon" src="icons/settings-light.png" alt="Settings" class="w-6 h-6 mx-3 cursor-pointer">
49+
</button>
4050
</div>
41-
<span class=""></span>
42-
Enable
43-
</label>
44-
<button id="settingsToggle">
45-
<img id="settingsIcon" src="icons/settings-light.png" alt="Settings" class="w-7 h-7 mx-3 cursor-pointer">
46-
</button>
51+
4752
</div>
4853
</div>
4954

@@ -134,8 +139,31 @@ <h6 class="text-base font-semibold">Scrum Report</h6>
134139
</div>
135140

136141
<div class="">
137-
<p class="text-sm font-medium">Enter cache TTL <span class="text-sm text-gray-800 font-normal">(in
138-
minutes)</span>
142+
143+
144+
<div class="flex items-center justify-between">
145+
<div class="flex">
146+
<h4>Your Github Token</h4>
147+
<span class="tooltip-container">
148+
<i class="fa fa-question-circle question-icon"></i>
149+
<span class="tooltip-bubble">
150+
<b>Why is it recommended to add a GitHub token?</b><br>
151+
Scrum Helper works without a GitHub token, but adding a personal access token is recommended for a better experience. It raises your API limits, allows access to private repos (if permitted), and improves accuracy and speed. Tokens are stored locally and never sent to us and used only to fetch your git data. You can add one anytime in the extension settings.<br><br>
152+
<b>How to obtain:</b><br>
153+
1. Go to <a href="https://github.com/settings/tokens" target="_blank" style="color:#2563eb;text-decoration:underline;">GitHub Developer Settings</a>.<br>
154+
3. Click "Generate new token", select classic token<br>
155+
4. Paste it here.<br>
156+
<i>Keep your token secret!</i>
157+
</span>
158+
</span>
159+
</div>
160+
<button id="toggleTokenVisibility" type="button" class="focus:outline-none">
161+
<i id="tokenEyeIcon" class="fa fa-eye text-gray-600"></i>
162+
</button>
163+
</div>
164+
<input id="githubToken" type="password" class="w-full border-2 border-gray-200 bg-gray-200 rounded-xl text-gray-800 p-2 my-2 pr-10" placeholder="Required for making authenticated requests">
165+
<p class="text-sm font-medium">Enter cache TTL <span class="text-sm font-normal">(in minutes)</span>
166+
139167
<span class="tooltip-container">
140168
<i class="fa fa-question-circle question-icon"></i>
141169
<span class="tooltip-bubble">

src/scripts/main.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
let enableToggleElement = document.getElementById('enable');
22
let githubUsernameElement = document.getElementById('githubUsername');
3+
let githubTokenElement = document.getElementById('githubToken');
34
let cacheInputElement = document.getElementById('cacheInput');
45
let projectNameElement = document.getElementById('projectName');
56
let lastWeekContributionElement = document.getElementById('lastWeekContribution');
@@ -23,11 +24,15 @@ function handleBodyOnLoad() {
2324
'lastWeekContribution',
2425
'yesterdayContribution',
2526
'cacheInput',
27+
'githubToken',
2628
],
2729
(items) => {
2830
if (items.githubUsername) {
2931
githubUsernameElement.value = items.githubUsername;
3032
}
33+
if (items.githubToken) {
34+
githubTokenElement.value = items.githubToken;
35+
}
3136
if (items.projectName) {
3237
projectNameElement.value = items.projectName;
3338
}
@@ -206,6 +211,10 @@ function handleGithubUsernameChange() {
206211
let value = githubUsernameElement.value;
207212
chrome.storage.local.set({ githubUsername: value });
208213
}
214+
function handleGithubTokenChange() {
215+
let value = githubTokenElement.value;
216+
chrome.storage.local.set({ githubToken: value });
217+
}
209218
function handleProjectNameChange() {
210219
let value = projectNameElement.value;
211220
chrome.storage.local.set({ projectName: value });
@@ -235,6 +244,7 @@ function handleUserReasonChange() {
235244
}
236245
enableToggleElement.addEventListener('change', handleEnableChange);
237246
githubUsernameElement.addEventListener('keyup', handleGithubUsernameChange);
247+
githubTokenElement.addEventListener('keyup', handleGithubTokenChange);
238248
cacheInputElement.addEventListener('keyup', handleCacheInputChange);
239249
projectNameElement.addEventListener('keyup', handleProjectNameChange);
240250
startingDateElement.addEventListener('change', handleStartingDateChange);

0 commit comments

Comments
 (0)