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 misalignments in the mobile view of /encounter/encounterId/updates page #9782

Conversation

Utkarsh-Anandani
Copy link
Contributor

@Utkarsh-Anandani Utkarsh-Anandani commented Jan 6, 2025

Proposed Changes

Before
image

After
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

  • Style

    • Updated layout and styling of the patient information card.
    • Adjusted padding and spacing of badge containers.
    • Modified grid and container alignments for improved visual presentation.
    • Updated class names for improved layout dynamics.
    • Implemented responsive design for plot display based on screen size.
    • Introduced horizontal scrolling for the tabs list component.
  • New Features

    • Added new properties to the PageTitle component for enhanced breadcrumb functionality.
    • Integrated responsive column display for plots based on screen size.

@Utkarsh-Anandani Utkarsh-Anandani requested a review from a team as a code owner January 6, 2025 08:29
Copy link
Contributor

coderabbitai bot commented Jan 6, 2025

Walkthrough

The pull request modifies the PatientInfoCard.tsx, PageTitle.tsx, and EncounterPlotsTab.tsx components, focusing on layout and styling adjustments as well as enhancements to properties. In PatientInfoCard.tsx, changes include increased top padding, adjustments to badge container spacing and alignment, and updates to grid container spacing. In PageTitle.tsx, new properties were added to the PageTitleProps interface to improve breadcrumb functionality, along with a minor layout adjustment. The EncounterPlotsTab.tsx introduces responsive design by implementing a hook for dynamic column adjustments based on screen size.

Changes

File Change Summary
src/components/Patient/PatientInfoCard.tsx - Increased top padding from pt-2 to pt-4
- Changed badge container justification from justify-evenly to justify-items-start
- Added gap-5 to badge container
- Removed left margin from patient name display
- Updated grid container with mt-2 and px-2
src/components/Common/PageTitle.tsx - Added new properties to PageTitleProps: hideBack, backUrl, hideTitleOnPage, onBackClick
- Removed items-center class from flex container
src/pages/Encounters/tabs/EncounterPlotsTab.tsx - Imported useBreakpoints hook for responsive column display
- Updated gridCols in ObservationVisualizer to use dynamic plotColumns
- Wrapped TabsList in a div for horizontal scrolling

Assessment against linked issues

Objective Addressed Explanation
Improve mobile view design [#9763]

Possibly related PRs

Suggested labels

needs testing

Suggested reviewers

  • rithviknishad
  • bodhish
  • Jacobjeevan

Poem

🐰 In the garden of care, layouts bloom bright,
Padding and spacing, a wonderful sight,
Badges now dance with a gap that's just right,
Page titles enhanced, guiding with light,
A rabbit's delight in each pixel's flight! 🌼


📜 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 b0283f8 and 8548803.

📒 Files selected for processing (1)
  • src/components/Patient/PatientInfoCard.tsx (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/Patient/PatientInfoCard.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 6, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit 8548803
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/67861c069e1e440008551d7c
😎 Deploy Preview https://deploy-preview-9782--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 (2)
src/components/Patient/PatientInfoCard.tsx (2)

51-51: Double-check alignment approach
Centering this block might conflict with other design rules, especially on larger screens. Confirm that this won’t misalign elements with future additions.


74-74: Consider a responsive grid layout
Currently, this is locked into three columns on all screen sizes. Using responsive classes like grid-cols-1 md:grid-cols-3 could improve readability on smaller screens.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4318ffd and f20eb02.

📒 Files selected for processing (1)
  • src/components/Patient/PatientInfoCard.tsx (2 hunks)
🔇 Additional comments (5)
src/components/Patient/PatientInfoCard.tsx (5)

42-42: Increase in top padding appears intentional
Seems like a straightforward design improvement to provide more vertical spacing.


45-45: justify-items-start has no effect on flex containers
If the goal is to align items to the left in a flex parent, consider justify-start instead.


53-53: Visibility restricted to smaller screens
This element is now hidden on large viewports. Verify that the redesign calls for this layout shift.


57-57: Minor margin tweak
No issues here; it’s a small stylistic enhancement.


64-64: Confirm that justify-normal is supported
Tailwind doesn’t typically include a “justify-normal” utility class for flex. Verify that this is valid in your Tailwind configuration; otherwise, consider justify-start.

@bodhish
Copy link
Member

bodhish commented Jan 6, 2025

Why not move the page heading also to the left
image

@rithviknishad
Copy link
Member

update the pr's title to something meaningful btw

@Utkarsh-Anandani
Copy link
Contributor Author

Why not move the page heading also to the left image

Did the required changes

@Utkarsh-Anandani Utkarsh-Anandani changed the title Issues/#9763/redesigning patient info card componenet Fixed the misalignments in the mobile view of /encounter/encounterId/updates page Jan 6, 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: 0

🧹 Nitpick comments (2)
src/components/Common/PageTitle.tsx (2)

Line range hint 19-22: Add JSDoc or property comments for clarity
The newly introduced props (hideBack, backUrl, hideTitleOnPage, and onBackClick) expand the functionality of breadcrumbs, but it's helpful to add brief comments or JSDoc annotations describing each prop's intended usage. This will improve discoverability and maintainability for future contributors.


Line range hint 37-40: Ensure consistent default parameter ordering
The new props are destructured in the middle of the parameter list. It's good practice to keep related parameters together (e.g., group all breadcrumb-related parameters). This helps readability, especially when the component grows more complex.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f20eb02 and dbcfc7a.

📒 Files selected for processing (1)
  • src/components/Common/PageTitle.tsx (1 hunks)
🔇 Additional comments (1)
src/components/Common/PageTitle.tsx (1)

69-69: Confirm removal of “items-center” or any other alignment classes
You removed the items-center class from the flex container. Verify once more that the new layout matches the intended design. Removing vertical alignment might shift elements in unexpected ways if other spacing/positioning isn’t adjusted.

@vinutv
Copy link
Member

vinutv commented Jan 8, 2025

Screenshot 2025-01-09 at 12 26 12 AM

Plots tab cards are broken. We can switch to a single-column layout for smaller screens.

@Utkarsh-Anandani
Copy link
Contributor Author

Screenshot 2025-01-09 at 12 26 12 AM Plots tab cards are broken. We can switch to a single-column layout for smaller screens.

Already being worked upon in a different PR

Screenshot 2025-01-09 at 12 28 25 AM The alignment and spacing on the profile card need to be fixed. Consider reducing the avatar size for smaller screens. Screenshot 2025-01-09 at 12 25 40 AM

Would definitely consider this..

@rithviknishad
Copy link
Member

@Utkarsh-Anandani combine the plots changes here itself and close the other one.

Copy link
Member

@vinutv vinutv left a comment

Choose a reason for hiding this comment

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

Screenshot 2025-01-09 at 12 28 25 AM

The alignment and spacing on the profile card need to be fixed. Consider reducing the avatar size for smaller screens.

Screenshot 2025-01-09 at 12 25 40 AM

@nihal467
Copy link
Member

image
image

The alignments in your PR are currently broken in desktop view compared to the develop branch.

@nihal467
Copy link
Member

LGTM

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

@Utkarsh-Anandani 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! 🙌

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.

The design of encounter/:encounterId/updates seems uneven in mobile view
6 participants