Skip to content

task done#529

Closed
jeetvasoya21 wants to merge 2 commits into
GitMetricsLab:mainfrom
jeetvasoya21:#518
Closed

task done#529
jeetvasoya21 wants to merge 2 commits into
GitMetricsLab:mainfrom
jeetvasoya21:#518

Conversation

@jeetvasoya21
Copy link
Copy Markdown
Contributor

@jeetvasoya21 jeetvasoya21 commented May 25, 2026

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.ts
  • Created a custom hook to analyze daily GitHub activity

  • Detects:

    • Commits
    • Pull requests
    • Issues
    • Repository interactions
  • Calculates contribution streaks

  • Returns structured activity analytics using an ActivityStatus interface


New Utility Functions

activityReminders.ts

Added reusable helper utilities including:

  • generateReminders()

    • Generates motivational and reminder messages dynamically
  • generateStreakData()

    • Calculates streak progress and milestone messaging
  • calculateProductivityScore()

    • Generates a dynamic productivity score (0–100)
  • getActivityColor()

    • Returns color indicators based on contribution levels
  • Additional helper functions for analytics and activity evaluation


New UI Component

ActivityReminder.tsx

Created 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:

    • Commits
    • PRs
    • Issues
    • Interactions

Tracker Integration

Tracker.tsx
  • Integrated the activity reminder system into the dashboard
  • Added required hook and component imports
  • Added conditional rendering after GitHub data loads successfully

Documentation

ACTIVITY_REMINDER_FEATURE.md
  • Added complete feature documentation and implementation details

Key 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

  • Displays only for authenticated users
  • Appears after GitHub data is successfully fetched
  • Hidden during loading states
  • Fully decoupled from existing dashboard functionality

How Has This Been Tested?

Functional Testing

  • Verified activity data loads correctly after authentication
  • Confirmed commits, PRs, issues, and interactions are detected properly
  • Tested streak calculations with varying contribution scenarios
  • Validated productivity score updates dynamically

UI Testing

  • Confirmed responsive layout across screen sizes
  • Verified progress bars, alerts, and checklist rendering
  • Tested color-coded activity indicators

Integration Testing

  • Ensured ActivityReminder renders correctly inside Tracker.tsx
  • Confirmed no interference with existing GitHub Tracker features
  • Verified loading and authenticated states behave correctly

Stability Testing

  • Checked workspace for TypeScript and linting issues
  • Confirmed zero breaking changes to existing functionality

Screenshots (if applicable)

  • Added screenshots for:

    • Activity reminder dashboard card
    • Contribution streak display
    • Productivity score progress bar
    • Motivational reminder alerts
    • Activity checklist UI
Screenshot 2026-05-25 220247

Type of Change

  • Bug fix
  • New feature
  • Code style update
  • Breaking change
  • Documentation update

Summary by CodeRabbit

  • New Features

    • Added Daily Activity Reminder System to the GitHub Tracker dashboard, displaying daily activity status, contribution streaks, productivity scores, and personalized motivational reminders.
    • Added Activity Breakdown summary showing today's contributions and activity patterns.
  • Documentation

    • Added comprehensive guide for the Daily Activity Reminder feature, including usage, technical overview, and troubleshooting.

Review Change Stack

Requested Features Added:
Developer Activity Reminder & Motivation System
@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 2d2b9af
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a14831886f2e80008482648
😎 Deploy Preview https://deploy-preview-529--github-spy.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

Warning

Review limit reached

@jeetvasoya21, we couldn't start this review because you've used your available PR reviews for now.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d1c34c22-1bf6-4abb-9b15-1f414b852ea5

📥 Commits

Reviewing files that changed from the base of the PR and between 67be97a and 2d2b9af.

📒 Files selected for processing (5)
  • ACTIVITY_REMINDER_FEATURE.md
  • src/components/ActivityReminder.tsx
  • src/hooks/useGitHubActivity.ts
  • src/pages/Tracker/Tracker.tsx
  • src/utils/dateUtils.ts
📝 Walkthrough

Walkthrough

This 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.

Changes

Daily Activity Reminder System

Layer / File(s) Summary
Activity Status Type & Computation
src/hooks/useGitHubActivity.ts
Defines the ActivityStatus interface modeling daily GitHub activity (inactivity flags, contribution counts, streaks, and last activity date) and implements the useGitHubActivity hook that computes it by filtering today's issues and PRs, calculating consecutive contribution streaks from sorted activity dates, and deriving boolean and count fields.
Activity Display Utilities
src/utils/activityReminders.ts
Provides utility functions that transform ActivityStatus into user-facing display values: generateReminders produces conditional alert messages, generateStreakData computes streak risk and tiered motivational messages, getActivitySummary creates activity labels, getActivityColor maps status to color variants, calculateProductivityScore computes a 0–100 score from activity signals and streak bonuses, and getMotivationLevel converts streak length to motivation categories.
ActivityReminder Component UI
src/components/ActivityReminder.tsx
Implements a React component rendering four MUI card sections: a Daily Activity Status card with conditional icon and contribution count, a Streak & Productivity Score card with progress bar visualization, optional Activity Reminders alerts, and an Activity Breakdown card showing checkmarks for commits, PRs opened, PRs merged, and issues. All values are derived from the activity prop via memoized utility calls.
Tracker Page Integration
src/pages/Tracker/Tracker.tsx
Integrates the reminder feature by importing useGitHubActivity and ActivityReminder, invoking the hook with the page's issues and PRs, and conditionally rendering the reminder component when a user is authenticated, not loading, and has at least one item available.
Feature Documentation
ACTIVITY_REMINDER_FEATURE.md
Documents the Daily Activity Reminder System user-facing behavior, data computation logic, usage steps, token requirements, technical architecture, limitations, future enhancements, troubleshooting, and feedback channels.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

type:feature, level:intermediate, quality:clean

Poem

🐰 A reminder system hops into view,
Tracking streaks and keeping you true.
Daily activity, scores, and motivation shine,
Contributing habits, one day at a time. ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The PR title 'task done' is vague and generic, providing no meaningful information about the implementation of the developer activity reminder system. Consider a more descriptive title such as 'Add Developer Activity Reminder & Motivation System' to clearly communicate the main change.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check ✅ Passed The PR description is comprehensive and follows the template structure with all required sections populated including related issue, detailed description, testing details, screenshots, and type of change.
Linked Issues check ✅ Passed All core requirements from issue #518 are met: daily activity tracking (commits, PRs, issues), contribution streak calculation, activity status display, motivational reminders, dynamic score calculation, responsive Material-UI integration, and no disruption to existing features.
Out of Scope Changes check ✅ Passed All changes align with the linked issue #518 objectives: new hook for activity analysis, utility functions for reminders/scoring, ActivityReminder UI component, Tracker integration, and documentation are all directly addressing the feature request requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 win

Clarify 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

📥 Commits

Reviewing files that changed from the base of the PR and between 6c6bc3e and 67be97a.

📒 Files selected for processing (5)
  • ACTIVITY_REMINDER_FEATURE.md
  • src/components/ActivityReminder.tsx
  • src/hooks/useGitHubActivity.ts
  • src/pages/Tracker/Tracker.tsx
  • src/utils/activityReminders.ts

## How It Works

### Data Collection
The system analyzes GitHub activity data from the last 30 days by default and identifies:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 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' || true

Repository: 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 . || true

Repository: 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' || true

Repository: 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.tsx

Repository: 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.ts

Repository: 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.tsx

Repository: 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.tsx

Repository: GitMetricsLab/github_tracker

Length of output: 10694


Correct the “last 30 days by default” documentation

  • ACTIVITY_REMINDER_FEATURE.md says the feature analyzes “the last 30 days by default”, but the code does not enforce any fixed 30-day lookback in GitHub queries: useGitHubData only applies created:>=startDate / created:<=endDate when filters are provided, while src/pages/Tracker/Tracker.tsx calls fetchData(username, page + 1, ROWS_PER_PAGE) with no filters.
  • The “Start Date/End Date” inputs only filter the already-loaded issues/prs client-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).

Comment thread ACTIVITY_REMINDER_FEATURE.md Outdated
Comment thread ACTIVITY_REMINDER_FEATURE.md Outdated
Comment thread src/components/ActivityReminder.tsx
Comment thread src/hooks/useGitHubActivity.ts
Comment on lines +79 to +99
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);
}
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

Comment thread src/pages/Tracker/Tracker.tsx Outdated
@codedbydollys10
Copy link
Copy Markdown
Contributor

dude @jeetvasoya21 that issue was assigned to me i created it.

@mehul-m-prajapati
Copy link
Copy Markdown
Collaborator

not working

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature Request: Add Developer Activity Reminder & Motivation System

3 participants