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
6 changes: 6 additions & 0 deletions workspaces/theme/.changeset/entity-page-layout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@red-hat-developer-hub/backstage-plugin-theme': patch
---

Fix the RHDH entity-page layout so content can grow beyond the viewport without
being clipped by the main content container.
Original file line number Diff line number Diff line change
Expand Up @@ -125,12 +125,14 @@ describe('createComponents', () => {
const desktop = root?.['@media (min-width: 600px)'] as
| Record<string, unknown>
| undefined;
expect(desktop?.['& > main:not([data-backstage-core-page])']).toEqual(
expect(desktop?.['& > main:has([class*="bui-Container"])']).toEqual(
expect.objectContaining({
display: 'flex',
flexDirection: 'column',
flex: 1,
minHeight: 0,
flex: '1 0 auto',
minHeight: 'calc(100vh - 2 * 1.5rem)',
height: 'auto',
maxHeight: 'none !important',
}),
);
});
Expand Down
18 changes: 9 additions & 9 deletions workspaces/theme/plugins/theme/src/utils/createComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -815,17 +815,17 @@ export const createComponents = (themeConfig: ThemeConfig): Components => {
// Prevent overflow in the main container due to the margin
maxHeight: `calc(100vh - 2 * ${general.pageInset})`,
},
// NFS BUI entity pages wrap PluginHeader + tabs + Container in a
// classless <main>. BUI Container is flex: 1 1 0% but that only
// grows when main is a flex column — otherwise Topology / Scorecard
// stay content-height inside a tall well (RHDHBUGS-3543). Do not
// override Backstage Page, which uses display:grid on <main>.
'& > main:not([data-backstage-core-page])': {
// NFS BUI entity pages wrap their content in a BUI Container inside
// a classless <main>. The Container is flex: 1 1 0%, but that only
// grows when main is a flex column. Keep the main content at least
// viewport-height while allowing longer entity pages to grow.
'& > main:has([class*="bui-Container"])': {
display: 'flex',
flexDirection: 'column',
flex: 1,
minHeight: 0,
maxHeight: `calc(100% - 2 * ${general.pageInset})`,
flex: '1 0 auto',
minHeight: `calc(100vh - 2 * ${general.pageInset})`,
height: 'auto',
maxHeight: 'none !important',
},
// NFS / BUI pages use Container instead of <main>. Match the content
// well color (same token as BackstageContent) and rely on flex: 1
Expand Down
Loading