feat: implement theme-aware coding personality calculator widget#562
feat: implement theme-aware coding personality calculator widget#562Sushma-1206 wants to merge 2 commits into
Conversation
✅ Deploy Preview for github-spy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
🎉 Thank you @Sushma-1206 for your contribution. Please make sure your PR follows https://github.com/GitMetricsLab/github_tracker/blob/main/CONTRIBUTING.md#-pull-request-guidelines
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a local-time coding persona calculator that skips invalid timestamps, a themed React widget displaying Early Bird vs Night Owl percentages, and integrates the widget into Dashboard and Tracker with conditional rendering when datasets are present. ChangesCoding Persona Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ 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: 3
🤖 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/utils/persona.ts`:
- Around line 26-27: The code currently uses UTC hours via the const hour =
date.getUTCHours() statement which conflicts with the local-time objective;
change this to use the local hour (e.g., date.getHours()) or accept/convert
using a provided timezone parameter before bucketing so persona reflects user
local activity timing—update the reference in the function that contains hour
(the line with const hour = date.getUTCHours()) and adjust any downstream logic
that uses hour for bucketing accordingly.
- Around line 24-43: The code uses date = new Date(dateString) then hour =
date.getUTCHours() without validating the Date, so invalid dateStrings produce
NaN and always fall into the else (midDay) bucket; fix by validating the parsed
Date immediately after const date = new Date(dateString) using
isNaN(date.getTime()) (or Number.isNaN(hour)) and, for invalid timestamps, skip
bucketing (e.g., continue the loop or return early) without touching
earlyBirdCount, nightOwlCount, midDayCount, or validTimestampsCount; optionally
increment or log an invalidTimestampCount for metrics.
- Line 4: The persona bucketing code is counting invalid dates as valid and
placing them into the “Mid-Day” bucket because it uses new Date(dateString)
without validating; update the logic that parses timestamps (the code that
constructs Date from the incoming timestamp used with getUTCHours()) to first
check for invalid dates via isNaN(date.getTime()) and skip/ignore (and do not
increment validTimestampsCount) when invalid. Also tighten the ContributionItem
type by removing or narrowing the [key: string]: any index signature if
possible, and confirm whether the bucketing should use UTC (getUTCHours()) or
local time (getHours()) and switch accordingly or add explicit timezone handling
so the intended local-time behavior is enforced.
🪄 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: f8e23419-ac52-4abb-ad51-5a9c437742f7
📒 Files selected for processing (4)
src/components/CodingPersonaWidget.tsxsrc/components/Dashboard.tsxsrc/pages/Tracker/Tracker.tsxsrc/utils/persona.ts
…s using local machine hours
|
Actionable comments posted: 0 |
Related Issue
Description
Implements a responsive, theme-aware "Night Owl vs. Early Bird" coding personality analyzer widget on the Tracker dashboard.
useThemecontext hook to support flawless light and dark mode switching automatically.How Has This Been Tested?
Sushma-1206) across 12+ loaded chronological records.Screenshots (if applicable)
(Tip: You can literally drag and drop or paste your browser screenshot right here to show off your beautiful widget!)
Type of Change
Summary by CodeRabbit
New Features
Bug Fixes