From b28d371af09c7b4e4e2f8926ae58fb58dc01fcc8 Mon Sep 17 00:00:00 2001 From: DesmondL-dev <161560016+DesmondL-dev@users.noreply.github.com> Date: Wed, 11 Mar 2026 22:44:31 -0400 Subject: [PATCH] feat(demo): inject non-destructive spotlight for chaos engine Implement SaaS-style feature onboarding popover tied to sessionStorage to intuitively guide non-technical users toward the ErrorBoundary demonstration without altering the core UI aesthetics. --- .../dashboard/components/AmlDataGrid.tsx | 39 +++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/src/features/dashboard/components/AmlDataGrid.tsx b/src/features/dashboard/components/AmlDataGrid.tsx index 59bc5dd..a8cee0e 100644 --- a/src/features/dashboard/components/AmlDataGrid.tsx +++ b/src/features/dashboard/components/AmlDataGrid.tsx @@ -7,6 +7,7 @@ import { useDataRedaction } from '../hooks/useDataRedaction'; import { maskAccount, maskSin } from '../utils/dataRedaction'; import { RequireRole } from '../../auth/components/RequireRole'; import { KYC_RECORDS, type KycRecord } from '../data/kycMockData'; +import { useDemoMode } from '../../../core/hooks/useDemoMode'; export type { KycRecord }; @@ -86,6 +87,9 @@ export const AmlDataGrid = ({ onRowClick, records: recordsProp, onSimulateCrash const isTabletOrLarger = useIsTabletOrLarger(); const scrollContainerRef = useRef(null); const dataSource = recordsProp ?? KYC_RECORDS; + const { isDemoMode } = useDemoMode(); + const [showSpotlight, setShowSpotlight] = useState(() => typeof window !== 'undefined' ? sessionStorage.getItem('aegis_chaos_spotlight') !== 'true' : true); + const handleSimulateCrash = () => { if (isDemoMode) { setShowSpotlight(false); sessionStorage.setItem('aegis_chaos_spotlight', 'true'); } onSimulateCrash?.(); }; const virtualizer = useVirtualizer({ count: dataSource.length, @@ -119,13 +123,34 @@ export const AmlDataGrid = ({ onRowClick, records: recordsProp, onSimulateCrash {/* Chaos engineering trigger: right-aligned in flow so it pushes content instead of overlapping */} {onSimulateCrash && ( - +
+ + {isDemoMode && showSpotlight && ( +
+ {/* Caret pointing up */} +
+
+ ⛈️ +
+

Chaos Engine

+

Click to simulate a total server crash and watch the system gracefully survive.

+ +
+
+
+ )} +
)}