From 0caa4f80995f3f21eeade2b386aec8c07522bbf7 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 15 Feb 2024 16:30:08 -0800 Subject: [PATCH] Responsive (scroll) workspace header --- src-web/components/SidebarActions.tsx | 2 +- src-web/components/Workspace.tsx | 22 +++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src-web/components/SidebarActions.tsx b/src-web/components/SidebarActions.tsx index 565a6643..00b2ce54 100644 --- a/src-web/components/SidebarActions.tsx +++ b/src-web/components/SidebarActions.tsx @@ -16,7 +16,7 @@ export const SidebarActions = memo(function SidebarActions() { const { hidden, show, hide } = useSidebarHidden(); return ( - + { trackEvent('Sidebar', 'Toggle'); diff --git a/src-web/components/Workspace.tsx b/src-web/components/Workspace.tsx index 06787861..76a940a7 100644 --- a/src-web/components/Workspace.tsx +++ b/src-web/components/Workspace.tsx @@ -15,7 +15,6 @@ import { useSidebarHidden } from '../hooks/useSidebarHidden'; import { useSidebarWidth } from '../hooks/useSidebarWidth'; import { Button } from './core/Button'; import { HotKeyList } from './core/HotKeyList'; -import { HStack } from './core/Stacks'; import { GrpcConnectionLayout } from './GrpcConnectionLayout'; import { HttpRequestLayout } from './HttpRequestLayout'; import { Overlay } from './Overlay'; @@ -137,9 +136,7 @@ export default function Workspace() { )} > - - - + @@ -159,11 +156,7 @@ export default function Workspace() { /> )} - + {activeRequest == null ? ( @@ -181,18 +174,21 @@ interface HeaderSizeProps extends HTMLAttributes { children: ReactNode; } -function HeaderSize({ className, ...props }: HeaderSizeProps) { +function HeaderSize({ className, style, ...props }: HeaderSizeProps) { const platform = useOsInfo(); const fullscreen = useIsFullscreen(); const stoplightsVisible = platform?.osType === 'Darwin' && !fullscreen; return (
+ > + {/* NOTE: This needs display:grid or else the element shrinks (even though scrollable) */} +
+
); }