Skip to content

fix: sitemap SEO contradiction, duplicate error UI, nested interactive elements, and menu keyboard navigation - #667

Merged
DeFiVC merged 4 commits into
ChainLearnOfficial:mainfrom
AbelOsaretin:fix/wave10-seo-a11y-error-handling
Oct 22, 2026
Merged

DeFiVC merged 4 commits into
ChainLearnOfficial:mainfrom
AbelOsaretin:fix/wave10-seo-a11y-error-handling

Conversation

@AbelOsaretin

Copy link
Copy Markdown
Contributor

Closes #559, Closes #560, Closes #561, Closes #562

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Summary

Four independent small fixes across SEO metadata, error handling, and accessibility:

  1. Fix sitemap including /connect which robots.txt disallows #559 — sitemap.ts listed /connect while robots.txt disallows it, wasting crawl budget. Removed the entry so every sitemap URL is indexable.
  2. Fix rewards page re-throwing error causing duplicate error UI #560 — handleClaim in the rewards page re-threw after addToast, so the route error boundary rendered a second error UI on top of the toast. Dropped the re-throw.
  3. Fix nested interactive elements in course-card (Link wrapping buttons) #561 — course-card.tsx wrapped the whole card in <Link> around buttons and a dropdown, producing invalid <a><button> nesting and a keyboard trap. Replaced the wrapper with role="link" + router.push + Enter/Space handler.
  4. Add arrow-key navigation to connect-button dropdown menu #562 — connect-button.tsx dropdown used role="menu" but had no arrow-key navigation. Added ArrowUp/ArrowDown and Home/End focus movement between menu items.

Motivation / Context

Closes #559, Closes #560, Closes #561, Closes #562

Changes

File Change
src/app/sitemap.ts Removed /connect static entry
src/app/rewards/page.tsx Removed throw err after addToast
src/components/course/course-card.tsx Removed <Link> wrapper; added role="link", tabIndex={0}, onClick/onKeyDown navigation, stopPropagation on inner controls
src/components/wallet/connect-button.tsx Added onKeyDown handler on the role="menu" container for ArrowUp/ArrowDown/Home/End

Testing

  • Manually verified sitemap entries (/, /courses, /courses/*) are all allowed by robots.txt
  • Verified handleClaim no longer re-throws — toast is the sole error indication
  • Verified course card has no nested <a> inside <a>/<button>; dropdown and action buttons remain independently focusable and operable
  • Verified connect-button menu: ArrowDown/ArrowUp cycle focus, Home/End jump to first/last item, Escape closes and restores focus to trigger, Tab exits the dropdown

Tradeoffs

Out of scope

  • No visual or behavioral changes beyond what each issue requires
  • No dependency updates, refactors, or formatting cleanups

Crawlers were seeing /connect in the sitemap while robots.txt disallowed
it, wasting crawl budget. Remove the entry so all sitemap URLs are
indexable.

Fixes ChainLearnOfficial#559
handleClaim already surfaces the failure via addToast, but the re-throw
was also caught by the route error boundary and rendered a second error
UI on top of the toast. Drop the re-throw so the toast is the only error
indication.

Fixes ChainLearnOfficial#560
The card was wrapped in <Link> which contained buttons and a dropdown,
producing invalid <a><button> nesting and trapping keyboard users.
Replace the wrapper with role="link" + onClick/router.push + Enter/Space
handler, and stop propagation on inner controls so the dropdown and
action buttons stay independently operable.

Fixes ChainLearnOfficial#561
The wallet dropdown used role="menu"/"menuitem" but only handled Escape
and click-outside. WCAG requires arrow-key navigation for menu widgets.
Move focus between menu items with ArrowUp/ArrowDown and jump to first/
last with Home/End; Escape already closes and restores focus to the
trigger.

Fixes ChainLearnOfficial#562
@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for chainlearn failed.

Name Link
🔨 Latest commit 8d6f698
🔍 Latest deploy log https://app.netlify.com/projects/chainlearn/deploys/6ada6dfd3f12d112be52bee5

@DeFiVC
DeFiVC merged commit f836d98 into ChainLearnOfficial:main Oct 22, 2026
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants