fix: Wakatime compact card display
This pull request updates the layout logic for rendering the compact Wakatime card, focusing on improving the spacing and alignment of language nodes. The main changes introduce a configurable lineHeight parameter, ensuring better vertical spacing and more maintainable code when displaying language statistics.
What’s changed
- Introduced an actually functional line_height parameter (previously the spacing and card height were both implicitly locked to a hardcoded value 25, so changing line_height had no real effect).
- Card height and the vertical spacing between language rows are now both derived dynamically from line_height, making layout scaling predictable.
- Passed the line_height parameter through the rendering pipeline for consistent use in height calculation and row positioning.
- Added a new ordering query parameter (&ordering=horizontal | vertical) to explicitly control how compact layout items flow. Default is
horizontal. - Fixes #4432
Examples
Horizontal ordering:
Vertical ordering:
Larger line height (35):
Smaller line height (15):
@bbbugg is attempting to deploy a commit to the github readme stats Team on Vercel.
A member of the Team first needs to authorize it.
Hello @bbbugg
Thank you for opening pull request. I appreciate you interest in our project.
Regarding the changes, the wakatime card works as is for years and thousands of users are okay with current behavior. This means that we definitely should not change the default baviour of the card. For preventing users to experience unexpected changes in their profiles withour actions from their side let's keep it as is.
However, I'm open to consider the addition of new query string parameter, for example
&ordering=horizontal | vertical, to provide more customization ways for users who really wants it.Also I didn't get the changes related to the line height, I would be grateful in case you can explain in more details.
@qwerty541 Thank you for your review!
About the line height changes:
Previously, both the line spacing and the overall card height were determined by a fixed value of 25, so the line_height parameter had no real effect. In this PR, the spacing between lines and the card height are now both dynamically calculated based on the line_height parameter, making it actually functional.
Additionally, the ordering logic has been refactored to use the &ordering=horizontal | vertical parameter.
All changes can be demonstrated through the examples on the top.
Hi @qwerty541,
Could you please take a look at this PR when you have a chance? Any feedback would be greatly appreciated.
Thanks