-
Notifications
You must be signed in to change notification settings - Fork 248
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
(feat) O3-3253: Move the details panel button below the Patient Header in the workspace #1844
(feat) O3-3253: Move the details panel button below the Patient Header in the workspace #1844
Conversation
@usamaidrsk can we have a screenshot of how this would look when used as the patient banner on the patient chart, and also with the actions button present. |
@ibacher is this the implementation you envisaged? I've messaged Paul and Grace on #ux-design-advisory to get their thoughts on the redesign. |
I would've anticipated only moving the button in the condensed version of the patient banner. I.e., in the chart, this actually makes the banner take up more visual space, which seems undesirable. |
I agree. Is there a contextual prop @usamaidrsk should be checking for to know whether the banner is the condensed version? |
We might also want to make that dependent on the |
It looks like we could also conditionally render based on isTabletViewport which is computed from isTabletViewport.mp4 |
Yes, @denniskigen that does do the trick. |
toggleContactDetails={toggleContactDetails} | ||
showContactDetails={showContactDetails} | ||
/> | ||
{!isTabletViewport ? ( |
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.
So, I was expecting the condition here to be something like:
const renderDetailsButtonBelow = !isTabletViewport && (!Boolean(patientBannerRef.current) || patientBannerRef.current.scrollWidth <= 500);
Basically:
- We do not want to move the details button in tablet mode, because tablet mode is actually wider than the workspace, so this should be a non-issue. (We may want to move it in tablet mode when there are less than maybe 800px of screen width, but let's consider that if / when it comes up or we have more concrete design guidance).
- We only want to move the icon if the
<header />
element is 500px or less, because that indicates that we're being rendered in the workspace (tablet mode is a minimum of 600px of screen real-estate). - If the ref has not yet been set, we don't know which of these two modes to use, so we just assume the default (render to the right).
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.
Defer to @ibacher on this....
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.
This is the technical version of "we leave the patient banner as-is, but where there’s 500px or less of width to render the banner in, we move the “Show Details“ to a new line" 😁
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.
I have pushed an update that uses
const renderDetailsButtonBelow = patientBannerRef.current?.scrollWidth <= 520;
As per zeroheight workspace documentation.
On desktop screens, the workspace sits on the right side of the page. Its width is 420px in most cases, and 520px if it's a clinical form.
16acb90
to
4a6c36a
Compare
@@ -42,6 +42,9 @@ const PatientBanner: React.FC<PatientBannerProps> = ({ patient, patientUuid, hid | |||
}, []); | |||
|
|||
const isDeceased = Boolean(patient?.deceasedDateTime); | |||
// render details button below patient details for workspaces | |||
// 520px is the maximum width a workspace occupies | |||
const renderDetailsButtonBelow = patientBannerRef.current?.scrollWidth <= 520; |
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.
const renderDetailsButtonBelow = patientBannerRef.current?.scrollWidth <= 520; | |
const maxWorkspaceWidth = 520; | |
const showDetailsButtonBelowHeader = !isTabletViewport && (!Boolean(patientBannerRef.current) || patientBannerRef.current.scrollWidth <= maxWorkspaceWidth); |
The current logic doesn't account for two of the situations Ian mentioned above.
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.
Yes @denniskigen. Thanks for pointing this out. I tested it with the condition provided, but the appearance on the desktop view was not as expected.
Therefore, I decided to only check the width of the banner instead. Whenever the width is less than 520px, the button will be displayed below the header. This way, the button will never appear under the header on tablets, as they are greater than 520px in width.
cc @ibacher
…ent details on tableview
2b235e0
to
8f67de4
Compare
So I've just tested this and it works well with workspaces: show-details-button-below-patient-header.mp4It doesn't work as well with overlays (such as what we use for the Appointments form). Is it because we don't constrain the max-width @brandones @mogoodrich? Perhaps setting a max-width and using that value for the condition could be the ideal approach: |
Thanks @denniskigen!,
I think the screenshot looks okay, given that the patient details on the banner are not compressed/squeezed as to why @mogoodrich suggested to improve the layout. |
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.
Ok. Approving and deferring to @mogoodrich to merge if it meets the acceptance criteria. Thanks, @usamaidrsk!
Requirements
Summary
This PR moves the show details button below the patient details.
Screenshots
show-hide-details-below-patient-details.mp4
Related Issue
O3-3253
Other