From 5339cc242cef70f74cd904f031542c663ddd8fa5 Mon Sep 17 00:00:00 2001 From: Praveen K B Date: Thu, 5 Dec 2024 22:33:41 +0530 Subject: [PATCH] Added keyboard shortcut for toolbar collapse --- src/pages/Stream/index.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/Stream/index.tsx b/src/pages/Stream/index.tsx index 89c9faef..40b0b762 100644 --- a/src/pages/Stream/index.tsx +++ b/src/pages/Stream/index.tsx @@ -1,5 +1,5 @@ import { Box, Stack } from '@mantine/core'; -import { useDocumentTitle } from '@mantine/hooks'; +import { useDocumentTitle, useHotkeys } from '@mantine/hooks'; import { FC, useCallback, useEffect } from 'react'; import LiveLogTable from './Views/LiveTail/LiveLogTable'; import ViewLog from './components/ViewLog'; @@ -20,7 +20,7 @@ import { useGetStreamSchema } from '@/hooks/useGetLogStreamSchema'; import { useGetStreamInfo } from '@/hooks/useGetStreamInfo'; import useParamsController from './hooks/useParamsController'; -const { streamChangeCleanup } = streamStoreReducers; +const { streamChangeCleanup, toggleSideBar } = streamStoreReducers; const ErrorView = (props: { error: string | null; onRetry: () => void }) => { return ( @@ -45,12 +45,14 @@ const Stream: FC = () => { const [maximized] = useAppStore((store) => store.maximized); const [instanceConfig] = useAppStore((store) => store.instanceConfig); const queryEngine = instanceConfig?.queryEngine; - const [sideBarOpen, setStreamStore] = useStreamStore((store) => store.sideBarOpen); + const [, setStreamStore] = useStreamStore((store) => store.sideBarOpen); const { getStreamInfoRefetch, getStreamInfoLoading, getStreamInfoRefetching } = useGetStreamInfo( currentStream || '', currentStream !== null, ); + useHotkeys([['mod+/', () => setStreamStore((store) => toggleSideBar(store))]]); + const { refetch: refetchSchema, isLoading: isSchemaLoading,