From 814e50c5168e8b10c4773d68307f20eefd2dda55 Mon Sep 17 00:00:00 2001 From: Timrossid Date: Fri, 29 May 2026 15:11:16 +0100 Subject: [PATCH] feat: add filter controls customer support (#441) - Add FilterHelpPopover component for inline per-filter help - Add FilterSupportGuide modal with Guide/FAQ/Contact tabs - Add useFilterCustomerSupport hook with content for 7 filter sections - Integrate help popovers and support guide into FilterSidebar - Integrate help popovers and support guide into FacetedFilterSystem - Integrate help button and support guide into DashboardFilters - Write unit tests for all new components and hook --- src/components/dashboard/DashboardFilters.tsx | 74 ++-- src/components/search/FacetedFilterSystem.tsx | 52 ++- src/components/search/FilterHelpPopover.tsx | 136 +++++++ src/components/search/FilterSidebar.tsx | 52 ++- src/components/search/FilterSupportGuide.tsx | 194 ++++++++++ .../__tests__/FilterCustomerSupport.test.tsx | 348 ++++++++++++++++++ src/hooks/useFilterCustomerSupport.ts | 211 +++++++++++ 7 files changed, 1043 insertions(+), 24 deletions(-) create mode 100644 src/components/search/FilterHelpPopover.tsx create mode 100644 src/components/search/FilterSupportGuide.tsx create mode 100644 src/components/search/__tests__/FilterCustomerSupport.test.tsx create mode 100644 src/hooks/useFilterCustomerSupport.ts diff --git a/src/components/dashboard/DashboardFilters.tsx b/src/components/dashboard/DashboardFilters.tsx index 57c74cc3..95719632 100644 --- a/src/components/dashboard/DashboardFilters.tsx +++ b/src/components/dashboard/DashboardFilters.tsx @@ -7,7 +7,7 @@ 'use client'; import React, { useState, useCallback, useMemo } from 'react'; -import { Filter, X, RotateCcw } from 'lucide-react'; +import { Filter, X, RotateCcw, LifeBuoy } from 'lucide-react'; import { TimeRange, AggregationType, CHART_COLOR_PALETTE } from '@/utils/visualizationUtils'; import type { DashboardFiltersState } from '@/hooks/useDashboardData'; import { useInternationalization } from '@/hooks/useInternationalization'; @@ -18,6 +18,9 @@ import { getDashboardTimeRangeLabel, translateWithFallback, } from './dashboardI18n'; +import { FilterHelpPopover } from '@/components/search/FilterHelpPopover'; +import { FilterSupportGuide } from '@/components/search/FilterSupportGuide'; +import { useFilterCustomerSupport } from '@/hooks/useFilterCustomerSupport'; // ─── Types ──────────────────────────────────────────────────────────────────── @@ -52,6 +55,7 @@ export const DashboardFilters = React.memo( }) => { const { t } = useInternationalization(); const [isOpen, setIsOpen] = useState(false); + const support = useFilterCustomerSupport(); const timeRangeOptions = useMemo( () => @@ -184,20 +188,32 @@ export const DashboardFilters = React.memo( - {activeFilterCount > 0 && ( +
+ {activeFilterCount > 0 && ( + + )} + - )} +
{/* Expandable panel */} @@ -208,16 +224,24 @@ export const DashboardFilters = React.memo( > {/* Time Range */}
- +
+ + support.toggleHelp('duration')} + onClose={support.closeHelp} + /> +