diff --git a/src/app/(campaign)/campanha/(app)/layout.tsx b/src/app/(campaign)/campanha/(app)/layout.tsx index ee35e237..82ef42a0 100644 --- a/src/app/(campaign)/campanha/(app)/layout.tsx +++ b/src/app/(campaign)/campanha/(app)/layout.tsx @@ -78,30 +78,30 @@ export default async function CampaignAppLayout({ children }: { children: React. - - } - /> -
- -
- -
-
- {/* + + } + /> +
+ +
+ +
+
+ {/* Provider must wrap CampaignAppScrollChrome, not only page children: the mobile quick-actions drawer (B91/B100) mounts as a sibling of the scrollport and renders search hits with CampaignHoverTooltip (priority flag). Nested only around {children} left focus→suggest without a provider and crashed the page (B102). */} - - {children} - - - - {biometricEnrollment ? : null} -
+ + {children} + + + + {biometricEnrollment ? : null} +
diff --git a/src/components/campaign/dashboard/CampaignHomeStaffChrome.tsx b/src/components/campaign/dashboard/CampaignHomeStaffChrome.tsx index a54094c0..fb91e0ad 100644 --- a/src/components/campaign/dashboard/CampaignHomeStaffChrome.tsx +++ b/src/components/campaign/dashboard/CampaignHomeStaffChrome.tsx @@ -8,8 +8,8 @@ import { } from '@/components/campaign/dashboard/CampaignGlobalSearchMount' import { CampaignHomeLayout } from '@/components/campaign/dashboard/CampaignHomeLayout' import { CampaignHomeSearch } from '@/components/campaign/dashboard/CampaignHomeSearch' -import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext' import { CampaignHomeSearchChromePublisher } from '@/components/campaign/dashboard/CampaignHomeSearchChromePublisher' +import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext' import { HomeSearchResultsProvider, InitialHomeSearchSuggestProvider, diff --git a/src/components/campaign/dashboard/HomeSearchResultsShell.tsx b/src/components/campaign/dashboard/HomeSearchResultsShell.tsx index 9d999122..4e0297a6 100644 --- a/src/components/campaign/dashboard/HomeSearchResultsShell.tsx +++ b/src/components/campaign/dashboard/HomeSearchResultsShell.tsx @@ -3,16 +3,15 @@ import type { ReactNode } from 'react' import { useHomeSearch } from '@/components/campaign/dashboard/HomeSearchContext' -import { HomeSearchSuggestSkeleton } from '@/components/campaign/dashboard/HomeSearchSuggestSkeleton' import { useHomeSearchResults } from '@/components/campaign/dashboard/HomeSearchResultsContext' +import { HomeSearchSuggestSkeleton } from '@/components/campaign/dashboard/HomeSearchSuggestSkeleton' import { homeSearchHasAnyHits } from '@/lib/campaignHomeSearchHits' export const HomeSearchResultsShell = ({ children }: { children: ReactNode }) => { const { query } = useHomeSearch() const { results, resultKind, isFetching } = useHomeSearchResults() - const hasRenderableHits = - results.status === 'success' && homeSearchHasAnyHits(results.data) + const hasRenderableHits = results.status === 'success' && homeSearchHasAnyHits(results.data) const showSkeleton = isFetching && !hasRenderableHits && results.status !== 'error' const showEmpty = diff --git a/src/components/campaign/shell/CampaignMobileTopBar.tsx b/src/components/campaign/shell/CampaignMobileTopBar.tsx index c25cbd8c..9f3b37c7 100644 --- a/src/components/campaign/shell/CampaignMobileTopBar.tsx +++ b/src/components/campaign/shell/CampaignMobileTopBar.tsx @@ -10,13 +10,13 @@ import { useCampaignWizardChrome } from '@/components/campaign/shell/CampaignWiz import { Button } from '@/components/ui/button' import { SidebarTrigger } from '@/components/ui/Sidebar' import { Skeleton } from '@/components/ui/skeleton' +import { HOME_SEARCH_COLLAPSE_ARIA_LABEL } from '@/lib/campaignHomeSearchContract' import { WIZARD_APP_TOP_BAR_ARIA_LABEL, WIZARD_DISMISS_ARIA_LABEL, wizardFlowChromeAriaLabel, wizardMunicipalityChromeAriaLabel, } from '@/lib/campaignWizardCopy' -import { HOME_SEARCH_COLLAPSE_ARIA_LABEL } from '@/lib/campaignHomeSearchContract' import { cn } from '@/lib/utils' const wizardNavButtonClass = diff --git a/src/lib/homeSearchFocusHistory.ts b/src/lib/homeSearchFocusHistory.ts index 72e674a6..7921fb47 100644 --- a/src/lib/homeSearchFocusHistory.ts +++ b/src/lib/homeSearchFocusHistory.ts @@ -5,7 +5,9 @@ export type HomeSearchFocusHistoryState = { [HOME_SEARCH_FOCUS_HISTORY_KEY]?: true } -export const isHomeSearchFocusHistoryState = (state: unknown): state is HomeSearchFocusHistoryState => +export const isHomeSearchFocusHistoryState = ( + state: unknown, +): state is HomeSearchFocusHistoryState => typeof state === 'object' && state !== null && HOME_SEARCH_FOCUS_HISTORY_KEY in state && diff --git a/tests/unit/campaignMobileTopBar.unit.spec.tsx b/tests/unit/campaignMobileTopBar.unit.spec.tsx index 76c92d31..56d61633 100644 --- a/tests/unit/campaignMobileTopBar.unit.spec.tsx +++ b/tests/unit/campaignMobileTopBar.unit.spec.tsx @@ -8,12 +8,12 @@ vi.mock('next/navigation', () => ({ }), })) -import { CampaignMobileTopBar } from '@/components/campaign/shell/CampaignMobileTopBar' import { CampaignHomeSearchChromeProvider, useSetCampaignHomeSearchChrome, type CampaignHomeSearchChromeState, } from '@/components/campaign/shell/CampaignHomeSearchChromeContext' +import { CampaignMobileTopBar } from '@/components/campaign/shell/CampaignMobileTopBar' import { CampaignWizardChromeProvider, useSetCampaignWizardChrome,