-
-
Notifications
You must be signed in to change notification settings - Fork 23.4k
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
Fix #1170: Allow customizable width for GitHub Stats Card #1334
Fix #1170: Allow customizable width for GitHub Stats Card #1334
Conversation
@postatum is attempting to deploy a commit to the github readme stats Team on Vercel. A member of the Team first needs to authorize it. |
@postatum Thanks for your pull request. I quickly reviewed your code and it looks good to me. It however looks that the current code doesn't take into account the hide_rank=trueTest without card_widthTest with to small card_width (i.e 50)This card width is Test with card_width 300This card width is Test with card_width 600hide_rank=true, show_icons=trueTest without card_widthTest with to small card_width (i.e 50)This card width is Test with card_width 300This card width is Test with card_width 600hide_rank=falseTest without card_widthTest with to small card_width (i.e 50)This card width is Test with card_width 300This card width is Test with card_width 600hide_rank=false, show_icons=trueTest without card_widthTest with to small card_width (i.e 50)This card width is Test with card_width 300This card width is Test with card_width 600 |
@postatum, please merge postatum#1 to fix the issues described above. It also trims trialling whitespace, but I can remove that if you want. After this pull request has been merged I will forward it to hide_rank=false, show_icons=trueTest without card_widthTest with to small card_width (i.e 50)This card width is Test with card_width 300This card width is Test with card_width 600 |
The rank circle looks like shifted way too much to the right on the new updates Left: THIS PR https://github-readme-stats-git-testwidthfix-rickstaa.vercel.app/api?username=anuraghazra&show_icons=true&hide_rank=false Right: CURRENT https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&hide_rank=false |
This commit fixes a padding problem that was introduced in f9c0e0b. In the new code, the padding around the rank circle will be 50 when the stats card is bigger than 450. When it is smaller than 450 the left and right padding will shrink equally.
@anuraghazra You are right I missed that. This seems to be caused by the following code that was added by @postatum: github-readme-stats/src/cards/stats-card.js Line 230 in dc78bad
I added a fix for this to my pull request (see postatum@34d6423). |
Left: THIS PR https://github-readme-stats-git-testwidthfix2-rickstaa.vercel.app/api?username=anuraghazra&show_icons=true&hide_rank=false Visual testshide_rank=falseTest without card_widthWithout the card, width specified a card width of Test with to small card_width (i.e 50)This card width is Test with card_width 400This card width is Test with card_width 600hide_rank=false, show_icons=trueTest without card_widthWithout the card, width specified a card width of Test with to small card_width (i.e 50)This card width is Test with card_width 400This card width is Test with card_width 600 |
@anuraghazra No problem, I will do that next time. I created the pull request to speed up the development process since it solves one of my problems. |
…ation fix: add icon width to stats-card min width calculation
Hi guys! Thanks for reviewing this PR. Sorry, I didn't have time to merge your PR. I did it just now. |
@postatum No problem. Thanks again for creating this pull request! |
Is this blocked by code review mostly? |
@douglasg14b Thanks for your interest in this feature. I already reviewed this PR some time ago. I, however, have to check it one last time. There are currently three things preventing this PR from being merged:
After these points are solved, this PR can be merged. However, I am very short on time since I'm in the final stage of my master's thesis. Therefore, I cannot make a promise when I have time to look at this PR again. |
Codecov ReportBase: 95.07% // Head: 95.13% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #1334 +/- ##
==========================================
+ Coverage 95.07% 95.13% +0.06%
==========================================
Files 22 22
Lines 771 781 +10
Branches 208 214 +6
==========================================
+ Hits 733 743 +10
Misses 33 33
Partials 5 5
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
This commit makes sure we also test the stats card width for the case that the 'show_icons' option is enabled.
Just merged into the master. Sorry for the delay. @postatum Thanks a lot for implementing this feature 🚀. |
…nuraghazra#1334) * Change default stats card width with hide rank * Add tests for stats card with card_width * Add card_width Stats Card description to readme * fix: add icon width to stats-card min width calculation * fix: fixes rank circle padding problem This commit fixes a padding problem that was introduced in f9c0e0b. In the new code, the padding around the rank circle will be 50 when the stats card is bigger than 450. When it is smaller than 450 the left and right padding will shrink equally. * style: run prettier * tests: add extra stats 'card_width' tests This commit makes sure we also test the stats card width for the case that the 'show_icons' option is enabled. * style: run prettier Co-authored-by: rickstaa <rick.staa@outlook.com>
Fixes #1170 by allowing customizable width for Github Stats Card.
To avoid things overlaping each other, Stats Card has minimum widths which are applied when provided
custom_width
is less than certain values.