feat(customize): improve HTML export alt text with dynamic username#1825
feat(customize): improve HTML export alt text with dynamic username#1825meetparmar392005 wants to merge 3 commits into
Conversation
|
@meetparmar392005 is attempting to deploy a commit to the jhasourav07's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
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 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates exported badge snippets to include more descriptive alt text (including the user value when present) for both Markdown and HTML outputs.
Changes:
- Derives
alt/alt-text fromuserquery param ingetExportSnippet. - Updates unit tests to assert the new Markdown/HTML snippet text.
- Keeps placeholder snippet behavior but with updated descriptive text.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| app/customize/utils.ts | Builds alt text dynamically from the user query param and injects it into generated snippets. |
| app/customize/utils.test.ts | Updates expectations to match the new descriptive alt text in Markdown/HTML outputs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Extract username from query string for descriptive alt text | ||
| const usernameMatch = queryString.match(/(?:^|&)user=([^&]+)/); | ||
| const username = usernameMatch ? usernameMatch[1] : null; | ||
| const altText = username | ||
| ? `CommitPulse Contribution Graph for ${username}` | ||
| : 'CommitPulse Contribution Graph'; | ||
|
|
||
| if (format === 'html') { | ||
| return `<img src="${badgeUrl}" alt="CommitPulse" />`; | ||
| return `<img src="${badgeUrl}" alt="${altText}" />`; | ||
| } | ||
|
|
||
| return ``; | ||
| return ``; |
| const usernameMatch = queryString.match(/(?:^|&)user=([^&]+)/); | ||
| const username = usernameMatch ? usernameMatch[1] : null; | ||
| const altText = username | ||
| ? `CommitPulse Contribution Graph for ${username}` | ||
| : 'CommitPulse Contribution Graph'; |
| expect(result).toContain(complexQuery); | ||
| expect(result).toBe(``); | ||
| expect(result).toBe( | ||
| `` | ||
| ); |
|
🚨 Hey @meetparmar392005, the CI Pipeline is failing on this PR and it has been marked as Please fix the issues before this can be reviewed. Here's how: 1. Run checks locally before pushing: npm run format:check # Check Prettier formatting
npm run lint # Run ESLint
npm run typecheck # TypeScript type check
npm run test # Run unit tests (Vitest)
npm run build # Verify production build passes2. Auto-fix common issues: npm run format # Auto-fix formatting with Prettier
npm run lint -- --fix # Auto-fix lint errors where possible3. Check the full failure log here: Once you push a fix and the CI passes, the |
4b8ad45 to
e3760b7
Compare
|
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 |
4 similar comments
|
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 |
|
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 |
|
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 |
|
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 |
b108f85 to
0612809
Compare
|
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 |
2 similar comments
|
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 |
|
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 |
1461f21 to
1fd27ac
Compare
|
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 |
5 similar comments
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
b1d5287 to
2341a58
Compare
Aamod007
left a comment
There was a problem hiding this comment.
There is a syntax error in \�pp/customize/utils.ts\ at line 66 — an extra closing brace }\ causes a parse error. Also the indentation is broken in the \if (format === 'action')\ block, and the defensive \ hrow new Error('Invalid format')\ was removed. Please fix these before re-requesting review.
57671c6 to
3025fd0
Compare
3025fd0 to
718ec99
Compare
Fixes #1793
Description
The HTML export snippet previously used a static
alt="CommitPulse"attribute. This PR improves accessibility by dynamically injecting the
GitHub username into the alt text, providing a more descriptive and
screen-reader-friendly output.
Changes Made
getExportSnippet()inapp/customize/utils.tsto extractthe
userparameter from the query string and inject it into the alt textalt="CommitPulse Contribution Graph for {username}""CommitPulse Contribution Graph"when username is not presentapp/customize/utils.test.tsto reflect new alt text formatPillar
Checklist
CONTRIBUTING.mdfile.npm run formatandnpm run lintpass locally ✅npm run testpasses locally ✅