Skip to content
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

Fix the accessibility issue by adding DialogTitle to DialogContent and making the facility title responsive #10106

Merged
merged 10 commits into from
Jan 30, 2025

Conversation

modamaan
Copy link
Contributor

@modamaan modamaan commented Jan 22, 2025

Proposed Changes

CARE.-.DialogTitleError.2025-01-22.23-36-05.mp4

Updated

CARE.-.DialogTitleSolved.2025-01-22.23-38-19.mp4

@ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

Summary by CodeRabbit

  • Accessibility Improvements

    • Added a hidden title for screen readers in the mobile sidebar view, enhancing the user experience for assistive technology users.
  • User Interface Enhancements

    • Improved responsiveness and visual alignment in the FacilityHome component.
    • Integrated tooltip functionality for additional context on facility names.
    • Adjusted avatar size for better display on smaller screens.
    • Modified title font size and added truncation to prevent overflow.
    • Changed dropdown menu width for a more compact appearance on smaller screens.
    • Updated contact information layout for improved responsiveness across devices.
  • Localization

    • Added a new entry for "facility_actions_menu" to the localization dictionary.

@modamaan modamaan requested a review from a team as a code owner January 22, 2025 18:11
Copy link
Contributor

coderabbitai bot commented Jan 22, 2025

Walkthrough

The pull request introduces an accessibility enhancement to the Sidebar component by adding a VisuallyHidden title from Radix UI. This change addresses a potential screen reader accessibility issue by providing a hidden title for the sidebar when viewed on mobile devices. The modification involves importing the VisuallyHidden and SheetTitle components and wrapping the sidebar title in a way that improves semantic structure without changing the visual presentation. Additionally, the FacilityHome component has undergone layout and styling adjustments to enhance responsiveness, including tooltip integration and responsive design changes. A new localization entry has also been added for the facility actions menu.

Changes

File Change Summary
src/components/ui/sidebar.tsx - Added import for VisuallyHidden from @radix-ui/react-visually-hidden
- Added SheetTitle to existing imports
- Wrapped sidebar title with VisuallyHidden component
src/components/Facility/FacilityHome.tsx - Integrated tooltip functionality with new imports
- Adjusted layout and styling for responsiveness
- Modified flexbox classes for better alignment
- Changed avatar size and title font size
- Updated dropdown menu width
- Altered contact information layout
public/locale/en.json - Added new key-value pair for "facility_actions_menu": "Facility action menu"
src/components/Resource/ResourceBoard.tsx - Removed ESLint comment line that disables warnings

Possibly related PRs

Suggested labels

tested

Suggested reviewers

  • Jacobjeevan
  • rithviknishad

Poem

🐰 A sidebar so sleek, yet hidden from sight,
Accessibility leaps with rabbit-like might!
VisuallyHidden, a whisper so clear,
Guiding screen readers without any fear.
Code magic unfurls, with accessibility's grace! 🌈


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d9424e4 and 8bb6a58.

📒 Files selected for processing (4)
  • public/locale/en.json (1 hunks)
  • src/components/Facility/FacilityHome.tsx (3 hunks)
  • src/components/Resource/ResourceBoard.tsx (1 hunks)
  • src/components/ui/sidebar.tsx (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • src/components/Resource/ResourceBoard.tsx
🚧 Files skipped from review as they are similar to previous changes (3)
  • public/locale/en.json
  • src/components/ui/sidebar.tsx
  • src/components/Facility/FacilityHome.tsx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Jan 22, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 8bb6a58
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/6798cfea767cdb000868f203
😎 Deploy Preview https://deploy-preview-10106--care-ohc.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
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: 0

🧹 Nitpick comments (1)
src/components/ui/sidebar.tsx (1)

211-213: Consider internationalizing the sidebar title.

The accessibility enhancement looks good! However, the hardcoded "Sidebar" text should be moved to the i18n files to support multiple languages.

 <VisuallyHidden>
-  <SheetTitle>Sidebar</SheetTitle>
+  <SheetTitle>{t('common.sidebar.title')}</SheetTitle>
 </VisuallyHidden>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6eea7f5 and 4b365ab.

📒 Files selected for processing (1)
  • src/components/ui/sidebar.tsx (3 hunks)
🔇 Additional comments (1)
src/components/ui/sidebar.tsx (1)

2-2: LGTM! Good choice of accessibility components.

The addition of Radix UI's VisuallyHidden and SheetTitle components is a solid choice for improving screen reader accessibility.

Also applies to: 13-13

@modamaan modamaan changed the title Fix accessibility issue by adding DialogTitle to DialogContent Fix the accessibility issue by adding DialogTitle to DialogContent and making the facility title responsive Jan 22, 2025
Copy link
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: 1

🧹 Nitpick comments (2)
src/components/Facility/FacilityHome.tsx (2)

227-232: Consider adding aria-label to improve accessibility

The responsive design changes look great! However, since this is an accessibility-focused PR, consider adding an aria-label to the Avatar component when the facility name is truncated to ensure screen readers can access the full name.

 <Avatar
   name={facilityData.name}
+  aria-label={facilityData.name}
   className="h-9 w-9 md:h-12 md:w-12 shrink-0 rounded-xl border-2 border-white/10 shadow-xl"
 />

Line range hint 222-296: Additional accessibility improvements needed

While the responsive design changes are excellent, considering this PR's focus on accessibility, consider implementing these additional improvements:

  1. Add appropriate ARIA landmarks for main content sections
  2. Ensure proper heading hierarchy throughout the component
  3. Add keyboard navigation support for interactive elements
  4. Consider adding skip links for screen readers

Example implementation for landmarks:

-<div className="container mx-auto p-6">
+<main className="container mx-auto p-6" role="main">
   <div className="mx-auto max-w-3xl space-y-6">
+    <section aria-label={t("facility_information")}>
       {/* existing content */}
+    </section>
   </div>
-</div>
+</main>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b365ab and 6f92213.

📒 Files selected for processing (1)
  • src/components/Facility/FacilityHome.tsx (2 hunks)
🔇 Additional comments (2)
src/components/Facility/FacilityHome.tsx (2)

222-224: Great responsive layout improvements!

The flex container changes with flex-wrap and min-width-0 effectively prevent content overflow, while responsive gap adjustments ensure consistent spacing across different screen sizes.


296-296: Good responsive layout for contact information!

The switch from column to row layout on larger screens improves content organization and readability.

src/components/Facility/FacilityHome.tsx Outdated Show resolved Hide resolved
src/components/Facility/FacilityHome.tsx Outdated Show resolved Hide resolved
src/components/Facility/FacilityHome.tsx Outdated Show resolved Hide resolved
Copy link

👋 Hi, @modamaan,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Jan 28, 2025
@modamaan
Copy link
Contributor Author

@nihal467

@github-actions github-actions bot removed the merge conflict pull requests with merge conflict label Jan 28, 2025
@modamaan modamaan requested a review from Jacobjeevan January 29, 2025 13:41
@nihal467
Copy link
Member

LGTM

@rithviknishad rithviknishad merged commit bd0557b into ohcnetwork:develop Jan 30, 2025
15 of 16 checks passed
Copy link

@modamaan Your efforts have helped advance digital healthcare and TeleICU systems. 🚀 Thank you for taking the time out to make CARE better. We hope you continue to innovate and contribute; your impact is immense! 🙌

@coderabbitai coderabbitai bot mentioned this pull request Jan 31, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants