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

O3-2895: Fix Layout of Patient Search Patient Banner #1000

Merged
merged 1 commit into from
Feb 27, 2024
Merged

Conversation

mogoodrich
Copy link
Member

@mogoodrich mogoodrich commented Feb 23, 2024

Requirements

  • This PR has a title that briefly describes the work done including the ticket number. If there is a ticket, make sure your PR title includes a conventional commit label. See existing PR titles for inspiration.
  • My work conforms to the OpenMRS 3.0 Styleguide and design documentation.
  • My work includes tests or is validated by existing tests.

Summary

Screenshots

Related Issue

Other

@mogoodrich mogoodrich marked this pull request as draft February 23, 2024 15:50
Copy link
Contributor

Size Change: +14 B (0%)

Total Size: 2.96 MB

ℹ️ View Unchanged
Filename Size Change
packages/esm-active-visits-app/dist/130.js 123 kB 0 B
packages/esm-active-visits-app/dist/255.js 2.21 kB 0 B
packages/esm-active-visits-app/dist/271.js 762 B 0 B
packages/esm-active-visits-app/dist/277.js 13.4 kB 0 B
packages/esm-active-visits-app/dist/316.js 42.9 kB 0 B
packages/esm-active-visits-app/dist/319.js 683 B 0 B
packages/esm-active-visits-app/dist/382.js 1.15 kB 0 B
packages/esm-active-visits-app/dist/448.js 47.1 kB 0 B
packages/esm-active-visits-app/dist/460.js 784 B 0 B
packages/esm-active-visits-app/dist/574.js 588 B 0 B
packages/esm-active-visits-app/dist/588.js 6.66 kB 0 B
packages/esm-active-visits-app/dist/635.js 1.15 kB 0 B
packages/esm-active-visits-app/dist/644.js 762 B 0 B
packages/esm-active-visits-app/dist/729.js 3.1 kB 0 B
packages/esm-active-visits-app/dist/757.js 695 B 0 B
packages/esm-active-visits-app/dist/784.js 2.63 kB 0 B
packages/esm-active-visits-app/dist/788.js 586 B 0 B
packages/esm-active-visits-app/dist/807.js 918 B 0 B
packages/esm-active-visits-app/dist/833.js 732 B 0 B
packages/esm-active-visits-app/dist/879.js 2.94 kB 0 B
packages/esm-active-visits-app/dist/main.js 65 kB 0 B
packages/esm-active-visits-app/dist/openmrs-esm-active-visits-app.js 3.33 kB 0 B
packages/esm-appointments-app/dist/130.js 123 kB 0 B
packages/esm-appointments-app/dist/152.js 257 B 0 B
packages/esm-appointments-app/dist/255.js 2.21 kB 0 B
packages/esm-appointments-app/dist/271.js 2.19 kB 0 B
packages/esm-appointments-app/dist/303.js 258 B 0 B
packages/esm-appointments-app/dist/319.js 2.1 kB 0 B
packages/esm-appointments-app/dist/426.js 271 kB 0 B
packages/esm-appointments-app/dist/460.js 2.29 kB 0 B
packages/esm-appointments-app/dist/500.js 2.51 kB 0 B
packages/esm-appointments-app/dist/574.js 1.85 kB 0 B
packages/esm-appointments-app/dist/588.js 6.65 kB 0 B
packages/esm-appointments-app/dist/591.js 16.9 kB 0 B
packages/esm-appointments-app/dist/644.js 2.19 kB 0 B
packages/esm-appointments-app/dist/693.js 48.7 kB 0 B
packages/esm-appointments-app/dist/729.js 3.1 kB 0 B
packages/esm-appointments-app/dist/757.js 1.85 kB 0 B
packages/esm-appointments-app/dist/784.js 2.63 kB 0 B
packages/esm-appointments-app/dist/788.js 1.85 kB 0 B
packages/esm-appointments-app/dist/807.js 2.53 kB 0 B
packages/esm-appointments-app/dist/833.js 2.16 kB 0 B
packages/esm-appointments-app/dist/main.js 323 kB 0 B
packages/esm-appointments-app/dist/openmrs-esm-appointments-app.js 3.33 kB 0 B
packages/esm-patient-list-management-app/dist/130.js 123 kB 0 B
packages/esm-patient-list-management-app/dist/255.js 2.21 kB 0 B
packages/esm-patient-list-management-app/dist/271.js 1.56 kB 0 B
packages/esm-patient-list-management-app/dist/295.js 99.3 kB 0 B
packages/esm-patient-list-management-app/dist/319.js 1.52 kB 0 B
packages/esm-patient-list-management-app/dist/382.js 1.15 kB 0 B
packages/esm-patient-list-management-app/dist/435.js 22.7 kB 0 B
packages/esm-patient-list-management-app/dist/460.js 1.7 kB 0 B
packages/esm-patient-list-management-app/dist/574.js 1.34 kB 0 B
packages/esm-patient-list-management-app/dist/588.js 6.66 kB 0 B
packages/esm-patient-list-management-app/dist/591.js 16.9 kB 0 B
packages/esm-patient-list-management-app/dist/635.js 1.15 kB 0 B
packages/esm-patient-list-management-app/dist/644.js 1.56 kB 0 B
packages/esm-patient-list-management-app/dist/716.js 4.66 kB 0 B
packages/esm-patient-list-management-app/dist/729.js 3.1 kB 0 B
packages/esm-patient-list-management-app/dist/757.js 1.5 kB 0 B
packages/esm-patient-list-management-app/dist/784.js 2.64 kB 0 B
packages/esm-patient-list-management-app/dist/788.js 1.34 kB 0 B
packages/esm-patient-list-management-app/dist/807.js 1.84 kB 0 B
packages/esm-patient-list-management-app/dist/833.js 1.58 kB 0 B
packages/esm-patient-list-management-app/dist/main.js 126 kB 0 B
packages/esm-patient-list-management-app/dist/openmrs-esm-patient-list-management-app.js 3.3 kB 0 B
packages/esm-patient-registration-app/dist/130.js 123 kB 0 B
packages/esm-patient-registration-app/dist/152.js 262 B 0 B
packages/esm-patient-registration-app/dist/209.js 36.4 kB 0 B
packages/esm-patient-registration-app/dist/255.js 2.21 kB 0 B
packages/esm-patient-registration-app/dist/271.js 2.01 kB 0 B
packages/esm-patient-registration-app/dist/303.js 260 B 0 B
packages/esm-patient-registration-app/dist/319.js 1.99 kB 0 B
packages/esm-patient-registration-app/dist/460.js 2.12 kB 0 B
packages/esm-patient-registration-app/dist/537.js 2.34 kB 0 B
packages/esm-patient-registration-app/dist/574.js 1.7 kB 0 B
packages/esm-patient-registration-app/dist/591.js 16.9 kB 0 B
packages/esm-patient-registration-app/dist/62.js 6.86 kB 0 B
packages/esm-patient-registration-app/dist/644.js 2.01 kB 0 B
packages/esm-patient-registration-app/dist/729.js 3.1 kB 0 B
packages/esm-patient-registration-app/dist/730.js 115 kB 0 B
packages/esm-patient-registration-app/dist/735.js 464 B 0 B
packages/esm-patient-registration-app/dist/757.js 2.07 kB 0 B
packages/esm-patient-registration-app/dist/784.js 2.64 kB 0 B
packages/esm-patient-registration-app/dist/788.js 1.71 kB 0 B
packages/esm-patient-registration-app/dist/807.js 2.43 kB 0 B
packages/esm-patient-registration-app/dist/833.js 1.97 kB 0 B
packages/esm-patient-registration-app/dist/879.js 2.94 kB 0 B
packages/esm-patient-registration-app/dist/884.js 6.1 kB 0 B
packages/esm-patient-registration-app/dist/main.js 153 kB 0 B
packages/esm-patient-registration-app/dist/openmrs-esm-patient-registration-app.js 3.34 kB 0 B
packages/esm-patient-search-app/dist/130.js 123 kB 0 B
packages/esm-patient-search-app/dist/152.js 261 B 0 B
packages/esm-patient-search-app/dist/255.js 2.21 kB 0 B
packages/esm-patient-search-app/dist/271.js 1.12 kB 0 B
packages/esm-patient-search-app/dist/303.js 260 B 0 B
packages/esm-patient-search-app/dist/319.js 1.06 kB 0 B
packages/esm-patient-search-app/dist/382.js 1.15 kB 0 B
packages/esm-patient-search-app/dist/460.js 1.16 kB 0 B
packages/esm-patient-search-app/dist/48.js 26.3 kB +5 B (0%)
packages/esm-patient-search-app/dist/574.js 910 B 0 B
packages/esm-patient-search-app/dist/588.js 6.66 kB 0 B
packages/esm-patient-search-app/dist/591.js 16.9 kB 0 B
packages/esm-patient-search-app/dist/635.js 1.15 kB 0 B
packages/esm-patient-search-app/dist/644.js 1.12 kB 0 B
packages/esm-patient-search-app/dist/710.js 22.8 kB 0 B
packages/esm-patient-search-app/dist/729.js 3.1 kB 0 B
packages/esm-patient-search-app/dist/757.js 1.06 kB 0 B
packages/esm-patient-search-app/dist/784.js 2.63 kB 0 B
packages/esm-patient-search-app/dist/788.js 905 B 0 B
packages/esm-patient-search-app/dist/807.js 1.3 kB 0 B
packages/esm-patient-search-app/dist/833.js 1.08 kB 0 B
packages/esm-patient-search-app/dist/main.js 52.2 kB +9 B (0%)
packages/esm-patient-search-app/dist/openmrs-esm-patient-search-app.js 3.34 kB 0 B
packages/esm-service-queues-app/dist/130.js 123 kB 0 B
packages/esm-service-queues-app/dist/152.js 262 B 0 B
packages/esm-service-queues-app/dist/255.js 2.22 kB 0 B
packages/esm-service-queues-app/dist/271.js 3.71 kB 0 B
packages/esm-service-queues-app/dist/303.js 261 B 0 B
packages/esm-service-queues-app/dist/319.js 3.19 kB 0 B
packages/esm-service-queues-app/dist/328.js 3.08 kB 0 B
packages/esm-service-queues-app/dist/389.js 2.42 kB 0 B
packages/esm-service-queues-app/dist/425.js 2.06 kB 0 B
packages/esm-service-queues-app/dist/460.js 3.98 kB 0 B
packages/esm-service-queues-app/dist/574.js 3.19 kB 0 B
packages/esm-service-queues-app/dist/581.js 156 kB 0 B
packages/esm-service-queues-app/dist/588.js 6.66 kB 0 B
packages/esm-service-queues-app/dist/591.js 16.9 kB 0 B
packages/esm-service-queues-app/dist/616.js 2.71 kB 0 B
packages/esm-service-queues-app/dist/621.js 54.9 kB 0 B
packages/esm-service-queues-app/dist/644.js 3.71 kB 0 B
packages/esm-service-queues-app/dist/694.js 2.64 kB 0 B
packages/esm-service-queues-app/dist/729.js 3.1 kB 0 B
packages/esm-service-queues-app/dist/757.js 3.19 kB 0 B
packages/esm-service-queues-app/dist/784.js 2.63 kB 0 B
packages/esm-service-queues-app/dist/788.js 3.18 kB 0 B
packages/esm-service-queues-app/dist/807.js 4.45 kB 0 B
packages/esm-service-queues-app/dist/833.js 3.67 kB 0 B
packages/esm-service-queues-app/dist/981.js 2.93 kB 0 B
packages/esm-service-queues-app/dist/main.js 214 kB 0 B
packages/esm-service-queues-app/dist/openmrs-esm-service-queues-app.js 3.31 kB 0 B

compressed-size-action

@mogoodrich
Copy link
Member Author

mogoodrich commented Feb 23, 2024

See my comments, but here are a few "before" screenshots (note how overlay is wider than normal, how the "show details" is not always displayed, and when it does it makes the overlay even wider)

2024-02-22_17-25
2024-02-22_17-24
2024-02-23_12-50

and one "after" screen shot:

2024-02-23_12-21

@@ -30,7 +30,7 @@ export const useCalendarDistribution = (
) => {
const appointmentSummary = useAppointmentSummary(new Date(appointmentDate), serviceUuid);
const monthlyData = getMonthlyCalendarDistribution(new Date(appointmentDate), appointmentSummary) ?? [];
return distributionType === 'month' ? monthlyData : monthlyData.slice(0, 7);
return distributionType === 'month' ? monthlyData : monthlyData.slice(0, 6);
Copy link
Member Author

@mogoodrich mogoodrich Feb 23, 2024

Choose a reason for hiding this comment

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

This is kind of strange, but the view of 7 days of workload distribution is too big for the 420px view, so I changed the "weekly" view to show only 6. This seems acceptable in the short-term because it really isn't a weekly view (rather it shows "the next x days out from the selected appointment date") and likely needs to be improved in the future. (I thought I wrote a ticket but can't find it now)

<div className={styles.identifiers}>
{patient.identifiers?.length ? patient.identifiers.map((i) => i.identifier).join(', ') : '--'}
<div>
<div className={styles.identifiers}>
Copy link
Member Author

Choose a reason for hiding this comment

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

see comments below and on the left for details.

@@ -135,35 +145,13 @@ const PatientBanner: React.FC<PatientBannerProps> = ({ patient, patientUuid, hid
</CustomOverflowMenuComponent>
</div>
)}
Copy link
Member Author

@mogoodrich mogoodrich Feb 23, 2024

Choose a reason for hiding this comment

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

So the below code had some strange logic to only show the show details for a patient if they were deceased or if they didn't have an active visit. Not sure what the logic was meant to be, but I'm assuming it was just "don't show the start visit button if the button is button is deceased or already had an active visit", so I pulled all the show details button out of this if block.

I also deduplicated and moved it up, because as it currently stands it was expanding the view (see screen shots) or pushing all the patient information to the left and eating up real estate which didn't really work in this 420px view (see my comments/questions above about the use of this patient banner). The way I have it now it appears below all details, which increases the vertical spacing, but I can try to narrow that down a bit until someone with better layout skills than I can reformat.

Also (as in the above) I'm wondering if we want to remove all the action/details/etc buttons from this patient banner (see above). Right now the "Actions" button causes similar layout issues, and I suspect that the "start visits" will do the same.

@@ -9,7 +9,6 @@ import {
formatDate,
Copy link
Member Author

@mogoodrich mogoodrich Feb 23, 2024

Choose a reason for hiding this comment

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

Broad question is how this patient-banner differs from the patient-banner in the patient-chart ESM? My guess would be that patient-chart is a broad banner to use for the patient chart as a header, while this is one specifically for search results? If so, can I suggest we remove all the action elements (start visit, show details, and the actions menu) from this banner?

Also, this banner can be used n an overlay context, so needs to work well in a 420px context (we have a compact patient search but that is only meant to be used from the navigation bar). So if we do want to keep the above action elements we need to make sure they are formatted properly in a 420px view.

(I'll attach some screen shots to to the overall PR)

@@ -90,6 +90,7 @@
@include type.type-style('body-compact-02');
color: $text-02;
margin-top: 0.375rem;
text-align: left;
Copy link
Member Author

Choose a reason for hiding this comment

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

The demographics and the identifiers were bought center aligned (see screen shots) this and the line below just left-aligns them.

@@ -8,7 +8,7 @@
top: spacing.$spacing-09;
right: 0;
height: 100vh;
min-width: 33rem;
width: 26.25rem;
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing the overlay to the standard 420px workspace/overlay size

@denniskigen
Copy link
Member

denniskigen commented Feb 23, 2024

@mogoodrich Could we indent the overlay heading with a horizontal margin of 1rem? It'd look a lot better if it weren't flush with the left border of the overlay. Also, the Close button on the overlay should be flush with the right border.

@mogoodrich
Copy link
Member Author

@mogoodrich Could we indent the overlay heading with a horizontal margin of 1rem? It'd look a lot better if it weren't flush with the left border of the overlay. Also, the Close button on the overlay should be flush with the right border.

Yep, @denniskigen ... the overlay layout is somewhat screwed up. The coloring of the button is wrong, too, as you can tell. I started looking into that this morning but wasn't immediately able to track down how to fix and wanted to get this PR out this week... I can either fix in a follow-on commit or ticket.

Copy link
Member

@mseaton mseaton left a comment

Choose a reason for hiding this comment

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

LGTM

@mogoodrich
Copy link
Member Author

@denniskigen are you okay with the PR if the overlay heading is ticketed separately? @ibacher @brandones do you want to add any thoughts before I merge?

@mogoodrich
Copy link
Member Author

Going to merge this in because I'm running into some weird layout issues with another commit and need to see if this fixes it. Post commit reviews still welcome.

@mogoodrich mogoodrich merged commit 2382751 into main Feb 27, 2024
6 checks passed
@mogoodrich mogoodrich deleted the O3-2895 branch February 27, 2024 21:14
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.

3 participants