feat: add optional 3D isometric month headers and weekday labels#800
feat: add optional 3D isometric month headers and weekday labels#800Sahitya3105 wants to merge 3 commits into
Conversation
|
@Sahitya3105 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
👋 Hey @Sahitya3105, welcome to CommitPulse! 🎉 Thanks for opening your first pull request — this is a big deal and we appreciate the effort! While you wait for a review, please double-check:
A maintainer will review your PR shortly. Hang tight! 🚀 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds optional month/weekday “isometric” labels to the streak SVG, with an API/query parameter to enable them and a customizable label color.
Changes:
- Extend
BadgeParamswithlabelsandlabelColor - Parse/validate
labels+labelColorfor the streak API route - Render SVG labels (static + auto-theme) and add generator tests
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| types/index.ts | Adds new badge parameters for enabling labels and customizing label color |
| lib/validations.ts | Parses labels and sanitizes labelColor from query params |
| lib/svg/generator.ts | Implements label rendering and hooks it into both SVG modes |
| lib/svg/generator.test.ts | Adds tests for label rendering + color behavior |
| app/api/streak/route.ts | Wires parsed params into the SVG generation request flow |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const tx = s(300 + (label.col - 7.2) * 16 + 8); | ||
| const ty = s(120 + (label.col + 7.2) * 9 + 20) + Math.round(20 * sf); |
| const tx = s(300 + (-1.2 - day.row) * 16); | ||
| const ty = s(120 + (-1.2 + day.row) * 9 + 20) + Math.round(20 * sf); |
| const tx = s(300 + (label.col - 7.2) * 16 + 8); | ||
| const ty = s(120 + (label.col + 7.2) * 9 + 20) + Math.round(20 * sf); | ||
| elements += ` | ||
| <text x="${tx}" y="${ty}" text-anchor="middle" fill="${labelColorHex}" fill-opacity="0.6" font-family=""Roboto", sans-serif" font-size="${Math.round(10 * sf)}px" font-weight="400" letter-spacing="1px">${label.text}</text>`; |
| const tx = s(300 + (-1.2 - day.row) * 16); | ||
| const ty = s(120 + (-1.2 + day.row) * 9 + 20) + Math.round(20 * sf); | ||
| elements += ` | ||
| <text x="${tx}" y="${ty}" text-anchor="end" fill="${labelColorHex}" fill-opacity="0.6" font-family=""Roboto", sans-serif" font-size="${Math.round(10 * sf)}px" font-weight="400" letter-spacing="1px">${day.text}</text>`; |
| it('does not render labels when labels parameter is absent or false', () => { | ||
| const svg = generateSVG( | ||
| mockStats, | ||
| { user: 'avi', labels: false } as unknown as BadgeParams, | ||
| mockCalendar | ||
| ); | ||
| expect(svg).not.toContain('class="isometric-labels"'); | ||
| }); |
|
Attach visual preview |
This is a backend SVG generation feature — the output is an API response. To preview it locally, run npm run dev and visit: localhost:3000/api/streak?user=YOUR_USERNAME&labels=true for Issue #792 |
|
you can generate you own token from developer setting ? |
|
Please pull the latest changes and resolve the conflicts so we can review it! git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-leaseOnce resolved, the |
1 similar comment
|
Please pull the latest changes and resolve the conflicts so we can review it! git fetch origin
git rebase origin/main
# resolve any conflicts, then:
git push --force-with-leaseOnce resolved, the |
|
@JhaSourav07 conflicts removes and preview images added |
Description
Fixes #792
This PR implements optional 3D isometric month headers and day-of-week labels (
Mon,Wed,Fri) flat on the isometric grid floor.Key changes:
labels(boolean) andlabelColor(hex) to the validation schema andBadgeParamstypes.i = -1.2) to ensure zero visual obstruction.j = 7.2) to keep text fully visible.var(--cp-text)).lib/svg/generator.test.ts.Pillar
Visual Preview
(Rendered optional text labels below the front edge and Mon/Wed/Fri tags flat along the left edge when
labels=trueis requested)Checklist before requesting a review:
CONTRIBUTING.mdfile.npm run formatandnpm run lintlocally and resolved all errors (CI will fail otherwise).feat(themes): ...,fix(calculate): ...).README.mdif I added a new theme or URL parameter.