Skip to content

feat: Add daily GitHub activity reminders and streak tracking#535

Merged
mehul-m-prajapati merged 3 commits into
GitMetricsLab:mainfrom
codedbydollys10:feature/github-activity-reminders
May 29, 2026
Merged

feat: Add daily GitHub activity reminders and streak tracking#535
mehul-m-prajapati merged 3 commits into
GitMetricsLab:mainfrom
codedbydollys10:feature/github-activity-reminders

Conversation

@codedbydollys10
Copy link
Copy Markdown
Contributor

@codedbydollys10 codedbydollys10 commented May 26, 2026

Related Issue


Description

Added a new Daily Activity Status feature to the GitHub Tracker dashboard to encourage consistent GitHub contributions through reminders and streak tracking.

Changes include:

  • Detect daily activity:

    • Commits made today
    • Pull requests opened today
    • Pull requests merged today
    • Issues created/interacted with today
    • Full inactivity detection
  • Added contribution streak calculation based on consecutive active days

  • Added dynamic motivational reminders, such as:

    • 🚀 No commits today
    • 💻 No pull requests opened today
    • 🔥 Contribution streak at risk
    • 📌 Time to make your first contribution today
  • Added a new dashboard section displaying:

    • Current streak
    • Activity summary
    • Reminder messages
    • Daily GitHub engagement status
  • Integrated feature without affecting existing tracker functionality


How Has This Been Tested?

Tested manually for the following scenarios:

  • Existing GitHub Tracker fetch functionality still works
  • Reminder messages appear when no activity exists for today
  • Commit reminders disappear after detecting commits
  • PR/merged PR/issue reminders update dynamically
  • Contribution streak updates correctly
  • Empty states handled without UI breakage
  • Dashboard renders correctly after adding new component

Screenshots (if applicable)

Before

Screenshot 2026-05-26 121504

After

Screenshot 2026-05-26 121758 Screenshot 2026-05-26 121810

Add screenshots showing:

  1. Tracker with active contributions (positive status)
  2. Tracker with inactivity reminders
  3. Contribution streak display
  4. Existing dashboard working normally

Type of Change

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

Summary by CodeRabbit

  • New Features
    • Added Daily Activity Status panel displaying your daily metrics including streak count, commits, PRs opened/merged, and issues.
    • Metrics are color-coded based on activity level.
    • Added reminders section providing alerts for low activity or congratulatory messages for active days.

Review Change Stack

@netlify
Copy link
Copy Markdown

netlify Bot commented May 26, 2026

Deploy Preview for github-spy ready!

Name Link
🔨 Latest commit 7adb3f0
🔍 Latest deploy log https://app.netlify.com/projects/github-spy/deploys/6a19c72e3a72d7000822e551
😎 Deploy Preview https://deploy-preview-535--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 26, 2026

Warning

Review limit reached

@mehul-m-prajapati, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 27 minutes and 21 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, 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 include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: afade60e-c8df-4cb9-8a6f-69c8db1988af

📥 Commits

Reviewing files that changed from the base of the PR and between 1acd66b and 7adb3f0.

📒 Files selected for processing (2)
  • src/hooks/useGitHubData.ts
  • src/pages/Tracker/Tracker.tsx
📝 Walkthrough

Walkthrough

This PR implements a daily activity tracking feature that fetches GitHub contribution metrics (commits, PRs, issues, and a 7-day streak) and displays motivational reminders on the Tracker dashboard. The useGitHubData hook is extended to compute daily activity, a new DailyActivityStatus component renders the metrics and reminders, and the Tracker page conditionally displays the component when data loads.

Changes

Daily Activity Status

Layer / File(s) Summary
Daily Activity data shape and helpers
src/hooks/useGitHubData.ts
DailyActivity interface, date-key derivation, and reminder-text generation based on today's activity counts are introduced.
Daily activity fetching implementation
src/hooks/useGitHubData.ts
fetchDailyActivity queries GitHub search API for commits, PRs, and issues opened/merged today, derives a 7-day contribution streak from user events, and updates state only if the request is still current.
Hook return value extension
src/hooks/useGitHubData.ts
useGitHubData return object now exposes dailyActivity and dailyActivityLoaded.
DailyActivityStatus component
src/components/DailyActivityStatus.tsx
Renders daily metrics as colored Chips and a reminders section with warning/info alerts for inactive areas or a success message when fully active.
Tracker page integration
src/pages/Tracker/Tracker.tsx
Imports component, destructures hook data, and conditionally renders DailyActivityStatus after authentication when data is loaded.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • GitMetricsLab/github_tracker#149: Both PRs extend useGitHubData hook's fetchData workflow and returned state; this one adds daily activity metrics on top of existing issues/PR pagination.
  • GitMetricsLab/github_tracker#255: Both PRs modify useGitHubData and Tracker rendering to add new UI state; this focuses on daily activity reminders while that refactors filtering.

Suggested labels

type:feature, level:intermediate, quality:clean

Poem

🐰 Daily metrics now glow on the screen,
Reminders that nudge you to stay in the scene,
Commits, PRs, issues—all tracked with great care,
Your 7-day streak floats bright in the air! ✨
Motivation served fresh, no more silent despair.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding daily GitHub activity reminders and streak tracking functionality to the tracker dashboard.
Description check ✅ Passed The PR description is comprehensive and follows the template structure with all required sections filled: Related Issue, Description, Testing, Screenshots, and Type of Change.
Linked Issues check ✅ Passed All primary objectives from issue #518 are met: daily activity detection (commits, PRs, issues), streak tracking, motivational reminders, dashboard integration, and preservation of existing functionality.
Out of Scope Changes check ✅ Passed All changes are directly related to the daily activity reminders and streak tracking feature; no unrelated code modifications detected.
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

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

@codedbydollys10
Copy link
Copy Markdown
Contributor Author

hey @mehul-m-prajapati pls check my pr and review it

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/hooks/useGitHubData.ts (1)

292-294: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Reset daily activity loading state when a new fetch starts.

A new fetch starts at Line 292, but dailyActivityLoaded isn’t reset. The UI can temporarily show stale daily status for a previous request/user.

Suggested fix
       setLoading(true);
       setError('');
+      setDailyActivityLoaded(false);

Also applies to: 273-273

🤖 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/useGitHubData.ts` around lines 292 - 294, When starting a new
GitHub fetch in useGitHubData (where you call setLoading(true) and
setError('')), also reset the dailyActivityLoaded flag to false so stale daily
activity isn’t shown; update the same two start-of-fetch sites that call
setLoading/setError (the one that currently calls setLoading(true); setError('')
and the other similar call) to call setDailyActivityLoaded(false) immediately
when the new fetch begins, ensuring you still set it true only after fresh daily
activity is successfully loaded.
🤖 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 `@src/hooks/useGitHubData.ts`:
- Around line 42-43: getDateKey currently uses date.toISOString() (UTC) which
can flip the day near local midnight; replace its implementation to produce a
local YYYY-MM-DD string using date.getFullYear(), date.getMonth()+1 and
date.getDate() with zero-padding so keys reflect the local day; update the other
occurrence that also uses toISOString (the instance referenced around line 217)
to use the same local-date key helper or identical logic to avoid timezone drift
for “today” reminders/streaks.
- Around line 165-167: The current catch blocks in src/hooks/useGitHubData.ts
(the try/catch that returns 0 at the end of the daily activity computation)
swallow errors and convert API failures into a fake "0" activity; change those
catch blocks to propagate failure (either rethrow the caught error or return a
distinct "unavailable" sentinel such as null/undefined) instead of returning 0,
and update any callers of the function (e.g., the hook function that calls the
daily-activity computation) to treat null/undefined as "activity unavailable"
(showing an error state or retry) rather than "no activity"; specifically modify
the catch at the end of the function(s) involved (the catch that currently
returns 0 at lines shown) to throw the caught error or return null and ensure
downstream code in useGitHubData hook handles that sentinel appropriately.
- Around line 230-234: The current getSearchCount call using the query
`commenter:${username} updated:>=${today}` can include issues updated today by
others and thus overcounts; change the logic in useGitHubData to fetch actual
comment objects and filter by comment creation time instead of relying on that
search query: use the octokit REST comment-listing endpoint (e.g.,
octokit.rest.issues.listCommentsForRepo or the appropriate list comments
endpoint for the scope you need) with the since/today parameter, then count only
comments where comment.user.login === username and new Date(comment.created_at)
>= today; replace the getSearchCount call for “activity today” with this
comment-fetch-and-filter approach so the result strictly reflects comments the
user created today.
- Line 181: The forEach callback currently types the GitHub event as any; define
and use a narrow type (e.g. an interface or inline shape with at least `type:
string` and `created_at: string`) and replace `(event: any)` with that type in
the `response.data.forEach` call inside `useGitHubData`; update any local
variables that access `event.type` or `event.created_at` to use the new type so
the linter `@typescript-eslint/no-explicit-any` is satisfied and the streak logic
retains correct typings.

---

Outside diff comments:
In `@src/hooks/useGitHubData.ts`:
- Around line 292-294: When starting a new GitHub fetch in useGitHubData (where
you call setLoading(true) and setError('')), also reset the dailyActivityLoaded
flag to false so stale daily activity isn’t shown; update the same two
start-of-fetch sites that call setLoading/setError (the one that currently calls
setLoading(true); setError('') and the other similar call) to call
setDailyActivityLoaded(false) immediately when the new fetch begins, ensuring
you still set it true only after fresh daily activity is successfully loaded.
🪄 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: 5c2d5873-3aa9-4e6a-b62e-83c4717bdb68

📥 Commits

Reviewing files that changed from the base of the PR and between 6c6bc3e and 1acd66b.

📒 Files selected for processing (3)
  • src/components/DailyActivityStatus.tsx
  • src/hooks/useGitHubData.ts
  • src/pages/Tracker/Tracker.tsx

Comment thread src/hooks/useGitHubData.ts Outdated
Comment on lines +165 to +167
} catch {
return 0;
}
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

Don’t convert daily-activity API failures into fake zero activity.

At Line 165 and Line 207, errors are swallowed and coerced to 0, which can incorrectly show “no activity” reminders when the real issue is API failure/permission/rate limit. Propagate failure and mark daily activity as unavailable instead of inactive.

Suggested fix
-  ) => {
+  ): Promise<number> => {
     try {
       const response = await octokit.request(endpoint, {
         q,
         per_page: 1,
@@
-      return response.data.total_count ?? 0;
-    } catch {
-      return 0;
+      return response.data.total_count ?? 0;
+    } catch (error) {
+      throw error;
     }
   };
@@
-  ) => {
+  ): Promise<number> => {
     try {
@@
-      return streak;
-    } catch {
-      return 0;
+      return streak;
+    } catch (error) {
+      throw error;
     }
   };

Also applies to: 207-209

🤖 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/useGitHubData.ts` around lines 165 - 167, The current catch blocks
in src/hooks/useGitHubData.ts (the try/catch that returns 0 at the end of the
daily activity computation) swallow errors and convert API failures into a fake
"0" activity; change those catch blocks to propagate failure (either rethrow the
caught error or return a distinct "unavailable" sentinel such as null/undefined)
instead of returning 0, and update any callers of the function (e.g., the hook
function that calls the daily-activity computation) to treat null/undefined as
"activity unavailable" (showing an error state or retry) rather than "no
activity"; specifically modify the catch at the end of the function(s) involved
(the catch that currently returns 0 at lines shown) to throw the caught error or
return null and ensure downstream code in useGitHubData hook handles that
sentinel appropriately.

});

const eventDates = new Set<string>();
response.data.forEach((event: any) => {
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
set -euo pipefail
# Locate file and print the relevant section around the referenced line.
ls -la src/hooks/useGitHubData.ts
nl -ba src/hooks/useGitHubData.ts | sed -n '150,230p'
# Also search for other explicit any occurrences in this file to gauge context.
rg -n ":\s*any\b|no-explicit-any|as\s+any\b|\bany\b" src/hooks/useGitHubData.ts

Repository: GitMetricsLab/github_tracker

Length of output: 210


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Print lines 150-230 with line numbers via awk (nl is unavailable)
awk 'NR>=150 && NR<=230 {printf "%d\t%s\n", NR, $0}' src/hooks/useGitHubData.ts

# Search for explicit any (and likely no-explicit-any violations) in the file
rg -n "(:\s*)any\b|no-explicit-any|as\s+any\b|\bany\b" src/hooks/useGitHubData.ts

Repository: GitMetricsLab/github_tracker

Length of output: 2400


🏁 Script executed:

#!/bin/bash
set -euo pipefail
# Search for existing types/interfaces mentioning events or GitHub event fields
rg -n "interface .*Event|type .*Event|created_at|PushEvent|PullRequestEvent|IssuesEvent|IssueCommentEvent|PullRequestReviewCommentEvent|PullRequestReviewEvent" src/hooks/useGitHubData.ts
# Show a bit more context around the streak function for any surrounding types/imports
awk 'NR>=120 && NR<=220 {printf "%d\t%s\n", NR, $0}' src/hooks/useGitHubData.ts

Repository: GitMetricsLab/github_tracker

Length of output: 3022


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show imports/types at the top of the file (first ~120 lines)
awk 'NR>=1 && NR<=120 {printf "%d\t%s\n", NR, $0}' src/hooks/useGitHubData.ts

# Search for all streak-related access patterns
rg -n "fetchStreakFromEvents|created_at|event\.type|event\.created_at|GET /users/\\{username\\}/events" src/hooks/useGitHubData.ts

Repository: GitMetricsLab/github_tracker

Length of output: 3673


Replace explicit any in GitHub event iteration with a typed event shape.

src/hooks/useGitHubData.ts line 181 uses response.data.forEach((event: any) => ...), violating @typescript-eslint/no-explicit-any; the streak logic only needs event.type and event.created_at.

Suggested fix
+type GitHubUserEvent = {
+  type: string;
+  created_at?: string;
+};
@@
-      response.data.forEach((event: any) => {
+      response.data.forEach((event: GitHubUserEvent) => {
🧰 Tools
🪛 ESLint

[error] 181-181: Unexpected any. Specify a different type.

(@typescript-eslint/no-explicit-any)

🤖 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/useGitHubData.ts` at line 181, The forEach callback currently types
the GitHub event as any; define and use a narrow type (e.g. an interface or
inline shape with at least `type: string` and `created_at: string`) and replace
`(event: any)` with that type in the `response.data.forEach` call inside
`useGitHubData`; update any local variables that access `event.type` or
`event.created_at` to use the new type so the linter
`@typescript-eslint/no-explicit-any` is satisfied and the streak logic retains
correct typings.

Comment on lines +230 to +234
getSearchCount(
octokit,
'GET /search/issues',
`commenter:${username} type:issue updated:>=${today}`
),
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 | 🏗️ Heavy lift

🧩 Analysis chain

🌐 Web query:

GitHub Search API qualifiers: Does commenter:USERNAME updated:>=YYYY-MM-DD mean the user commented on or after that date, or only that the issue was updated on that date by anyone? What is the correct qualifier/query to count issues commented by a user today?

💡 Result:

The GitHub Search API qualifier updated:>=YYYY-MM-DD refers to the date the issue or pull request was last updated by anyone [1]. It does not specifically filter for when the user commented; rather, it narrows the result set to issues or pull requests that have had any modification (including new comments, label changes, state changes, etc.) on or after the specified date [1]. Using commenter:USERNAME in combination with updated:>=YYYY-MM-DD will return issues where the user has commented AND the issue has been updated on or after the specified date [1]. There is no direct search qualifier in the GitHub Search API to filter specifically for when a comment was posted by a specific user. The GitHub Search API is designed to return issues or pull requests that match specific metadata, not individual comment timestamps. To find issues or pull requests where a user has commented today (2026-05-26), you can use: commenter:USERNAME updated:>=2026-05-26 Please note the following limitations: 1. This query will return all issues/PRs where the user has commented that were also updated by anyone today [1]. 2. Because the Search API does not index individual comment creation dates for filtering, this is the best available approximation to narrow your search to recent activity. 3. If you require a precise list of comments made by a user on a specific day, you must use the GitHub REST API or GraphQL API to fetch the user's event activity or repository-specific comments [2]. For example, the GET /users/{username}/events endpoint can be used to programmatically check for IssueCommentEvent activity occurring today.

Citations:


🌐 Web query:

GitHub issue search qualifier commenter:semantics (does it require that user has commented?) and how it combines withupdated:; cite docs if available

💡 Result:

The GitHub search qualifier commenter: is used to filter issues and pull requests based on participation in the conversation [1]. Specifically, it matches issues or pull requests where the specified user has posted a comment [1]. Key semantic details include: - Requirement of Comment: The commenter: qualifier requires that the user has commented on the issue or pull request [1]. It generally excludes the original author of the issue if they have not added any subsequent comments [1]. - Interaction with Other Qualifiers: commenter: functions as a discrete filter [2]. It can be combined with other qualifiers like updated: in a standard AND-based search query [2]. For example, commenter:username updated:>2026-01-01 will return issues or pull requests where the user has commented and that have been updated since the specified date. - Comparison with involves:: While commenter: is strictly for comments, the involves: qualifier is broader; it matches issues or pull requests where a user was mentioned, assigned, or has commented [1]. If you want to include all instances of a user's activity regardless of whether they were the "author" or a "commenter," involves: is often a more comprehensive choice [1]. Qualifiers can be combined by simply separating them with spaces, which acts as a logical AND [3][2]. Any valid GitHub username, or @me for the authenticated user, can be used with commenter: [4][1].

Citations:


Fix “activity today” query semantics for GitHub Search (commenter: + updated:).

In src/hooks/useGitHubData.ts (lines ~230-234), commenter:${username} updated:>=${today} can count issues where the user commented at some point, but the issue was updated today by anyone—it does not guarantee the user’s comment happened “today”. If the acceptance criteria require “user commented today”, this query will overcount. Prefer fetching the user’s comment activity (e.g., via REST/GraphQL events or comment listing) and filtering by the comment created_at/date instead.

🤖 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/useGitHubData.ts` around lines 230 - 234, The current
getSearchCount call using the query `commenter:${username} updated:>=${today}`
can include issues updated today by others and thus overcounts; change the logic
in useGitHubData to fetch actual comment objects and filter by comment creation
time instead of relying on that search query: use the octokit REST
comment-listing endpoint (e.g., octokit.rest.issues.listCommentsForRepo or the
appropriate list comments endpoint for the scope you need) with the since/today
parameter, then count only comments where comment.user.login === username and
new Date(comment.created_at) >= today; replace the getSearchCount call for
“activity today” with this comment-fetch-and-filter approach so the result
strictly reflects comments the user created today.

@codedbydollys10
Copy link
Copy Markdown
Contributor Author

hey @mehul-m-prajapati review my PR.

@mehul-m-prajapati mehul-m-prajapati merged commit 609731d into GitMetricsLab:main May 29, 2026
4 of 6 checks passed
@github-actions
Copy link
Copy Markdown

🎉🎉 Thank you for your contribution! Your PR #535 has been merged! 🎉🎉

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

2 participants