diff --git a/src/app/(campaign)/campanha/(app)/municipios/page.tsx b/src/app/(campaign)/campanha/(app)/municipios/page.tsx index 6490170a..078ec158 100644 --- a/src/app/(campaign)/campanha/(app)/municipios/page.tsx +++ b/src/app/(campaign)/campanha/(app)/municipios/page.tsx @@ -126,6 +126,8 @@ export default async function MunicipalitiesPage({ searchParams }: Municipalitie ? null : buildMunicipalityListHref({ ...state, priority: 'alta', coverage: 'sem_assessor' }, 1) + // The overview and the table's filter header stay mounted even with zero + // results — only the rows are replaced by the empty state (inside MunicipalityList). const overviewNode = isStaffView && overview ? ( @@ -158,31 +160,27 @@ export default async function MunicipalitiesPage({ searchParams }: Municipalitie ) // Shared pieces; flag only switches the composition shell (CL3 tracer). - const main = resolveListUnifiedEnabled() ? ( - wrapStaffListRegion( - isStaffView, + // Provider wraps both paths the same way (outside the pending boundary). + const main = wrapStaffListRegion( + isStaffView, + resolveListUnifiedEnabled() ? ( , - ) - ) : ( - - {wrapStaffListRegion( - isStaffView, - <> - {filters} - - {overviewNode} - {tableNode} - {footerNode} - - , - )} - + /> + ) : ( + + {filters} + + {overviewNode} + {tableNode} + {footerNode} + + + ), ) return ( diff --git a/src/components/campaign/shared/OpsListPage.tsx b/src/components/campaign/shared/OpsListPage.tsx index 82617776..71812dc5 100644 --- a/src/components/campaign/shared/OpsListPage.tsx +++ b/src/components/campaign/shared/OpsListPage.tsx @@ -1,17 +1,14 @@ import type { ReactNode } from 'react' -import { - OpsListView, - type OpsListViewProps, -} from '@/components/campaign/shared/OpsListView' +import { OpsListView, type OpsListViewProps } from '@/components/campaign/shared/OpsListView' export type OpsListPageProps = OpsListViewProps /** * CL3 — casca server da factory de listas unificadas. * - * Hoje só reencaminha slots para `OpsListView`. Ponto de extensão para OH12 - * (`OfflineBoundary` → Local vs RSC) sem mudar as pages de domínio. + * Reencaminha slots para `OpsListView`. Nome estável para as pages/CL8 pins; + * lógica de offline (OH12) vive na rota (`OfflineBoundary`), não aqui. */ export const OpsListPage = ({ overview, @@ -20,11 +17,5 @@ export const OpsListPage = ({ empty, footer, }: OpsListPageProps): ReactNode => ( - + ) diff --git a/src/components/campaign/shared/OpsListView.tsx b/src/components/campaign/shared/OpsListView.tsx index 343f59f2..6efe0f95 100644 --- a/src/components/campaign/shared/OpsListView.tsx +++ b/src/components/campaign/shared/OpsListView.tsx @@ -14,8 +14,8 @@ export type OpsListViewProps = { toolbar: ReactNode /** A tabela já resolvida (CampaignTable com colunas do domínio). */ table: ReactNode - /** Empty state (CampaignListEmptyState ou Empty do domínio). */ - empty: ReactNode + /** Empty state (CampaignListEmptyState ou Empty do domínio); null se o empty vive na tabela. */ + empty: ReactNode | null /** Footer/paginação (CampaignListFooter / CampaignListPagination). */ footer: ReactNode } diff --git a/tests/unit/opsListPage.unit.spec.ts b/tests/unit/opsListPage.unit.spec.ts index 0c036e18..82c59ddd 100644 --- a/tests/unit/opsListPage.unit.spec.ts +++ b/tests/unit/opsListPage.unit.spec.ts @@ -3,12 +3,7 @@ import { join } from 'node:path' import { describe, expect, it } from 'vitest' -import { resolveListUnifiedEnabled } from '@/lib/opsListRegistry/opsListFlag' - -const MUNICIPIOS_PAGE = join( - process.cwd(), - 'src/app/(campaign)/campanha/(app)/municipios/page.tsx', -) +const MUNICIPIOS_PAGE = join(process.cwd(), 'src/app/(campaign)/campanha/(app)/municipios/page.tsx') describe('OpsListPage municipios tracer (CL3)', () => { it('wires LIST_UNIFIED behind OpsListPage on the municipios route', () => { @@ -18,8 +13,4 @@ describe('OpsListPage municipios tracer (CL3)', () => { expect(source).toContain("from '@/components/campaign/shared/OpsListPage'") expect(source).toContain("from '@/lib/opsListRegistry/opsListFlag'") }) - - it('keeps the flag fail-closed when LIST_UNIFIED is unset', () => { - expect(resolveListUnifiedEnabled({})).toBe(false) - }) })