-
Notifications
You must be signed in to change notification settings - Fork 2
feat(connections): Enhance connections page with improved accessibility and UX #275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…ty and UX - Add screen reader announcements for tab changes - Implement responsive tab design with mobile-friendly layouts - Add keyboard navigation support for connection stats cards - Introduce new CSS animations for smoother interactions - Enhance focus and hover states for better user engagement - Improve tab content transitions with fade-in animation - Add count animation for connection statistics - Implement touch-friendly button sizing for mobile devices Improves overall user experience and accessibility for the connections page, making navigation more intuitive and interactive across different devices.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughThis PR enhances the connections UI with CSS animations, responsive design improvements, and comprehensive accessibility features including screen reader announcements, keyboard navigation support for interactive cards, and aria attributes across multiple components. Changes
Sequence DiagramsequenceDiagram
actor User
participant Tab as Tab Component
participant Page as Connections Page
participant AnnouncementRegion as Screen Reader<br/>Announcement Region
participant TabContent as Tab Content
User->>Tab: Click/Enter/Space on tab
Tab->>Page: Trigger handleTabChange()
Page->>Page: Update activeTab state
Page->>AnnouncementRegion: Set announcement message
AnnouncementRegion->>AnnouncementRegion: Announce to screen reader
Page->>TabContent: Render with animate-fadeIn
TabContent-->>User: Visual fade-in effect
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
app/globals.css(1 hunks)app/protected/connections/page.tsx(1 hunks)components/connections/ConnectionStats.tsx(1 hunks)components/connections/UserCard.tsx(3 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
app/protected/connections/page.tsx (3)
components/connections/ConnectionStats.tsx (1)
ConnectionStats(13-97)components/connections/FollowingList.tsx (1)
FollowingList(18-115)components/connections/FollowersList.tsx (1)
FollowersList(19-123)
components/connections/UserCard.tsx (1)
components/ui/button.tsx (1)
Button(59-59)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Test Suite
🔇 Additional comments (13)
app/globals.css (4)
493-507: LGTM! Count animation with bounce effect.The
countUpanimation with cubic-bezier easing provides a pleasant bounce effect for statistics. The timing and scale values are well-chosen for smooth number transitions.
509-524: LGTM! Button press feedback animation.The press animation provides clear tactile feedback with appropriate timing (0.2s) and scale values for interactive elements.
526-530: LGTM! Keyboard navigation focus styles.The
.focus-visible:focusselector properly targets keyboard-only focus states, avoiding unwanted outlines on mouse clicks while maintaining accessibility.
532-538: LGTM! Touch-friendly sizing meets WCAG guidelines.The 44x44px minimum touch target size meets WCAG 2.5.5 Level AAA requirements, ensuring accessible tap targets on mobile devices.
components/connections/ConnectionStats.tsx (4)
58-68: Excellent keyboard navigation implementation!The card properly implements interactive accessibility with
role="button",tabIndex={0}, and keyboard event handlers for Enter and Space keys. Thee.preventDefault()for Space key correctly prevents unwanted page scrolling.
68-68: Well-crafted dynamic aria-labels.The aria-labels provide clear, contextual information including both the action ("View following list") and the current state ("You are following X users"), which is excellent for screen reader users.
Also applies to: 87-87
71-71: LGTM! Icons properly marked as decorative.Setting
aria-hidden="true"on icons is correct since they're purely decorative and the accompanying text and aria-labels already convey the meaning.Also applies to: 90-90
74-74: LGTM! Count animation enhances visual feedback.The
animate-countUpclass provides subtle visual emphasis when statistics load or update, improving the user experience without being distracting.Also applies to: 93-93
components/connections/UserCard.tsx (1)
158-162: Excellent accessibility enhancement across all action buttons!All buttons now include:
- Descriptive
aria-labelattributes with dynamic user names providing clear contextaria-hidden="true"on decorative iconsactive:animate-buttonPressfor tactile feedbackThe consistent application of these patterns across View, Message, Unfollow, and Follow buttons creates a cohesive, accessible user experience.
Also applies to: 171-175, 185-189, 196-200
app/protected/connections/page.tsx (4)
15-15: Well-implemented screen reader announcement mechanism!The
handleTabChangefunction properly manages both the visual tab state and screen reader announcements. The human-readable tab names in thetabNamesrecord provide clear context for assistive technology users.Also applies to: 17-25
29-32: LGTM! Proper ARIA live region implementation.The announcement region uses:
aria-live="polite"for non-disruptive announcementsrole="status"to identify the region's purposearia-atomic="true"to ensure complete message reading.sr-onlyto hide visually while remaining accessibleThis follows WCAG 2.1 guidelines for status messages.
48-60: Excellent responsive tab design!The mobile-first approach with:
flex-col sm:flex-rowfor vertical stacking on small screenstext-xs sm:text-smfor appropriate font sizingpy-2 sm:py-1.5for touch-friendly spacingh-autofor flexible heightThis ensures tabs remain usable and accessible across all device sizes while maintaining the WCAG 2.5.5 touch target requirements.
63-63: LGTM! Smooth tab content transitions.The
animate-fadeInclass provides subtle visual feedback during tab switches, enhancing the user experience without being disruptive. The 0.3s duration is appropriate for content transitions.Also applies to: 67-67, 71-71
|
|
||
| /* Tab content animations */ | ||
| @keyframes fadeIn { | ||
| from { | ||
| opacity: 0; | ||
| transform: translateY(10px); | ||
| } | ||
| to { | ||
| opacity: 1; | ||
| transform: translateY(0); | ||
| } | ||
| } | ||
|
|
||
| .animate-fadeIn { | ||
| animation: fadeIn 0.3s ease-out; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove duplicate fadeIn animation definition.
The fadeIn keyframes are already defined at lines 176-186. This duplicate definition is unnecessary and can cause confusion. The utility class names also differ (.animate-fade-in vs .animate-fadeIn), which may lead to inconsistent usage.
Apply this diff to remove the duplicate:
-/* Tab content animations */
-@keyframes fadeIn {
- from {
- opacity: 0;
- transform: translateY(10px);
- }
- to {
- opacity: 1;
- transform: translateY(0);
- }
-}
-
.animate-fadeIn {
animation: fadeIn 0.3s ease-out;
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| /* Tab content animations */ | |
| @keyframes fadeIn { | |
| from { | |
| opacity: 0; | |
| transform: translateY(10px); | |
| } | |
| to { | |
| opacity: 1; | |
| transform: translateY(0); | |
| } | |
| } | |
| .animate-fadeIn { | |
| animation: fadeIn 0.3s ease-out; | |
| } | |
| .animate-fadeIn { | |
| animation: fadeIn 0.3s ease-out; | |
| } |
🤖 Prompt for AI Agents
In app/globals.css around lines 476-491, remove the duplicate @keyframes fadeIn
block and the .animate-fadeIn utility; instead ensure the single canonical
@keyframes fadeIn (defined at lines 176-186) is used and either rename or map
the utility to the existing class naming convention (.animate-fade-in) so usage
is consistent across the codebase (delete the duplicate keyframes + utility and,
if needed, add/rename a utility to .animate-fade-in that references the existing
animation).
Summary by CodeRabbit
New Features
Style