task done#529
Conversation
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Warning Review limit reached
Your plan includes 1 review of capacity. Refill in 25 minutes and 16 seconds. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more review capacity refills, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than trial, open-source, and free plans. In all cases, review capacity refills continuously over time. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThis PR implements a complete Daily Activity Reminder System for the GitHub Tracker dashboard. It adds activity computation from GitHub data, transformation utilities for display values, a new React component rendering activity status and streak information, integration into the Tracker page, and comprehensive feature documentation. ChangesDaily Activity Reminder System
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Nitpick comments (2)
ACTIVITY_REMINDER_FEATURE.md (2)
10-10: ⚡ Quick win"Real-time" is misleading terminology.
The feature analyzes GitHub data that has already been fetched via API calls, rather than tracking activity in real time. Consider rewording to "Activity Tracking" or "Recent Activity Analysis" for accuracy.
📝 Suggested rewording
- - **Real-time Activity Tracking**: Monitors commits, pull requests, issues, and other GitHub activities throughout the day + - **Activity Tracking**: Analyzes commits, pull requests, issues, and other GitHub activities from your fetched GitHub data🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ACTIVITY_REMINDER_FEATURE.md` at line 10, Replace the misleading header text "**Real-time Activity Tracking**" in ACTIVITY_REMINDER_FEATURE.md with a more accurate phrase such as "Activity Tracking" or "Recent Activity Analysis" (or similar wording), so the description "Monitors commits, pull requests, issues, and other GitHub activities throughout the day" correctly reflects that data is analyzed after being fetched via API rather than being tracked in real time.
58-58: ⚡ Quick winClarify timezone earlier in the document.
The timezone (UTC) is only mentioned in the Limitations section (line 127), but it's critical for understanding what counts as "today's activity." Consider adding a timezone note in the "Daily Activity" section (line 58) or "How It Works" section for clarity.
📝 Suggested addition
Add a note in the "Daily Activity" subsection:
### Data Collection The system analyzes GitHub activity data from the last 30 days by default and identifies: - **Commits**: Estimated from PR creation activity - **Pull Requests**: Tracked separately as opened and merged - **Issues**: Issues created or interacted with -- **Daily Activity**: All contributions made within a 24-hour period +- **Daily Activity**: All contributions made within a 24-hour period (based on UTC timezone)Also applies to: 127-127
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@ACTIVITY_REMINDER_FEATURE.md` at line 58, The "Daily Activity" definition lacks an explicit timezone, causing ambiguity; update the ACTIVITY_REMINDER_FEATURE.md by adding a short timezone note (e.g., "All times are in UTC") to the "Daily Activity" subsection (the line containing "**Daily Activity**: All contributions made within a 24-hour period") or the nearby "How It Works" heading so readers immediately know which timezone defines "today"; ensure the wording matches the existing style and mirrors the existing UTC mention from the Limitations section.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@ACTIVITY_REMINDER_FEATURE.md`:
- Line 101: Update the documentation to reflect that the ActivityReminder
component is only available to authenticated users and therefore requires a
Personal Access Token (PAT); replace the line stating "The feature works with or
without a token" with a clear statement that authentication (a PAT) is required
to view/use the ActivityReminder UI, and ensure the doc references the same auth
behavior used in the integration logic and PR objectives (ActivityReminder
component visibility and any authentication gating code).
- Around line 106-108: Update the docs to reference the actual exported symbols
instead of a non-existent `activityReminders` export: keep `useGitHubActivity`
and `ActivityReminder` as written, and replace `activityReminders` with the
actual exported utility function names (e.g. `generateReminders`,
`generateStreakData`, `getActivitySummary`, etc.) so the README matches the
module exports; ensure you list the precise exported function names from the
utilities module rather than the module filename.
- Line 54: The docs claim a "last 30 days by default" window but the code does
not enforce a 30-day GitHub query; update implementation so server/client
behavior matches the doc: modify useGitHubData (the filter application logic
around created:>=startDate / created:<=endDate) and the fetchData call site in
src/pages/Tracker/Tracker.tsx (where fetchData(username, page + 1,
ROWS_PER_PAGE) is invoked) to apply a default startDate = today - 30 days and
endDate = today when no filters are provided, and ensure the Start Date/End Date
inputs still perform client-side filtering of issues/prs arrays while the GitHub
query itself is constrained by the default 30-day window (adjust any variable
names like issues and prs usage to pass the default filters through).
In `@src/components/ActivityReminder.tsx`:
- Around line 28-36: The ActivityReminderProps declares a username and
ActivityReminder component destructures username but never uses it, causing an
unused-variable lint error; either remove username from ActivityReminderProps
and the destructuring in the ActivityReminder component, or update the
ActivityReminder component to reference the username where appropriate (e.g.,
include it in rendered text or logic) so the prop is actually used; target the
ActivityReminderProps interface and the ActivityReminder functional component's
parameter destructuring to apply the change.
In `@src/hooks/useGitHubActivity.ts`:
- Around line 42-57: The code currently derives todaysMergedPRs from todaysPRs
(PRs created today), which misses PRs created earlier but merged today; in
useGitHubActivity.ts change the logic so todaysMergedPRs is computed by
filtering prs (not todaysPRs) for entries where pull_request?.merged_at exists
and the merged_at date normalized to midnight equals today.getTime(), then set
hasMergedPRToday = todaysMergedPRs.length > 0; keep todaysPRs/todaysOpenPRs
logic unchanged and reuse the existing today normalization routine when
comparing merged_at.
- Around line 79-99: The code currently only computes a contribution streak when
hasActivityToday is true, which forces contributionStreak to remain 0 on days
without activity; update the logic in useGitHubActivity.ts so streak calculation
runs regardless of activity today by initializing contributionStreak based on
whether there was activity today (e.g., start at 1 if hasActivityToday else 0)
then iterate allActivity comparing item.created_at to currentDate (use
itemDate.setHours(0,0,0,0) and currentDate normalized) decrementing currentDate
and incrementing contributionStreak for each consecutive matching day; ensure
the initial currentDate used for the backward loop is set to yesterday if
activity exists today or remains today if not, so streak-at-risk can be
correctly detected.
In `@src/pages/Tracker/Tracker.tsx`:
- Around line 338-340: The ActivityReminder is incorrectly gated by
(issues.length > 0 || prs.length > 0) so users with no current issues/PRs won't
see inactivity reminders; update the JSX conditional to render <ActivityReminder
activity={activity} username={username} /> whenever username exists and loading
is false (i.e., remove the issues/prs length check), locating the conditional
near the render that references ActivityReminder, username, loading, issues, and
prs.
---
Nitpick comments:
In `@ACTIVITY_REMINDER_FEATURE.md`:
- Line 10: Replace the misleading header text "**Real-time Activity Tracking**"
in ACTIVITY_REMINDER_FEATURE.md with a more accurate phrase such as "Activity
Tracking" or "Recent Activity Analysis" (or similar wording), so the description
"Monitors commits, pull requests, issues, and other GitHub activities throughout
the day" correctly reflects that data is analyzed after being fetched via API
rather than being tracked in real time.
- Line 58: The "Daily Activity" definition lacks an explicit timezone, causing
ambiguity; update the ACTIVITY_REMINDER_FEATURE.md by adding a short timezone
note (e.g., "All times are in UTC") to the "Daily Activity" subsection (the line
containing "**Daily Activity**: All contributions made within a 24-hour period")
or the nearby "How It Works" heading so readers immediately know which timezone
defines "today"; ensure the wording matches the existing style and mirrors the
existing UTC mention from the Limitations section.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: efb13bed-ad08-4441-a803-ea52e711baea
📒 Files selected for processing (5)
ACTIVITY_REMINDER_FEATURE.mdsrc/components/ActivityReminder.tsxsrc/hooks/useGitHubActivity.tssrc/pages/Tracker/Tracker.tsxsrc/utils/activityReminders.ts
| ## How It Works | ||
|
|
||
| ### Data Collection | ||
| The system analyzes GitHub activity data from the last 30 days by default and identifies: |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Check if the 30-day window is configurable or hard-coded
# Search for 30-day calculations or configurations
rg -n "30.*day|days.*30" src/hooks/useGitHubActivity.ts src/utils/activityReminders.ts
# Look for any configuration or parameter that might control the time window
ast-grep --pattern 'const $_ = 30'Repository: GitMetricsLab/github_tracker
Length of output: 54
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== ACTIVITY_REMINDER_FEATURE.md excerpt (around line 54) =="
nl -ba ACTIVITY_REMINDER_FEATURE.md | sed -n '40,80p'
echo
echo "== Repo-wide search for 30-day wording =="
rg -n --hidden --no-ignore-vcs -S "last 30 days|30[- ]day|30 days|thirty" \
-g'*.md' -g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx' -g'*.json' -g'*.yml' -g'*.yaml' || true
echo
echo "== Search for numeric 30-day windows (seconds/days multipliers) =="
rg -n --hidden --no-ignore-vcs -S \
"30\s*\*\s*24\s*\*\s*60|30\s*\*\s*24\s*\*|2592000|time.*30|days?.*30" \
-g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx' || true
echo
echo "== Find likely integration files (Tracker.tsx, reminder/activity code) =="
fd -e ts -e tsx -e js -e jsx -a "Tracker.tsx" . || true
fd -e ts -e tsx -e js -e jsx -a "useGitHubActivity" . || true
fd -e ts -e tsx -e js -e jsx -a "*activity*remind*" . || true
echo
echo "== Search for config keys that might control time window =="
rg -n --hidden --no-ignore-vcs -S \
"config.*(day|days)|days.*(window|range)|time.*(window|range)|reminder.*(day|days)" \
-g'*.ts' -g'*.tsx' -g'*.json' -g'*.yml' -g'*.yaml' || trueRepository: GitMetricsLab/github_tracker
Length of output: 193
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Tool availability =="
for c in rg fd find sed awk head tail; do
command -v "$c" >/dev/null 2>&1 && echo "found: $c" || echo "missing: $c"
done
echo
echo "== ACTIVITY_REMINDER_FEATURE.md excerpt (approx lines 45-75) =="
awk 'NR>=45 && NR<=75 {printf "%d\t%s\n", NR, $0}' ACTIVITY_REMINDER_FEATURE.md
echo
echo "== Repo search for exact 'last 30 days' / '30 days' wording =="
rg -n --hidden --no-ignore-vcs -S "last 30 days|last 30 day|30 days|30-day|30[- ]days" || true
echo
echo "== Repo search for likely time window math =="
rg -n --hidden --no-ignore-vcs -S \
"2592000|30\s*\*\s*24\s*\*\s*60|30\s*\*\s*24\s*\*|time.*(window|range)|days?.*(ago|back)|lookback.*30|past.*30" \
-g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx' -g'*.json' -g'*.yml' -g'*.yaml' || true
echo
echo "== Find likely integration/entry points (Tracker.tsx, activity hooks) =="
if command -v fd >/dev/null 2>&1; then
fd -e ts -e tsx -e js -e jsx -a "Tracker.tsx" . || true
fd -e ts -e tsx -e js -e jsx -a "useGitHubActivity" . || true
fd -e ts -e tsx -e js -e jsx -a "*activity*remind*" . || true
fi
echo
echo "== Repo search for 'display condition' hints (issues/prs) =="
rg -n --hidden --no-ignore-vcs -S "display.*(condition|when)|issues.*pr|pull requests|issues or PRs|some GitHub activity" ACTIVITY_REMINDER_FEATURE.md . || trueRepository: GitMetricsLab/github_tracker
Length of output: 50700
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Repo top-level (quick) =="
find . -maxdepth 2 -type d -name "src" -o -name "app" -o -name "packages" -o -name "frontend" -o -name "." | head
echo
echo "== Search (exclude node_modules) for 30-day window wording =="
rg -n --hidden --no-ignore-vcs -S "last 30 days|30[- ]day|30 days" \
--glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**'
echo
echo
echo "== Search (exclude node_modules) for likely lookback math (days/range) =="
rg -n --hidden --no-ignore-vcs -S \
"2592000|30\s*\*\s*24\s*\*\s*60|30\s*\*\s*24\s*\*|lookback.*30|past.*30|days?.*(ago|back)|time.*window.*30" \
--glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
-g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx'
echo
echo
echo "== Search for reminder/activity/streak implementation entry points =="
rg -n --hidden --no-ignore-vcs -S "activity reminder|Activity Reminder|reminder|streak|daily activity" \
--glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
-g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx'
echo
echo
echo "== Attempt to locate Tracker.tsx and related components =="
fd -e ts -e tsx -e js -e jsx "Tracker\.tsx" . --max-results 20 2>/dev/null || true
fd -e ts -e tsx -e js -e jsx "Tracker" . --max-results 50 2>/dev/null || true
echo
echo
echo "== Search for 'issues or PRs' display condition implementation =="
rg -n --hidden --no-ignore-vcs -S "issues|pull requests|PRs" \
--glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
-g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx'Repository: GitMetricsLab/github_tracker
Length of output: 8203
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== useGitHubActivity.ts (key sections around streak/30-day logic) =="
awk 'NR>=1 && NR<=220 {print}' src/hooks/useGitHubActivity.ts | sed -n '1,220p'
echo
echo "== activityReminders.ts (any 30-day assumptions) =="
awk 'NR>=1 && NR<=260 {print}' src/utils/activityReminders.ts | sed -n '1,260p'
echo
echo "== Tracker.tsx (Activity Reminder display gating) =="
awk 'NR>=300 && NR<=380 {print}' src/pages/Tracker/Tracker.tsx
echo
echo "== useGitHubData.ts (where issues/PRs date range is chosen) =="
rg -n --hidden --no-ignore-vcs -S "created:|updated:|pushed:|since:|startDate|endDate|lookback|daysAgo|30\s*day|30\s*\*" src/hooks/useGitHubData.ts || true
awk 'NR>=1 && NR<=320 {print}' src/hooks/useGitHubData.ts | sed -n '1,320p'
echo
echo "== Repo-wide search (exclude node_modules) for 30-day window in source =="
rg -n --hidden --no-ignore-vcs -S "last\s*30\s*day|last\s*30\s*days|\b30\s*days\b|30[- ]day|daysAgo|lookback.*30|created:.*30|since:.*30" \
--glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
-g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx' || trueRepository: GitMetricsLab/github_tracker
Length of output: 17521
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== ACTIVITY_REMINDER_FEATURE.md around Historical Data (110-140) =="
awk 'NR>=105 && NR<=145 {print}' ACTIVITY_REMINDER_FEATURE.md
echo
echo "== Where useGitHubData startDate/endDate are set/passed =="
rg -n --hidden --no-ignore-vcs -S "startDate\s*:|endDate\s*:|filters\.startDate|filters\.endDate|fetchData\(" src --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' -g'*.ts' -g'*.tsx' -g'*.js' -g'*.jsx'
echo
echo "== Search for default 30-day lookback math =="
rg -n --hidden --no-ignore-vcs -S \
"startDate.*-.*30|endDate.*-.*30|30\s*\*\s*24\s*\*\s*60\s*\*\s*60|30\s*\*\s*24\s*\*\s*60|30\s*\*\s*24|30\s*days|last 30|lookback|DEFAULT_.*30|DAYS.*30" \
src --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**'
echo
echo "== Tracker.tsx: locate fetchData call + any filters construction =="
rg -n --hidden --no-ignore-vcs -S "fetchData\(" src/pages/Tracker/Tracker.tsx
awk 'NR>=1 && NR<=260 {print}' src/pages/Tracker/Tracker.tsxRepository: GitMetricsLab/github_tracker
Length of output: 2688
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Tracker.tsx: search for startDate/endDate/30-day/filters =="
rg -n --hidden --no-ignore-vcs -S "startDate|endDate|filters|created:>=|created:<=" src/pages/Tracker/Tracker.tsx src/pages/ContributorProfile/ContributorProfile.tsx || true
echo
echo "== Tracker.tsx: search for '30' near date/window usage =="
rg -n --hidden --no-ignore-vcs -S "30" src/pages/Tracker/Tracker.tsx src/pages/ContributorProfile/ContributorProfile.tsx || true
echo
echo "== Tracker.tsx: inspect around the fetchData calls (lines ~60-110) =="
awk 'NR>=60 && NR<=120 {print}' src/pages/Tracker/Tracker.tsx
echo
echo "== Tracker.tsx: inspect around any helper that builds filters (whole file, but limited output) =="
rg -n --hidden --no-ignore-vcs -S "FetchFilters|filters|startDate|endDate" src/pages/Tracker/Tracker.tsx || true
echo
echo "== useGitHubData.ts: check for any default date range constants =="
rg -n --hidden --no-ignore-vcs -S "30|last 30|lookback|window|daysAgo|DEFAULT" src/hooks/useGitHubData.ts || true
echo
echo "== useGitHubData.ts: inspect top 120 lines to ensure no hidden date logic =="
awk 'NR>=1 && NR<=160 {print}' src/hooks/useGitHubData.tsRepository: GitMetricsLab/github_tracker
Length of output: 6979
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Tracker.tsx: where startDate/endDate are mutated =="
rg -n "setStartDate|setEndDate" src/pages/Tracker/Tracker.tsx
echo
echo "== Tracker.tsx: any fetchData calls that pass filters (startDate/endDate) =="
rg -n "fetchData\(username|fetchData\(" src/pages/Tracker/Tracker.tsx
echo
echo "== Tracker.tsx: grep for filters object usage with startDate/endDate =="
rg -n "fetchData\(.*filters|filters\s*:\s*\{|startDate\s*,|endDate\s*," src/pages/Tracker/Tracker.tsx || true
echo
echo "== Tracker.tsx: locate date filter UI + how filterData is applied =="
rg -n "startDate|endDate|filterData|currentFilteredData" src/pages/Tracker/Tracker.tsx
echo
echo "== Tracker.tsx: view around filterData (approx 110-190) =="
awk 'NR>=100 && NR<=210 {print NR":"$0}' src/pages/Tracker/Tracker.tsx
echo
echo "== Tracker.tsx: view around input fields / date pickers (approx 240-300) =="
awk 'NR>=230 && NR<=310 {print NR":"$0}' src/pages/Tracker/Tracker.tsxRepository: GitMetricsLab/github_tracker
Length of output: 8198
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "== Search for computed '30 days ago' style logic in src =="
rg -n --hidden --no-ignore-vcs -S \
"30\s*\*\s*24\s*\*\s*60\s*\*\s*60\s*\*|30\s*\*\s*24\s*\*\s*60\s*\*|Date\.now\(\)\s*-\s*.*30|now\(\)\s*-\s*.*30|last 30 days|lookback.*30|DEFAULT_.*30" \
src --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' || true
echo
echo "== Search for 'created:>=' / 'created:<=' being set via filters =="
rg -n --hidden --no-ignore-vcs -S \
"created:>=|created:<=|filters\.startDate|filters\.endDate" \
src --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' || true
echo
echo "== Find where startDate/endDate are used in any fetch/filter wiring =="
rg -n --hidden --no-ignore-vcs -S "startDate|endDate" \
src --glob '!**/node_modules/**' --glob '!**/dist/**' --glob '!**/build/**' \
-g'*.ts' -g'*.tsx' | head -n 80
echo
echo "== Find ROWS_PER_PAGE and how pagination stops/limits fetched range =="
rg -n --hidden --no-ignore-vcs -S "ROWS_PER_PAGE|maxPages|pageLimit|hasMore|infinite|IntersectionObserver|loadMore|onScroll|load more" \
src/pages/Tracker/Tracker.tsx src/pages/ContributorProfile/ContributorProfile.tsx src/hooks/useGitHubData.ts || true
echo
echo "== Inspect Tracker.tsx around ROWS_PER_PAGE and pagination controls =="
rg -n "ROWS_PER_PAGE" src/pages/Tracker/Tracker.tsx
awk 'NR>=1 && NR<=160 {print NR":"$0}' src/pages/Tracker/Tracker.tsx | sed -n '1,160p'
echo
echo "== Inspect Tracker.tsx for load-more/pagination handlers (later portion) =="
awk 'NR>=160 && NR<=260 {print NR":"$0}' src/pages/Tracker/Tracker.tsxRepository: GitMetricsLab/github_tracker
Length of output: 10694
Correct the “last 30 days by default” documentation
ACTIVITY_REMINDER_FEATURE.mdsays the feature analyzes “the last 30 days by default”, but the code does not enforce any fixed 30-day lookback in GitHub queries:useGitHubDataonly appliescreated:>=startDate/created:<=endDatewhen filters are provided, whilesrc/pages/Tracker/Tracker.tsxcallsfetchData(username, page + 1, ROWS_PER_PAGE)with no filters.- The “Start Date/End Date” inputs only filter the already-loaded
issues/prsclient-side (default is empty), so this is not a hard-coded “last 30 days” window. - The display condition (“some GitHub activity (issues or PRs)”) matches the UI gate in
Tracker.tsx(username && !loading && (issues.length > 0 || prs.length > 0)).
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@ACTIVITY_REMINDER_FEATURE.md` at line 54, The docs claim a "last 30 days by
default" window but the code does not enforce a 30-day GitHub query; update
implementation so server/client behavior matches the doc: modify useGitHubData
(the filter application logic around created:>=startDate / created:<=endDate)
and the fetchData call site in src/pages/Tracker/Tracker.tsx (where
fetchData(username, page + 1, ROWS_PER_PAGE) is invoked) to apply a default
startDate = today - 30 days and endDate = today when no filters are provided,
and ensure the Start Date/End Date inputs still perform client-side filtering of
issues/prs arrays while the GitHub query itself is constrained by the default
30-day window (adjust any variable names like issues and prs usage to pass the
default filters through).
| const hasActivityToday = allActivity.some((item) => { | ||
| const itemDate = new Date(item.created_at); | ||
| itemDate.setHours(0, 0, 0, 0); | ||
| return itemDate.getTime() === currentDate.getTime(); | ||
| }); | ||
|
|
||
| if (hasActivityToday) { | ||
| contributionStreak = 1; | ||
| currentDate.setDate(currentDate.getDate() - 1); | ||
|
|
||
| // Count consecutive days backwards | ||
| for (const item of allActivity) { | ||
| const itemDate = new Date(item.created_at); | ||
| itemDate.setHours(0, 0, 0, 0); | ||
|
|
||
| if (itemDate.getTime() === currentDate.getTime()) { | ||
| contributionStreak++; | ||
| currentDate.setDate(currentDate.getDate() - 1); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Streak is incorrectly reset to 0 whenever there is no activity today.
Because Line 85 gates streak computation behind hasActivityToday, inactive days always produce contributionStreak = 0, so “streak at risk” can never trigger.
💡 Proposed fix
- if (hasActivityToday) {
- contributionStreak = 1;
- currentDate.setDate(currentDate.getDate() - 1);
-
- // Count consecutive days backwards
- for (const item of allActivity) {
- const itemDate = new Date(item.created_at);
- itemDate.setHours(0, 0, 0, 0);
-
- if (itemDate.getTime() === currentDate.getTime()) {
- contributionStreak++;
- currentDate.setDate(currentDate.getDate() - 1);
- }
- }
- }
+ const activityDays = new Set(
+ allActivity.map((item) => {
+ const d = new Date(item.created_at);
+ d.setHours(0, 0, 0, 0);
+ return d.getTime();
+ })
+ );
+
+ const streakStart = new Date(currentDate);
+ if (!hasActivityToday) {
+ streakStart.setDate(streakStart.getDate() - 1);
+ }
+
+ while (activityDays.has(streakStart.getTime())) {
+ contributionStreak++;
+ streakStart.setDate(streakStart.getDate() - 1);
+ }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/hooks/useGitHubActivity.ts` around lines 79 - 99, The code currently only
computes a contribution streak when hasActivityToday is true, which forces
contributionStreak to remain 0 on days without activity; update the logic in
useGitHubActivity.ts so streak calculation runs regardless of activity today by
initializing contributionStreak based on whether there was activity today (e.g.,
start at 1 if hasActivityToday else 0) then iterate allActivity comparing
item.created_at to currentDate (use itemDate.setHours(0,0,0,0) and currentDate
normalized) decrementing currentDate and incrementing contributionStreak for
each consecutive matching day; ensure the initial currentDate used for the
backward loop is set to yesterday if activity exists today or remains today if
not, so streak-at-risk can be correctly detected.
|
dude @jeetvasoya21 that issue was assigned to me i created it. |
|
not working |
Requested Features Added:
Developer Activity Reminder & Motivation System
Related Issue
Description
Implemented a comprehensive Developer Activity Reminder & Motivation System for the GitHub Tracker dashboard to help users monitor daily GitHub activity, maintain contribution streaks, and stay motivated through dynamic productivity insights.
Changes Made
New Custom Hook
useGitHubActivity.tsCreated a custom hook to analyze daily GitHub activity
Detects:
Calculates contribution streaks
Returns structured activity analytics using an
ActivityStatusinterfaceNew Utility Functions
activityReminders.tsAdded reusable helper utilities including:
generateReminders()generateStreakData()calculateProductivityScore()getActivityColor()Additional helper functions for analytics and activity evaluation
New UI Component
ActivityReminder.tsxCreated a fully responsive dashboard component featuring:
Daily activity status card
Contribution streak tracker with flame indicator
Productivity score progress visualization
Dynamic motivational reminder alerts
Activity checklist for:
Tracker Integration
Tracker.tsxDocumentation
ACTIVITY_REMINDER_FEATURE.mdKey Features
✨ Real-time GitHub activity tracking
🔥 Contribution streak calculation and risk detection
📊 Dynamic productivity scoring system
💬 Personalized motivational reminders
📋 Visual activity breakdown checklist
🎨 Color-coded contribution feedback
📱 Responsive UI integrated with existing Material-UI theme
Smart Display Logic
How Has This Been Tested?
Functional Testing
UI Testing
Integration Testing
ActivityReminderrenders correctly insideTracker.tsxStability Testing
Screenshots (if applicable)
Added screenshots for:
Type of Change
Summary by CodeRabbit
New Features
Documentation