Skip to content

Commit

Permalink
fix: improve layout of stability popovers
Browse files Browse the repository at this point in the history
Signed-off-by: Nick Mitchell <[email protected]>
  • Loading branch information
starpit committed Mar 7, 2025
1 parent 4cae296 commit 7a02e75
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 21 deletions.
50 changes: 30 additions & 20 deletions pdl-live-react/src/view/masonry/MasonryTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ function renderValue({
className="pdl-masonry-tile-stability-popover"
headerContent={detailHeader}
bodyContent={
<Stack hasGutter>
<Stack>
<Progress
size="sm"
variant={
Expand All @@ -211,35 +211,45 @@ function renderValue({
: "success"
}
value={100 * v}
title="A/B Match"
title={
v === 1
? "Perfect Match!"
: "A/B Comparison of Differences"
}
/>
<Split hasGutter>
<Split>
<Panel
isScrollable
className="pdl-masonry-tile-stability-popover-ab-panel"
data-perfect-match={v === 1 || undefined}
>
<PanelHeader>
<Title headingLevel="h4">A</Title>
</PanelHeader>
<PanelMain maxHeight="400px">
{v < 1 && (
<PanelHeader>
<Title headingLevel="h4">A</Title>
</PanelHeader>
)}
<PanelMain maxHeight="300px">
<PanelMainBody>
<Result result={detailBody?.[i]} term="" />
</PanelMainBody>
</PanelMain>
</Panel>
<Panel
isScrollable
className="pdl-masonry-tile-stability-popover-ab-panel"
>
<PanelHeader>
<Title headingLevel="h4">B</Title>
</PanelHeader>
<PanelMain maxHeight="400px">
<PanelMainBody>
<Result result={detailBody?.[j]} term="" />
</PanelMainBody>
</PanelMain>
</Panel>
{v < 1 && (
<Panel
isScrollable
variant="secondary"
className="pdl-masonry-tile-stability-popover-ab-panel"
>
<PanelHeader>
<Title headingLevel="h4">B</Title>
</PanelHeader>
<PanelMain maxHeight="300px">
<PanelMainBody>
<Result result={detailBody?.[j]} term="" />
</PanelMainBody>
</PanelMain>
</Panel>
)}
</Split>
</Stack>
}
Expand Down
29 changes: 28 additions & 1 deletion pdl-live-react/src/view/masonry/Stability.css
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,32 @@
}

.pdl-masonry-tile-stability-popover-ab-panel {
max-width: 300px;
.pf-v6-c-panel__main-body {
padding-bottom: 0;
}
&:not([data-perfect-match]) {
max-width: 300px;
}

&:first-child {
.pf-v6-c-panel__main-body,
.pf-v6-c-panel__header {
padding-left: 0;
}
}
&:last-child {
.pf-v6-c-panel__main-body,
.pf-v6-c-panel__header {
padding-right: 0;
}
}
&[data-perfect-match] {
.pf-v6-c-panel__main-body {
padding-left: 0;
padding-right: 0;
}
}
}
.pdl-masonry-tile-stability-popover-ab-panel-mainbody {
margin-left: 0;
}

0 comments on commit 7a02e75

Please sign in to comment.