fix(layout): resolve isometric tile height mismatch between projectIsometric (10) and renderIsometricLabels (9) — move grid constants to layoutConstants.ts#6077
Open
ChetanSenta wants to merge 3 commits into
Conversation
…e TILE_HEIGHT_HALF=10 via layoutConstants.ts
Contributor
|
Someone is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod-Dev
approved these changes
Jun 20, 2026
Aamod-Dev
left a comment
Collaborator
There was a problem hiding this comment.
Review Summary
Labels applied:
- level:intermediate — Touches 8 files with both a core bug fix (TILE_HEIGHT_HALF mismatch: 10 vs 9), scaling parameter adjustments (LOG_SCALE_MULTIPLIER 12→15, MAX_LOG_HEIGHT 80→50), test reorganization, and a vitest config change. Requires understanding of isometric projection math across layout.ts and generator.ts.
- quality:clean — Root cause is clearly identified and explained: accumulated 14px y-drift over 14 columns (layoutConstants.ts:28-31). Tests include explicit guards against the 9 vs 10 reversion (layout.test.ts:428-434). The scaling parameter changes are documented and test assertions updated accordingly.
- type:bug — Fixes label drift on ?labels=true badges caused by TILE_HEIGHT_HALF mismatch between projectIsometric() and
enderIsometricLabels(). - type:refactor — Extracted isometric grid constants to layoutConstants.ts as single source of truth.
- type:testing — 7 new regression tests for projectIsometric verifying coordinate math.
Mentor: Aamod007
Assessment: Solid bug fix with thorough root cause analysis. The extracted constants pattern prevents future drift. The scaling parameter changes (LOG_SCALE_MULTIPLIER, MAX_LOG_HEIGHT) are a notable scope addition beyond the title — please confirm these adjustments are intentional and don't affect existing badge output heights.
Approved! 🚀
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
Fixes #5610
Pillar
Visual Preview
Fixes label drift on badges using ?labels=true — month and weekday
labels now align correctly with their tower columns, especially
visible on the rightmost columns of ?size=large&labels=true badges.
Root cause
projectIsometric() in layout.ts used TILE_HEIGHT_HALF = 10.
renderIsometricLabels() in generator.ts used TILE_HEIGHT_HALF = 9.
Over 14 columns (max rendered window):
accumulated y-drift = (10 - 9) × 14 = 14px
Changes
lib/svg/layoutConstants.tslib/svg/layout.tslib/svg/generator.tslib/svg/layout.test.tsChecklist before requesting a review:
CONTRIBUTING.mdfile.npm run formatandnpm run lintlocally and resolved all errors.README.mdif I added a new theme or URL parameter.