Commit graph

204 commits

Author SHA1 Message Date
Cursor Agent
daeff53bf4
OH10: mirror CAS base, advisors conflict toast, pledgeId path
Prefer municipalitiesCollection updatedAt for list/update outbox CAS,
restore advisors conflict Manter/Usar toast, and pass pledgeId for O(1)
declareVotes mirror/outbox keys. Drop unused membership Cas export and
expectedVotes baseUpdatedAt.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 01:42:23 +00:00
Cursor Agent
26bda9e430
OH10: fix fixtures, bypass comment, drop unsupported metadata
Align list view-model test fixtures with updatedAt, justify the CAS
advisor read bypass, and remove createOfflineAction metadata the
TanStack API does not accept.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 01:36:31 +00:00
Cursor Agent
a517638e3c
OH10: municipality staff writes CAS + offline outbox
Add baseUpdatedAt CAS for declareVotes, municipalityUpdate, political
trend, engagement level, and advisors. Sibling outbox executor wires
hybrid controls when OPS_HYBRID is on; flag OFF keeps legacy paths.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 01:33:58 +00:00
Cursor Agent
4e65559fdd
OH9: dual-path municipality detail (HeaderView + Local + OfflineBoundary)
Extract presentational header shared by RSC and offline Local; OfflineBoundary
swaps to mirror-backed Local only when OPS_HYBRID is on and the browser is
offline (sync failure stays on RSC + chrome). Closes #172.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 01:10:00 +00:00
Cursor Agent
38d9488df1
OH5: prettier format gate files 2026-08-02 00:15:05 +00:00
Cursor Agent
7d9ef93738
OH5: SyncProvider + OPFS→IDB mirror + poll + chrome
Bootstrap the campaign ops mirror behind OPS_HYBRID for staff: hydrate
TanStack localOnly collections from OPFS file (IDB fallback), GET
/campanha/api/ops-sync with mergeOpsSnapshot (outbox-aware), poll every
3 min in foreground, and show discreet sync chrome in the shell.
Leaders stay no-op even when the flag is on.

Closes #168

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 00:15:05 +00:00
Cursor Agent
93912a1304
CL8 — contrato registry, redirect canónico e cleanup (#162)
- Pin slug↔rota: tests/unit/opsListRegistryRoutes.unit.spec.ts (8 slugs v1)
- resolveDemandListUrl + resolveOrganizationListUrl; pages redirect; registry
  canonicalRedirect: true para demandas/organizacoes
- E2E tracer saved filters com LIST_UNIFIED=1; flag em next/playwright env
- Docs: CHANGELOG, lista-unificada spec, plano CL8 entregue

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 23:56:59 +00:00
Francisco Solla
abe0d106b1
Merge pull request #191 from fsolla/cursor/pool-i161-a9c58ad5-f5de
CL7 — Migrar apoiadores e organizações para a factory
2026-08-01 20:52:40 -03:00
Cursor Agent
59907172f7
refactor(OH4): parallel snapshot queries + simplify reuse
Promise.all for collection finds; reuse requireRelationshipId /
populatedContactName / campaignAccess; truncate in lib; auth message
canonical. Register OH4+ (#186) for benchmark→builder DRY.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 23:36:57 +00:00
Cursor Agent
eb4ed64377
feat(OH4): GET /campanha/api/ops-sync full snapshot + scoped access
Add buildOpsSnapshot (server-only) with overrideAccess:false queries,
municipality_update truncation (OH3 N=50), and int pins for
401/403/200 + advisor portfolio + truncation.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 23:36:57 +00:00
Cursor Agent
e0789a673e
Format apoiadores and organizacoes pages 2026-08-01 23:22:38 +00:00
Cursor Agent
f49e8e3c55
CL7 — Migrar apoiadores e organizações para OpsListPage
Wire LIST_UNIFIED flag on /campanha/apoiadores and /campanha/organizacoes
behind OpsListPage with full slot parity (KPI overview, filters, table,
footer). Registry entries were already present from CL2; this completes
the route delegation. Pins CL7 routes in opsListPage.unit.spec.ts.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 23:22:38 +00:00
Cursor Agent
cca7d4af47
CL6: format territorios page and loader imports 2026-08-01 23:22:29 +00:00
Cursor Agent
a91019f427
CL6: real territory list pagination + OpsListPage flag
Add page to the territories URL contract, apply filter/sort/slice in the
loader (page size 25), flip registry sortModel to url, and render
/campanha/territorios through OpsListPage when LIST_UNIFIED is on.

Closes #159

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 23:22:29 +00:00
Cursor Agent
76d6129e1e
CL5: Assessores CampaignTable + URL canónico + OpsListPage
Rewrite AdvisorsTable on CampaignTable with column picker, add
resolveAdvisorListUrl (preserves criar=1), register assessores in
CAMPAIGN_LIST_IDS/opsListRegistry, and wire LIST_UNIFIED factory shell.

Closes #160

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 23:07:00 +00:00
Francisco Solla
d909e3d28d
Merge pull request #183 from fsolla/cursor/pool-i167-a82e10a2-9a34
OH6 — estimateVotesCas + outbox mínimo + toasts (tracer bullet)
2026-08-01 20:06:15 -03:00
Cursor Agent
df0ff76267
style(OH6): prettier after OH2 rebase 2026-08-01 22:50:25 +00:00
Cursor Agent
f69eaa8f82
style(OH6): prettier format 2026-08-01 22:50:24 +00:00
Cursor Agent
9a402d2ac1
fix(OH6): bootstrap outbox on mount and tighten CAS/subscribe
Restore IndexedDB pending rows on hybrid form mount, drop synced stubs
so RSC props win, gate the post-lock re-read to CAS only, and notify
per-pledge subscribers instead of every estimate island.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 22:50:24 +00:00
Cursor Agent
f7e3591ea9
feat(OH6): estimate outbox + hybrid PledgeEstimateForm toasts
Wire @tanstack/offline-transactions for estimateVotesCas when OPS_HYBRID
is on: IndexedDB outbox, pending/conflict badges, Sonner keep/discard
resolution; legacy formAction path unchanged when the flag is off.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 22:50:24 +00:00
Cursor Agent
df4ee3fb76
feat(OH6): estimateVotesCas with optional baseEstimatedAt
Add CAS opt-in on vote pledge estimates: without baseEstimatedAt keep
last-write-wins; with a stale base refuse the write and stamp the
server estimatedAt for the outbox conflict toast.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 22:50:17 +00:00
Cursor Agent
3a2928278e
style: format CL4 page files 2026-08-01 22:48:20 +00:00
Cursor Agent
1398768670
CL4 — migrar lideranças, dobradinhas e demandas para OpsListPage
Delega as três rotas à factory unificada atrás de LIST_UNIFIED,
seguindo o padrão CL3 de municípios: slots extraídos (toolbar, overview,
table, footer) com paridade total quando a flag está OFF.

- lideranças/dobradinhas: sort summary no slot overview, sheet provider na tabela
- demandas: chips de status no toolbar, sem redirect canónico (sort fixed)
- testes unitários estendidos em opsListPage.unit.spec.ts

Closes #158

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 22:47:37 +00:00
Cursor Agent
45eaabd23c
CL3: align provider nesting and tighten OpsList types
Wrap the estimate-scenario provider outside both flag paths, type empty
as nullable, and drop the duplicated fail-closed unit assertion.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 22:31:07 +00:00
Cursor Agent
4d035017f2
CL3: OpsListPage/OpsListView tracer for municípios list
Introduce the unified list shell (OpsListView slots + OpsListPage
server casca) and wire /campanha/municipios behind LIST_UNIFIED with
flag-OFF parity and shared domain pieces as slots.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 22:29:08 +00:00
Cursor Agent
2e3740ef3f
Format B110 wizard return path changes 2026-08-01 20:40:04 +00:00
Cursor Agent
d5697bcfcb
B110 — wizard return path via allowlisted from query
Propagate return path from quick actions through the B98 wizard chain so
dismiss, skip, and chain end navigate back to the originating page instead
of always redirecting to Início.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 20:39:24 +00:00
Cursor Agent
f80f672732
B106 — format 2026-08-01 18:38:50 +00:00
Cursor Agent
84365ddf54
B106 — Voltar no header mobile, Android back e skeleton das sugestões
- CampaignHomeSearchChromeContext + publisher no Início
- CampaignMobileTopBar troca SidebarTrigger por Voltar quando uiFocused
- useHomeSearchFocusHistory com pushState/popstate para back do SO
- HomeSearchSuggestSkeleton enquanto isFetching sem hits
- Unit tests para history helper, top bar e skeleton

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 18:36:28 +00:00
Cursor Agent
653f04062b
B102 — fix drawer search crash on focus/type (TooltipProvider scope)
Lift TooltipProvider in the campaign app layout so it wraps
CampaignAppScrollChrome (scroll + quick-actions drawer). Focus→suggest
with priority-alta hits mounted CampaignHoverTooltip outside the old
provider and crashed the page. Unit pins cover focus→suggest and type→search.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 18:18:19 +00:00
Cursor Agent
d8f54a5d73
B98 — format Prettier nos arquivos do encadeamento 2026-08-01 11:42:08 +00:00
Cursor Agent
346949d035
B98 — Encadear ajustes do wizard após a ação principal
Após salvar (ou Pular) votos/tendência/sinal/liderança, navega ao
próximo elo da matriz v1 no mesmo município via entryAction, em vez
de voltar ao Início. Helper puro wizardActionChain + skips alinhados.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 11:41:26 +00:00
Cursor Agent
5ce82e2229
B97 — Salvar tendência fecha wizard (redirect home quando status já aplicado)
Após salvar a nota, o RSC refresh via server action via
redirecionava à etapa de escolha. Agora  manda
para Início nesse caso; o client usa  no sucesso.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 10:54:51 +00:00
Cursor Agent
20c69bd0de
B94 — wizard empty state: município mais próximo (geo)
No idle do passo de busca de município, resolve client-side o município
mais próximo no escopo do ator quando a permissão de geo já está granted
(reuso B14: campaignGeolocation + municipalityProximity + malha lazy).

- Prop RSC accessibleMunicipalities na rota acoes/[slug]
- Hook useWizardNearestMunicipality (fail-soft, só inScope)
- Merge geo no topo da lista B92 via wizardMunicipalitySuggestMerge
- Unit tests do merge/format

Closes #94

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 07:43:42 +00:00
Cursor Agent
dbf6a7fdce
B93 — wizard empty state continuity (visitados + última ação)
Merge client-side recent visits and last-acted municipality storage into
wizard municipality suggest idle list ahead of B92 server rankings.

- Add campaignLastActedMunicipality + wizardMunicipalitySuggestMerge libs
- Extend wizard-municipality-suggest with scopeMunicipalities for hit lookup
- Record last-acted on wizard write success (votes, signal, trend, leadership)
- Clear last-acted on logout alongside recent visits

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 07:21:56 +00:00
Francisco Solla
7f7c707d4d
Merge pull request #98 from fsolla/cursor/pool-i92-174dd43e-5e6f
B92 — Empty state do wizard: chassis + ranking de esquecidos
2026-08-01 04:17:53 -03:00
Francisco Solla
269fb79f37
Merge pull request #97 from fsolla/cursor/pool-i42-980ec2b6-2133
C11 — Escala planos (picker pós-C12 + paginação das demandas vinculadas)
2026-08-01 04:16:27 -03:00
Cursor Agent
4ed2787d36
Fix wizard suggest signal tie-break and route typing
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 07:03:20 +00:00
Cursor Agent
1ed65d0d81
B92 — wizard idle suggest: rank + loader + UI
Add wizard-municipality-suggest mode to home-search with cold-first
ranking (signal → E14 → trend → E10 class → 2022 votes). Wizard
municipality step now fetches suggestions when query is idle.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 07:01:19 +00:00
Cursor Agent
2ac6f4c8fa
style: prettier (C11 touched files) 2026-08-01 06:39:34 +00:00
Cursor Agent
8372cec91d
C11: picker remoto de atividades na demanda + paginação de vínculos
- Substitui loadActivityOptions (pagination: false) por AsyncSearchCombobox
  com busca server-backed filtrada por município (searchActivityRelationOptions).
- Pagina card Demandas vinculadas no detalhe da atividade (10/página) com
  soma de custo em query separada e link Ver todas na lista filtrada.
- Adiciona filtro ?activity= na lista /campanha/demandas.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 06:37:53 +00:00
Cursor Agent
ca80da178c
style: Prettier on B82 files 2026-08-01 06:24:54 +00:00
Cursor Agent
d5da7b0adf
B82 — Ações rápidas em lideranças (lista + detalhe)
Registra catálogo contextual no drawer B79 para /campanha/liderancas:
lista com update-leadership; detalhe com cinco wizards e prefill de
município quando N=1. Adiciona query leadershipId no wizard A4 e
CampaignQuickActionContextSync na ficha.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 06:24:54 +00:00
Francisco Solla
7261f3f588
Merge pull request #87 from fsolla/cursor/pool-i35-456a9692-831a
RS+ — Auth read leve + shells de senha
2026-08-01 03:23:51 -03:00
Cursor Agent
5f5b513336
style: prettier 2026-08-01 06:09:33 +00:00
Cursor Agent
104d6d4589
fix(RS+): depth:0 sem select parcial; form schema de convite separado
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 06:08:53 +00:00
Cursor Agent
7484aab28a
RS+ Fase 1+3: auth read leve, password fields e login state
- authenticateCampaignToken usa depth:0 + select mínimo (sem join media)
- getCampaignUserWithAvatar para layout/perfil; hasCampaignSession em rotas públicas
- CampaignPasswordFields reutilizado em reset, perfil e convite
- LoginForm migra para CampaignFormActionState + mapCampaignFormActionError
- invite login schema unifica refineMatchingPasswords

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 06:07:28 +00:00
Cursor Agent
f27563d694
style: Prettier (O0+ #34) 2026-08-01 06:04:44 +00:00
Cursor Agent
cbe171c597
O0+ (#34): consent key DRY, SQL int tests, Footer condicional, B68 suggest RSC
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 06:04:05 +00:00
Cursor Agent
be317191b6
B87 — Ações rápidas assessores (unrestricted)
Registry B79 para /campanha/assessores (lista + detalhe): catálogo
new-advisor com deep link ?criar=1; mount gate só unrestricted;
/novo redireciona para o deep link; busca global permanece na lista
(B91 no drawer).

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 05:48:08 +00:00