Skip to content

feat: improve roadmap accessibility and WCAG 2.1 compliance#319

Merged
Sachinchaurasiya360 merged 1 commit into
Sachinchaurasiya360:mainfrom
bhargavi075:feat/roadmap-accessibility
May 21, 2026
Merged

feat: improve roadmap accessibility and WCAG 2.1 compliance#319
Sachinchaurasiya360 merged 1 commit into
Sachinchaurasiya360:mainfrom
bhargavi075:feat/roadmap-accessibility

Conversation

@bhargavi075
Copy link
Copy Markdown

@bhargavi075 bhargavi075 commented May 18, 2026

Summary

This PR improves accessibility across roadmap-related pages and components to better align with WCAG 2.1 AA standards.

Accessibility Improvements Included

  • Improved keyboard navigation and focus order
  • Added visible focus indicators for interactive elements
  • Improved semantic HTML structure
  • Added ARIA attributes where necessary
  • Improved accessibility for roadmap cards, filters, buttons, and modals
  • Enhanced screen-reader support
  • Improved progress bar accessibility
  • Added accessible breadcrumb navigation
  • Improved form labeling and toggle states

Areas Covered

  • Roadmap dashboard
  • Roadmap listing page
  • Roadmap detail page
  • Roadmap topic page
  • Enrollment flow
  • Completion modal

Validation Performed

  • Manual keyboard navigation testing
  • Focus visibility testing
  • Semantic accessibility review
  • WCAG-focused accessibility improvements

This PR preserves the existing UI and functionality while improving accessibility and usability for keyboard and assistive technology users.

Summary by CodeRabbit

Refactor

  • Enhanced keyboard navigation and visual focus indicators across all student roadmap pages, including completion modal, dashboard, detail view, enrollment steps, topic pages, and landing page.
  • Improved semantic structure and labeling throughout the roadmap interface to better support screen reader navigation and provide clearer context for interactive elements.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 18, 2026

📝 Walkthrough

Walkthrough

This PR enhances accessibility across six roadmap UI components by adding ARIA attributes, focus management, semantic HTML elements, and keyboard navigation indicators. Changes include automatic focus handling for modal close buttons, semantic progress bar and list markup, focus-visible ring styling for keyboard navigation, dynamic aria-labels reflecting component state, and proper heading hierarchy for content structure.

Changes

Roadmap Accessibility Improvements

Layer / File(s) Summary
Completion modal focus and button accessibility
client/src/module/student/roadmap/RoadmapCompletionModal.tsx
Adds automatic keyboard focus to the close button when the modal opens via useEffect, updates the close button with aria-label and keyboard focus-visible ring styling, and applies focus-visible ring styling to share buttons (X, LinkedIn, native share) and dismiss button while marking decorative share icons as aria-hidden.
Dashboard page structure and card accessibility
client/src/module/student/roadmap/RoadmapDashboardPage.tsx
Updates main container to semantic <main> element, adds aria-busy and aria-label to loading state, marks empty state icon as aria-hidden, converts roadmap cards to <article> elements with aria-labels describing completion percentage, restructures progress bar with role="progressbar" and ARIA value attributes, and adds dynamic aria-labels to the download button indicating download state.
Detail page metadata and interactive sections accessibility
client/src/module/student/roadmap/RoadmapDetailPage.tsx
Marks metadata icons (hours, topics, status) as aria-hidden, adds focus-visible styling and aria-hidden to the syllabus <summary> and chevron icon, and wires FAQ accordion buttons with id, aria-expanded, aria-controls while connecting answer panels with id, role="region", and aria-labelledby for semantic relationships.
Enrollment step indicators and form controls accessibility
client/src/module/student/roadmap/RoadmapEnrollPage.tsx
Restructures step indicator as semantic list using role="list" and role="listitem" with aria-current for the active step, adds aria-live="polite" and aria-atomic="true" to the progress percentage announcement region, augments the hours-per-week range input with ARIA range metadata (aria-label, aria-valuemin, aria-valuemax, aria-valuenow), and applies aria-pressed and aria-label to day, experience level, and goal selection buttons.
Topic page breadcrumbs, buttons, and notes accessibility
client/src/module/student/roadmap/RoadmapTopicPage.tsx
Adds aria-hidden to breadcrumb chevrons and aria-current="page" to the current crumb, applies aria-pressed to completion and bookmark toggle buttons while marking icons as aria-hidden, marks resource external-link icon as aria-hidden, converts "Mini project" and "Self-check" labels from <p> to <h2> headings, and adds screen-reader-only label, focus-visible styling, and aria-hidden icons to the notes editor textarea.
Landing page search, filters, and card listing accessibility
client/src/module/student/roadmap/RoadmapsLandingPage.tsx
Marks AI CTA arrow as aria-hidden, adds aria-label and aria-hidden to search clear button, applies role="group" and aria-label to filter groups with aria-hidden label text spans, adds aria-live="polite" region to results count, updates RoadmapSection with aria-label and aria-hidden count span, restructures RoadmapCard as <li> with aria-label on the link including enrollment progress and focus-visible ring styling while marking decorative elements aria-hidden and adding full progressbar ARIA attributes, and applies aria-pressed={active} to FilterChip toggle state.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related issues

  • #97: Concrete accessibility/ARIA and focus-related enhancements aligned with WCAG 2.1 AA compliance objectives across the same roadmap pages and components.

Suggested labels

enhancement

🐰 Accessible pathways bloom,
From clicks to keyboard calls,
Focus rings light the way through,
Each button, each badge now seen—
A kindlier roadmap rises.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the primary change: improving roadmap accessibility and WCAG 2.1 compliance, which aligns directly with the changeset across multiple roadmap-related components.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bhargavi075
Copy link
Copy Markdown
Author

Implemented focused WCAG-oriented accessibility improvements across roadmap pages, including keyboard navigation enhancements, semantic structure fixes, visible focus states, and screen-reader support while preserving the existing UI and functionality. Looking forward to your feedback and review.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
client/src/module/student/roadmap/RoadmapCompletionModal.tsx (2)

222-222: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Replace arbitrary text size with standard Tailwind scale class.

The text-[10px] utility uses an arbitrary bracket size, which violates the coding guidelines. Use the standard text-xs class instead (12px is the closest standard size).

As per coding guidelines, "Do not use arbitrary bracket sizes like text-[17px], use standard scale classes instead".

♻️ Proposed fix
-              <p className="text-[10px] font-mono uppercase tracking-[0.28em] text-lime-400 mb-2">
+              <p className="text-xs font-mono uppercase tracking-[0.28em] text-lime-400 mb-2">
                 roadmap complete
               </p>
-              <p className="text-[10px] font-mono uppercase tracking-[0.22em] text-stone-500 mb-4">
+              <p className="text-xs font-mono uppercase tracking-[0.22em] text-stone-500 mb-4">
                 share your achievement
               </p>

Also applies to: 253-253

🤖 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 `@client/src/module/student/roadmap/RoadmapCompletionModal.tsx` at line 222,
There are Tailwind arbitrary text-size utilities used in RoadmapCompletionModal
(className containing "text-[10px]" on the paragraph elements); replace those
arbitrary sizes with the standard scale class "text-xs" in the affected elements
(e.g., the <p> with className including "text-[10px] font-mono ..." and the
other occurrence around line 253) so the components use the approved Tailwind
scale.

181-181: 🛠️ Refactor suggestion | 🟠 Major | ⚡ Quick win

Replace bg-gradient-* with bg-linear-* for Tailwind v4 compliance.

Tailwind CSS v4 requires using bg-linear-to-* instead of the deprecated bg-gradient-to-* shorthand.

As per coding guidelines, "Use bg-linear-to-* instead of bg-gradient-* shorthand in TailwindCSS".

♻️ Proposed fix
-          <div className="absolute top-0 inset-x-0 h-px bg-gradient-to-r from-transparent via-lime-400/60 to-transparent" />
+          <div className="absolute top-0 inset-x-0 h-px bg-linear-to-r from-transparent via-lime-400/60 to-transparent" />
-              className="my-6 h-px bg-gradient-to-r from-transparent via-white/10 to-transparent"
+              className="my-6 h-px bg-linear-to-r from-transparent via-white/10 to-transparent"

Also applies to: 243-243

🤖 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 `@client/src/module/student/roadmap/RoadmapCompletionModal.tsx` at line 181,
Update the Tailwind utility class used in RoadmapCompletionModal: replace any
occurrences of the deprecated "bg-gradient-to-r" shorthand (e.g., the div with
className containing "bg-gradient-to-r from-transparent via-lime-400/60
to-transparent") with the Tailwind v4 compliant "bg-linear-to-r" variant; search
for the same pattern in RoadmapCompletionModal (also appears around the other
occurrence noted) and change each "bg-gradient-to-*" to "bg-linear-to-*" while
keeping the color stops and opacity parts intact.
🧹 Nitpick comments (1)
client/src/module/student/roadmap/RoadmapsLandingPage.tsx (1)

495-503: 🏗️ Heavy lift

Refactor FilterChip onClick to use stable callback reference for effective memoization.

FilterChip is rendered in mapped filter lists (category, tags, level). To implement React.memo effectively, the inline onClick arrow functions need to be stabilized—currently they're recreated every parent render, defeating memoization benefits. Use useCallback to memoize the handlers, then wrap the component with React.memo (named function form).

RoadmapCard can be memoized with stable props, but verify enrollment data stability first.

🤖 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 `@client/src/module/student/roadmap/RoadmapsLandingPage.tsx` around lines 495 -
503, The FilterChip onClick handlers are created inline inside the mapped lists,
preventing React.memo from working; update RoadmapCard to use named function
component form and wrap it with React.memo, and change each inline onClick
passed to FilterChip to a stable, memoized callback via useCallback (e.g.,
create handleCategoryClick, handleTagClick, handleLevelClick inside
RoadmapCard), ensuring their dependency arrays only include the minimal stable
values they need (like the filter dispatch or setter). Also ensure any props
passed into RoadmapCard (including enrollment) are stable or normalized before
memoizing the component so memoization is effective.
🤖 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.

Inline comments:
In `@client/src/module/student/roadmap/RoadmapsLandingPage.tsx`:
- Line 610: Replace the non-standard pill and arbitrary text-size classes in the
FilterChip styling: in the FilterChip component (the JSX using className={`px-3
py-1 rounded-full text-[10px] ...`}) change rounded-full to rounded-md and
change text-[10px] to the standard Tailwind v4 class text-xs so the filter pills
follow the guideline and use supported utility classes.
- Line 318: In the RoadmapsLandingPage React component, replace all uses of the
arbitrary Tailwind class text-[10px] with the standard text-xs class; search for
occurrences of className values containing "text-[10px]" (for example the span
element currently rendering Category: and other spans) and swap the token to
"text-xs" so the JSX className strings conform to Tailwind v4 canonical scale
while preserving the rest of each className and attributes like aria-hidden.

---

Outside diff comments:
In `@client/src/module/student/roadmap/RoadmapCompletionModal.tsx`:
- Line 222: There are Tailwind arbitrary text-size utilities used in
RoadmapCompletionModal (className containing "text-[10px]" on the paragraph
elements); replace those arbitrary sizes with the standard scale class "text-xs"
in the affected elements (e.g., the <p> with className including "text-[10px]
font-mono ..." and the other occurrence around line 253) so the components use
the approved Tailwind scale.
- Line 181: Update the Tailwind utility class used in RoadmapCompletionModal:
replace any occurrences of the deprecated "bg-gradient-to-r" shorthand (e.g.,
the div with className containing "bg-gradient-to-r from-transparent
via-lime-400/60 to-transparent") with the Tailwind v4 compliant "bg-linear-to-r"
variant; search for the same pattern in RoadmapCompletionModal (also appears
around the other occurrence noted) and change each "bg-gradient-to-*" to
"bg-linear-to-*" while keeping the color stops and opacity parts intact.

---

Nitpick comments:
In `@client/src/module/student/roadmap/RoadmapsLandingPage.tsx`:
- Around line 495-503: The FilterChip onClick handlers are created inline inside
the mapped lists, preventing React.memo from working; update RoadmapCard to use
named function component form and wrap it with React.memo, and change each
inline onClick passed to FilterChip to a stable, memoized callback via
useCallback (e.g., create handleCategoryClick, handleTagClick, handleLevelClick
inside RoadmapCard), ensuring their dependency arrays only include the minimal
stable values they need (like the filter dispatch or setter). Also ensure any
props passed into RoadmapCard (including enrollment) are stable or normalized
before memoizing the component so memoization is effective.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2e85fcb5-1516-4848-97ec-4795fdf24f6c

📥 Commits

Reviewing files that changed from the base of the PR and between 3552efa and 4dc407e.

📒 Files selected for processing (6)
  • client/src/module/student/roadmap/RoadmapCompletionModal.tsx
  • client/src/module/student/roadmap/RoadmapDashboardPage.tsx
  • client/src/module/student/roadmap/RoadmapDetailPage.tsx
  • client/src/module/student/roadmap/RoadmapEnrollPage.tsx
  • client/src/module/student/roadmap/RoadmapTopicPage.tsx
  • client/src/module/student/roadmap/RoadmapsLandingPage.tsx

<div className="flex flex-wrap items-center gap-2">
<span className="text-[10px] font-mono uppercase tracking-widest text-stone-400 mr-2">Category:</span>
<div className="flex flex-wrap items-center gap-2" role="group" aria-label="Filter by category">
<span className="text-[10px] font-mono uppercase tracking-widest text-stone-400 mr-2" aria-hidden="true">Category:</span>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify arbitrary text-size utilities in TS/TSX files
rg -n --type=tsx --type=ts 'text-\[[0-9]+px\]'

Repository: Sachinchaurasiya360/InternHack

Length of output: 102


🏁 Script executed:

# Corrected script - search for arbitrary text sizes in the target file
rg 'text-\[[0-9]+px\]' client/src/module/student/roadmap/RoadmapsLandingPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 2045


🏁 Script executed:

# Also check for rounded-full usage in the same file
rg 'rounded-full' client/src/module/student/roadmap/RoadmapsLandingPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 280


🏁 Script executed:

# Check the file size and then read specific line ranges
wc -l client/src/module/student/roadmap/RoadmapsLandingPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 136


🏁 Script executed:

# Read the file to check context around the mentioned lines and React.memo usage
sed -n '310,330p' client/src/module/student/roadmap/RoadmapsLandingPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 1079


🏁 Script executed:

# Check context around rounded-full usage
sed -n '605,620p' client/src/module/student/roadmap/RoadmapsLandingPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 661


🏁 Script executed:

# Check for React.memo usage and list rendering patterns
rg -n 'React\.memo|\.map\(' client/src/module/student/roadmap/RoadmapsLandingPage.tsx | head -20

Repository: Sachinchaurasiya360/InternHack

Length of output: 573


🏁 Script executed:

# Check imports to see if Button component is being used
head -50 client/src/module/student/roadmap/RoadmapsLandingPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 1783


Replace arbitrary text-[10px] with standard scale class text-xs.

Lines 318, 331, 373, 476, 484, 526, 556, 557, and 578 use the arbitrary size text-[10px]. Switch to text-xs (Tailwind's standard 12px scale) to comply with the canonical TailwindCSS v4 class policy.

🤖 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 `@client/src/module/student/roadmap/RoadmapsLandingPage.tsx` at line 318, In
the RoadmapsLandingPage React component, replace all uses of the arbitrary
Tailwind class text-[10px] with the standard text-xs class; search for
occurrences of className values containing "text-[10px]" (for example the span
element currently rendering Category: and other spans) and swap the token to
"text-xs" so the JSX className strings conform to Tailwind v4 canonical scale
while preserving the rest of each className and attributes like aria-hidden.

<button
onClick={onClick}
aria-pressed={active}
className={`px-3 py-1 rounded-full text-[10px] font-mono uppercase tracking-widest transition-all ${
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify rounded-full usage in roadmap landing file
rg -n 'rounded-full' client/src/module/student/roadmap/RoadmapsLandingPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 288


🏁 Script executed:

sed -n '600,620p' client/src/module/student/roadmap/RoadmapsLandingPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 699


🏁 Script executed:

sed -n '550,650p' client/src/module/student/roadmap/RoadmapsLandingPage.tsx | head -100

Repository: Sachinchaurasiya360/InternHack

Length of output: 3065


🏁 Script executed:

# Find where FilterChip is used to understand its location on the page
rg -n 'FilterChip' client/src/module/student/roadmap/RoadmapsLandingPage.tsx | head -20

Repository: Sachinchaurasiya360/InternHack

Length of output: 289


🏁 Script executed:

sed -n '310,360p' client/src/module/student/roadmap/RoadmapsLandingPage.tsx

Repository: Sachinchaurasiya360/InternHack

Length of output: 2749


Replace rounded-full and text-[10px] with standard TailwindCSS v4 classes in FilterChip component.

The FilterChip component (line 610) uses rounded-full for filter pills (Category, Tags, Level), which violates the guideline against pill badges. Replace rounded-full with rounded-md and replace the arbitrary bracket size text-[10px] with the standard class text-xs.

Code location
className={`px-3 py-1 rounded-full text-[10px] font-mono uppercase tracking-widest transition-all ${
🤖 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 `@client/src/module/student/roadmap/RoadmapsLandingPage.tsx` at line 610,
Replace the non-standard pill and arbitrary text-size classes in the FilterChip
styling: in the FilterChip component (the JSX using className={`px-3 py-1
rounded-full text-[10px] ...`}) change rounded-full to rounded-md and change
text-[10px] to the standard Tailwind v4 class text-xs so the filter pills follow
the guideline and use supported utility classes.

@Sachinchaurasiya360 Sachinchaurasiya360 added enhancement New feature or request level:beginner Good for first-time contributors gssoc:approved Approved for GSSoC scoring labels May 21, 2026
@Sachinchaurasiya360 Sachinchaurasiya360 merged commit fe04c4a into Sachinchaurasiya360:main May 21, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gssoc:approved Approved for GSSoC scoring level:beginner Good for first-time contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants