Merge pull request #498 from buster-so/cursor/add-alert-for-truncated-data-warning-2003

add alert for truncated data warning 2003
This commit is contained in:
Nate Kelley 2025-07-14 11:39:28 -06:00 committed by GitHub
commit b72e8fa6c2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 52 additions and 26 deletions

View File

@ -304,7 +304,7 @@ const AppSplitterBase = forwardRef<
const refWidth = containerRef.current?.offsetWidth;
// Don't bust storage if container hasn't been sized yet
if (!refWidth || refWidth === 0) {
console.warn('AppSplitter: container not sized yet');
// console.warn('AppSplitter: container not sized yet');
return false;
}

View File

@ -0,0 +1,21 @@
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-1 rounded border p-4 shadow', className)}>
<Text className="font-medium">This request returned more than 5,000 records</Text>
<Text size="xs" 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 { inputHasText } from '@/lib/text';
import { MetricChartEvaluation } from './MetricChartEvaluation';
import { MetricDataTruncatedWarning } from './MetricDataTruncatedWarning';
import { MetricSaveFilePopup } from './MetricSaveFilePopup';
import { MetricViewChartContent } from './MetricViewChartContent';
import { MetricViewChartHeader } from './MetricViewChartHeader';
@ -78,31 +79,35 @@ export const MetricViewChart: React.FC<{
return (
<div className={cn('flex h-full flex-col justify-between space-y-3.5 p-5', className)}>
<MetricViewChartCard
loadingData={loadingData}
hasData={hasData}
errorData={errorData}
isTable={isTable}
className={cardClassName}>
<MetricViewChartHeader
className="px-4"
name={name}
description={description}
timeFrame={time_frame}
onSetTitle={onSetTitle}
readOnly={isReadOnly}
/>
<div className={'border-border border-b'} />
<MetricViewChartContent
chartConfig={metric.chart_config}
metricData={metricData?.data || []}
dataMetadata={metricData?.data_metadata}
fetchedData={isFetchedMetricData}
errorMessage={metricDataError?.message}
metricId={metricId}
readOnly={isReadOnly}
/>
</MetricViewChartCard>
<div className="flex h-full flex-col space-y-3">
<MetricViewChartCard
loadingData={loadingData}
hasData={hasData}
errorData={errorData}
isTable={isTable}
className={cardClassName}>
<MetricViewChartHeader
className="px-4"
name={name}
description={description}
timeFrame={time_frame}
onSetTitle={onSetTitle}
readOnly={isReadOnly}
/>
<div className={'border-border border-b'} />
<MetricViewChartContent
chartConfig={metric.chart_config}
metricData={metricData?.data || []}
dataMetadata={metricData?.data_metadata}
fetchedData={isFetchedMetricData}
errorMessage={metricDataError?.message}
metricId={metricId}
readOnly={isReadOnly}
/>
</MetricViewChartCard>
{!!metricData?.has_more_records && <MetricDataTruncatedWarning />}
</div>
<AnimatePresenceWrapper show={showEvaluation}>
<MetricChartEvaluation