Skip to content

🎨 Palette: Improve accessibility and UX for button links#10

Open
Twinber wants to merge 1 commit intomasterfrom
palette/fix-semantic-button-links-5121534829624105929
Open

🎨 Palette: Improve accessibility and UX for button links#10
Twinber wants to merge 1 commit intomasterfrom
palette/fix-semantic-button-links-5121534829624105929

Conversation

@Twinber
Copy link
Owner

@Twinber Twinber commented Mar 11, 2026

🎨 Palette: Improve Accessibility and UX for Button Links

💡 What

This PR addresses several micro-UX and accessibility improvements for interactive link elements styled as buttons:

  1. Refactored NetworkItem.tsx and GmapsButton.tsx to correctly use the <Button asChild> pattern.
  2. Added a helpful MapPin icon from lucide-react (with aria-hidden="true") to the Google Maps button to visually enforce its purpose.
  3. Updated external links to include rel="noopener noreferrer".
  4. Modernized TanStack Router links to use type-safe route parameters.

🎯 Why

Previously, the codebase was wrapping semantic link elements (<Link> and <a>) inappropriately, either embedding them directly inside <button> elements or completely omitting semantic linking by applying button classes to arbitrary elements. Nesting a button within an anchor tag is invalid HTML and causes screen-reader issues and degraded keyboard navigation support. Using Shadcn/Radix's asChild pattern gracefully solves this by applying the correct Button design system styles directly onto the semantic <Link> or <a> tag.

📸 Before/After

(Visuals successfully verified with Playwright during implementation)

  • Before: Text-only buttons that rendered as invalid semantic nested HTML.
  • After: Correctly semantic anchor tags that look like buttons, with the added context of a MapPin icon for external maps!

♿ Accessibility

  • Fixed invalid HTML structure (nested interactive elements).
  • Preserved native focus states and keyboard navigation for link destinations.
  • Ensured decorative icons are explicitly ignored by assistive technology (aria-hidden="true").

PR created automatically by Jules for task 5121534829624105929 started by @Twinber

- Fixed semantic HTML by using Radix `asChild` for `<Link>` and `<a>` elements inside `<Button>` components in `NetworkItem.tsx` and `GmapsButton.tsx`.
- Added a `MapPin` icon to the "Show in Google Maps" button to improve visual context.
- Added `rel="noopener noreferrer"` to external Google Maps links for security and performance.
- Fixed TypeScript primitive types for latitude/longitude props.
- Refactored TanStack Router `<Link>` components to use type-safe `to` and `params` props instead of string interpolation.

Co-authored-by: Twinber <5513621+Twinber@users.noreply.github.com>
@google-labs-jules
Copy link

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant