diff --git a/src/features/dashboard/components/BridgeControls.tsx b/src/features/dashboard/components/BridgeControls.tsx index 3463a45..4939f9d 100644 --- a/src/features/dashboard/components/BridgeControls.tsx +++ b/src/features/dashboard/components/BridgeControls.tsx @@ -7,7 +7,7 @@ import { useEffect, useState, type ReactNode } from 'react'; import { useTranslation } from 'react-i18next'; import { Link } from 'react-router-dom'; -import { Gauge as GaugeIcon, RefreshCw } from 'lucide-react'; +import { Gauge as GaugeIcon, RefreshCw, X } from 'lucide-react'; import type { Dashboard } from '../types/schema'; import { cn } from '@/lib/utils'; import { AUTO_REFRESH, useDashboardStore, type AutoRefresh } from '../stores/dashboardStore'; @@ -71,6 +71,8 @@ export function PeriodSwitch({ loading = false }: { loading?: boolean }) { const { t } = useTranslation(); const period = useDashboardStore((s) => s.period); const setPreset = useDashboardStore((s) => s.setPreset); + const zoomedFrom = useDashboardStore((s) => s.zoomedFrom); + const resetZoom = useDashboardStore((s) => s.resetZoom); const every = useDashboardStore((s) => s.autoRefresh); const setEvery = useDashboardStore((s) => s.setAutoRefresh); const onRefresh = useDashboardStore((s) => s.bump); @@ -103,6 +105,21 @@ export function PeriodSwitch({ loading = false }: { loading?: boolean }) { ))} + {/* inbuxa: zoomed in from a chart, the window shown, and the way back. */} + {zoomedFrom && period.kind === 'custom' && ( + + )}