From b4a09d2078508f998713d477e5b9e66a38fe1928 Mon Sep 17 00:00:00 2001 From: Evangelos Skopelitis Date: Thu, 19 Dec 2024 17:55:26 -0500 Subject: [PATCH 1/4] frontend: Sidebar: Display scroll bar under top bar Signed-off-by: Evangelos Skopelitis --- frontend/src/components/Sidebar/Sidebar.tsx | 1 + .../__snapshots__/Sidebar.HomeSidebarClosed.stories.storyshot | 4 ++-- .../__snapshots__/Sidebar.HomeSidebarOpen.stories.storyshot | 4 ++-- .../Sidebar.InClusterSidebarClosed.stories.storyshot | 4 ++-- .../Sidebar.InClusterSidebarOpen.stories.storyshot | 4 ++-- .../Sidebar.SelectedItemWithSidebarOmitted.stories.storyshot | 4 ++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/frontend/src/components/Sidebar/Sidebar.tsx b/frontend/src/components/Sidebar/Sidebar.tsx index afd0239509..eb49452918 100644 --- a/frontend/src/components/Sidebar/Sidebar.tsx +++ b/frontend/src/components/Sidebar/Sidebar.tsx @@ -305,6 +305,7 @@ export const PureSidebar = memo(
Date: Thu, 19 Dec 2024 17:57:28 -0500 Subject: [PATCH 2/4] frontend: themes: Set fixed toolbar height Signed-off-by: Evangelos Skopelitis --- frontend/src/lib/themes.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/frontend/src/lib/themes.ts b/frontend/src/lib/themes.ts index 1a02dcd954..57f2ef090c 100644 --- a/frontend/src/lib/themes.ts +++ b/frontend/src/lib/themes.ts @@ -30,6 +30,14 @@ const commonRules = { xl: 1920, }, }, + mixins: { + toolbar: { + minHeight: 64, + '@media (max-width:600px)': { + minHeight: 60, + }, + }, + }, palette: { primary: { contrastText: '#fff', From f0e35fa19fccbf563a7b0409c0681379505668d5 Mon Sep 17 00:00:00 2001 From: Evangelos Skopelitis Date: Thu, 19 Dec 2024 17:58:02 -0500 Subject: [PATCH 3/4] frontend: Layout: Display main scroll bar under top bar Signed-off-by: Evangelos Skopelitis --- frontend/src/components/App/Layout.tsx | 75 ++++++++++++------- frontend/src/components/App/TopBar.tsx | 4 +- .../TopBar.NoToken.stories.storyshot | 4 +- .../TopBar.OneCluster.stories.storyshot | 4 +- .../TopBar.ProcessorAction.stories.storyshot | 4 +- .../TopBar.Token.stories.storyshot | 4 +- .../TopBar.TwoCluster.stories.storyshot | 4 +- 7 files changed, 58 insertions(+), 41 deletions(-) diff --git a/frontend/src/components/App/Layout.tsx b/frontend/src/components/App/Layout.tsx index 7cc581b4e4..ba0a7aafd6 100644 --- a/frontend/src/components/App/Layout.tsx +++ b/frontend/src/components/App/Layout.tsx @@ -2,7 +2,6 @@ import { Box, Button } from '@mui/material'; import Container from '@mui/material/Container'; import CssBaseline from '@mui/material/CssBaseline'; import Link from '@mui/material/Link'; -import { useTheme } from '@mui/material/styles'; import { styled } from '@mui/material/styles'; import { useEffect } from 'react'; import { useTranslation } from 'react-i18next'; @@ -103,7 +102,6 @@ export default function Layout({}: LayoutProps) { const isFullWidth = useTypedSelector(state => state.ui.isFullWidth); const { t } = useTranslation(); const allClusters = useClustersConf(); - const theme = useTheme(); /** This fetches the cluster config from the backend and updates the redux store on an interval. * When stateless clusters are enabled, it also fetches the stateless cluster config from the @@ -209,33 +207,54 @@ export default function Layout({}: LayoutProps) { > {t('Skip to main content')} - - - + + + + - -
- {clustersNotInURL.slice(0, MAXIMUM_NUM_ALERTS).map(clusterName => ( - - ))} - - -
- - - {arePluginsLoaded && ( - { - const clusterName = getCluster() || ''; - const cluster = clusters ? clusters[clusterName] : undefined; - return cluster?.useToken === undefined || cluster?.useToken; - }} - /> - )} - - -
- + + +
+ {clustersNotInURL.slice(0, MAXIMUM_NUM_ALERTS).map(clusterName => ( + + ))} + + +
+ + + {arePluginsLoaded && ( + { + const clusterName = getCluster() || ''; + const cluster = clusters ? clusters[clusterName] : undefined; + return cluster?.useToken === undefined || cluster?.useToken; + }} + /> + )} + + +
+
); diff --git a/frontend/src/components/App/TopBar.tsx b/frontend/src/components/App/TopBar.tsx index 70ebb4509f..1ee0775bb1 100644 --- a/frontend/src/components/App/TopBar.tsx +++ b/frontend/src/components/App/TopBar.tsx @@ -30,7 +30,6 @@ import { SettingsButton } from '../App/Settings'; import { ClusterTitle } from '../cluster/Chooser'; import ErrorBoundary from '../common/ErrorBoundary'; import { GlobalSearch } from '../globalSearch/GlobalSearch'; -import { drawerWidth } from '../Sidebar'; import HeadlampButton from '../Sidebar/HeadlampButton'; import { setWhetherSidebarOpen } from '../Sidebar/sidebarSlice'; import { AppLogo } from './AppLogo'; @@ -408,9 +407,8 @@ export const PureTopBar = memo( return ( <> ({ - marginLeft: drawerWidth, zIndex: theme.zIndex.drawer + 1, '& > *': { color: theme.palette.text.primary, diff --git a/frontend/src/components/App/__snapshots__/TopBar.NoToken.stories.storyshot b/frontend/src/components/App/__snapshots__/TopBar.NoToken.stories.storyshot index ddc6df30a2..765d0c877a 100644 --- a/frontend/src/components/App/__snapshots__/TopBar.NoToken.stories.storyshot +++ b/frontend/src/components/App/__snapshots__/TopBar.NoToken.stories.storyshot @@ -2,10 +2,10 @@