Commit graph

547 commits

Author SHA1 Message Date
Francisco Ignácio Fontoura Solla
48623b0d06 fix(campanha): preserve StateDeputy migration identity 2026-08-06 18:38:47 -03:00
Francisco Ignácio Fontoura Solla
033c270a89 feat(campanha): B163 — editar contatos das dobradinhas 2026-08-06 16:52:55 -03:00
Francisco Ignácio Fontoura Solla
adc29c0379 feat(campaign): C14 remodel activity for agenda paradigm (#389)
- Replace kind enum with free-form tags (text[] hasMany)
- Remove origin and deadline fields
- Status: remove rascunho/planejado, keep confirmado/realizado/cancelado
- startAt required for user-facing creates (optional for tour drafts)
- Add deputyPresent time gate (only coordinator/candidate can reschedule)
- UI: calendar-like form with tag input, no origin/deadline, no draft status
- E13 giros: tourStopRoleActivityKind → tourStopRoleActivityTags
- Migration: kind→tags with label mapping, status remap, enum recreation
- Activity texts table creation (was missing from migration history)

Closes #389
2026-08-06 05:20:05 -03:00
Francisco Solla
cfceffc4bd
Merge pull request #387 from fsolla/cursor/sollinha-url-tool-498e
feat(ai): Sollinha buildCampaignLinks tool for canonical /campanha navigation (B162)
2026-08-06 00:34:11 +00:00
Cursor Agent
5f97b6a21c
feat(ai): add buildCampaignLinks tool for Sollinha navigation (B162)
Introduce a closed-catalog URL builder that delegates to existing list/detail
href helpers, with role-based guards for leader lockdown and unrestricted-only
assessor routes. Register the tool in the AI chat and teach the system prompt
when to offer markdown links after resolving entity ids/slugs.

Closes #383
2026-08-06 00:22:11 +00:00
Francisco Solla
f87e382836
fix(campanha): unblock dobradinhas list SSR for Assessores (#386)
* fix(campanha): unblock dobradinhas list SSR for Assessores column

Drop CampaignTableHead description on Assessores — its hover tooltip plus
StateDeputyAdvisorRelationCell breaks production SSR with an undefined element.

* fix(test): keep int gate under Postgres connection ceiling

Cap vitest workers and raise Docker max_connections so high-core laptops
stop failing the suite with cascading "too many clients" / QueryError noise.

* fix(test): do not force eight int workers on CI

An explicit maxWorkers: 8 raised parallelism on 2–4 vCPU runners and
starved shared invite/consent advisory leases (15s timeouts). Cap only
on local high-core hosts; leave CI on Vitest's CPU-relative default.

* style(test): format vitest.config.mts
2026-08-06 00:19:01 +00:00
Francisco Solla
a36b0b2625 simplify: safe fallback for browsers without container queries, trim test overhead 2026-08-05 12:28:17 -03:00
Francisco Solla
150bea2621 feat: make municipality columns follow content width 2026-08-05 11:35:20 -03:00
Francisco Solla
423c61d40b feat: distinguish municipality column defaults from explicit visibility 2026-08-05 10:49:58 -03:00
Francisco Ignácio Fontoura Solla
9fa701633e feat(campaign): unify municipality relation editors 2026-08-05 02:01:40 -03:00
Francisco Ignácio Fontoura Solla
896d957497 chore: migrate .cursor/ references to .agents/ folder
Replace all project-local .cursor/ path references with .agents/ across
rules, skills, environment config, hooks, and ignore files. Keep Cursor
editor paths (~/.cursor/, window.cursor, CURSOR_API_KEY) and vendored
Impeccable editor-hook paths unchanged.
2026-08-05 00:09:09 -03:00
Francisco Solla
4b79f00125
Merge pull request #373 from fsolla/feature/ai-chat-sollinha
feat: AI chat 'Sollinha' — campaign data assistant (v1 read-only)
2026-08-04 06:26:48 -03:00
Francisco Ignácio Fontoura Solla
f9cd1df7b2 feat: AI chat 'Sollinha' — campaign data assistant (v1 read-only)
- Streaming AI endpoint at /campanha/api/ai-chat with DeepSeek V4 Flash
- 8 tools: calculate, getMunicipalityVotes, getTopDeputies, getDobradinhas,
  getMunicipalityOverview, getLeaderships, getOrganizations, searchEntities
- In-memory rate limiter (50 msgs / 15 min per user)
- Desktop: resizable right sidebar via react-resizable-panels
- Mobile: full-screen Drawer opened by FAB (2/3 size of quick-actions FAB)
- Markdown rendering with react-markdown + remark-gfm (tables, bold, lists)
- Session-bound context (clean slate each open)
- Auth via existing campaign-token cookie, tools respect user RBAC
- Architecture doc: docs/plans/ai-chat-sollinha.md
- E2E tests: campaignAiChat.e2e.spec.ts (mocked endpoint)
2026-08-04 06:17:31 -03:00
Francisco Ignácio Fontoura Solla
6b8864debb B156 — assessores por dobradinha (campo, coluna e seção; RelationOptionCell extraído) 2026-08-04 04:57:15 -03:00
Francisco Ignácio Fontoura Solla
bd3ba5c2a5 style: format após rebase com B155 2026-08-04 02:56:05 -03:00
Francisco Ignácio Fontoura Solla
086a9c8ee0 B157 — coluna de dobradinhas na lista de municípios (+ criação inline) 2026-08-04 02:53:43 -03:00
Francisco Ignácio Fontoura Solla
596085c977 feat(campanha): B155 — coluna de lideranças na lista de municípios
Espelho da coluna de Assessores: chips com nome do contato, popover/sheet
com Command + delta otimista e criação inline (Nome + Celular). Sem
migration — leitura reversa de leadership.municipalities no bundle e
escrita reusando as actions B34/wizard; rota POST
/campanha/municipios/leaderships via campaignJsonMutationRoute.
2026-08-04 01:49:55 -03:00
Francisco Ignácio Fontoura Solla
b74268714c C86+ — simplify: JSDoc do contrato home, testes de borda e nota no impl plan
Fixes do /simplify (3 revisores read-only): JSDoc de normalizePathname/isListPath
documentando o invariante (homes nunca são '/' nem terminam em slash), teste de
multi-slash e inputs degenerados, comentário de isCampaignHomePath encurtado.
Sem mudança de comportamento.
2026-08-04 01:17:53 -03:00
Francisco Ignácio Fontoura Solla
4a90fb19ec C86+ — pathname de lista das ações rápidas em fonte única (isListPath)
Extrai isListPath + normalizePathname exportados em campaignQuickActionPaths.ts
e migra os 9 wrappers (7 públicos + 2 privados) + a 3a cópia de normalize em
campaignPageChrome.ts. Refactor estrutural sem mudança de comportamento;
derivação de regex de detalhe numérico adiada (gatilho: 3o vertical [id]).
Inclui docs/plans/escala-dry-pos-acoes-rapidas-impl.md e o fix de format
pré-existente de docs/plans/liderancas-coluna-municipios.md (bloqueava format:check).
2026-08-04 01:14:35 -03:00
Francisco Ignácio Fontoura Solla
26b2205c3a B154 — criar assessor inline no popover da lista de municípios
Closes #352

- POST /campanha/municipios/advisors aceita body de criação (name) na union;
  createMunicipalityAdvisorRecord cria campaignUser advisor (stub
  <slug>@criado.invalid, senha aleatória) e atribui ao município na mesma
  transação (cap 10 com rollback, lock municipality-advisors:{id})
- MunicipalityAdvisorCreateProvider compartilha o assessor criado entre linhas;
  opção "+ Criar assessor" e chip otimista com id temporário no control
- advisorNameSchema unificado em primitives.ts; predicado de placeholder cobre
  @criado.invalid (reset de senha e célula de e-mail tratam stubs inline)
- Destrava o spec e2e de municipios (falhas pré-existentes em main): key
  warning do fragment trailing de MunicipalityFilters; settle-wait da animação
  do Drawer no teste B136
2026-08-03 22:46:06 -03:00
Francisco Ignácio Fontoura Solla
d200a1b012 B86 — ações rápidas — apoiadores (staff): catálogo no FAB/overlay 2026-08-03 21:03:13 -03:00
Cursor Agent
199c83533b
format: Prettier 2026-08-03 14:10:07 +00:00
Cursor Agent
607eecd12b
B153 — simplify: phone assert helper, displayValue interno
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-03 14:09:14 +00:00
Cursor Agent
bb4c1ab199
B153 — editar nome, e-mail e celular da liderança (lista + detalhe)
- leadershipContactUpdateSchema + updateLeadershipContactRecord
- LeadershipContactFieldControl (lápis → input → blur-save)
- Lista e bloco Contato no detalhe
- Int tests para update, conflito de telefone e escopo

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-03 14:02:59 +00:00
Cursor Agent
fb75f7235b
fix(P5-P1): schedule campaign notification push after txn commit
queueMicrotask under req.transactionID raced withPayloadTransaction
commit. Register after-commit callbacks, soft-fail missing notification
rows on send, and pin the schedule with a convention unit spec.
2026-08-03 04:40:38 +00:00
Cursor Agent
673c5f3926
B148 — conta local na v2 (P/M/O + cobertura + classe)
- loadMunicipalityV2ContaData + MunicipalityV2LocalAccountSection
- Inline edit-in-place com cenário ativo local para cobertura
- Extract MunicipalityTerritorialClassRow do card E8
- Integra com B149 rede e B150 agora na mesma página v2
- Impl plan docs/plans/municipio-v2-conta-local-impl.md
2026-08-03 01:27:53 +00:00
Cursor Agent
9325380305
fix: resolve rebase conflict markers in v2 page 2026-08-03 01:03:19 +00:00
Cursor Agent
30a5a8a5e3
B151 — FAB secundário no detalhe município v2 (#334)
- Catálogo v2 de ações rápidas: dossiê, eleições, nova liderança, giro
- Integra no chassis B126 via registry + context sync na rota v2
- Omitido registrar sinal (já na faixa de status B147)

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-03 01:03:10 +00:00
Francisco Solla
2414001606
Merge pull request #343 from fsolla/cursor/pool-i333-5914f625-bd1e
B150 — Município v2 bloco Agora (encaminhamento + sugestão + visita)
2026-08-02 21:53:38 -03:00
Francisco Solla
d134dd0462
Merge pull request #346 from fsolla/cursor/pool-i315-94cacb95-bf11
B145 — Detalhe de entidade — título no header (sem hero espaçoso)
2026-08-02 21:52:20 -03:00
Francisco Solla
7753470a3b
Merge pull request #345 from fsolla/cursor/pool-i296-f91a8b70-0be4
OPS18 — Promote plan-issue dual (agente + Action no merge)
2026-08-02 21:45:56 -03:00
Cursor Agent
24611e4e35
fix: resolve v2 page merge with B149 network section 2026-08-03 00:39:37 +00:00
Cursor Agent
33d2e5ba01
chore: format B145 detail pages 2026-08-03 00:29:48 +00:00
Cursor Agent
9bcbfaf96d
fix: normalize activity detail action row indentation (simplify)
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-03 00:29:48 +00:00
Cursor Agent
5696aef9ed
B145 — move entity identity to shell header on detail pages
- Detail routes return null from campaignPageChrome catalog (override per page)
- SetCampaignPageChrome + generateMetadata on 8 entity detail routes
- Remove body hero (h1, Voltar links, duplicate identity chips)
- Keep operational badges/chips in page body
- Update zone map e2e to assert shell chrome title slot

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-03 00:29:48 +00:00
Cursor Agent
e36634786e
fix(campaign): clear RelationChipCell blur timeout on unmount
Prevents setState after jsdom teardown (window is not defined) that
failed CI unit on leadershipStateDeputyRelationCell.
2026-08-03 00:29:14 +00:00
Cursor Agent
debfd37919
style: prettier B150 files 2026-08-03 00:28:54 +00:00
Cursor Agent
6955cccc6b
B150 — Município v2 bloco Agora (encaminhamento + sugestão + visita)
- Loader e seção Agora na rota /campanha/municipio/[slug]/v2
- Encaminhamento editável com auto-save via POST /municipios/next-steps
- Até 2 sugestões E11 com resolve/dispensa existente; silêncio explícito
- Visita E13 condensada em uma linha + link ao compositor de giros
- Revalidação v2 ao resolver sugestão; helper compartilhado de empty state E11

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-03 00:28:47 +00:00
Francisco Solla
deefe566b0
Merge pull request #341 from fsolla/cursor/pool-i332-0d1ca390-b998
B149 — Município v2 — rede (lista edit-in-place)
2026-08-02 21:24:44 -03:00
Francisco Solla
fd29d0ecb4
Merge pull request #327 from fsolla/cursor/pool-i304-dfa7cbb3-3c18
B137 — Colunas ao lado da omnibox (e fim do “Ordenado por …” residual)
2026-08-02 21:21:28 -03:00
Francisco Solla
90bbfeb2da
Merge pull request #339 from fsolla/cursor/pool-i302-2f4dd995-03ba
B136 — Início / FAB — grade 3 colunas × 2 linhas (corrigir orientação)
2026-08-02 21:20:55 -03:00
Francisco Solla
43dcd8da9b
Merge pull request #325 from fsolla/cursor/pool-i306-4a43a35f-79fc
B138 — Atividades: presets e busca na omnibox; remover abas
2026-08-02 21:14:02 -03:00
Cursor Agent
c95d88562e
format + e2e prewarm for pledge autosave routes 2026-08-03 00:11:22 +00:00
Cursor Agent
7d89356710
B149 — Município v2 rede: lista edit-in-place com top-N lideranças
- Seção Rede na rota v2 com tabela/lista densa e CTAs Ver todas / Nova
- Células autosave (B9) para declarado e estimado via JSON routes
- Loader + view puro com ordenação por estimado/declarado
- Revalidate v2 em writes de pledge; unit tests de merge/sort

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-03 00:10:30 +00:00
Cursor Agent
6c6a742cb4
B137 — restore searchOnlyListOmnibox from main (CI merge ref) 2026-08-03 00:06:16 +00:00
Cursor Agent
fd435d54f6
B137 — remove dead searchOnlyListOmnibox exports after org omnibox 2026-08-03 00:06:16 +00:00
Cursor Agent
4c6cad9f41
B137 — format 2026-08-03 00:06:16 +00:00
Cursor Agent
e88073d892
B137 — simplify pass: dedupe picker type, derive territory columns
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-03 00:06:16 +00:00
Cursor Agent
d6455b1333
B137 — Colunas ao lado da omnibox e fim do Ordenado por residual
Move CampaignColumnPicker to omnibox trailing via CampaignColumnPickerTrailing
on all seven B17 list surfaces (+ organizações). Remove the picker row from
CampaignTable and drop visible sort-summary spans on territórios, lideranças
and dobradinhas (sr-only table captions keep sort context).

Closes #304

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-03 00:06:15 +00:00
Cursor Agent
0d124b47cb
fix: restore searchOnlyListOmnibox exports from main (CI merge) 2026-08-03 00:01:48 +00:00