mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-29 09:03:08 +00:00
fix(miss-52): one shared Drawer for the chip-relation lists too
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).
This commit is contained in:
parent
bfbb0ec713
commit
6f42bc3bf3
3 changed files with 276 additions and 259 deletions
|
|
@ -10,6 +10,7 @@ import {
|
||||||
CampaignListResults,
|
CampaignListResults,
|
||||||
CampaignTransitionAnchor,
|
CampaignTransitionAnchor,
|
||||||
} from '@/components/campaign/shared/CampaignListPending'
|
} from '@/components/campaign/shared/CampaignListPending'
|
||||||
|
import { CampaignListSheetProvider } from '@/components/campaign/shared/CampaignListSheetHost'
|
||||||
import {
|
import {
|
||||||
CampaignTable,
|
CampaignTable,
|
||||||
CampaignTableHead,
|
CampaignTableHead,
|
||||||
|
|
@ -249,6 +250,9 @@ export default async function StateDeputiesPage({ searchParams }: StateDeputiesP
|
||||||
<p className="text-sm text-muted-foreground" aria-live="polite">
|
<p className="text-sm text-muted-foreground" aria-live="polite">
|
||||||
{sortSummary}
|
{sortSummary}
|
||||||
</p>
|
</p>
|
||||||
|
{/* One shared Drawer for every chip-cell sheet on coarse pointers
|
||||||
|
(miss #52 — never a Drawer root per opened cell). */}
|
||||||
|
<CampaignListSheetProvider>
|
||||||
<CampaignTable
|
<CampaignTable
|
||||||
caption={`${sortSummary}. Deputados estaduais com quem a campanha dobra.`}
|
caption={`${sortSummary}. Deputados estaduais com quem a campanha dobra.`}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|
@ -257,6 +261,7 @@ export default async function StateDeputiesPage({ searchParams }: StateDeputiesP
|
||||||
rowKey={(row) => row.id}
|
rowKey={(row) => row.id}
|
||||||
empty={<StateDeputyListEmptyState state={state} />}
|
empty={<StateDeputyListEmptyState state={state} />}
|
||||||
/>
|
/>
|
||||||
|
</CampaignListSheetProvider>
|
||||||
{rows.length ? (
|
{rows.length ? (
|
||||||
<CampaignListFooter
|
<CampaignListFooter
|
||||||
totalDocs={totalDocs}
|
totalDocs={totalDocs}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import {
|
||||||
CampaignListResults,
|
CampaignListResults,
|
||||||
CampaignTransitionAnchor,
|
CampaignTransitionAnchor,
|
||||||
} from '@/components/campaign/shared/CampaignListPending'
|
} from '@/components/campaign/shared/CampaignListPending'
|
||||||
|
import { CampaignListSheetProvider } from '@/components/campaign/shared/CampaignListSheetHost'
|
||||||
import {
|
import {
|
||||||
CampaignTable,
|
CampaignTable,
|
||||||
CampaignTableHead,
|
CampaignTableHead,
|
||||||
|
|
@ -402,6 +403,9 @@ export default async function LeadershipsPage({ searchParams }: LeadershipsPageP
|
||||||
<p className="text-sm text-muted-foreground" aria-live="polite">
|
<p className="text-sm text-muted-foreground" aria-live="polite">
|
||||||
{sortSummary}
|
{sortSummary}
|
||||||
</p>
|
</p>
|
||||||
|
{/* One shared Drawer for every chip-cell sheet on coarse pointers
|
||||||
|
(miss #52 — never a Drawer root per opened cell). */}
|
||||||
|
<CampaignListSheetProvider>
|
||||||
<CampaignTable
|
<CampaignTable
|
||||||
caption={`${sortSummary}. Uma ficha por pessoa — cada liderança pode atuar em vários municípios e organizações.`}
|
caption={`${sortSummary}. Uma ficha por pessoa — cada liderança pode atuar em vários municípios e organizações.`}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|
@ -410,6 +414,7 @@ export default async function LeadershipsPage({ searchParams }: LeadershipsPageP
|
||||||
rowKey={(row) => row.id}
|
rowKey={(row) => row.id}
|
||||||
empty={<LeadershipListEmptyState state={state} />}
|
empty={<LeadershipListEmptyState state={state} />}
|
||||||
/>
|
/>
|
||||||
|
</CampaignListSheetProvider>
|
||||||
{rows.length ? (
|
{rows.length ? (
|
||||||
<CampaignListFooter
|
<CampaignListFooter
|
||||||
totalDocs={totalDocs}
|
totalDocs={totalDocs}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import {
|
||||||
campaignReadCellClassName,
|
campaignReadCellClassName,
|
||||||
} from '@/components/campaign/shared/CampaignCopyableCell'
|
} from '@/components/campaign/shared/CampaignCopyableCell'
|
||||||
import { CampaignListEmptyState } from '@/components/campaign/shared/CampaignListEmptyState'
|
import { CampaignListEmptyState } from '@/components/campaign/shared/CampaignListEmptyState'
|
||||||
|
import { CampaignListSheetProvider } from '@/components/campaign/shared/CampaignListSheetHost'
|
||||||
import { MunicipalityPortfolioCell } from '@/components/campaign/shared/MunicipalityPortfolioCell'
|
import { MunicipalityPortfolioCell } from '@/components/campaign/shared/MunicipalityPortfolioCell'
|
||||||
import { Button } from '@/components/ui/button'
|
import { Button } from '@/components/ui/button'
|
||||||
import { Input } from '@/components/ui/input'
|
import { Input } from '@/components/ui/input'
|
||||||
|
|
@ -155,6 +156,9 @@ export const AdvisorsTable = ({
|
||||||
const showEmpty = rows.length === 0 && !draft
|
const showEmpty = rows.length === 0 && !draft
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
// One shared Drawer for the portfolio chip cells on coarse pointers
|
||||||
|
// (miss #52 — never a Drawer root per opened cell).
|
||||||
|
<CampaignListSheetProvider>
|
||||||
<div className="flex flex-col gap-4">
|
<div className="flex flex-col gap-4">
|
||||||
<div className="flex flex-wrap justify-end gap-2">
|
<div className="flex flex-wrap justify-end gap-2">
|
||||||
{editing ? (
|
{editing ? (
|
||||||
|
|
@ -262,7 +266,9 @@ export const AdvisorsTable = ({
|
||||||
municipalityIndex={municipalityIndex}
|
municipalityIndex={municipalityIndex}
|
||||||
draft
|
draft
|
||||||
onDraftChange={(municipalityIds) =>
|
onDraftChange={(municipalityIds) =>
|
||||||
setDraft((current) => (current ? { ...current, municipalityIds } : current))
|
setDraft((current) =>
|
||||||
|
current ? { ...current, municipalityIds } : current,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
commitAction={municipalitiesAction}
|
commitAction={municipalitiesAction}
|
||||||
drawerTitle="Carteira do assessor"
|
drawerTitle="Carteira do assessor"
|
||||||
|
|
@ -419,5 +425,6 @@ export const AdvisorsTable = ({
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
</CampaignListSheetProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue