Adding a feature : Increase color intensity based on streak#478
Merged
lazyguru merged 3 commits intopyrochlore:masterfrom Jun 19, 2025
Merged
Adding a feature : Increase color intensity based on streak#478lazyguru merged 3 commits intopyrochlore:masterfrom
lazyguru merged 3 commits intopyrochlore:masterfrom
Conversation
Contributor
Author
|
Hey @lazyguru, I almost forgot about raising this PR from 2 moths back. The changes are tested, Please feel free to review it and revert back at your convenience |
lazyguru
approved these changes
Jun 19, 2025
Collaborator
lazyguru
left a comment
There was a problem hiding this comment.
Only a minor nit-pick. Thanks again for your contributions!
| } else { | ||
| break; | ||
| } | ||
| } |
Collaborator
There was a problem hiding this comment.
Minor nit-pick: My preference would be to follow the Return Early pattern. Something like this (while longer) is easier to follow mentally:
while(curStreakCount < 28) {
let curValue = dataset.getValue(streakStartDate);
if (curValue == null || curValue == threshold) break;
if (thresholdType === ThresholdType.GreaterThan && curValue < threshold) break;
if (thresholdType === ThresholdType.LessThan && curValue > threshold) break;
curStreakCount++;
streakStartDate = streakStartDate.subtract(1, "days");
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adding an option to have the calendar increase the color of the streak circle with increase in streak. This motivates the user to aim and retain a higher streak. The intensity starts low and increases till a 28 days streak. It maxes out at 28 days and thereon shows the same color even with increase in streak.
This option can be enabled or disabled using 'circleColorByStreak' field based on preference.
Fixes # (issue)
#395
Type of change
Please delete options that are not relevant.
How Has This Been Tested?