From b34ddb5903b89621b90c29cfe50c429249490e4e Mon Sep 17 00:00:00 2001 From: Nicolas Takashi Date: Fri, 24 Jul 2026 18:06:46 +0100 Subject: [PATCH] [FEATURE] Scope TimeSeriesChart annotations to the panel Rewire TimeSeriesChartPanel to consume annotations through the new panel-scoped usePanelAnnotationsWithData hook, fed the panel's annotations config from props.definition.spec.annotations, instead of the global useAnnotationsWithData. This makes the panel honor its dashboard-annotation toggle and render its own panel-local annotation definitions. The conversion and chart rendering are unchanged. Depends on perses/spec#61 (data model) and the usePanelAnnotationsWithData hook in perses/shared. Signed-off-by: Nicolas Takashi --- timeserieschart/src/TimeSeriesChartPanel.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timeserieschart/src/TimeSeriesChartPanel.tsx b/timeserieschart/src/TimeSeriesChartPanel.tsx index bb887333d..a22502839 100644 --- a/timeserieschart/src/TimeSeriesChartPanel.tsx +++ b/timeserieschart/src/TimeSeriesChartPanel.tsx @@ -45,7 +45,7 @@ import { getTimeSeriesValues, } from '@perses-dev/components'; import { TimeSeries, TimeSeriesData, TimeSeriesValueTuple } from '@perses-dev/spec'; -import { useAnnotationsWithData } from '@perses-dev/dashboards'; +import { usePanelAnnotationsWithData } from '@perses-dev/dashboards'; import { TimeSeriesChartOptions, DEFAULT_FORMAT, @@ -156,7 +156,7 @@ export function TimeSeriesChartPanel(props: TimeSeriesChartProps): ReactElement const { setTimeRange } = useTimeRange(); - const annotationsWithData = useAnnotationsWithData(); + const annotationsWithData = usePanelAnnotationsWithData(props.definition?.spec.annotations); const annotations: TimeSeriesAnnotation[] = useMemo( () => convertAnnotationToTimeSeriesAnnotation(annotationsWithData),