fix(layout): resolve isometric tile height mismatch between projectIsometric (10) and renderIsometricLabels (9) — move grid constants to layoutConstants.ts#6077
Conversation
…e TILE_HEIGHT_HALF=10 via layoutConstants.ts
|
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. |
📦 Next.js Bundle Size Report (Gzipped Sizes)✨ No significant bundle size changes detected. 📊 Summary of Totals
|
Aamod-Dev
left a comment
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! 🚀
|
🎉 Congratulations @ChetanSenta! Your PR has been successfully merged. 🚀 Thank you for contributing to CommitPulse. Your work helps us build a better tool for the community.
Keep building! 💻✨ |
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.