Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,36 @@ $actionPanelExpandedOffset: $actionNavOffset + $actionPanelOffset;

.grid {
display: grid;
grid-template-columns: 1fr min-content;
/* Main content + right workspace panel.
When workspace is closed: second column collapses to 0, first column uses 100% width.
When workspace is open: first column shrinks, second column expands up to min(40rem, 50vw).
Use auto for second column to allow it to collapse to 0 when empty. */
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @Harshraj112, the SCSS comments are too much detailed and breaks consistency with the rest of the codebase

Copy link
Author

Choose a reason for hiding this comment

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

Okay! So this cause any prbm? I have make it like rest of the codebase?

Copy link
Contributor

Choose a reason for hiding this comment

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

this doesn't cause any problem , but to maintain code consistency u can remove the comments

grid-template-columns: 1fr auto;
grid-template-rows: 1fr;
align-items: stretch;
width: inherit;
width: 100%;
/* Establish stacking context for proper z-index behavior */
position: relative;
isolation: isolate;
}

/* Ensure grid children can shrink instead of forcing overflow.
This prevents the right workspace from pushing header action buttons
off-screen when it opens. */
.grid > * {
min-width: 0;
box-sizing: border-box;
}

/* Constrain the workspace panel when it is rendered into the second grid column.
Use max-width to limit expansion to 50% of viewport or 40rem, whichever is smaller.
When workspace is closed (empty), this column will collapse to 0 due to grid-template-columns: auto.
This ensures main content keeps space for action buttons and nothing gets clipped. */
.grid > :nth-child(2) {
min-width: 0;
max-width: min(40rem, 50vw);
box-sizing: border-box;
overflow: auto;
}

.chartReview {
Expand All @@ -26,8 +52,15 @@ $actionPanelExpandedOffset: $actionNavOffset + $actionPanelOffset;
align-self: start;
height: 90%;
width: 100%;
max-width: 100%;
margin: 0 auto;
padding-bottom: layout.$spacing-10;
/* Allow the chartReview to shrink properly inside the grid. Without
this, flex/grid children can overflow their container and push
sibling content (like header action buttons) off-screen. */
min-width: 0;
/* Prevent child content from overflowing the grid column */
overflow-x: auto;
}

.widthContained {
Expand All @@ -49,6 +82,8 @@ $actionPanelExpandedOffset: $actionNavOffset + $actionPanelOffset;
display: flex;
width: 100%;
flex-direction: column;
/* safeguard for nested content */
min-width: 0;
}

// Overriding styles for RTL support
Expand Down
16 changes: 16 additions & 0 deletions packages/esm-patient-common-lib/src/cards/card-header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
align-items: center;
padding: layout.$spacing-04 0 layout.$spacing-04 layout.$spacing-05;
background-color: $ui-background;
/* Allow header to shrink when workspace opens */
min-width: 0;
/* Ensure children don't get clipped */
overflow: visible;

h4:after {
content: '';
Expand All @@ -17,6 +21,18 @@
padding-top: 0.188rem;
border-bottom: 0.375rem solid var(--brand-03);
}

/* Ensure title can shrink if needed */
h4 {
min-width: 0;
flex-shrink: 1;
}

/* Ensure children container can shrink but tries to keep buttons visible */
\u003e :not(h4) {
min-width: 0;
flex-shrink: 1;
}
}

.desktopHeader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,47 @@
.widgetCard {
border: 1px solid $ui-03;
background-color: $ui-02;
width: 100%;
max-width: 100%;
box-sizing: border-box;
overflow-x: auto;
}

.biometricsHeaderActionItems {
align-items: center;
display: flex;
flex: 1 1 0%;
justify-content: end;
flex-wrap: wrap;
gap: layout.$spacing-02;
/* Allow this container to shrink when workspace opens */
min-width: 0;
overflow: visible;

& :global(.cds--content-switcher) {
max-width: max-content;
/* Allow content switcher to shrink if absolutely necessary */
flex-shrink: 1;

:global(.cds--content-switcher__label) {
height: layout.$spacing-05;
}
}

& button {
/* Allow buttons to shrink if needed, but try to keep them visible */
flex-shrink: 1;
white-space: nowrap;
min-width: max-content;
}
}

.divider {
width: 1px;
height: layout.$spacing-05;
color: $ui-05;
margin: 0 layout.$spacing-05;
flex-shrink: 0;
}

.backgroundDataFetchingIndicator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
min-height: layout.$spacing-07;
outline: none;
pointer-events: visibleFill;
position: relative;
overflow: visible;
}

.emptyStateVitalsHeader {
Expand Down Expand Up @@ -45,6 +47,9 @@
align-items: baseline;
flex-flow: row wrap;
gap: layout.$spacing-02 layout.$spacing-04;
/* Allow items to wrap naturally without fixed padding.
Button container will use flexbox to position itself. */
flex: 1;
}

.heading {
Expand All @@ -67,13 +72,27 @@
column-gap: layout.$spacing-05;
}

// Narrow viewport: 4 columns (when workspace is opened or container is reduced)
// Medium viewport: 4 columns (when workspace is opened or container is reduced to ~80rem)
@container vitals-header-row-container (max-width: 80rem) {
.row {
grid-template-columns: repeat(4, minmax(0, 1fr));
}
}

// Small viewport: 3 columns (when width shrinks further to ~68rem - accommodates sidebar)
@container vitals-header-row-container (max-width: 68rem) {
.row {
grid-template-columns: repeat(3, minmax(0, 1fr));
}
}

// Extra small viewport: 2 columns (for very narrow screens or workspace taking more space)
@container vitals-header-row-container (max-width: 55rem) {
.row {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}

.loading {
display: flex;
background-color: $openmrs-background-grey;
Expand All @@ -99,11 +118,17 @@
.buttonContainer {
display: flex;
align-items: center;
justify-content: right;
gap: layout.$spacing-03;
/* Use flexbox positioning instead of absolute - prevents overlap and jumping */
margin-left: auto;
flex-shrink: 0;
min-width: max-content;
}

.recordVitalsButton {
@include type.type-style('body-compact-01');
white-space: nowrap;
flex-shrink: 0;

&:not([disabled]) svg {
fill: $color-blue-60-2;
Expand Down
19 changes: 19 additions & 0 deletions packages/esm-patient-vitals-app/src/vitals/vitals-overview.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,28 +5,47 @@
.widgetCard {
background-color: colors.$white;
border: 1px solid colors.$gray-20;
width: 100%;
max-width: 100%;
box-sizing: border-box;
overflow-x: auto;
}

.divider {
width: 1px;
height: layout.$spacing-05;
color: $ui-05;
margin: 0 layout.$spacing-05;
flex-shrink: 0;
}

.vitalsHeaderActionItems {
align-items: center;
display: flex;
flex: 1 1 0%;
justify-content: end;
flex-wrap: wrap;
gap: layout.$spacing-02;
/* Allow this container to shrink when workspace opens */
min-width: 0;
overflow: visible;

& :global(.cds--content-switcher) {
max-width: max-content;
/* Allow content switcher to shrink if absolutely necessary */
flex-shrink: 1;

:global(.cds--content-switcher__label) {
height: layout.$spacing-05;
}
}

& button {
/* Allow buttons to shrink if needed, but try to keep them visible */
flex-shrink: 1;
white-space: nowrap;
min-width: max-content;
}
}

.customRow tbody {
Expand Down