Skip to content

Conversation

@adarsh-priydarshi-5646
Copy link

@adarsh-priydarshi-5646 adarsh-priydarshi-5646 commented Dec 4, 2025

Proposed Changes

Fixes #14606

  • Fixed location label to correctly display "Planned Location" for future locations instead of showing "Current Location" for both
  • Added logic to detect if a location is planned based on start time being in the future
  • Updated LocationCardWrapper component to dynamically set label based on location timing

Technical Details:

  • Added isPlannedLocation check that evaluates if status is "planned" OR if status is "active" but start time is in the future
  • Updated label rendering to use isPlannedLocation condition instead of just checking status

Screenshots

- Before

Screenshot 2025-12-04 at 7 04 41 PM

- After

Screenshot 2025-12-04 at 7 56 07 PM Screenshot 2025-12-04 at 8 00 12 PM

Tagging: @ohcnetwork/care-fe-code-reviewers

Merge Checklist

  • Add specs that demonstrate the bug or test the new feature.
  • Update product documentation.
  • Ensure that UI text is placed in I18n files.
  • Prepare a screenshot or demo video for the changelog entry and attach it to the issue.
  • Request peer reviews.
  • Complete QA on mobile devices.
  • Complete QA on desktop devices.
  • Add or update Playwright tests for related changes

Summary by CodeRabbit

Bug Fixes

  • Fixed location labeling to correctly display scheduled locations with future start dates as "planned" instead of "current".

✏️ Tip: You can customize this high-level summary in your review settings.

@adarsh-priydarshi-5646 adarsh-priydarshi-5646 requested review from a team December 4, 2025 14:43
@netlify
Copy link

netlify bot commented Dec 4, 2025

Deploy Preview for care-ohc ready!

Name Link
🔨 Latest commit a793f98
🔍 Latest deploy log https://app.netlify.com/projects/care-ohc/deploys/69319e07da05e00008cf3173
😎 Deploy Preview https://deploy-preview-14633.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 project configuration.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 4, 2025

Walkthrough

Modifies LocationCardWrapper.tsx to introduce an isPlannedLocation derived boolean that determines location labels based on status and start_datetime timing. The component now correctly distinguishes between current and planned locations in conditional rendering.

Changes

Cohort / File(s) Summary
Location Label Logic
src/components/Location/LocationCardWrapper.tsx
Add isPlannedLocation derived boolean computed from status and locationHistory.start_datetime to replace direct status check in title rendering logic

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: fixing the display of 'Planned Location' label for future locations instead of incorrectly showing 'Current Location'.
Linked Issues check ✅ Passed The PR successfully addresses issue #14606 by implementing logic to distinguish between 'Current Location' and 'Planned Location' labels based on timing, meeting the core objective.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing the location label display issue in LocationCardWrapper component, with no unrelated modifications detected.
Description check ✅ Passed Pull request description follows the template with clear proposed changes, technical details, screenshots, and merge checklist completion status.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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

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

@adarsh-priydarshi-5646
Copy link
Author

@rithviknishad, @Jacobjeevan, @abhimanyurajeesh, @AdityaJ2305
The PR is ready for review and merge.

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.

"Current location" text shown in both current and newly planned location

1 participant