Skip to content

Conversation

bbbugg
Copy link

@bbbugg bbbugg commented Sep 18, 2025

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 Compact layout grid order between WakaTime and Top Languages cards is inconsistent #4432

Examples

Horizontal ordering:

WakaTime stats

Vertical ordering:

WakaTime stats

Larger line height (35):

WakaTime stats

Smaller line height (15):

WakaTime stats

Copy link

vercel bot commented Sep 18, 2025

@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.

@github-actions github-actions bot added the wakatime-card Issues related to the wakatime card. label Sep 18, 2025
@bbbugg bbbugg changed the title Fix wakatime fix: Wakatime compact card display Sep 18, 2025
Copy link
Collaborator

@qwerty541 qwerty541 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions bot added the documentation Improvements or additions to documentation. label Oct 5, 2025
@bbbugg
Copy link
Author

bbbugg commented Oct 5, 2025

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.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation. wakatime-card Issues related to the wakatime card.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compact layout grid order between WakaTime and Top Languages cards is inconsistent
2 participants