-
-
Notifications
You must be signed in to change notification settings - Fork 23.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creates a new Streaks Card #3338
Conversation
@yaten2302 is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yaten2302 First, you did an excellent job on your first PR. You can be genuinely proud of yourself 🚀. I added some things that need to be improved before this pull request can be merged. Besides these points, the pull requests also lack tests, which need to be added. You can check out the tests folder to see how these tests should be implemented.
I also like the simplicity of the design of your card. I think when icons are added, it truly gives users a different card than the one already provided by https://github.com/DenverCoder1/github-readme-streak-stats ❤️🔥. One improvement I can think of is to add a small graph to the right of the stats that displays the user's contributions over time (see https://github.com/Ashutosh00710/github-readme-activity-graph) 🤔.
@@ -568,6 +571,24 @@ Change the `?username=` value to your [Wakatime](https://wakatime.com) username. | |||
|
|||
*** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*** |
### Hide individual elements from the streaks card | ||
|
||
To hide individual elements form the card, use - `&hide=params`, where `params` = `totalContributions`, `weeklyLongest`, `weeklyCurrent`, `dailyLongest`, `dailyCurrent` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*** |
@@ -123,13 +123,23 @@ const iconWithLabel = (icon, label, testid, iconSize) => { | |||
/** | |||
* Retrieves num with suffix k(thousands) precise to 1 decimal if greater than 999. | |||
* | |||
* @param {number} num The number to format. | |||
* @returns {string|number} The formatted number. | |||
* num The number to format. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the typings removed 🤔 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess, I removed those typings by mistake, will add those again 👍
: Math.sign(num) * Math.abs(num); | ||
: Math.sign(num) * Math.abs(num); */ | ||
|
||
if (typeof num == "number") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why does this need to be changed? This function should only accept numbers. In its current form strings should be converted before they enter the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this because while rendering the streaks card, it requires some additional information in the value (like - days
or weeks
)
If this is reverted to the original code, then it will show NaN
in the value instead of 2 weeks
or something.
This change will not affect the other cards. But, if you want, then I can make a separate function in the utils.js
specifically for the Streaks card
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. You should handle this problem outside the kFormatter function. Maybe only use the kformatter function when the value is a number:
const kValue = number_format === "long" ? value : kFormatter(value); |
Since my comments will take you some time to implement, I already attached the |
Hi @rickstaa, thanks for your valuable suggestions, I'll surely make the necessary changes ASAP. So, should I create a separate card for the graph or should I add it here only? |
Or something like this Which I quickly created in GIMP. Coding it would be more work, though. But maybe you can combine the code in https://github.com/Ashutosh00710/github-readme-activity-graph/tree/main/src with the code you already have 🤔. @qwerty541, @anuraghazra, what are your thoughts on this design and whether we should add a new streak card in the GRS repository? |
Will have to think this through, I'm not sure about adding this Card.
|
@anuraghazra, thanks for your thoughts. Those are excellent points, and I think it is similar to the statement by @qwerty541 that we should only add this Card if it has a unique design/feature set compared to https://github.com/DenverCoder1/github-readme-streak-stats (see #3209 (comment)). Sadly, the current implementation by @yaten2302, in my opinion, is not unique enough. I think my design, which combines https://github.com/Ashutosh00710/github-readme-activity-graph and https://github.com/DenverCoder1/github-readme-streak-stats, would offer a special card for users. Neverteless, this Card might be best realised as a feature/pull request to https://github.com/DenverCoder1/github-readme-streak-stats instead of being added to GRS. |
Originally posted by @rickstaa in #3338 (comment) |
@qwerty541, @anuraghazra Let's continue the discussion on #3338. |
@rickstaa, @anuraghazra, @qwerty541, is this card not required or it requires a change in its design? |
To summarize. We concluded that your card doesn't offer more new features compared to https://github.com/DenverCoder1/github-readme-streak-stats. Adding it to GRS might create a monopoly against https://github.com/DenverCoder1/github-readme-streak-stats since this project is more popular 😅. Maybe @anuraghazra can elaborate on whether he wants to accept this card if it has a very different design from https://github.com/DenverCoder1/github-readme-streak-stats. |
Conclusion: let's refrain from adding Card. Given there are already better solutions out there which people can use, plus it reduces our maintenance and dev efforts. |
I agree. Let's close this when Hacktoberfest is over 👍🏻. |
Fixes issue - #3209
This PR creates a new streak card which shows the user's streak on GitHub.
Screenshots