feat(generator): add role, aria-label, and title to root SVG for acce… - #5
Merged
Merged
Conversation
…ssibility Add summary to SVG for accessibility and context. Signed-off-by: Raiyanul Islam <58294098+raiyan22@users.noreply.github.com>
m3hrab
self-requested a review
September 8, 2026 09:36
m3hrab
approved these changes
Sep 8, 2026
m3hrab
left a comment
Owner
There was a problem hiding this comment.
PR #5 Review
Approved ✅ - merging now.
@raiyan22 Correct implementation. role="img", aria-label, and <title> added properly. No visual changes.
@yourasmit15-web I noticed your commit 59e7bb4 also addresses the same issue. Appreciate the initiative! Since @raiyan22's PR is already complete and linked to #3, I'm going with this one. Feel free to open a separate PR if you have any additional improvements or a different approach worth exploring.
Minor nit (not blocking):
The summary label currently shows "longest streak 0 days" when a user has no active streak. While this is technically accurate, it might sound a bit awkward. Consider handling this edge case in a follow-up:
const streakText = stats.longest > 0 ? `${stats.longest} days` : 'no streak yet';
const summary = `GitHub contribution constellation: ${totalContributions} contributions, longest streak ${streakText}`;
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.
What does this PR do?
Adds screen-reader accessibility metadata to the root SVG generated by
buildSvg().role="img"to the root<svg>aria-labelsummarizing GitHub contributions and longest streak<title>element as the first child of the root SVGfullandminimallayoutsType of change
Checklist
node src/generate-constellation.jslocally and bothdist/constellation-dark.svganddist/constellation-light.svggenerated without errors.
action.ymlinput, I updated the inputs table inREADME.mdand theDEFAULTSblock / doc comment insrc/generate-constellation.js.Screenshots
Not applicable — this change only adds accessibility metadata and does not change the visual appearance.
Related issues
Closes #3