Skip to content

Commit 9041a53

Browse files
committed
updated readme, added question bubble
Signed-off-by: Vedansh Saini <[email protected]>
1 parent 2ef8c40 commit 9041a53

File tree

4 files changed

+161
-64
lines changed

4 files changed

+161
-64
lines changed

README.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,47 @@ 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+
- For most users, select **"Fine-grained tokens"** (recommended) or **"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. **Select Scopes/Permissions:**
138+
- At minimum, select:
139+
- `repo` (for access to your repositories)
140+
- `read:user` (to read your user profile)
141+
- For private repositories, ensure you grant access to those as well.
142+
143+
5. **Create and Copy the Token:**
144+
- Click **"Generate token"** at the bottom.
145+
- **Copy the token** and save it securely. You will not be able to see it again!
146+
147+
6. **Paste the Token in Scrum Helper:**
148+
- Open the Scrum Helper extension popup.
149+
- Paste your token into the "GitHub Token" field.
150+
151+
> **Keep your token secret!** Never share it or commit it to public repositories.
152+
153+
**Why use a token?**
154+
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.
155+
156+
---
157+
5. **Get Customized SCRUM Reports**
158+
- The reports will now be generated using contributions from your organization.
159+
121160

122161

123162
## About contributing

src/index.css

Lines changed: 43 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -253,79 +253,47 @@ body,input,div,h3,h4,p,label,hr, #scrumReport{
253253
}
254254

255255
.tooltip-bubble {
256-
visibility: hidden;
257-
opacity: 0;
258-
position: absolute;
259-
background-color: #1f2937;
260-
color: white;
261-
text-align: left;
262-
padding: 12px;
263-
border-radius: 8px;
264-
font-size: 12px;
265-
line-height: 1.4;
256+
position: fixed !important;
257+
z-index: 9999;
258+
background: #f9fafb;
259+
color: #222;
260+
border-radius: 10px;
261+
border: 1px solid #e5e7eb;
262+
box-shadow: 0 4px 24px 0 rgba(0,0,0,0.12), 0 1.5px 4px 0 rgba(0,0,0,0.08);
263+
padding: 14px 18px;
264+
font-size: 13px;
265+
line-height: 1.5;
266+
min-width: 220px;
267+
max-width: 320px;
266268
white-space: normal;
267-
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
268-
z-index: 1000;
269-
transition: opacity 0.3s ease, visibility 0.3s ease;
270-
width: 280px;
269+
opacity: 0;
270+
pointer-events: none;
271+
transition: opacity 0.18s;
271272
}
272273

273-
.tooltip-bubble {
274-
bottom: 125%;
275-
left: 150%;
276-
transform: translateX(-50%);
274+
.tooltip-container:hover .tooltip-bubble,
275+
.tooltip-container:focus-within .tooltip-bubble {
276+
opacity: 1;
277+
pointer-events: auto;
278+
}
279+
280+
.tooltip-bubble a {
281+
color: #2563eb;
282+
text-decoration: underline;
277283
}
278284

279285
.tooltip-bubble::after {
280286
content: "";
281287
position: absolute;
282-
top: 100%;
283-
left: 50%;
284-
margin-left: -5px;
285-
border-width: 5px;
288+
width: 0; height: 0;
286289
border-style: solid;
287-
border-color: #1f2937 transparent transparent transparent;
288-
}
289-
290-
.tooltip-container.tooltip-bottom .tooltip-bubble {
291-
top: 125%;
292-
bottom: auto;
293-
}
294-
295-
.tooltip-container.tooltip-bottom .tooltip-bubble::after {
296-
top: -10px;
297-
border-color: transparent transparent #1f2937 transparent;
298-
}
299-
300-
.tooltip-container.tooltip-right .tooltip-bubble {
301-
top: -5px;
302-
left: 125%;
303-
bottom: auto;
304-
transform: none;
305-
}
306-
307-
.tooltip-container.tooltip-right .tooltip-bubble::after {
308-
top: 15px;
309-
left: -10px;
310-
border-color: transparent #1f2937 transparent transparent;
311-
}
312-
313-
.tooltip-container:hover .tooltip-bubble {
314-
visibility: visible;
315-
opacity: 1;
316-
}
317-
318-
.dark-mode .question-icon {
319-
color: #9ca3af;
320290
}
321291

322-
.dark-mode .question-icon:hover {
323-
color: #60a5fa;
324-
}
325292

326293
.dark-mode .tooltip-bubble {
327-
background-color: #374151;
328-
border: 1px solid #4b5563;
294+
background: #f3f4f6;
295+
color: #222;
296+
border: 1px solid #374151;
329297
}
330298

331299
.dark-mode .tooltip-bubble::after {
@@ -364,4 +332,19 @@ body,input,div,h3,h4,p,label,hr, #scrumReport{
364332
box-shadow: 0 0 0 2px #3b82f6;
365333
opacity: 0.7;
366334
transform: translateX(8px) scale(1.03);
335+
}
336+
337+
.dark-mode #githubToken,
338+
.dark-mode .token-preview-char {
339+
background: #404040 !important;
340+
border-color: #505050 !important;
341+
color: #fff !important;
342+
}
343+
344+
.dark-mode .token-preview-dot {
345+
background: #9ca3af !important;
346+
}
347+
348+
.dark-mode .token-preview-char {
349+
box-shadow: 0 1px 4px rgba(0,0,0,0.18);
367350
}

src/popup.html

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,28 @@ <h6 class="text-base font-semibold">Scrum Report</h6>
113113

114114
<div class="">
115115
<div class="flex items-center justify-between">
116-
<h4>Your Github Token</h4>
116+
<div class="flex">
117+
<h4>Your Github Token</h4>
118+
<span class="tooltip-container">
119+
<i class="fa fa-question-circle question-icon"></i>
120+
<span class="tooltip-bubble">
121+
<b>Why use a GitHub Token?</b><br>
122+
Using a personal access token allows the extension to make authenticated requests to GitHub, increasing your API rate limit and enabling access to private repositories (if you grant those permissions).<br><br>
123+
<b>How to obtain:</b><br>
124+
1. Go to <a href="https://github.com/settings/tokens" target="_blank" style="color:#2563eb;text-decoration:underline;">GitHub Developer Settings</a>.<br>
125+
2. Click "Fine-grained tokens" or "Personal access tokens".<br>
126+
3. Click "Generate new token", select scopes (at least <code>repo</code> and <code>read:user</code>), and copy the token.<br>
127+
4. Paste it here.<br>
128+
<i>Keep your token secret!</i>
129+
</span>
130+
</span>
131+
</div>
117132
<button id="toggleTokenVisibility" type="button" class="focus:outline-none">
118133
<i id="tokenEyeIcon" class="fa fa-eye text-gray-600"></i>
119134
</button>
120135
</div>
121136
<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">
122-
<p class="text-sm font-medium">Enter cache TTL <span class="text-sm text-gray-800 font-normal">(in minutes)</span>
137+
<p class="text-sm font-medium">Enter cache TTL <span class="text-sm font-normal">(in minutes)</span>
123138
<span class="tooltip-container">
124139
<i class="fa fa-question-circle question-icon"></i>
125140
<span class="tooltip-bubble">

src/scripts/popup.js

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,28 @@ document.addEventListener('DOMContentLoaded', function() {
8383
if(settingsIcon){
8484
settingsIcon.src = isDarkMode ? 'icons/settings-night.png' : 'icons/settings-light.png';
8585
}
86+
renderTokenPreview();
8687
});
8788

89+
function renderTokenPreview() {
90+
tokenPreview.innerHTML = '';
91+
const value = githubTokenInput.value;
92+
const isDark = document.body.classList.contains('dark-mode');
93+
for (let i = 0; i < value.length; i++) {
94+
const charBox = document.createElement('span');
95+
charBox.className = 'token-preview-char' + (isDark ? ' dark-mode' : '');
96+
if (tokenVisible) {
97+
charBox.textContent = value[i];
98+
} else {
99+
const dot = document.createElement('span');
100+
dot.className = 'token-preview-dot' + (isDark ? ' dark-mode' : '');
101+
charBox.appendChild(dot);
102+
}
103+
tokenPreview.appendChild(charBox);
104+
setTimeout(() => charBox.classList.add('flip'), 10 + i * 30);
105+
}
106+
}
107+
88108
function updateContentState(enableToggle) {
89109
const elementsToToggle = [
90110
'startingDate',
@@ -314,6 +334,46 @@ document.addEventListener('DOMContentLoaded', function() {
314334

315335
});
316336

337+
// Tooltip bubble
338+
document.querySelectorAll('.tooltip-container').forEach(container => {
339+
const bubble = container.querySelector('.tooltip-bubble');
340+
if (!bubble) return;
341+
342+
function positionTooltip() {
343+
const icon = container.querySelector('.question-icon') || container;
344+
const rect = icon.getBoundingClientRect();
345+
const bubbleRect = bubble.getBoundingClientRect();
346+
const padding = 8;
347+
348+
let top = rect.top + window.scrollY;
349+
let left = rect.right + padding + window.scrollX;
350+
351+
if (left + bubbleRect.width > window.innerWidth - 10) {
352+
left = rect.left - bubbleRect.width - padding + window.scrollX;
353+
}
354+
if (left < 8) left = 8;
355+
if (top + bubbleRect.height > window.innerHeight - 10) {
356+
top = rect.top - bubbleRect.height - padding + window.scrollY;
357+
}
358+
if (top < 8) top = 8;
359+
360+
bubble.style.left = left + 'px';
361+
bubble.style.top = top + 'px';
362+
}
363+
364+
container.addEventListener('mouseenter', positionTooltip);
365+
container.addEventListener('focusin', positionTooltip);
366+
container.addEventListener('mousemove', positionTooltip);
367+
container.addEventListener('mouseleave', () => {
368+
bubble.style.left = '';
369+
bubble.style.top = '';
370+
});
371+
container.addEventListener('focusout', () => {
372+
bubble.style.left = '';
373+
bubble.style.top = '';
374+
});
375+
});
376+
317377
// Radio button click handlers with toggle functionality
318378
document.querySelectorAll('input[name="timeframe"]').forEach(radio => {
319379
radio.addEventListener('click', function() {

0 commit comments

Comments
 (0)