Skip to content

fix: CSS and a11y in class-detail components#1163

Merged
carddev81 merged 1 commit into
mainfrom
cpride/class-detail-a11y
Jun 9, 2026
Merged

fix: CSS and a11y in class-detail components#1163
carddev81 merged 1 commit into
mainfrom
cpride/class-detail-a11y

Conversation

@corypride

@corypride corypride commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Summary

Three small UX/a11y fixes in frontend/src/pages/class-detail/ surfaced by CodeRabbit on PR #1133. All were preexisting; extracted into named components by Split 3.

  • ClassNotFoundCard — Added min-h-screen to the outer wrapper so items-center has a height to center against. Without it the "Class Not Found" card rendered flush to the top of the page. Also corrected Tailwind class order (bg-surface-hover moved after layout utilities).

  • LoadingSkeleton — Replaced fixed grid-cols-5 and grid-cols-3 with responsive variants to prevent horizontal overflow on narrow screens:

    • Header: grid-cols-2 sm:grid-cols-3 lg:grid-cols-5
    • Cards: grid-cols-1 sm:grid-cols-2 lg:grid-cols-3
  • SessionRow — Added role="button", tabIndex={0}, and an onKeyDown handler (Enter/Space) to the clickable row div so it is reachable and activatable via keyboard. The handler guards with e.target !== e.currentTarget to prevent inner button keypresses (Reschedule, Cancel) from also firing the row's onClick. Also updated 6 flex-shrink-0shrink-0 (canonical Tailwind v3 alias).

Test plan

  • ClassNotFoundCard renders vertically centered at /program-classes/9999999/detail
  • "Back to Classes" navigates to /classes
  • LoadingSkeleton header renders 2-col at 375px, 3-col at 768px, 5-col at 1280px
  • LoadingSkeleton cards render 1-col at 375px, 2-col at 768px, 3-col at 1280px
  • Session rows reachable via Tab with visible focus ring (:focus-visible)
  • Enter and Space activate the row action; Space does not scroll the page
  • Enter on inner Reschedule/Cancel buttons fires only that button's action, not the row's onClick
  • Past and cancelled session rows keyboard accessible
  • No console errors during keyboard navigation

Closes #ID-666


@corypride corypride requested a review from a team as a code owner June 5, 2026 21:41
@corypride corypride requested review from CK-7vn and removed request for a team June 5, 2026 21:41
@coderabbitai

coderabbitai Bot commented Jun 5, 2026

Copy link
Copy Markdown

Ready to act? Review this PR in Change Stack to turn feedback into patch suggestions you can inspect and refine.

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a3469f4b-cdcd-4e43-ba3f-9622c7870043

📥 Commits

Reviewing files that changed from the base of the PR and between 5f9c489 and 5f9af08.

📒 Files selected for processing (3)
  • frontend/src/pages/class-detail/ClassNotFoundCard.tsx
  • frontend/src/pages/class-detail/LoadingSkeleton.tsx
  • frontend/src/pages/class-detail/SessionRow.tsx

📝 Walkthrough

Summary by CodeRabbit

  • Style

    • Improved layout centering and spacing on the class not found card.
    • Enhanced responsive design for loading placeholders with adaptive column layouts across mobile, tablet, and desktop screens.
  • Accessibility

    • Added keyboard navigation support to session rows, enabling interaction via Enter and Space keys.

Walkthrough

This PR updates the class detail page components with styling refinements and accessibility improvements. ClassNotFoundCard container gains min-h-screen sizing, LoadingSkeleton placeholder grids become responsive across breakpoints, SessionRow icons use simplified shrink-0 styling, and the clickable session row becomes keyboard-navigable via Enter and Space keys.

Changes

Class Detail Page UI and Accessibility Improvements

Layer / File(s) Summary
Container and responsive grid styling
frontend/src/pages/class-detail/ClassNotFoundCard.tsx, frontend/src/pages/class-detail/LoadingSkeleton.tsx
ClassNotFoundCard container adds min-h-screen for full-height centering; LoadingSkeleton placeholder grids switch from fixed column counts to responsive breakpoint-based configurations (grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 and grid-cols-1 sm:grid-cols-2 lg:grid-cols-3).
SessionRow icon styling and keyboard accessibility
frontend/src/pages/class-detail/SessionRow.tsx
Icon elements updated to use shrink-0 instead of flex-shrink-0; clickable row becomes keyboard-accessible by adding role="button", tabIndex={0}, and an onKeyDown handler that triggers onClick() on Enter or Space keys with proper target validation and default behavior prevention.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed The title accurately summarizes the main changes: CSS styling fixes and accessibility (a11y) improvements across three class-detail components.
Description check ✅ Passed The description provides clear, detailed explanations of the three component changes, includes specific CSS and accessibility improvements, and outlines a comprehensive test plan.
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 docstrings
  • Create stacked PR
  • Commit on current branch

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.

@carddev81 carddev81 left a comment

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.

Looks good and tested good.

@carddev81 carddev81 merged commit 10794df into main Jun 9, 2026
12 checks passed
@carddev81 carddev81 deleted the cpride/class-detail-a11y branch June 9, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants