Commit graph

37 commits

Author SHA1 Message Date
Cursor Agent
fb18bc8044
OH14 — harden e2e for always-on hybrid sync
- Add SW wait + offline-safe reload helpers for OH6/OH11
- Fix strict-mode duplicate locators (OH8, coordinator journey)
- Declare-votes journey asserts CAS POST + Atualizar (no legacy toast)
- OH12 local list: debounced search instead of Enter navigation
2026-08-02 04:53:29 +00:00
Cursor Agent
12f2d97f0a
OH14 — fix offline e2e: ops-sync wait, local list search, vote-pledges registry, B27 POST wait 2026-08-02 04:40:25 +00:00
Cursor Agent
ceb1b3a8af
OH14 — register mirror collections in offline executors + fix e2e POST waits 2026-08-02 04:07:20 +00:00
Cursor Agent
6f28ab78ff
fix(e2e): scope B118 header description assert to list header
Avoids Playwright strict-mode flakes when more than one header p matches.
2026-08-02 02:12:43 +00:00
Cursor Agent
3e81269971
fix(e2e): B118 mobile pin expects Filtrar municípios (B120)
Desktop Buscar município stays md+; mobile viewport asserts the
filter combobox label instead.
2026-08-02 02:12:35 +00:00
Cursor Agent
d221494994
fix: resolve changelog conflict markers + e2e card nav tap
Rebase left conflict markers in CHANGELOG-AGENTS.md; keep B120 + OH9.
E2E taps the card heading instead of TerritoryLink after densify.
2026-08-02 02:12:35 +00:00
Cursor Agent
ad23e9f4c7
feat(campanha): B120 mobile município filter combobox + denser cards
Replace the stacked NativeSelect mobile filters with a GitHub-style
combobox (chips + typeahead) over the frozen B18 URL contract, hide the
overview strip and sort notice below md, and densify mobile list cards.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 02:12:18 +00:00
Francisco Solla
492d0c77b8
Merge pull request #218 from fsolla/cursor/pool-i205-4d8c38ce-14ae
B118 — Listas mobile — ocultar título, subtítulo e chip de escopo
2026-08-01 22:52:04 -03:00
Cursor Agent
3b0a6afdf4
B118 — fix mobile header e2e: sr-only h1 stays a11y-visible to Playwright 2026-08-02 01:20:06 +00:00
Francisco Solla
50bd6f0764
Merge pull request #219 from fsolla/cursor/pool-i206-d740dec0-e4af
B119 — Fix crash ao tocar Nível no card mobile de municípios
2026-08-01 22:12:30 -03:00
Cursor Agent
586ac7d218
B118 — hide list page title, subtitle and scope chip on mobile
Extract CampaignListPageHeader with sr-only/md:not-sr-only h1 and hidden
subtitle/scope below md. Apply to all 8 list index routes. Unit + e2e pins.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 00:54:55 +00:00
Cursor Agent
1a722e8882
fix(e2e): scope B27 advisors reopen after reload by município
Loose "Editar assessores" matched multiple list rows after reload under
parallel fixtures — pin to the claimed municipality name like the open click.
2026-08-02 00:47:13 +00:00
Cursor Agent
a723a41794
fix(e2e): wait for drawer FULL snap; scope advisors trigger by município
B109 fullscreen assert raced the snap animation in CI; B27 advisors
button matched multiple rows — pin to the claimed municipality name.
2026-08-02 00:47:05 +00:00
Cursor Agent
f8cfe0746b
B119 — fix crash ao abrir Nível no card mobile de municípios
O footer portaled do CampaignListSheetProvider ficava fora da árvore React
do Drawer; DrawerCloseButton exigia useDialogRootContext e derrubava a página.

Substitui Cancelar por Button + onOpenChange(false) nos footers de nível e
sinal. Pin: unit com provider compartilhado + e2e mobile.

Closes #206

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 00:44:29 +00:00
Cursor Agent
1cc930efa4
test(e2e): wait for B109 drawer handle to dock near top 2026-08-02 00:22:47 +00:00
Francisco Solla
f9128f92b8
Merge pull request #189 from fsolla/cursor/pool-i159-da713125-4207
CL6 — Territórios: paginação real + sort server, depois factory
2026-08-01 20:35:58 -03:00
Cursor Agent
a20cfc393c
fix: resolve changelog conflict markers and scope B109 e2e
Rebase left conflict markers in CHANGELOG-AGENTS.md. Also scope the
B109 Sugestões assertion to the quick-actions drawer (page also has one).
2026-08-01 23:22:39 +00:00
Cursor Agent
ce68a46f21
OH8 — pins de caracterização (detalhe município + listas-chave)
- int: view model do detalhe, painel de pledges e tabs resolvidas
- e2e: header/tab/pledges/editar (staff) e lockdown do leader
- e2e: shell das listas municipios e liderancas (titulo, busca, paginacao)

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 23:09:56 +00:00
Cursor Agent
490d5deeb7
B109 — bottom drawer: fullscreen search, wider labels, exclude current entity
- Add QUICK_ACTIONS_SNAP_FULL; drawer expands on search focus and hides action strip
- Tighten dock bottom gap; restore dock/collapsed on blur per scroll position (B100)
- Widen CampaignHomeActionButton to w-[5.5rem] for two-line labels
- Client-side filter excludes current page entity from drawer search hits
- Unit + e2e coverage for full snap, exclusion, and label readability
2026-08-01 20:38:10 +00:00
Cursor Agent
98a69ab153
B105: bottom drawer handle top, scroll-up dock, discreet search peek
Revert handle to the top of the sheet; recalibrate collapsed/dock snaps
for handle+search and 2-line action labels; scroll ↓ collapses and ↑
re-docks; collapsed keeps a placeholder-less search peek that expands
on focus.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 18:40:51 +00:00
Cursor Agent
a056616d4a
Fix drawer snap geometry: handle at bottom, scroll on content ref
- Reorder drawer so handle sits at the screen bottom (snap shows bottom band)
- Hide dock content when collapsed instead of clipping through search
- Attach scroll-collapse listener directly on campaign-content-scroll ref
2026-08-01 11:35:09 +00:00
Cursor Agent
e09f01e683
Format + e2e manifest for Drawer/shell B100 2026-08-01 11:20:08 +00:00
Cursor Agent
1bb3fc7303
B100 — bottom drawer dock on load + collapse on scroll
- Replace expanded 55dvh snap with fixed DOCK height (12rem) + COLLAPSED handle
- Fix Base UI snap geometry via padding-bottom on Drawer popup
- Lift snap state to CampaignQuickActionsSnapProvider with pathname reset
- Collapse drawer when campaign-content-scroll passes threshold; reopen only via handle/pull
- Block collapse while global search is focused or active
- Dynamic content-scroll padding for dock vs collapsed peek
- Unit tests for dock default, scroll collapse, handle toggle; e2e on municipality detail

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-01 11:19:13 +00:00
Francisco Ignácio Fontoura Solla
b1a34a8c3a fix(tests): allocate homeSearch municipalities; scope B42 trend drawer 2026-07-31 20:57:17 -03:00
Francisco Ignácio Fontoura Solla
a8cb771303 B62+: flatten adversary signal to boolean and harden leader redirect e2e.
The simplify pass dropped the vestigial object wrapper on E11 input and aligned the leader home test with the retrying toHaveURL idiom used elsewhere.
2026-07-29 23:33:46 -03:00
Francisco Ignácio Fontoura Solla
120ed8d9b5 B62: simplify the signal model to type + text (drop fonte/triangulado).
Drops signalSource/triangulated from municipalityUpdate (migration
simplify_municipality_signal_fields), rewrites signal-type labels for the
field team, and treats any adversary signal as confirmed in E11 (P1
triage 1). Also fixes the stale post-B43 leader-home e2e and lowers a
drifted bypass pin.
2026-07-29 23:24:00 -03:00
Francisco Ignácio Fontoura Solla
4806c417c8 Engineering Pass 3: consolidate patterns and lock them with guards.
Fold duplicated campanha access, loaders, list/filter/form shells, and scripts into shared modules; reorganize utilities by domain; stabilize e2e; and document prevention-first audit workflow so the same smells cannot creep back in.
2026-07-29 06:11:29 -03:00
Francisco Ignácio Fontoura Solla
77023db99d B34+: scale and DRY after municipality chip lists.
Memoize access reads per req, cache portfolio index, trim chip revalidates, and shrink RSC payload via catalog-backed labels.
2026-07-28 19:49:29 -03:00
Francisco Ignácio Fontoura Solla
59d89ce287 B42: Drawer quick-edit and a tappable card on the mobile municipalities list.
Tendência, Assessores and Votos estimados now share one container
(CampaignCellEditOverlay: Popover on md+, bottom Drawer below), the card drops
to the table's density, and the whole card navigates through a stretched link
instead of a second "Abrir município" button.
2026-07-27 20:49:41 -03:00
Francisco Ignácio Fontoura Solla
b3283ee061 B24: auto-save e justificativa no popover de Tendência.
Remove o botão Salvar da lista de municípios; grava via POST political-trend sem revalidar a lista, com flush coalescido e feedback na célula.
2026-07-26 14:05:36 -03:00
Francisco Ignácio Fontoura Solla
7c50e29aa7 B27: combobox + chips + auto-save no popover de Assessores da lista de municípios
Replaces the checkbox-list + "Salvar assessores" button in the
Assessors popover (/campanha/municipios) with removable chips + a
Command combobox, delta-based auto-save (one advisor add/remove per
request, never the whole array), and optimistic UI with request
sequencing to resolve out-of-order responses correctly.

- New POST /campanha/municipios/advisors JSON route (mirrors
  expected-votes/), backed by setMunicipalityAdvisorMembership(Record)
  in actions/municipality.ts (text advisory lock + transaction).
- nextAdvisorIdsAfterMembership moved to
  src/lib/municipalityAdvisorMembership.ts with unit tests.
- Shared isSameOriginRequest (src/utilities/sameOriginRequest.ts) and
  uniqueRelationshipIds (src/utilities/relationship.ts) helpers,
  de-duplicating the same-origin CSRF check and the
  Set+map(relationshipId)+filter pattern across advisor call sites.
- MunicipalityListAdvisorsControl.tsx rewritten: chips, Command
  combobox, per-item pending affordance, rollback on error, and a
  request-sequence guard so only the most recently sent delta's
  response is adopted when concurrent optimistic updates settle.
- e2e coverage for the combobox auto-save flow; setup prewarms the new
  POST-only route to avoid Playwright dev-server HMR aborting the
  first request.
- Plan and roadmap marked as delivered (B27).
2026-07-26 03:31:51 -03:00
Francisco Ignácio Fontoura Solla
228eb36e90 B26: registrar sinal tipado a partir da célula Último sinal na lista de municípios.
Fecha o laço da fila E9 — Popover/Drawer cria municipalityUpdate kind sinal sem sair da varredura; submit explícito multi-campo; revalidate da lista.
2026-07-25 20:42:01 -03:00
Francisco Ignácio Fontoura Solla
51c13153fc E9: Fila de alocação (déficit como default do staff, frescor, coluna da vergonha)
A lista de municípios vira a fila de decisão, sem rota nova, sem coluna nova
e sem migration.

Fase 0 corrige a meta sintética do E8, que repartia a meta estadual
proporcionalmente só ao teto do campo e ignorava a votação própria (meta 2.911
para Vitória da Conquista, de 5.005 votos em 2022; 813 para Campo Formoso, de
47). `deriveSuggestedGoalsByScenario` substitui `decomposeStateGoal` e ancora a
meta na votação de 2022 por cenário — pessimista = base × (1 − margin), central
= base, otimista = base × (stateGoal ÷ Σ base), com clamp. `goalCoverage` passa
a receber `SuggestedGoalByScenario`, deixando `expectedVotes[S] ??
suggestedGoal[S]` simétrico. Só descrições do global mudaram.

Fase 1 adiciona frescor e ordenações: `declaredAt`/`estimatedAt` no select do
agregado de pledges (`lastPledgeAt`), `lastSignalAt` no view model via
`resolveMunicipalityLastSignalAt` (mesmo helper para o comparador do servidor e
a célula), e as sort keys `deficit` (novo default do staff) e `frescor`,
derivadas em memória no cenário central.

Fase 2 dobra os sinais nas células existentes: "há N dias" na coluna de última
atualização (frio ≥ 21 dias, em âmbar — vermelho já é da prioridade), badge
"sem responsável" em prioridade alta sem assessor, coluna da vergonha no
detalhe da métrica de assessoria, tooltip de cobertura nomeando o cenário e
copy Praças→Municípios.

Cortes: votos em jogo → B13, LQ/captura → E10, coluna dedicada de déficit
desnecessária.
2026-07-25 02:24:17 -03:00
Francisco Ignácio Fontoura Solla
5a4a9033ed E8: Conta da cadeira (metas derivadas, potencial por município, cobertura)
- campoParties.ts + committed election-aggregates artifact v2 (campo federal
  votes, federal tally, 2022 majoritarian presidente/governador)
- global campaignGoals (state goal + margin) with staff-only read /
  unrestricted-write access
- municipalityPotential.ts (teto do campo, captura, share intracampo,
  roll-off, proportional state-goal decomposition) and goalCoverage.ts
  (meta vs comprometido semantics locked this session)
- UI: dashboard + list overview 'Cobertura da meta' metric, new list column,
  detail page 'Conta da cadeira' card
- /simplify pass: dropped dead per-request TI-warning computation, O(1)
  potential lookup, deduped near-identical election loaders/tally types/
  percent formatters
2026-07-24 22:54:27 -03:00
Francisco Ignácio Fontoura Solla
c07969f4a7 Remove duplicated voteGoals; seed projection sheet into expectedVotes.
Meta Bom/Regular/Mínimo duplicated the estimate scenarios — keep a single municipality series (pessimista/média/otimista), backfill then drop the old columns, and map the spreadsheet onto expectedVotes.
2026-07-24 14:04:44 -03:00
Francisco Ignácio Fontoura Solla
3b2e99ac40 Type municipalities e2e consent fixture with Payload
Replace the `Function`-typed payload param (no-unsafe-function-type lint error
blocking pre-push) with `Pick<Payload, 'find' | 'create'>`, which also surfaced
missing Lexical `version` fields in the consent fixture — now added.
2026-07-23 21:39:14 -03:00
Francisco Ignácio Fontoura Solla
e2724c10da Remodel the campaign vertical from Praça to Município
Rename the operational unit "Praça"/"Núcleo" to "Município" (code identifier
`municipality`) and land the 2026-07-23 course changes:

- New `candidate` role with unrestricted visibility (`isCampaignStaff` now
  includes it) alongside coordinator/advisor; leader is locked down to the
  supporter contact tool only.
- Demandas become staff-only; dobradinhas modeled via a `stateDeputy` entity.
- Camaçari consolidated to a single município (ZE 170/171 aggregated);
  Salvador keeps its 19 zone municípios.
- Map moves to the staff dashboard; `/campanha/municipios` is list/overview.
- Vote pledges keep the declared vs estimated (scenario) asymmetry; leaders
  never see estimates.

Destructive migration for the campaign vertical (drops nucleus/plaza-era
tables, wipes campaign rows, seeds 435 municípios). Public-site data untouched.

Includes the post-delivery /simplify cleanups: shared reloadStaffActor /
reloadCoordinatorActor helpers, req.context cache for getFreshCampaignUser,
parallelized dashboard loads, candidate dashboard-copy fix, and dead
leader-dashboard / roleKind code removal.
2026-07-23 21:36:20 -03:00
Renamed from tests/e2e/campaignPlazas.e2e.spec.ts (Browse further)