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: Overflow for switchers in sidebar, Avatar size in notes tab, Textbox expansion in Add Facility #10005

Merged
merged 6 commits into from
Jan 16, 2025

Conversation

Rishith25
Copy link
Contributor

@Rishith25 Rishith25 commented Jan 16, 2025

Proposed Changes

image

image

image

image

@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

Release Notes

  • Localization

    • Added new translations for organization-related interface elements
    • Introduced internationalization support in organization and facility switchers
  • UI Improvements

    • Enhanced dropdown menus with scrollable content
    • Updated avatar component styling for better layout and centering
    • Adjusted facility creation form text area styling
  • User Experience

    • Improved organization selection and navigation
    • Added visual feedback for selected facilities

@Rishith25 Rishith25 requested a review from a team as a code owner January 16, 2025 04:11
Copy link
Contributor

coderabbitai bot commented Jan 16, 2025

Warning

Rate limit exceeded

@Rishith25 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 1 minutes and 57 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between d8fec9c and dc9309a.

📒 Files selected for processing (3)
  • src/components/ui/sidebar/facility-switcher.tsx (3 hunks)
  • src/components/ui/sidebar/organization-switcher.tsx (5 hunks)
  • src/pages/Encounters/tabs/EncounterNotesTab.tsx (1 hunks)

Walkthrough

This pull request introduces localization updates and UI improvements across multiple components. The changes focus on adding internationalization support to the OrganizationSwitcher, implementing vertical scrolling for facility and organization dropdowns, and adjusting avatar and textarea styling. The modifications enhance user interface flexibility, enable multi-language support, and improve the handling of overflowing content in dropdown menus.

Changes

File Change Summary
public/locale/en.json Added two new localization entries: "my_organizations" and "select_organization"
src/components/ui/sidebar/facility-switcher.tsx Added scrolling and selected state styling to dropdown menu
src/components/ui/sidebar/organization-switcher.tsx Integrated internationalization using react-i18next and added scrolling to dropdown
src/components/Common/Avatar.tsx Modified avatar styling using flexbox and adjusted image/fallback classes
src/components/Facility/CreateFacilityForm.tsx Removed fixed height for textareas and added conditional rendering for organization field

Assessment against linked issues

Objective Addressed Explanation
Vertical Scrolling for Facilities/Organizations
Reduce Avatar Size Minor styling changes, but not explicitly addressing size reduction
TextBox Expansion in Add Facility Removed fixed height constraints for textareas

Possibly related PRs

Suggested labels

needs review, needs testing

Suggested reviewers

  • rithviknishad
  • Jacobjeevan

Poem

🐰 Scrolling dropdowns, dancing with grace,
Translations bloom in every space
Avatars flex, textareas free
A rabbit's code, of UI glee!
Internationalization takes flight 🌍


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 16, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit dc9309a
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/678897ff395a7600080a9799
😎 Deploy Preview https://deploy-preview-10005--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.

@Rishith25 Rishith25 changed the title Overflow for switchers in sidebar Fix: Overflow for switchers in sidebar, Reduce Avatar size in notes tab Jan 16, 2025
src/components/ui/sidebar/facility-switcher.tsx Outdated Show resolved Hide resolved
src/components/ui/sidebar/organization-switcher.tsx Outdated Show resolved Hide resolved
src/pages/Encounters/tabs/EncounterNotesTab.tsx Outdated Show resolved Hide resolved
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 (2)
src/components/Common/Avatar.tsx (2)

69-69: Consider adding size constraints for consistency.

Removing h-full w-full while keeping only aspect-square object-cover might lead to inconsistent avatar sizes. The image will maintain its aspect ratio but could expand beyond intended bounds.

Consider adding specific size classes or ensuring parent components provide proper constraints:

-          className="aspect-square object-cover"
+          className="aspect-square object-cover max-w-full max-h-full"

77-77: Add viewBox-based sizing for SVG fallback.

The SVG fallback uses the same className changes as the image, but SVGs might need more explicit sizing control to maintain consistency with image avatars.

Consider preserving the viewBox proportions:

-            className="aspect-square object-cover"
+            className="aspect-square object-cover w-full h-full"
+            preserveAspectRatio="xMidYMid meet"
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between ffe1c8a and d8fec9c.

📒 Files selected for processing (4)
  • src/components/Common/Avatar.tsx (2 hunks)
  • src/components/Facility/CreateFacilityForm.tsx (0 hunks)
  • src/components/ui/sidebar/facility-switcher.tsx (3 hunks)
  • src/components/ui/sidebar/organization-switcher.tsx (5 hunks)
💤 Files with no reviewable changes (1)
  • src/components/Facility/CreateFacilityForm.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/components/ui/sidebar/organization-switcher.tsx
  • src/components/ui/sidebar/facility-switcher.tsx
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Check linked issues
  • GitHub Check: cypress-run (1)
🔇 Additional comments (1)
src/components/Common/Avatar.tsx (1)

60-60: Verify sizing behavior with flex layout.

The removal of explicit size classes (w-full h-full) in favor of flex layout could affect how the avatar sizes within its parent container. Ensure this change aligns with the PR's goal of reducing avatar size.

Run this script to find avatar usage patterns:

✅ Verification successful

Avatar sizing is properly controlled through explicit size classes.

The removal of w-full h-full classes in favor of flex layout is safe as all avatar instances across the codebase use explicit size classes (e.g., h-6 w-6, h-12 w-12) to control their dimensions. The new flex layout only improves content centering without affecting the sizing behavior.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Find avatar size definitions in parent components
rg -l 'Avatar' | xargs rg -A 3 -B 3 'className.*(?i)(width|height|size|w-\d+|h-\d+)'

Length of output: 108420

@Rishith25 Rishith25 changed the title Fix: Overflow for switchers in sidebar, Reduce Avatar size in notes tab Fix: Overflow for switchers in sidebar, Reduce Avatar size in notes tab, Textbox expansion in Add Facility Jan 16, 2025
src/components/Common/Avatar.tsx Outdated Show resolved Hide resolved
src/components/ui/sidebar/organization-switcher.tsx Outdated Show resolved Hide resolved
src/components/Common/Avatar.tsx Outdated Show resolved Hide resolved
src/components/Common/Avatar.tsx Outdated Show resolved Hide resolved
@Rishith25 Rishith25 changed the title Fix: Overflow for switchers in sidebar, Reduce Avatar size in notes tab, Textbox expansion in Add Facility Fix: Overflow for switchers in sidebar, Avatar size in notes tab, Textbox expansion in Add Facility Jan 16, 2025
@rithviknishad rithviknishad merged commit cae4451 into ohcnetwork:develop Jan 16, 2025
16 of 17 checks passed
Copy link

@Rishith25 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! 🙌

@Rishith25
Copy link
Contributor Author

Rishith25 commented Jan 18, 2025

@Jacobjeevan @rithviknishad Can you assign story points for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants