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: Align and format cards in Health Profile #10298

Merged

Conversation

ashwinpraveengo
Copy link
Contributor

@ashwinpraveengo ashwinpraveengo commented Jan 30, 2025

Proposed Changes

  • Fixes Minor UI Enhancement in Patient Details Section #10293
  • Added messages for "No Symptoms Recorded" and "No Diagnoses Recorded" in en.json and ml.json.
  • Updated styles for card titles and CardContent containers to improve UI and ensure proper alignment.
  • Improved text alignment for consistency across all health profile sections.

Updated Design

image

@ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • 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 translation keys for displaying messages when no medical records are present
  • UI Improvements

    • Enhanced layout and styling for cards showing empty medical record sections (diagnoses, symptoms, allergies, medications)
    • Improved visual consistency for "no records" messages across different patient record components
  • User Experience

    • Added clearer feedback for sections with no recorded medical information

@ashwinpraveengo ashwinpraveengo requested a review from a team as a code owner January 30, 2025 16:54
Copy link
Contributor

coderabbitai bot commented Jan 30, 2025

Walkthrough

This pull request focuses on minor UI enhancements across several patient-related components. The changes primarily involve standardizing the layout and styling for scenarios where no medical records (diagnoses, symptoms, allergies) are present. The modifications include updating localization files with new keys for "no records" messages and adjusting the rendering of these messages within card components to ensure consistent padding and alignment.

Changes

File Change Summary
public/locale/en.json Added two new localization keys: "no_diagnoses_recorded" and "no_symptoms_recorded"
src/components/Patient/*/list.tsx Updated card content styling and layout for empty state messages in Medication, Allergy, Diagnosis, and Symptoms lists

Assessment against linked issues

Objective Addressed Explanation
Consistent text formatting for "no records" sections
Improve alignment of text in patient details sections
Enhance UI presentation for empty medical record sections

Possibly related PRs

Suggested Labels

tested, reviewed

Suggested Reviewers

  • rithviknishad
  • Jacobjeevan

Poem

🐰 A rabbit's tale of UI delight,
Where empty spaces now shine bright,
No records? No problem, we'll display
With padding and style, we'll save the day!
Consistency reigns, our code so neat 🎨


📜 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 e1ae6dc and d3ff533.

📒 Files selected for processing (1)
  • public/locale/en.json (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • public/locale/en.json
⏰ Context from checks skipped due to timeout of 90000ms (5)
  • GitHub Check: Test
  • GitHub Check: lint
  • GitHub Check: OSSAR-Scan
  • GitHub Check: CodeQL-Build
  • GitHub Check: cypress-run (1)

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

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit d3ff533
🔍 Latest deploy log https://app.netlify.com/sites/care-ohc/deploys/679c67de4c52a30007b9984c
😎 Deploy Preview https://deploy-preview-10298--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.

@github-actions github-actions bot added the Deploy-Failed Deplyment is not showing preview label Jan 30, 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

🔭 Outside diff range comments (2)
src/components/Patient/MedicationStatementList.tsx (1)

Line range hint 183-191: Fix fragment and key prop usage.

The fragment (<>...</>) wrapping MedicationRow is unnecessary, and the key prop should be on the outermost element of the mapped items.

- {filteredMedications.map((statement, index) => {
-   const isEnteredInError = statement.status === "entered_in_error";
-   return (
-     <>
-       <MedicationRow
-         key={statement.id}
-         statement={statement}
-         isEnteredInError={isEnteredInError}
-         index={index}
-       />
-     </>
-   );
- })}
+ {filteredMedications.map((statement, index) => {
+   const isEnteredInError = statement.status === "entered_in_error";
+   return (
+     <MedicationRow
+       key={statement.id}
+       statement={statement}
+       isEnteredInError={isEnteredInError}
+       index={index}
+     />
+   );
+ })}
src/components/Patient/diagnosis/list.tsx (1)

Line range hint 134-134: Standardize padding in DiagnosisListLayout.

The CardContent padding in DiagnosisListLayout (px-2 pb-2) differs from the empty state CardContent (px-2 pb-3 pt-2). This inconsistency might cause layout shifts when toggling between states.

- <CardContent className="px-2 pb-2">{children}</CardContent>
+ <CardContent className="px-2 pb-3 pt-2">{children}</CardContent>
🧹 Nitpick comments (4)
src/components/Patient/MedicationStatementList.tsx (1)

142-144: Consider extracting common card header styles.

The CardHeader styling className="px-4 py-0 pt-4 flex justify-between flex-row" appears to be repeated across components (also used in DiagnosisList). Consider extracting this into a shared style constant or component to maintain consistency.

+ // src/constants/styles.ts
+ export const CARD_HEADER_STYLES = "px-4 py-0 pt-4 flex justify-between flex-row";

- <CardHeader className="px-4 py-0 pt-4 flex justify-between flex-row">
+ <CardHeader className={CARD_HEADER_STYLES}>
public/locale/en.json (3)

1307-1307: Maintain consistent capitalization in "no records" messages.

The capitalization of "Allergies" in this message differs from similar messages in the file. Consider standardizing the capitalization across all "no records" messages.

-  "no_allergies_recorded": "No Allergies recorded",
+  "no_allergies_recorded": "No allergies recorded",

1323-1323: Standardize capitalization in new message.

The capitalization of "Diagnoses" should match other similar messages for consistency.

-  "no_diagnoses_recorded": "No Diagnoses recorded",
+  "no_diagnoses_recorded": "No diagnoses recorded",

1374-1374: Standardize capitalization in new message.

The capitalization of "Symptoms" should match other similar messages for consistency.

-  "no_symptoms_recorded": "No Symptoms recorded",
+  "no_symptoms_recorded": "No symptoms recorded",
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between e35cc72 and e1ae6dc.

📒 Files selected for processing (6)
  • public/locale/en.json (3 hunks)
  • public/locale/ml.json (2 hunks)
  • src/components/Patient/MedicationStatementList.tsx (1 hunks)
  • src/components/Patient/allergy/list.tsx (1 hunks)
  • src/components/Patient/diagnosis/list.tsx (1 hunks)
  • src/components/Patient/symptoms/list.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • src/components/Patient/allergy/list.tsx
  • src/components/Patient/symptoms/list.tsx
🔇 Additional comments (3)
src/components/Patient/diagnosis/list.tsx (1)

66-68: Ensure sufficient color contrast for accessibility.

The text-muted-foreground class is used for the "no diagnoses" message. Verify that this provides sufficient color contrast for accessibility.

public/locale/ml.json (2)

1250-1250: LGTM! Accurate Malayalam translation for "no diagnoses recorded".

The translation is grammatically correct and maintains consistency with the application's terminology.


1292-1292: LGTM! Accurate Malayalam translation for "no symptoms recorded".

The translation is grammatically correct and maintains consistency with the application's terminology.

public/locale/ml.json Outdated Show resolved Hide resolved
public/locale/ml.json Outdated Show resolved Hide resolved
public/locale/en.json Outdated Show resolved Hide resolved
public/locale/en.json Outdated Show resolved Hide resolved
public/locale/en.json Outdated Show resolved Hide resolved
ashwinpraveengo and others added 6 commits January 31, 2025 11:32
Co-authored-by: Rithvik Nishad <rithvikn2001@gmail.com>
Co-authored-by: Rithvik Nishad <rithvikn2001@gmail.com>
Co-authored-by: Rithvik Nishad <rithvikn2001@gmail.com>
Co-authored-by: Rithvik Nishad <rithvikn2001@gmail.com>
Co-authored-by: Rithvik Nishad <rithvikn2001@gmail.com>
@rithviknishad rithviknishad removed the Deploy-Failed Deplyment is not showing preview label Jan 31, 2025
@rithviknishad rithviknishad merged commit 55d5790 into ohcnetwork:develop Jan 31, 2025
20 checks passed
Copy link

@ashwinpraveengo 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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minor UI Enhancement in Patient Details Section
3 participants