🎨 Palette: Fix a11y for external docs button in OAuth Providers Card - #162
MillionthOdin16 wants to merge 1 commit into
Conversation
…k wrapper Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe OAuth provider documentation icon button now has an explicit provider-specific ChangesOAuth accessibility update
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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.
Code Review
This pull request adds an aria-label and tabIndex={-1} to a Button component nested inside an anchor tag in OAuthProvidersCard.tsx. The review feedback correctly points out that nesting interactive elements is invalid HTML and violates accessibility standards. It suggests cleaner alternatives, such as using asChild or styling the anchor tag directly, rather than using tabIndex={-1} as a workaround.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| title={`Open ${p.name} docs`} | ||
| > | ||
| <Button ghost size="icon"> | ||
| <Button ghost size="icon" aria-label={`Open ${p.name} docs`} tabIndex={-1}> |
There was a problem hiding this comment.
Nesting an interactive element like <Button> (which renders a <button>) inside another interactive element <a> is invalid HTML and violates accessibility standards (WCAG / HTML5 spec). This causes screen readers and keyboard navigation to behave unexpectedly because of nested focusable elements.
Instead of using tabIndex={-1} to patch the double-focus issue, we should avoid nesting interactive elements entirely.
Recommended Solutions:
-
Use
asChild(if supported by the UI library):
If theButtoncomponent supportsasChild(common in Radix/shadcn-based UI libraries), you can swap the nesting so theButtonis the outer element and renders as an<a>tag:<Button ghost size="icon" asChild> <a href={p.docs_url} target="_blank" rel="noopener noreferrer" aria-label={`Open ${p.name} docs`} > <ExternalLink /> </a> </Button>
-
Style the
<a>tag directly:
Remove the<Button>component entirely and apply the button's classes (e.g., ghost, icon size) directly to the<a>tag.
💡 What: Added
aria-labelandtabIndex={-1}to an icon-only<Button>nested inside an<a>tag within theOAuthProvidersCardcomponent.🎯 Why: To prevent a "double tab stop" accessibility issue and improve screen reader experience for users trying to access external documentation links.
📸 Before/After: No visual changes.
♿ Accessibility: Fixes a keyboard navigation and screen reader naming issue where an inner interactive element lacked description and caused an extra, confusing tab focus state.
PR created automatically by Jules for task 14690492189608683739 started by @MillionthOdin16
Summary by CodeRabbit