add subtle shadow to cards

This commit is contained in:
Nate Kelley 2025-03-13 20:06:22 -06:00
parent 4abd605280
commit 2f74448c8e
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
7 changed files with 28 additions and 13 deletions

View File

@ -160,6 +160,6 @@ export const AppCodeEditor = forwardRef<AppCodeEditorHandle, AppCodeEditorProps>
AppCodeEditor.displayName = 'AppCodeEditor'; AppCodeEditor.displayName = 'AppCodeEditor';
const LoadingContainer = React.memo(() => { const LoadingContainer = React.memo(() => {
return <CircleSpinnerLoaderContainer />; return <CircleSpinnerLoaderContainer className="animate-in fade-in-0 duration-300" />;
}); });
LoadingContainer.displayName = 'LoadingContainer'; LoadingContainer.displayName = 'LoadingContainer';

View File

@ -75,7 +75,11 @@ const MetricViewChartCard: React.FC<{
}, [isTable, loadingData, errorData]); }, [isTable, loadingData, errorData]);
return ( return (
<div className={cn(cardClass, 'bg-background flex flex-col overflow-hidden rounded border')}> <div
className={cn(
'bg-background flex flex-col overflow-hidden rounded border shadow',
cardClass
)}>
{children} {children}
</div> </div>
); );

View File

@ -20,7 +20,7 @@ export const MetricViewChartHeader: React.FC<{
)}> )}>
{hasTitleOrDescription ? ( {hasTitleOrDescription ? (
<> <>
<EditableTitle level={4} className="mb-0" inputClassName="h-auto!" onChange={onSetTitle}> <EditableTitle level={4} className="" inputClassName="h-auto!" onChange={onSetTitle}>
{title} {title}
</EditableTitle> </EditableTitle>
<div className="flex items-center space-x-1 whitespace-nowrap"> <div className="flex items-center space-x-1 whitespace-nowrap">

View File

@ -34,7 +34,7 @@ export const MetricViewFile: React.FC<MetricViewProps> = React.memo(({ metricId
}, [fileProp]); }, [fileProp]);
return ( return (
<div className="relative h-full overflow-hidden p-3"> <div className="relative h-full overflow-hidden p-5">
<CodeCard <CodeCard
code={file} code={file}
language="yaml" language="yaml"

View File

@ -81,8 +81,9 @@ export const MetricViewResults: React.FC<MetricViewProps> = React.memo(({ metric
}); });
return ( return (
<div ref={containerRef} className="h-full w-full p-3"> <div ref={containerRef} className="swag h-full w-full p-5">
<AppVerticalCodeSplitter <AppVerticalCodeSplitter
className="shadow"
ref={appSplitterRef} ref={appSplitterRef}
autoSaveId={autoSaveId} autoSaveId={autoSaveId}
sql={sql} sql={sql}

View File

@ -80,3 +80,7 @@ export const createFileRoute = ({ assetId, type }: { assetId: string; type: File
if (!routeBuilder) return ''; if (!routeBuilder) return '';
return routeBuilder(assetId); return routeBuilder(assetId);
}; };
export const createChatRoute = (chatId: string) => {
return createBusterRoute({ route: BusterRoutes.APP_CHAT_ID, chatId });
};

View File

@ -5,7 +5,11 @@ import type { ChatLayoutView, SelectedFile } from '../../interfaces';
import { usePathname } from 'next/navigation'; import { usePathname } from 'next/navigation';
import { parsePathnameSegments } from './parsePathnameSegments'; import { parsePathnameSegments } from './parsePathnameSegments';
import { useMemoizedFn } from '@/hooks'; import { useMemoizedFn } from '@/hooks';
import { createChatAssetRoute, createFileRoute } from '../../ChatLayoutContext/helpers'; import {
createChatAssetRoute,
createChatRoute,
createFileRoute
} from '../../ChatLayoutContext/helpers';
import { useAppLayoutContextSelector } from '@/context/BusterAppLayout'; import { useAppLayoutContextSelector } from '@/context/BusterAppLayout';
import { initializeSelectedFile } from './initializeSelectedFile'; import { initializeSelectedFile } from './initializeSelectedFile';
@ -41,20 +45,22 @@ export const useSelectedFileAndLayout = ({
const onSetSelectedFile = useMemoizedFn(async (file: SelectedFile) => { const onSetSelectedFile = useMemoizedFn(async (file: SelectedFile) => {
const fileType = file.type; const fileType = file.type;
const fileId = file.id; 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 isSameAsCurrentFile = selectedFile?.id === fileId;
const route =
chatId !== undefined
? isSameAsCurrentFile
? createChatRoute(chatId)
: createChatAssetRoute({ chatId, assetId: fileId, type: fileType })
: createFileRoute({ assetId: fileId, type: fileType });
setRenderViewLayoutKey('both'); setRenderViewLayoutKey('both');
setSelectedFile(file); setSelectedFile(isSameAsCurrentFile ? undefined : file);
await onChangePage(route); await onChangePage(route);
startTransition(() => { startTransition(() => {
onChangePage(route); //this is hack for now... onChangePage(route); //this is hack for now...
animateOpenSplitter('both'); animateOpenSplitter(isSameAsCurrentFile ? 'left' : 'both');
}); });
}); });