From 6f42bc3bf332653168416b608c84f1be6c195860 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 31 Jul 2026 05:50:41 +0000 Subject: [PATCH] fix(miss-52): one shared Drawer for the chip-relation lists too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The B42 fix reached the municípios mobile cards, but the three chip-relation surfaces still mounted a Drawer root per OPENED cell on coarse pointers (lideranças 50 cells, dobradinhas 50, assessores 25): the exact hundreds-of-hidden-instances class that tripped React #130 in prod. Each now wraps its table in CampaignListSheetProvider — cell bodies portal into the single host Drawer, fine-pointer popover path untouched (behavior delta: after opening N cells sequentially on touch, N drawer roots -> 1). --- .../campanha/(app)/dobradinhas/page.tsx | 21 +- .../campanha/(app)/liderancas/page.tsx | 21 +- .../campaign/advisor/AdvisorsTable.tsx | 493 +++++++++--------- 3 files changed, 276 insertions(+), 259 deletions(-) diff --git a/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx b/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx index 55ade6e5..c8e9a3f9 100644 --- a/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx +++ b/src/app/(campaign)/campanha/(app)/dobradinhas/page.tsx @@ -10,6 +10,7 @@ import { CampaignListResults, CampaignTransitionAnchor, } from '@/components/campaign/shared/CampaignListPending' +import { CampaignListSheetProvider } from '@/components/campaign/shared/CampaignListSheetHost' import { CampaignTable, CampaignTableHead, @@ -249,14 +250,18 @@ export default async function StateDeputiesPage({ searchParams }: StateDeputiesP

{sortSummary}

- row.id} - empty={} - /> + {/* One shared Drawer for every chip-cell sheet on coarse pointers + (miss #52 — never a Drawer root per opened cell). */} + + row.id} + empty={} + /> + {rows.length ? ( {sortSummary}

- row.id} - empty={} - /> + {/* One shared Drawer for every chip-cell sheet on coarse pointers + (miss #52 — never a Drawer root per opened cell). */} + + row.id} + empty={} + /> + {rows.length ? ( -
- {editing ? ( - - ) : ( - - )} - -
- - {showEmpty ? ( - - {!hasQuery ? ( - - ) : null} - - ) : ( -
- - - - Nome - E-mail - Celular - Municípios - - Ações - - - - - {draft ? ( - - - { - const name = event.currentTarget.value - setDraft((current) => (current ? { ...current, name } : current)) - }} - placeholder="Nome" - aria-label="Nome do novo assessor" - className={campaignInlineInputClassName} - autoFocus - /> - - - { - const email = event.currentTarget.value - setDraft((current) => (current ? { ...current, email } : current)) - }} - placeholder="E-mail" - aria-label="E-mail do novo assessor" - className={campaignInlineInputClassName} - /> - - - { - const phone = formatBrazilianPhoneInput( - sanitizeBrazilianPhoneInput(event.currentTarget.value), - ) - setDraft((current) => (current ? { ...current, phone } : current)) - }} - placeholder="Celular" - aria-label="Celular do novo assessor" - className={campaignInlineInputClassName} - /> - - - - setDraft((current) => (current ? { ...current, municipalityIds } : current)) - } - commitAction={municipalitiesAction} - drawerTitle="Carteira do assessor" - updateErrorMessage="Não foi possível atualizar a carteira." - /> - - -
- - -
-
+ ) : ( + + )} + + + + {showEmpty ? ( + + {!hasQuery ? ( + + ) : null} + + ) : ( +
+
+ + + Nome + E-mail + Celular + Municípios + + Ações + - ) : null} - - {rows.map((row) => { - const whatsAppHref = whatsAppHrefForPhone(row.phone) - const emailShown = displayEmail(row.email) - - return ( - + + + {draft ? ( + - {editing ? ( - - ) : ( - - {row.name} - - )} + { + const name = event.currentTarget.value + setDraft((current) => (current ? { ...current, name } : current)) + }} + placeholder="Nome" + aria-label="Nome do novo assessor" + className={campaignInlineInputClassName} + autoFocus + /> - {editing ? ( - - ) : ( - - )} + { + const email = event.currentTarget.value + setDraft((current) => (current ? { ...current, email } : current)) + }} + placeholder="E-mail" + aria-label="E-mail do novo assessor" + className={campaignInlineInputClassName} + /> - {editing ? ( - - ) : ( - - )} + { + const phone = formatBrazilianPhoneInput( + sanitizeBrazilianPhoneInput(event.currentTarget.value), + ) + setDraft((current) => (current ? { ...current, phone } : current)) + }} + placeholder="Celular" + aria-label="Celular do novo assessor" + className={campaignInlineInputClassName} + /> + setDraft((current) => + current ? { ...current, municipalityIds } : current, + ) + } commitAction={municipalitiesAction} drawerTitle="Carteira do assessor" updateErrorMessage="Não foi possível atualizar a carteira." @@ -379,45 +277,154 @@ export const AdvisorsTable = ({
- {whatsAppHref ? ( - - ) : ( - - )} - + +
- ) - })} -
-
-
- )} - + ) : null} + + {rows.map((row) => { + const whatsAppHref = whatsAppHrefForPhone(row.phone) + const emailShown = displayEmail(row.email) + + return ( + + + {editing ? ( + + ) : ( + + {row.name} + + )} + + + {editing ? ( + + ) : ( + + )} + + + {editing ? ( + + ) : ( + + )} + + + + + +
+ {whatsAppHref ? ( + + ) : ( + + )} + +
+
+
+ ) + })} + + + + )} + + ) }