-
Notifications
You must be signed in to change notification settings - Fork 152
Fix: Show message when user have no activity for selected days #390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 6 commits
d271760
0bf3777
6ac51e5
5957c56
503bd90
ca50732
263ca8b
f622bd6
15b4a31
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1000,20 +1000,16 @@ function allIncluded(outputTarget = 'email') { | |||||||||||||||||||||||||||
| log('[DEBUG] Both data processing functions completed, generating scrum body'); | ||||||||||||||||||||||||||||
| if (subjectForEmail) { | ||||||||||||||||||||||||||||
| // Synchronized subject and body injection for email | ||||||||||||||||||||||||||||
| let lastWeekUl = '<ul>'; | ||||||||||||||||||||||||||||
| for (let i = 0; i < lastWeekArray.length; i++) lastWeekUl += lastWeekArray[i]; | ||||||||||||||||||||||||||||
| for (let i = 0; i < reviewedPrsArray.length; i++) lastWeekUl += reviewedPrsArray[i]; | ||||||||||||||||||||||||||||
| lastWeekUl += '</ul>'; | ||||||||||||||||||||||||||||
| let nextWeekUl = '<ul>'; | ||||||||||||||||||||||||||||
| for (let i = 0; i < nextWeekArray.length; i++) nextWeekUl += nextWeekArray[i]; | ||||||||||||||||||||||||||||
| nextWeekUl += '</ul>'; | ||||||||||||||||||||||||||||
| const lastWeekUl = buildActivityListHtml(); | ||||||||||||||||||||||||||||
| const nextWeekUl = buildNextWeekListHtml(); | ||||||||||||||||||||||||||||
| const blockerText = buildBlockerTextHtml(); | ||||||||||||||||||||||||||||
| const weekOrDay = yesterdayContribution ? 'yesterday' : 'the period'; | ||||||||||||||||||||||||||||
| const weekOrDay2 = 'today'; | ||||||||||||||||||||||||||||
| let content; | ||||||||||||||||||||||||||||
| if (yesterdayContribution) { | ||||||||||||||||||||||||||||
| content = `<b>1. What did I do ${weekOrDay}?</b><br>${lastWeekUl}<br><b>2. What do I plan to do ${weekOrDay2}?</b><br>${nextWeekUl}<br><b>3. What is blocking me from making progress?</b><br>${userReason}`; | ||||||||||||||||||||||||||||
| content = `<b>1. What did I do ${weekOrDay}?</b><br>${lastWeekUl}<br><b>2. What do I plan to do ${weekOrDay2}?</b><br>${nextWeekUl}<br><b>3. What is blocking me from making progress?</b><br>${blockerText}`; | ||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||
| content = `<b>1. What did I do from ${formatDate(startingDate)} to ${formatDate(endingDate)}?</b><br>${lastWeekUl}<br><b>2. What do I plan to do ${weekOrDay2}?</b><br>${nextWeekUl}<br><b>3. What is blocking me from making progress?</b><br>${userReason}`; | ||||||||||||||||||||||||||||
| content = `<b>1. What did I do from ${formatDate(startingDate)} to ${formatDate(endingDate)}?</b><br>${lastWeekUl}<br><b>2. What do I plan to do ${weekOrDay2}?</b><br>${nextWeekUl}<br><b>3. What is blocking me from making progress?</b><br>${blockerText}`; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
| // Wait for both subject and body to be available, then inject both | ||||||||||||||||||||||||||||
| let injected = false; | ||||||||||||||||||||||||||||
|
|
@@ -1041,20 +1037,42 @@ function allIncluded(outputTarget = 'email') { | |||||||||||||||||||||||||||
| return date.toLocaleDateString('en-US', options); | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| function buildActivityListHtml() { | ||||||||||||||||||||||||||||
| if (lastWeekArray.length === 0 && reviewedPrsArray.length === 0) { | ||||||||||||||||||||||||||||
| return '<span style="display: inline-block; padding: 0 8px; margin: 0; line-height: 1.2;">No activity to report for the selected time period.</span>'; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| let activityList = '<ul>'; | ||||||||||||||||||||||||||||
| for (let i = 0; i < lastWeekArray.length; i++) activityList += lastWeekArray[i]; | ||||||||||||||||||||||||||||
| for (let i = 0; i < reviewedPrsArray.length; i++) activityList += reviewedPrsArray[i]; | ||||||||||||||||||||||||||||
| activityList += '</ul>'; | ||||||||||||||||||||||||||||
| return activityList; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
Comment on lines
+1041
to
+1051
|
||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| function buildNextWeekListHtml() { | ||||||||||||||||||||||||||||
| if (nextWeekArray.length === 0) { | ||||||||||||||||||||||||||||
| return '<span style="display: inline-block; padding: 0 8px; margin: 0; line-height: 1.2;">No plans added yet.</span>'; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| let nextWeekList = '<ul>'; | ||||||||||||||||||||||||||||
| for (let i = 0; i < nextWeekArray.length; i++) nextWeekList += nextWeekArray[i]; | ||||||||||||||||||||||||||||
| nextWeekList += '</ul>'; | ||||||||||||||||||||||||||||
| return nextWeekList; | ||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||
| function buildBlockerTextHtml() { | ||||||||||||||||||||||||||||
| return `<span style="display: inline-block; padding: 0 8px; margin: 0; line-height: 1.2;">${userReason}</span>`; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
| function buildBlockerTextHtml() { | |
| return `<span style="display: inline-block; padding: 0 8px; margin: 0; line-height: 1.2;">${userReason}</span>`; | |
| function escapeHtml(str) { | |
| return String(str) | |
| .replace(/&/g, '&') | |
| .replace(/</g, '<') | |
| .replace(/>/g, '>') | |
| .replace(/"/g, '"') | |
| .replace(/'/g, '''); | |
| } | |
| function buildBlockerTextHtml() { | |
| return `<span style="display: inline-block; padding: 0 8px; margin: 0; line-height: 1.2;">${escapeHtml(userReason)}</span>`; |
Outdated
Copilot
AI
Mar 3, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableToggle is referenced here but it is not defined anywhere in scrumHelper.js (and a repo-wide search only finds it being removed from storage in popup.js). This will throw a ReferenceError when writeScrumBody() runs in the non-email path. Remove this guard or replace it with a locally-defined flag (e.g., read from storage) and a safe check that won’t crash when undefined.
| if (!enableToggle) { | |
| let isEnabled = true; | |
| if (typeof enableToggle !== 'undefined' && !enableToggle) { | |
| isEnabled = false; | |
| } | |
| if (!isEnabled) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same long inline
style="display: inline-block; padding: 0 8px; margin: 0; line-height: 1.2;"string is hard-coded in multiple helpers (activity, next-week, blockers). Consider extracting it into a constant or a shared wrapper helper (or a CSS class) to avoid duplication and keep formatting changes centralized.