Skip to content

Implement Keyboard Navigation for All Interactive Elements#649

Open
Emmy6654 wants to merge 2 commits into
StellarDevHub:mainfrom
Emmy6654:main
Open

Implement Keyboard Navigation for All Interactive Elements#649
Emmy6654 wants to merge 2 commits into
StellarDevHub:mainfrom
Emmy6654:main

Conversation

@Emmy6654
Copy link
Copy Markdown

@Emmy6654 Emmy6654 commented Jun 2, 2026

Closes #600

Summary

Implements comprehensive keyboard navigation support for all interactive elements with focus management and skip links, ensuring equal access for all students.

Changes

New files

  • src/lib/keyboard-navigation.ts — Core keyboard utilities
  • src/hooks/useKeyboardNavigation.ts — Global shortcuts, arrow navigation, type-ahead, focus-visible
  • src/hooks/useFocusTrap.ts — Focus trapping for modals
  • src/hooks/useRovingTabindex.ts — WAI-ARIA roving tabindex
  • src/components/ui/SkipLink.tsx — Skip-to-content with multiple targets
  • src/components/ui/FocusTrap.tsx — FocusTrap component
  • 6 test files with 115 tests

Modified files

  • Dialog, index.ts, globals.css, layout.tsx, setup.ts, vitest.config.ts

Testing

  • 115 tests, >90% coverage: 95.3% stmts, 85.4% branches, 98.3% funcs, 99% lines

Closes #603

  • Replaced express-rate-limit + old apiRateLimiter with new rateLimiter middleware
  • Rate limiting is conditionally applied via config.rateLimiting.enabled
  • Wires env-var overrides for login/register limits

Modified: backend/src/config/env.config.ts

  • Added rateLimiting config section with env-var-backed settings

Modified: backend/.env.example

  • Added all RATE_LIMIT_* environment variables with documentation

Configuration via environment variables

Variable Default Description
RATE_LIMIT_ENABLED true Toggle rate limiting
RATE_LIMIT_BURST_MAX 20 Default burst limit (unauth)
RATE_LIMIT_SUSTAINED_MAX 200 Default sustained limit (unauth)
RATE_LIMIT_AUTH_BURST_MAX 80 Burst limit for authenticated users
RATE_LIMIT_AUTH_SUSTAINED_MAX 600 Sustained limit for authenticated users
RATE_LIMIT_ADMIN_BURST_MAX 200 Burst limit for admin users
RATE_LIMIT_ADMIN_SUSTAINED_MAX 2000 Sustained limit for admin users
RATE_LIMIT_LOGIN_BURST_MAX 5 Login endpoint burst limit
RATE_LIMIT_REGISTER_BURST_MAX 3 Registration endpoint burst limit

Testing

  • Rate limiting applied globally with per-endpoint override rules
  • Authenticated users tracked by userId, anonymous by IP
  • Both burst and sustained limits must be satisfied
  • Fail-open when Redis is unavailable
  • Skipped entirely in test environment

Emmy6654 added 2 commits June 2, 2026 09:16
…t and skip links

- Add keyboard navigation utilities (KEYS, FOCUSABLE_SELECTOR, focus helpers, arrow/grid nav)
- Add useGlobalShortcuts, useArrowNavigation, useTypeAhead, useKeyboardNavigation, useFocusVisible hooks
- Add useFocusTrap hook with Tab/Shift+Tab cycling, Escape handling, return focus on deactivate
- Add useRovingTabindex hook for WAI-ARIA roving tabindex patterns
- Add SkipLink component with multiple focus targets and SkipLinkTarget wrapper
- Add FocusTrap component wrapping useFocusTrap
- Integrate focus trap into Dialog component with aria-modal
- Update root layout with enhanced skip links
- Add keyboard navigation CSS (skip-link, forced-colors, focus-visible for ARIA roles)
- Add setup cleanup to test infrastructure
- 115 comprehensive unit tests across 6 test files with >90% coverage

Closes StellarDevHub#650
feat: full keyboard navigation support with focus management and skip links
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

@Emmy6654 is attempting to deploy a commit to the Ayomide Adeniran's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Jun 2, 2026

@Emmy6654 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

[Frontend] Add Print-Friendly Styles for Learning Materials and Certificates [Frontend] Implement Keyboard Navigation for All Interactive Elements

1 participant