From ed0fb4065fe13cd60bdfa75e96d88ecc1f14465f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Ign=C3=A1cio=20Fontoura=20Solla?= Date: Tue, 28 Jul 2026 09:17:46 -0300 Subject: [PATCH] B17 simplify: inherit header labels, split persist from refresh. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The four *SortableHead islands already fall back to their sort-label record, so B17's new `label` made the header text a third copy instead of removing the second one — 16 redundant `children` deleted, leaving only `frescor`, which diverges on purpose and now reads the record too. The 3 s "safety net" timer was committing like a close, refresh included, which recreated the per-toggle route render the 400 ms debounce was rejected for: at a reading pace every checkbox landed outside the window. The timer now writes the cookie only; closing repaints. A session that ends where it started refreshes nothing, and a menu open when the route unmounts saves from the cleanup, since Radix reports no close event for a sidebar navigation. Both pinned red first. Also: `columnVisibility` required rather than optional for the tests' benefit, the redundant per-list cap dropped, `resolveVisibleColumns` no longer copies, and B29's unused `LeadershipListAccessFilter` export un-exported — knip was failing on main too. --- .cursor/rules/projects/nucleos-eleitorais.mdc | 2 +- AGENTS.md | 2 +- .../plans/seletor-colunas-lista-municipios.md | 12 +++- docs/roadmap.md | 2 +- .../campanha/(app)/dobradinhas/page.tsx | 10 +-- .../campanha/(app)/liderancas/page.tsx | 22 ++---- .../municipality/MunicipalityList.tsx | 69 +++++++----------- .../campaign/shared/CampaignColumnPicker.tsx | 72 +++++++++++++------ src/lib/campaignColumnVisibility.ts | 10 +-- src/utilities/leadershipListUrl.ts | 2 +- src/utilities/municipalityListUrl.ts | 11 +-- tests/unit/campaignColumnPicker.unit.spec.ts | 40 ++++++++++- tests/unit/campaignComponents.unit.spec.ts | 5 ++ 13 files changed, 150 insertions(+), 109 deletions(-) diff --git a/.cursor/rules/projects/nucleos-eleitorais.mdc b/.cursor/rules/projects/nucleos-eleitorais.mdc index f79ff7fc..9bdc17a1 100644 --- a/.cursor/rules/projects/nucleos-eleitorais.mdc +++ b/.cursor/rules/projects/nucleos-eleitorais.mdc @@ -7,7 +7,7 @@ alwaysApply: false ## Status -- **B17 entregue em código (2026-07-28):** seletor de colunas, e **nas sete superfícies** do sistema de listas (municípios, lideranças, dobradinhas, organizações, demandas, apoiadores, territórios), não só em municípios — o picker nasceu como capacidade do `CampaignTable` (uma prop `columnVisibility`, devolvida inteira por `readCampaignColumnVisibility(listId)`, liga o controle e filtra), então o custo marginal por lista foi `label` nas colunas e uma prop. Fora: `/campanha/assessores`, cujo `AdvisorsTable` ainda é `ui/Table` cru com `table-fixed`. **Duas premissas do plano de 24/07 morreram.** (1) `localStorage` — e o motivo é de tipo, não de gosto: `CampaignTableColumn.cell` é **função**, o array de colunas não atravessa a fronteira server/client, e esconder no cliente exigiria `data-column` + `