Skip to content

feat(customize): improve HTML export alt text with dynamic username#1825

Open
meetparmar392005 wants to merge 3 commits into
JhaSourav07:mainfrom
meetparmar392005:feat/improve-html-export-alt-text
Open

feat(customize): improve HTML export alt text with dynamic username#1825
meetparmar392005 wants to merge 3 commits into
JhaSourav07:mainfrom
meetparmar392005:feat/improve-html-export-alt-text

Conversation

@meetparmar392005
Copy link
Copy Markdown
Contributor

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

  • Updated getExportSnippet() in app/customize/utils.ts to extract
    the user parameter from the query string and inject it into the alt text
  • HTML output: alt="CommitPulse Contribution Graph for {username}"
  • Markdown output: ![CommitPulse Contribution Graph for {username}](...)
  • Fallback to "CommitPulse Contribution Graph" when username is not present
  • Updated app/customize/utils.test.ts to reflect new alt text format

Pillar

  • 🎨 Pillar 1 — New Theme Design
  • 📐 Pillar 2 — Geometric SVG Improvement
  • 🕐 Pillar 3 — Timezone Logic Optimization
  • 🛠️ Other (Bug fix, refactoring, docs)

Checklist

  • I have read the CONTRIBUTING.md file.
  • I have tested these changes locally.
  • npm run format and npm run lint pass locally ✅
  • npm run test passes locally ✅
  • My commits follow Conventional Commits format.
  • I have starred the repo.
  • I have only one commit in this PR.
  • (Recommended) I joined the CommitPulse Discord server.

Copilot AI review requested due to automatic review settings May 30, 2026 17:52
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 30, 2026

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

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions github-actions Bot added the needs-rebase This PR has merge conflicts and needs a rebase. label May 30, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 from user query param in getExportSnippet.
  • 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.

Comment thread app/customize/utils.ts Outdated
Comment on lines +29 to +40
// 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 `![CommitPulse](${badgeUrl})`;
return `![${altText}](${badgeUrl})`;
Comment thread app/customize/utils.ts Outdated
Comment on lines +30 to +34
const usernameMatch = queryString.match(/(?:^|&)user=([^&]+)/);
const username = usernameMatch ? usernameMatch[1] : null;
const altText = username
? `CommitPulse Contribution Graph for ${username}`
: 'CommitPulse Contribution Graph';
Comment on lines 48 to +51
expect(result).toContain(complexQuery);
expect(result).toBe(`![CommitPulse](${EXPECTED_BASE_URL}?${complexQuery})`);
expect(result).toBe(
`![CommitPulse Contribution Graph for complex%20name](${EXPECTED_BASE_URL}?${complexQuery})`
);
@github-actions github-actions Bot added status:blocked This PR is blocked due to a failing CI check. and removed needs-rebase This PR has merge conflicts and needs a rebase. labels May 30, 2026
@github-actions
Copy link
Copy Markdown

🚨 Hey @meetparmar392005, the CI Pipeline is failing on this PR and it has been marked as status:blocked.

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 passes

2. Auto-fix common issues:

npm run format         # Auto-fix formatting with Prettier
npm run lint -- --fix  # Auto-fix lint errors where possible

3. Check the full failure log here:
👉 View CI Run

Once you push a fix and the CI passes, the status:blocked label will be removed automatically. 💪

@meetparmar392005 meetparmar392005 force-pushed the feat/improve-html-export-alt-text branch from 4b8ad45 to e3760b7 Compare May 30, 2026 17:57
@github-actions github-actions Bot added the needs-rebase This PR has merge conflicts and needs a rebase. label May 30, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

4 similar comments
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions github-actions Bot removed the needs-rebase This PR has merge conflicts and needs a rebase. label May 30, 2026
@meetparmar392005 meetparmar392005 force-pushed the feat/improve-html-export-alt-text branch from b108f85 to 0612809 Compare May 30, 2026 18:31
@github-actions github-actions Bot added the needs-rebase This PR has merge conflicts and needs a rebase. label May 30, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

2 similar comments
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions github-actions Bot removed the needs-rebase This PR has merge conflicts and needs a rebase. label May 30, 2026
@meetparmar392005 meetparmar392005 force-pushed the feat/improve-html-export-alt-text branch from 1461f21 to 1fd27ac Compare May 30, 2026 18:41
@github-actions github-actions Bot added the needs-rebase This PR has merge conflicts and needs a rebase. label May 30, 2026
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

5 similar comments
@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions
Copy link
Copy Markdown

⚠️ Hey @meetparmar392005, this PR has merge conflicts with the main branch.

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-lease

Once resolved, the needs-rebase label will be removed automatically on the next check. 🙌

@github-actions github-actions Bot added type:feature New features, additions, or enhancements and removed needs-rebase This PR has merge conflicts and needs a rebase. labels May 30, 2026
@meetparmar392005 meetparmar392005 force-pushed the feat/improve-html-export-alt-text branch from b1d5287 to 2341a58 Compare May 30, 2026 18:59
Copy link
Copy Markdown
Collaborator

@Aamod007 Aamod007 left a comment

Choose a reason for hiding this comment

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

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.

@meetparmar392005 meetparmar392005 force-pushed the feat/improve-html-export-alt-text branch 2 times, most recently from 57671c6 to 3025fd0 Compare May 30, 2026 19:15
@meetparmar392005 meetparmar392005 force-pushed the feat/improve-html-export-alt-text branch from 3025fd0 to 718ec99 Compare May 30, 2026 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status:blocked This PR is blocked due to a failing CI check. type:feature New features, additions, or enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Improve alt text in HTML export snippet

3 participants