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: Add min-width to user cards for responsiveness #11272 #11289

Closed
wants to merge 1 commit into from

Conversation

Gurdeep75way
Copy link

@Gurdeep75way Gurdeep75way commented Mar 14, 2025

Closes #11272

  • Fixed overlap on tiny screens (<400px) by constraining widths.
  • Shrunk avatar, text, and padding for small screens, scales up smoothly.
  • Tested across all breakpoints—no overlap, functionality intact.

https://drive.google.com/file/d/1jyk18p8OpJYxPtMTAd3s81SqI0OHZOk6/view?usp=sharing

@Jacobjeevan Plz Review it once

Summary by CodeRabbit

  • Bug Fixes

    • Improved phone number filtering in search results to ensure only valid entries influence the results.
  • Style

    • Enhanced the overall layout with refined alignment and spacing for a cleaner interface.
    • Reorganized the display of user details and badges for improved responsiveness and visual consistency.

@Gurdeep75way Gurdeep75way requested a review from a team as a code owner March 14, 2025 03:02
Copy link
Contributor

coderabbitai bot commented Mar 14, 2025

Walkthrough

This pull request refactors the OrganizationUsers component in src/pages/Organization/OrganizationUsers.tsx. The changes consolidate phone number utility imports and streamline the handleSearch function to set the phone_number only when valid. The layout is adjusted for improved alignment and spacing, with modifications to the conditional loading state and user card presentation. Additionally, the setOpen functions for modal sheets are simplified without altering the component’s external behavior.

Changes

File Path Change Summary
src/pages/Organization/OrganizationUsers.tsx Consolidated phone number utility imports; refactored handleSearch for valid phone_number assignment; adjusted layout and spacing; simplified modal setOpen syntax; updated grid classes and user card layout for consistent styling.

Possibly related PRs

Suggested labels

needs review, tested

Suggested reviewers

  • Jacobjeevan
  • rithviknishad

Poem

I’m a little rabbit, swift on the run,
Hopping through code under the coding sun.
Layouts aligned, functions so neat,
Refactoring the logic with a rhythmic beat.
Cheers to changes that make our app fun!
🐇✨

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 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 b1a8eab and c3a9304.

📒 Files selected for processing (1)
  • src/pages/Organization/OrganizationUsers.tsx (5 hunks)
🔇 Additional comments (9)
src/pages/Organization/OrganizationUsers.tsx (9)

5-8: Clean import organization.

Good job consolidating the phone number utility imports into a single import statement, which improves code readability.


58-70: Improved search logic implementation.

The refactored handleSearch function streamlines the logic for setting the phone_number parameter. The conditional check ensures that only valid phone numbers are included in the search parameters, which is a good practice.


110-117: Enhanced layout structure for better responsiveness.

Good implementation of responsive layout with proper flex direction changes between mobile and desktop (flex-col to md:flex-row). The search component positioning has been improved as well.

Also applies to: 136-147


120-123: Cleaner event handler implementation.

The simplified setOpen functions for both sheets improve code readability while maintaining the same functionality.

Also applies to: 129-131


149-149: Consistent grid layout.

Good use of responsive grid classes that adapt to different screen sizes. The layout transitions smoothly from 1 column on mobile to 3 columns on larger screens.

Also applies to: 153-153


162-165: Improved card container constraints.

Adding max-w-full and overflow-hidden to the cards prevents layout issues on small screens. The adjusted padding (p-3 on small screens, sm:p-4 on larger) helps with space efficiency on mobile devices.

Also applies to: 166-167


171-171: Effective responsive user card implementation.

Well-implemented responsive design with:

  1. Responsive avatar sizing that scales appropriately with screen size
  2. Added min-w-0 to prevent text overflow issues
  3. Proper text truncation with truncate class
  4. Good spacing adjustments that accommodate smaller screens

This should address the issue with user cards on screens <400px as mentioned in the PR objectives.

Also applies to: 173-188


191-191: Improved text wrapping behavior.

Adding break-words to prevent long text (like roles or phone numbers) from causing layout issues is a good approach for maintaining consistent card dimensions.

Also applies to: 199-199


210-238: Enhanced responsive button layout.

Excellent implementation of responsive button layout:

  1. Vertical stacking on mobile (flex-col)
  2. Horizontal layout on larger screens (sm:flex-row)
  3. Full-width buttons on mobile (w-full) and auto-width on larger screens (sm:w-auto)

This improves usability on small screens while maintaining an efficient layout on larger displays.

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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.
  • @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 Mar 14, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit c3a9304
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/67d39c2b369d0f000834b7e4
😎 Deploy Preview https://deploy-preview-11289.preview.ohc.network
📱 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.

@Tanuj1718
Copy link
Contributor

Closes #11272

  • Fixed overlap on tiny screens (<400px) by constraining widths.
  • Shrunk avatar, text, and padding for small screens, scales up smoothly.
  • Tested across all breakpoints—no overlap, functionality intact.

https://drive.google.com/file/d/1jyk18p8OpJYxPtMTAd3s81SqI0OHZOk6/view?usp=sharing

@Jacobjeevan Plz Review it once

Summary by CodeRabbit

  • Bug Fixes

    • Improved phone number filtering in search results to ensure only valid entries influence the results.
  • Style

    • Enhanced the overall layout with refined alignment and spacing for a cleaner interface.
    • Reorganized the display of user details and badges for improved responsiveness and visual consistency.

@Gurdeep75way

  1. Try to keep Role and Phone Number on the same row.
  2. Please Follow the merge checklist in your PR
    cc: @Jacobjeevan

@abhimanyurajeesh
Copy link
Contributor

Merge Checklist!? Please follow the template.

@github-actions github-actions bot added needs-triage question Further information is requested labels Mar 14, 2025
Copy link
Contributor

@abhimanyurajeesh abhimanyurajeesh left a comment

Choose a reason for hiding this comment

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

I would suggest you to follow the same format as facility user page.

@rithviknishad
Copy link
Member

PR's not following the PR template and merge checklist will not be considered for reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Adjust organization users cards for Tablet
5 participants