Skip to content

Refactor/patient appointments page UI#79

Merged
aditya241104 merged 3 commits into
mainfrom
refactor/PatientAppointments-page-ui
Nov 3, 2025
Merged

Refactor/patient appointments page UI#79
aditya241104 merged 3 commits into
mainfrom
refactor/PatientAppointments-page-ui

Conversation

@aditya241104

@aditya241104 aditya241104 commented Nov 3, 2025

Copy link
Copy Markdown
Collaborator

Screenshot

desktop :
image
mobile :
image
closes #75

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced appointment cards now display doctor profile, specialization, and reason for visit.
    • Improved error handling with retry functionality for failed data loads.
  • Improvements

    • Redesigned appointment tab navigation for better usability.
    • Streamlined header with refined search and filter controls.
    • Enhanced appointment information layout with clearer virtual vs. in-person indicators.
    • Improved empty state messaging for appointment views.

@vercel

vercel Bot commented Nov 3, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
quick-clinic Ready Ready Preview Comment Nov 3, 2025 9:32am
quick-clinic-m9k7 Ready Ready Preview Comment Nov 3, 2025 9:32am

@coderabbitai

coderabbitai Bot commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

This PR redesigns the Patient Appointments page UI by overhauling AppointmentCard with enriched header and avatar display, simplifying AppointmentHeader layout, replacing AppointmentTabs grid with flex-based tab bar and vertical list, removing AppointmentStats component entirely, and adding error handling with prescription status tracking in the main page.

Changes

Cohort / File(s) Change Summary
Appointment Card Redesign
client/src/components/Patient/PatientAppointments/AppointmentCard.jsx
Complete UI restructuring: richer header with doctor avatar/details/reason, new status badge styling, date/time grid layout, virtual/in-person indicators, prescription badges, and full-width "View Details" button.
Header & Tab Navigation
client/src/components/Patient/PatientAppointments/AppointmentHeader.jsx, client/src/components/Patient/PatientAppointments/AppointmentTabs.jsx
AppointmentHeader: simplified minimal layout with stacked controls, updated input/select styling. AppointmentTabs: replaced tab header with flex-based bar, added active-tab bottom accent, changed appointments grid to vertical list, improved empty-state messaging.
Component Removal
client/src/components/Patient/PatientAppointments/AppointmentStats.jsx
Deleted entire AppointmentStats component that rendered appointment statistics cards (total, upcoming, completed, with prescriptions).
Page Integration
client/src/pages/patient/PatientAppointments.jsx
Added error handling flow with ErrorState component, introduced prescription status tracking map, removed AppointmentStats usage, changed routing parameter from appointmentId to id, updated container styling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • AppointmentCard.jsx: Significant UI restructuring with new data flow and conditional rendering logic requires careful verification of layout alignment and avatar rendering fallbacks.
  • AppointmentTabs.jsx: Tab bar and empty-state changes should be visually verified; the shift from grid to vertical list layout may affect responsive behavior.
  • PatientAppointments.jsx: Error handling flow and prescription status tracking logic should be tested for edge cases and proper state management.

Possibly related PRs

  • #74: Concurrent modularization of the same Patient Appointments components (AppointmentCard, AppointmentHeader, AppointmentTabs, AppointmentStats).

Suggested labels

enhancement, UI, redesign

Poem

🐰 A card redesigned, so rich and so bright,
With avatars glowing and layouts just right,
Appointments now showcase their doctor with flair,
Stats fade away but the beauty stays there!

Pre-merge checks and finishing touches

✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "Refactor/patient appointments page UI" clearly and concisely identifies the primary change: a UI refactor of the patient appointments page. The title accurately reflects the main focus of the changeset, which includes comprehensive updates to the AppointmentCard, AppointmentHeader, AppointmentTabs components and the PatientAppointments page itself. The title is specific enough for a team member to understand the primary change without requiring additional context.
Linked Issues Check ✅ Passed The pull request addresses the linked issue #75 "[UI REDESIGN]: Patient Appointments Page" by implementing a comprehensive UI redesign of the patient appointments page. The changeset includes redesigned components (AppointmentCard with enhanced header area and avatar support, AppointmentHeader with simplified layout, AppointmentTabs with new tab bar design, and removal of AppointmentStats), improved error handling and loading state management, and prescription status tracking. The PR includes both desktop and mobile screenshots demonstrating the new design and explicitly closes issue #75. All code changes align with the objective of providing a UI redesign for the patient appointments page at the specified route.
Out of Scope Changes Check ✅ Passed The changes in this pull request are primarily in scope with the UI redesign objective from issue #75. All component modifications (AppointmentCard, AppointmentHeader, AppointmentTabs, AppointmentStats removal) are directly related to visual and structural UI redesign. The enhancements to error handling, loading state flow, and prescription status tracking in the PatientAppointments page represent reasonable UX improvements that complement the redesign effort rather than introducing unrelated functionality. The callback signature adjustment from appointmentId to id is a minor cleanup change consistent with the refactoring scope. No out-of-scope changes have been identified.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/PatientAppointments-page-ui

Comment @coderabbitai help to get the list of available commands and usage tips.

@aditya241104 aditya241104 reopened this Nov 3, 2025
@aditya241104 aditya241104 merged commit 44d02f3 into main Nov 3, 2025
5 of 6 checks passed
@aditya241104 aditya241104 deleted the refactor/PatientAppointments-page-ui branch November 3, 2025 09:34

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
client/src/pages/patient/PatientAppointments.jsx (1)

25-37: Reset the error state before retrying fetches.

Once error is set, we never clear it on a successful retry, so the component keeps returning the error view even after fresh data arrives. Please clear the error before the API call (or immediately after a successful response) so users can recover from transient failures.

   try {
     setLoading(true);
+    setError(null);
     const response = await getPatientAppointments();
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f9f373b and 414737e.

📒 Files selected for processing (5)
  • client/src/components/Patient/PatientAppointments/AppointmentCard.jsx (1 hunks)
  • client/src/components/Patient/PatientAppointments/AppointmentHeader.jsx (1 hunks)
  • client/src/components/Patient/PatientAppointments/AppointmentStats.jsx (0 hunks)
  • client/src/components/Patient/PatientAppointments/AppointmentTabs.jsx (1 hunks)
  • client/src/pages/patient/PatientAppointments.jsx (2 hunks)
💤 Files with no reviewable changes (1)
  • client/src/components/Patient/PatientAppointments/AppointmentStats.jsx
🧰 Additional context used
🧬 Code graph analysis (4)
client/src/components/Patient/PatientAppointments/AppointmentTabs.jsx (2)
client/src/pages/patient/PatientAppointments.jsx (2)
  • activeTab (17-17)
  • prescriptionStatus (14-14)
client/src/components/Patient/PatientAppointments/AppointmentCard.jsx (1)
  • AppointmentCard (16-150)
client/src/components/Patient/PatientAppointments/AppointmentHeader.jsx (1)
client/src/pages/patient/PatientAppointments.jsx (2)
  • searchTerm (15-15)
  • filterStatus (16-16)
client/src/components/Patient/PatientAppointments/AppointmentCard.jsx (1)
client/src/pages/patient/PatientAppointments.jsx (1)
  • prescriptionStatus (14-14)
client/src/pages/patient/PatientAppointments.jsx (4)
client/src/components/Patient/PatientAppointments/ErrorState.jsx (1)
  • ErrorState (3-12)
client/src/components/public/Nearbyclinics/ErrorState.jsx (1)
  • ErrorState (3-18)
client/src/components/Patient/PatientAppointments/AppointmentHeader.jsx (1)
  • AppointmentHeader (3-44)
client/src/components/Patient/PatientAppointments/AppointmentTabs.jsx (1)
  • AppointmentTabs (6-112)

Comment on lines +81 to +83
if (error) {
return <ErrorState message={error} onRetry={fetchAppointments} />;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Pass the correct prop to ErrorState.

ErrorState reads from an error prop (see client/src/components/Patient/PatientAppointments/ErrorState.jsx), so sending message leaves the UI blank and hides the failure explanation. Please pass error={error} here.

-  if (error) {
-    return <ErrorState message={error} onRetry={fetchAppointments} />;
-  }
+  if (error) {
+    return <ErrorState error={error} onRetry={fetchAppointments} />;
+  }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if (error) {
return <ErrorState message={error} onRetry={fetchAppointments} />;
}
if (error) {
return <ErrorState error={error} onRetry={fetchAppointments} />;
}
🤖 Prompt for AI Agents
In client/src/pages/patient/PatientAppointments.jsx around lines 81 to 83, the
component currently returns <ErrorState message={error} ... />, but ErrorState
expects an error prop; change the prop to error={error} and keep the onRetry
prop intact so the error message displays correctly.

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.

[UI REDESIGN]:Patient Appointments Page

1 participant