-
Notifications
You must be signed in to change notification settings - Fork 572
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: UI Update Suggestions: Appointment Page (Date Picker Filter) #9958
Fix: UI Update Suggestions: Appointment Page (Date Picker Filter) #9958
Conversation
WalkthroughThis pull request introduces UI updates to the date range picker and appointments page. The changes include centering the date range picker button, modifying the calendar's day selection and today styles, and enhancing the date range display logic in the AppointmentsPage component. The modifications aim to improve the visual consistency and user experience of date-related interactions. Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
✅ Deploy Preview for care-ohc ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@rithviknishad requesting for a review, Thank you. |
…y logic for yesterday
There was a problem hiding this 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 (1)
src/pages/Appointments/AppointmentsPage.tsx (1)
Line range hint
598-642
: Remove commented-out code.Instead of keeping commented-out code, remove it entirely. The code history can be accessed through version control if needed.
Apply this diff to clean up the code:
- {/* <Popover> - <PopoverTrigger asChild> - <Button variant="secondary"> - <CareIcon icon="l-filter" className="mr-2" /> - <span>{t("filter")}</span> - </Button> - </PopoverTrigger> - <PopoverContent className="mr-11"> - <div> - <Label className="mb-2">{t("date")}</Label> - <DateRangePicker - date={{ - from: qParams.date_from - ? new Date(qParams.date_from) - : undefined, - to: qParams.date_to ? new Date(qParams.date_to) : undefined, - }} - onChange={(date) => - setQParams({ - ...qParams, - date_from: date?.from ? dateQueryString(date.from) : null, - date_to: date?.to ? dateQueryString(date?.to) : null, - }) - } - /> - </div> - <div className="flex justify-end bg-gray-100 mt-6 -m-4 py-3 px-4 rounded-md"> - <Button - variant="outline" - onClick={() => - setQParams({ - date_from: null, - date_to: null, - slot: null, - search: null, - practitioner: null, - }) - } - > - <ReloadIcon className="mr-2" /> - {t("clear_all_filters")} - </Button> - </div> - </PopoverContent> - </Popover> */}
🧹 Nitpick comments (1)
src/pages/Appointments/AppointmentsPage.tsx (1)
Line range hint
932-938
: Track and implement TODO items.Several placeholder implementations need to be addressed:
- Room information
- Labels
- Triage category
- Token number implementation
Would you like me to help create GitHub issues to track these implementation tasks?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
public/locale/en.json
(3 hunks)src/pages/Appointments/AppointmentsPage.tsx
(6 hunks)
✅ Files skipped from review due to trivial changes (1)
- public/locale/en.json
🧰 Additional context used
🪛 Biome (1.9.4)
src/pages/Appointments/AppointmentsPage.tsx
[error] 117-133: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment
(lint/complexity/noUselessFragments)
🔇 Additional comments (1)
src/pages/Appointments/AppointmentsPage.tsx (1)
110-116
: LGTM! Date range condition expanded correctly.The condition has been properly expanded to handle both "Today" and "Yesterday" cases, aligning with the PR objectives.
@rithviknishad requesting for a review, thank you! |
This PR is not linked to any issue. |
I have already raised this issue/concern with @rithviknishad , will be updating via cva |
@rajku-dev, thank you, but I'm well aware of linking an issue. I hope you understand that I mentioned the issue without linking it to a fix or any closing keywords because I don’t want to close this issue yet during the merge. The reason is that the current date text becomes invisible when it is selected as the start date. I’m looking for a new background color for the current date. and other |
no worries, i'd recommend going with a yellow or green shade for that👍 |
…y component for consistent styling
There was a problem hiding this 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
🔭 Outside diff range comments (1)
src/pages/Appointments/AppointmentsPage.tsx (1)
Line range hint
600-644
: Remove commented-out code.Instead of keeping the commented-out filter button code, it should be removed since it's no longer needed. If needed, the code can be retrieved from version control history.
🧹 Nitpick comments (1)
src/components/ui/calendar.tsx (1)
51-53
: LGTM! The styling changes improve visibility.The green border for today's date and the simplified selected day styles enhance visibility. Consider adding a transition to the border for a smoother user experience.
- "dark:bg-gray-800 dark:text-gray-50 border-2 border-green-500", + "dark:bg-gray-800 dark:text-gray-50 border-2 border-green-500 transition-all duration-200",
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/components/ui/calendar.tsx
(1 hunks)src/pages/Appointments/AppointmentsPage.tsx
(7 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/pages/Appointments/AppointmentsPage.tsx
[error] 117-133: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment
(lint/complexity/noUselessFragments)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: OSSAR-Scan
🔇 Additional comments (2)
src/pages/Appointments/AppointmentsPage.tsx (2)
201-202
: LGTM! Consistent date format styling.The changes standardize the date format display across "on", "before", and "after" filters, improving visual consistency.
Also applies to: 213-214, 224-227
110-133
:⚠️ Potential issueRemove unnecessary fragment.
The fragment (
<>...</>
) is redundant here as it's used in a return statement.Apply this diff to fix the issue:
- <> {dateFrom === dateQueryString(today) ? ( <> <span className="text-black">{t("today")}</span> <span className="pl-1 text-gray-500"> ({formatDate(dateFrom, "dd MMM yyyy")}) </span> </> ) : ( <> <span className="text-black">{t("yesterday")}</span> <span className="pl-1 text-gray-500"> ({formatDate(dateFrom, "dd MMM yyyy")}) </span> </> )} - </>;Likely invalid or redundant comment.
🧰 Tools
🪛 Biome (1.9.4)
[error] 117-133: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
…onent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, we should do something about the dropdown placement 🤔 Since it keeps moving on different selection.
Otherwise lgtm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abhimanyurajeesh for the thing which @Jacobjeevan mentioned:
let's keep that label (date as readable string) within the PopoverTrigger component, and maybe also set the PopoverContent's align prop to start to remove that jitter when trigger's width changes.
other than these two lgtm;
Okaii, 🙌 |
…nyu/fix-daterange-alignment
…on for improved UI consistency
…the button for improved UI consistency"
…/github.com/abhimanyurajeesh/care_fe into minor-fix/abhimanyu/fix-daterange-alignment
…tton for improved UI consistency
There was a problem hiding this 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/pages/Appointments/AppointmentsPage.tsx (1)
Line range hint
789-789
: Address TODO comments for token number and room information.There are two pending implementations:
- Replace the fake token number with the actual token number
- Add the room information display
Would you like me to:
- Open GitHub issues to track these TODOs?
- Help implement these features by providing the necessary code?
Also applies to: 849-849
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/pages/Appointments/AppointmentsPage.tsx
(6 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
src/pages/Appointments/AppointmentsPage.tsx
[error] 117-133: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment
(lint/complexity/noUselessFragments)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: Test
- GitHub Check: cypress-run (1)
- GitHub Check: CodeQL-Build
- GitHub Check: OSSAR-Scan
🔇 Additional comments (2)
src/pages/Appointments/AppointmentsPage.tsx (2)
458-465
: LGTM! Improved date picker button UI.The changes enhance the visual presentation and accessibility of the date picker:
- Ghost variant provides a cleaner look
- Edit3Icon improves user interaction affordance
- Label wrapping enhances accessibility
110-133
: 🛠️ Refactor suggestionRemove unnecessary fragment and simplify the return statement.
The code can be improved by:
- Removing the redundant fragment wrapper
- Simplifying the return statement structure
Apply this diff to improve the code:
// Case 1: Today only or Yesterday only if ( (dateFrom === dateQueryString(today) && dateTo === dateQueryString(today)) || (dateFrom === dateQueryString(subDays(today, 1)) && dateTo === dateQueryString(subDays(today, 1))) ) { - <> - {dateFrom === dateQueryString(today) ? ( - <> - <span className="text-black">{t("today")}</span> - <span className="pl-1 text-gray-500"> - ({formatDate(dateFrom, "dd MMM yyyy")}) - </span> - </> - ) : ( - <> - <span className="text-black">{t("yesterday")}</span> - <span className="pl-1 text-gray-500"> - ({formatDate(dateFrom, "dd MMM yyyy")}) - </span> - </> - )} - </>; + return ( + <> + <span className="text-black"> + {dateFrom === dateQueryString(today) ? t("today") : t("yesterday")} + </span> + <span className="pl-1 text-gray-500"> + ({formatDate(dateFrom, "dd MMM yyyy")}) + </span> + </> + ); }Likely invalid or redundant comment.
🧰 Tools
🪛 Biome (1.9.4)
[error] 117-133: Avoid using unnecessary Fragment.
A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a keyed fragment.
Unsafe fix: Remove the Fragment(lint/complexity/noUselessFragments)
@rithviknishad its done. |
@abhimanyurajeesh 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! 🙌 |
Proposed Changes
Fix UI Update Suggestions: Appointment Page (Date Picker Filter) #9968
The filter button has been removed as a new filter option is now available. The DateRangePicker component has been aligned to the center of its container for better visual balance. The format for 'Before,' 'On,' and 'After' filters has been standardized to match the format used for 'Today,' 'Yesterday,' and 'Tomorrow' filters. Additionally, the 'Yesterday' filter now displays only the 'From Date,' similar to the 'Today' filter, instead of both 'From' and 'To' dates. Fixed: when selecting a range that starts from today, the today's date is not visible.
@ohcnetwork/care-fe-code-reviewers
Before
After
Merge Checklist
Summary by CodeRabbit