Add data truncation warning for metrics with over 5,000 records

Co-authored-by: natemkelley <natemkelley@gmail.com>
This commit is contained in:
Cursor Agent 2025-07-13 14:44:48 +00:00
parent c0745bc0c2
commit 58f50f488d
2 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,25 @@
import React from 'react';
import { Text } from '@/components/ui/typography';
import { cn } from '@/lib/classMerge';
interface MetricDataTruncatedWarningProps {
className?: string;
}
export const MetricDataTruncatedWarning: React.FC<MetricDataTruncatedWarningProps> = ({
className
}) => {
return (
<div className={cn(
'bg-background flex flex-col space-y-2 rounded border p-4 shadow',
className
)}>
<Text size="sm" className="font-medium">
This request returned more than 5,000 records
</Text>
<Text size="sm" variant="secondary">
If you need more than that, please contact your data admin.
</Text>
</div>
);
};

View File

@ -10,6 +10,7 @@ import { useMemoizedFn } from '@/hooks';
import { cn } from '@/lib/classMerge'; import { cn } from '@/lib/classMerge';
import { inputHasText } from '@/lib/text'; import { inputHasText } from '@/lib/text';
import { MetricChartEvaluation } from './MetricChartEvaluation'; import { MetricChartEvaluation } from './MetricChartEvaluation';
import { MetricDataTruncatedWarning } from './MetricDataTruncatedWarning';
import { MetricSaveFilePopup } from './MetricSaveFilePopup'; import { MetricSaveFilePopup } from './MetricSaveFilePopup';
import { MetricViewChartContent } from './MetricViewChartContent'; import { MetricViewChartContent } from './MetricViewChartContent';
import { MetricViewChartHeader } from './MetricViewChartHeader'; import { MetricViewChartHeader } from './MetricViewChartHeader';
@ -104,6 +105,10 @@ export const MetricViewChart: React.FC<{
/> />
</MetricViewChartCard> </MetricViewChartCard>
<AnimatePresenceWrapper show={!!metricData?.has_more_records}>
<MetricDataTruncatedWarning />
</AnimatePresenceWrapper>
<AnimatePresenceWrapper show={showEvaluation}> <AnimatePresenceWrapper show={showEvaluation}>
<MetricChartEvaluation <MetricChartEvaluation
evaluationScore={evaluation_score} evaluationScore={evaluation_score}