From 2f74448c8e3e1cc832833238009f2eb3fd79b83a Mon Sep 17 00:00:00 2001 From: Nate Kelley Date: Thu, 13 Mar 2025 20:06:22 -0600 Subject: [PATCH] add subtle shadow to cards --- .../ui/inputs/AppCodeEditor/AppCodeEditor.tsx | 2 +- .../MetricViewChart/MetricViewChart.tsx | 6 ++++- .../MetricViewChart/MetricViewChartHeader.tsx | 2 +- .../MetricViewFile/MetricViewFile.tsx | 2 +- .../MetricViewResultsController.tsx | 3 ++- .../ChatLayout/ChatLayoutContext/helpers.ts | 4 ++++ .../useSelectedFileAndLayout.ts | 22 ++++++++++++------- 7 files changed, 28 insertions(+), 13 deletions(-) diff --git a/web/src/components/ui/inputs/AppCodeEditor/AppCodeEditor.tsx b/web/src/components/ui/inputs/AppCodeEditor/AppCodeEditor.tsx index 14a0af898..9e1be60c2 100644 --- a/web/src/components/ui/inputs/AppCodeEditor/AppCodeEditor.tsx +++ b/web/src/components/ui/inputs/AppCodeEditor/AppCodeEditor.tsx @@ -160,6 +160,6 @@ export const AppCodeEditor = forwardRef AppCodeEditor.displayName = 'AppCodeEditor'; const LoadingContainer = React.memo(() => { - return ; + return ; }); LoadingContainer.displayName = 'LoadingContainer'; diff --git a/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx b/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx index 59dfbfc74..0dbfa9baf 100644 --- a/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx +++ b/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx @@ -75,7 +75,11 @@ const MetricViewChartCard: React.FC<{ }, [isTable, loadingData, errorData]); return ( -
+
{children}
); diff --git a/web/src/controllers/MetricController/MetricViewChart/MetricViewChartHeader.tsx b/web/src/controllers/MetricController/MetricViewChart/MetricViewChartHeader.tsx index 26f273fde..bb0ffc38f 100644 --- a/web/src/controllers/MetricController/MetricViewChart/MetricViewChartHeader.tsx +++ b/web/src/controllers/MetricController/MetricViewChart/MetricViewChartHeader.tsx @@ -20,7 +20,7 @@ export const MetricViewChartHeader: React.FC<{ )}> {hasTitleOrDescription ? ( <> - + {title}
diff --git a/web/src/controllers/MetricController/MetricViewFile/MetricViewFile.tsx b/web/src/controllers/MetricController/MetricViewFile/MetricViewFile.tsx index 263af715d..ce649613c 100644 --- a/web/src/controllers/MetricController/MetricViewFile/MetricViewFile.tsx +++ b/web/src/controllers/MetricController/MetricViewFile/MetricViewFile.tsx @@ -34,7 +34,7 @@ export const MetricViewFile: React.FC = React.memo(({ metricId }, [fileProp]); return ( -
+
= React.memo(({ metric }); return ( -
+
{ + return createBusterRoute({ route: BusterRoutes.APP_CHAT_ID, chatId }); +}; diff --git a/web/src/layouts/ChatLayout/hooks/useSelectedFileAndLayout/useSelectedFileAndLayout.ts b/web/src/layouts/ChatLayout/hooks/useSelectedFileAndLayout/useSelectedFileAndLayout.ts index 01b18fa64..64260c721 100644 --- a/web/src/layouts/ChatLayout/hooks/useSelectedFileAndLayout/useSelectedFileAndLayout.ts +++ b/web/src/layouts/ChatLayout/hooks/useSelectedFileAndLayout/useSelectedFileAndLayout.ts @@ -5,7 +5,11 @@ import type { ChatLayoutView, SelectedFile } from '../../interfaces'; import { usePathname } from 'next/navigation'; import { parsePathnameSegments } from './parsePathnameSegments'; import { useMemoizedFn } from '@/hooks'; -import { createChatAssetRoute, createFileRoute } from '../../ChatLayoutContext/helpers'; +import { + createChatAssetRoute, + createChatRoute, + createFileRoute +} from '../../ChatLayoutContext/helpers'; import { useAppLayoutContextSelector } from '@/context/BusterAppLayout'; import { initializeSelectedFile } from './initializeSelectedFile'; @@ -41,20 +45,22 @@ export const useSelectedFileAndLayout = ({ const onSetSelectedFile = useMemoizedFn(async (file: SelectedFile) => { const fileType = file.type; const fileId = file.id; - const route = - chatId !== undefined - ? createChatAssetRoute({ chatId, assetId: fileId, type: fileType }) - : createFileRoute({ assetId: fileId, type: fileType }); - const isSameAsCurrentFile = selectedFile?.id === fileId; + const route = + chatId !== undefined + ? isSameAsCurrentFile + ? createChatRoute(chatId) + : createChatAssetRoute({ chatId, assetId: fileId, type: fileType }) + : createFileRoute({ assetId: fileId, type: fileType }); + setRenderViewLayoutKey('both'); - setSelectedFile(file); + setSelectedFile(isSameAsCurrentFile ? undefined : file); await onChangePage(route); startTransition(() => { onChangePage(route); //this is hack for now... - animateOpenSplitter('both'); + animateOpenSplitter(isSameAsCurrentFile ? 'left' : 'both'); }); });