[FEAT] Add aria-label attributes to platform icon links on public profile page for screen reader accessibility#313
Conversation
…ile page Adds descriptive aria-label attributes to all platform icon links rendered on the public profile page (/[username]), so screen readers announce 'Visit GitHub', 'Visit LinkedIn', etc. instead of just 'link'. Closes vishnukothakapu#312
|
@PranavAgarkar07 is attempting to deploy a commit to the vishnukothakapu's projects Team on Vercel. A member of the Team first needs to authorize it. |
📝 WalkthroughWalkthroughProfileLinkItem now computes an ChangesProfile Link Accessibility
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
app/[username]/ProfileLinkItem.tsx (1)
26-26: 💤 Low valueConsider adding new window indication to aria-label (optional enhancement).
The anchor uses
target="_blank"to open in a new window, but the aria-label doesn't inform screen reader users about this behavior. Consider updating the aria-label to include this information for better accessibility.♻️ Optional enhancement
- const ariaLabel = `Visit ${link.label || link.platform}`; + const ariaLabel = `Visit ${link.label || link.platform} (opens in new window)`;🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@app/`[username]/ProfileLinkItem.tsx at line 26, The anchor has target="_blank" but the aria-label (ariaLabel) doesn't indicate that it opens a new window; update the ProfileLinkItem component to compute or adjust ariaLabel when target="_blank" is used (e.g., append "— opens in a new window" or similar) and pass that computed value into the aria-label prop, avoiding duplicate phrases if ariaLabel already mentions it; locate the aria-label usage and the anchor element in ProfileLinkItem.tsx and implement the conditional label adjustment (keep existing rel and security attributes unchanged).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@app/`[username]/ProfileLinkItem.tsx:
- Line 26: The anchor has target="_blank" but the aria-label (ariaLabel) doesn't
indicate that it opens a new window; update the ProfileLinkItem component to
compute or adjust ariaLabel when target="_blank" is used (e.g., append "— opens
in a new window" or similar) and pass that computed value into the aria-label
prop, avoiding duplicate phrases if ariaLabel already mentions it; locate the
aria-label usage and the anchor element in ProfileLinkItem.tsx and implement the
conditional label adjustment (keep existing rel and security attributes
unchanged).
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 23b6d420-0dc6-427c-9388-bbdebc57bd1f
📒 Files selected for processing (1)
app/[username]/ProfileLinkItem.tsx
Description
Adds
aria-labelattributes to all platform icon links on the public profile page (/[username]). Screen readers now announce the platform name instead of just "link".Changes
app/[username]/ProfileLinkItem.tsx— Addedaria-label="Visit ${link.label || link.platform}"to the anchor tag wrapping each platform iconAcceptance Criteria
aria-labelaria-labelvaluesCloses #312
Summary by CodeRabbit