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

FIXED: The facility and appointment pages lack mobile responsiveness #9712

Closed

Conversation

modamaan
Copy link
Contributor

@modamaan modamaan commented Jan 3, 2025

Proposed Changes

@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

  • New Features

    • None
  • Bug Fixes

    • None
  • Style

    • Improved responsiveness of Facility Home component layout
    • Enhanced Appointments page search and filter UI adaptability
    • Optimized Appointment Token Card styling for better display across different screen sizes
    • Updated layout and spacing for Appointment Details page to enhance responsiveness
  • Refactor

    • Adjusted component layouts to be more flexible and mobile-friendly
    • Updated responsive design elements for improved user experience

@modamaan modamaan requested a review from a team as a code owner January 3, 2025 15:21
Copy link
Contributor

coderabbitai bot commented Jan 3, 2025

Walkthrough

The pull request focuses on enhancing mobile responsiveness for the Facility Home and Appointments pages. Changes include adjustments to layout, styling, and element sizing to ensure a better user experience across different screen sizes. The modifications primarily involve responsive design techniques such as using Tailwind CSS breakpoint classes, adjusting flex layouts, and modifying element sizes and spacing to create a more adaptive interface.

Changes

File Change Summary
src/components/Facility/FacilityHome.tsx - Added data-sidebar="content" attribute to outer div
- Implemented responsive layout with flex-wrap and gap adjustments
- Modified avatar and title sizes for different screen sizes
- Updated dropdown menu and contact information layout
src/components/Schedule/Appointments/AppointmentsPage.tsx - Improved search input and filter button layout for mobile screens
- Added full-width and overflow scrolling to Tabs component
src/components/Schedule/Appointments/AppointmentTokenCard.tsx - Altered Card component width to be responsive
- Adjusted font sizes for headings and labels based on screen size
src/components/Schedule/Appointments/AppointmentDetailsPage.tsx - Modified flex direction and margin settings for improved responsiveness

Assessment against linked issues

Objective Addressed Explanation
Mobile Responsiveness for Facility Page [#9674]
Mobile Responsiveness for Appointments Page [#9674]

Suggested labels

needs review, needs testing

Suggested reviewers

  • rithviknishad
  • Jacobjeevan

Poem

🐰 Responsive rabbits hop with glee,
Pixels dancing, screens set free!
Flex and wrap, sizes just right,
Mobile magic, a delightful sight!
CodeRabbit's touch, smooth and neat,
UI design can't be beat! 🎨📱


📜 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 472c87c and c21beac.

📒 Files selected for processing (1)
  • src/components/Schedule/Appointments/AppointmentDetailsPage.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Schedule/Appointments/AppointmentDetailsPage.tsx

Finishing Touches

  • 📝 Generate Docstrings

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

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit f9a426c
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/678027be549cb50008098083
😎 Deploy Preview https://deploy-preview-9712--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/Facility/FacilityHome.tsx (1)

240-240: Consider unifying breakpoints for consistent usability.
Currently, mt-4 is applied for all smaller screens and reset at md:mt-0. If you prefer uniform spacing patterns, you could also use sm:mt-0 or consistently use md:flex-row in the parent container if needed.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b36f39f and ef7ce76.

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

226-228: Responsive layout enhancement looks good.
Switching to a column layout at smaller breakpoints and a row at sm aligns well with the PR's objective. Good job!

src/components/Schedule/Appointments/AppointmentsPage.tsx (3)

252-254: Good responsive sizing for the Input component.
Using w-full on smaller screens and md:w-[300px] for larger devices is a clear and effective approach to ensure readability across screen sizes.


261-261: Full-width Filter button on smaller screens is sensible.
This ensures the button remains accessible on devices with limited horizontal space. Nicely done.


316-325: ScrollArea usage for the list view is well-implemented.
Wrapping the AppointmentRow in a scrollable container avoids content overflow. This is consistent with the board view’s horizontal scroll approach.

@Jacobjeevan
Copy link
Contributor

Check the other pages as well, see if any of the other pages needs responsive fixes and make appropriate changes @modamaan

@modamaan
Copy link
Contributor Author

modamaan commented Jan 4, 2025

Old
Screenshot 2025-01-04 201733

Updated
Screenshot 2025-01-04 201738

@bodhish
Copy link
Member

bodhish commented Jan 4, 2025

This doesn't look right
image

@modamaan
Copy link
Contributor Author

modamaan commented Jan 4, 2025

@bodhish @rithviknishad
Screenshot 2025-01-04 221724

@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Jan 5, 2025
Copy link

github-actions bot commented Jan 5, 2025

👋 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 removed the merge conflict pull requests with merge conflict label Jan 8, 2025
@modamaan
Copy link
Contributor Author

modamaan commented Jan 8, 2025

appointmentsCare.mp4

@modamaan
Copy link
Contributor Author

modamaan commented Jan 8, 2025

@Jacobjeevan @rithviknishad
Old
Screenshot 2025-01-09 000736

Updated card
Screenshot 2025-01-09 012028

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/Schedule/Appointments/AppointmentTokenCard.tsx (2)

34-34: Consider adjusting line height for better mobile readability

While the font size adaptation is good, consider adding line height adjustment for better readability on mobile devices.

-            <h3 className="text-base sm:text-lg font-bold tracking-tight">
+            <h3 className="text-base leading-snug sm:text-lg font-bold tracking-tight">

66-66: Consider additional spacing adjustments for token number

The font size adaptation is good, but consider adding margin adjustments for better visual balance on mobile.

-              <p className="text-4xl sm:text-5xl font-bold leading-none">
+              <p className="text-4xl sm:text-5xl font-bold leading-none mt-1 sm:mt-0">
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e0e9685 and 34a67ed.

📒 Files selected for processing (1)
  • src/components/Schedule/Appointments/AppointmentTokenCard.tsx (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (7)
  • GitHub Check: Redirect rules - care-ohc
  • GitHub Check: Header rules - care-ohc
  • GitHub Check: Pages changed - care-ohc
  • GitHub Check: Test
  • GitHub Check: CodeQL-Build
  • GitHub Check: OSSAR-Scan
  • GitHub Check: cypress-run (1)
🔇 Additional comments (3)
src/components/Schedule/Appointments/AppointmentTokenCard.tsx (3)

27-27: Well-implemented responsive card width!

The card's width adaptation (full width on mobile, 30rem on larger screens) provides an optimal layout across different devices. The hover effects and transitions also add a nice touch to the user experience.


67-69: Backend integration needed for token number

The TODO comment indicates that the token number is currently using a temporary solution. This should be properly integrated with the backend.

Would you like me to help create a GitHub issue to track the backend integration task?


Line range hint 27-69: Overall excellent mobile-first implementation!

The changes effectively improve mobile responsiveness through:

  • Consistent use of Tailwind's mobile-first approach
  • Well-balanced responsive typography
  • Appropriate use of breakpoints
  • Maintained visual hierarchy across screen sizes

While I've suggested some minor improvements, the overall implementation successfully addresses the mobile responsiveness objectives.

@Jacobjeevan
Copy link
Contributor

You would need to modify the appointment details page as well.

iPad:

image

@modamaan
Copy link
Contributor Author

modamaan commented Jan 9, 2025

i pad responsive added

loom-video.6.mp4

@rithviknishad
Copy link
Member

This doesn't look nice on mobile

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/Schedule/Appointments/AppointmentDetailsPage.tsx (1)

176-176: LGTM! Better mobile margins.

Removing horizontal margins on mobile screens (mx-0 sm:mx-6) prevents content from being squeezed on small devices.

Consider using a consistent spacing scale across breakpoints. You could extract these values into a reusable Tailwind class:

-            <div className="mx-0 sm:mx-6 mt-10">
+            <div className="mx-0 sm:mx-6 md:mx-8 lg:mx-10 mt-10">
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 34a67ed and 472c87c.

📒 Files selected for processing (2)
  • src/components/Schedule/Appointments/AppointmentDetailsPage.tsx (2 hunks)
  • src/components/Schedule/Appointments/AppointmentTokenCard.tsx (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Schedule/Appointments/AppointmentTokenCard.tsx
🔇 Additional comments (1)
src/components/Schedule/Appointments/AppointmentDetailsPage.tsx (1)

138-138: LGTM! Improved tablet layout.

The change from md:flex-row to lg:flex-row improves the layout on tablet devices by maintaining a vertical stack until larger screen sizes.

To ensure consistent responsive behavior across the application, check other appointment-related pages:

✅ Verification successful

Verified: Different breakpoint is appropriate for details view

The lg breakpoint in AppointmentDetailsPage is justified as it handles more complex content compared to other appointment pages that use md breakpoint for simpler layouts (filters and lists).

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for similar flex patterns in appointment components
rg -l "flex.*flex-(row|col)" src/components/Schedule/Appointments/

Length of output: 253


Script:

#!/bin/bash
# Search for flex patterns with context in appointment components
rg "flex.*flex-(row|col)" src/components/Schedule/Appointments/ -B 2 -A 2

Length of output: 3777

@modamaan
Copy link
Contributor Author

modamaan commented Jan 9, 2025

This doesn't look nice on mobile
@rithviknishad

what changes should i make ?

@github-actions github-actions bot added needs-triage question Further information is requested labels Jan 9, 2025
@modamaan
Copy link
Contributor Author

modamaan commented Jan 9, 2025

loom-video.7.mp4

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.

@bodhish
Copy link
Member

bodhish commented Jan 14, 2025

Closing the PR as its inactive.

@bodhish bodhish closed this Jan 14, 2025
@modamaan
Copy link
Contributor Author

modamaan commented Jan 14, 2025

@Jacobjeevan @rithviknishad @bodhish can you please reopen the PR, i can complete today itself

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

Successfully merging this pull request may close these issues.

The facility and appointment pages lack mobile responsiveness
4 participants