From 58f50f488d21b208bea8ade7151a81ae63e01585 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 13 Jul 2025 14:44:48 +0000 Subject: [PATCH 1/2] Add data truncation warning for metrics with over 5,000 records Co-authored-by: natemkelley --- .../MetricDataTruncatedWarning.tsx | 25 +++++++++++++++++++ .../MetricViewChart/MetricViewChart.tsx | 5 ++++ 2 files changed, 30 insertions(+) create mode 100644 apps/web/src/controllers/MetricController/MetricViewChart/MetricDataTruncatedWarning.tsx diff --git a/apps/web/src/controllers/MetricController/MetricViewChart/MetricDataTruncatedWarning.tsx b/apps/web/src/controllers/MetricController/MetricViewChart/MetricDataTruncatedWarning.tsx new file mode 100644 index 000000000..4e4bae563 --- /dev/null +++ b/apps/web/src/controllers/MetricController/MetricViewChart/MetricDataTruncatedWarning.tsx @@ -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 = ({ + className +}) => { + return ( +
+ + This request returned more than 5,000 records + + + If you need more than that, please contact your data admin. + +
+ ); +}; \ No newline at end of file diff --git a/apps/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx b/apps/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx index 63769f5ab..70c252f66 100644 --- a/apps/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx +++ b/apps/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx @@ -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'; @@ -104,6 +105,10 @@ export const MetricViewChart: React.FC<{ /> + + + + Date: Mon, 14 Jul 2025 11:36:03 -0600 Subject: [PATCH 2/2] metric data truncate warning --- .../ui/layouts/AppSplitter/AppSplitter.tsx | 2 +- .../MetricDataTruncatedWarning.tsx | 18 +++--- .../MetricViewChart/MetricViewChart.tsx | 56 +++++++++---------- 3 files changed, 36 insertions(+), 40 deletions(-) diff --git a/apps/web/src/components/ui/layouts/AppSplitter/AppSplitter.tsx b/apps/web/src/components/ui/layouts/AppSplitter/AppSplitter.tsx index d2a84cb71..19da71164 100644 --- a/apps/web/src/components/ui/layouts/AppSplitter/AppSplitter.tsx +++ b/apps/web/src/components/ui/layouts/AppSplitter/AppSplitter.tsx @@ -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; } diff --git a/apps/web/src/controllers/MetricController/MetricViewChart/MetricDataTruncatedWarning.tsx b/apps/web/src/controllers/MetricController/MetricViewChart/MetricDataTruncatedWarning.tsx index 4e4bae563..c22d714c1 100644 --- a/apps/web/src/controllers/MetricController/MetricViewChart/MetricDataTruncatedWarning.tsx +++ b/apps/web/src/controllers/MetricController/MetricViewChart/MetricDataTruncatedWarning.tsx @@ -6,20 +6,16 @@ interface MetricDataTruncatedWarningProps { className?: string; } -export const MetricDataTruncatedWarning: React.FC = ({ - className +export const MetricDataTruncatedWarning: React.FC = ({ + className }) => { return ( -
- - This request returned more than 5,000 records - - +
+ This request returned more than 5,000 records + If you need more than that, please contact your data admin.
); -}; \ No newline at end of file +}; diff --git a/apps/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx b/apps/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx index 70c252f66..a18d94b43 100644 --- a/apps/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx +++ b/apps/web/src/controllers/MetricController/MetricViewChart/MetricViewChart.tsx @@ -79,35 +79,35 @@ export const MetricViewChart: React.FC<{ return (
- - -
- - +
+ + +
+ + - - - + {!!metricData?.has_more_records && } +