Commit graph

67 commits

Author SHA1 Message Date
Francisco Ignácio Fontoura Solla
a18e2f15f5 Simplify C2 supporter paths and register C6 scale follow-ups.
Tighten import/create view models after review, and capture the deferred DRY/import-scale work as roadmap item C6.
2026-07-18 20:33:50 -03:00
Francisco Ignácio Fontoura Solla
b079daa9bb Add C2 nominal supporter registry for /campanha.
Ship the supporter join collection, consent-keyed create/import/remove actions, and apoiadores UI so staff can build a phone-required nominal base before mass field ops.
2026-07-18 20:32:54 -03:00
Francisco Ignácio Fontoura Solla
3b703d42a3 Align docs with A2 as-built delivery on main.
Record the merged municipality↔TSE zone suggestions in AGENTS, the nuclei notebook, roadmap, and the zonas plan (post-simplify API shape).
2026-07-18 20:07:33 -03:00
Francisco Ignácio Fontoura Solla
ac7f2775cd Add opt-in TSE zone and territory suggestion chips for nuclei.
Ship A2 with a static Bahia municipality↔zone map, pure suggestion engine, and form chips that never auto-apply geography.
2026-07-18 20:04:04 -03:00
Francisco Ignácio Fontoura Solla
7e9660ef8f Add skill to audit and plan roadmap item implementation. 2026-07-18 19:25:12 -03:00
Francisco Ignácio Fontoura Solla
202f1579ec Align docs with cycle 2 delivery and add roadmap-item skill.
Mark A1/A3/B1/C1/D1 as shipped, revise the A2 zone-suggestion plan, and tighten the share dialog overflow.
2026-07-18 19:01:25 -03:00
Francisco Ignácio Fontoura Solla
b035cc4a2f Support multi-municipality and multi-neighborhood nucleus territory.
Replace scalar region/city/neighborhood with hasMany arrays so nuclei can span multiple Bahia municipalities while keeping neighborhoods scoped to a single city.
2026-07-18 18:31:51 -03:00
Francisco Ignácio Fontoura Solla
c42b16baab Add TSE 2022 election results model and local seed import. 2026-07-18 18:25:19 -03:00
Francisco Ignácio Fontoura Solla
040c36bed7 Add filtered overview panel to the nuclei list page.
Give coordinators aggregate vote estimates, coverage, and recent updates for the current list filters without leaving /campanha/nucleos.
2026-07-18 18:20:33 -03:00
Francisco Ignácio Fontoura Solla
b483e0cb32 Add nucleus detail share dialog for WhatsApp and copy-link.
Staff can open recipients for gerais, coordinators, and engaged leaderships without granting access, and coordenadores/lideranças can read geral phones for contact.
2026-07-18 18:14:49 -03:00
Francisco Ignácio Fontoura Solla
5bfa226a7e Add installable PWA foundation for the /campanha field app.
Scoped manifest and service worker unlock offline shell and future push, with an install toast and logout cache wipe.
2026-07-18 17:28:34 -03:00
Francisco Ignácio Fontoura Solla
b0c86cf8e3 Version UX Pilot design refs and map them to roadmap plans
Add the 11 UX Pilot design pairs (.png + .html) under
docs/design-refs/latest/ and link each to its roadmap item and plan.
Record the decision that UX/structure is the reference but the old
palette is not — implementation uses the light campaign theme tokens.
2026-07-18 16:36:09 -03:00
Francisco Ignácio Fontoura Solla
9c338b2d28 Fix Vercel build by correcting UI component filename casing.
Badge, Sheet, and Sidebar were tracked lowercase while imports used PascalCase, which breaks Linux case-sensitive builds.
2026-07-18 15:10:39 -03:00
Francisco Ignácio Fontoura Solla
a5903d52ad Align project docs with the shipped nuclei MVP.
Update AGENTS, README, roadmap, and the Núcleos notebook so status, territory scope, tests, and the LGPD production blocker match main.
2026-07-18 15:04:32 -03:00
Francisco Ignácio Fontoura Solla
bcac665cb5 Ship /campanha nuclei MVP with RBAC, invites, and vote estimates.
Adds electoral nuclei, leaderships, updates, and WhatsApp invite flows behind campaign auth, plus the consolidated schema migration that Vercel applies on deploy.
2026-07-18 15:01:56 -03:00
Francisco Ignácio Fontoura Solla
198de05c18 Add campaign app shell with a light shadcn sidebar.
Gives authenticated /campanha pages a navigable rail (logo, nav, user/Sair)
so the internal area feels like a real app instead of a bare layout.
2026-07-15 23:17:51 -03:00
Francisco Ignácio Fontoura Solla
c4866fabc0 Add /campanha internal area with isolated Payload auth
Introduce the internal campaign-management area gated by its own
authentication, kept isolated from the Payload admin so a campaign
session and an admin session can coexist in one browser.

- Add separate `campaignUser` auth collection (not `users` + roles)
- Authenticate via an isolated httpOnly `campaign-token` cookie scoped
  to /campanha, distinct from the default `payload-token`
- Add loginCampaign/logoutCampaign server actions and getCampaignUser
  session verification helper
- Add public login route and a protected (app) route group whose
  layout enforces the auth barrier
- Add migration 20260716_010420_add_campaign_user and document the
  auth foundation in AGENTS.md
2026-07-15 22:33:26 -03:00
Francisco Ignácio Fontoura Solla
f15a2cf1c1 Document posts/tags feature in project docs
Update AGENTS.md, the local-database and payload-migrations skills, and the
README to reflect the shipped Post/Tag collections, the electoral `hidden`
visibility control and fail-closed `isPostVisible` rule, the mixed-ISR `posts`
cache model with self-revalidating afterChange hooks, the `db:seed:posts` seed,
and the required post-seed/direct-DB revalidation via POST /api/revalidate.
2026-07-15 21:31:06 -03:00
Francisco Ignácio Fontoura Solla
f96863fad1 Add secured on-demand revalidation endpoint for posts cache
Public post pages read through the `posts`-tagged unstable_cache wrappers,
so their data is frozen at build time until revalidateTag('posts') runs in
the deployed runtime. A direct-DB seed (pnpm db:seed:posts) writes past the
Payload afterChange hooks (next/cache is stubbed), so nothing busts the tag
in prod and seeded posts never surface publicly.

Add POST /api/revalidate, guarded by a REVALIDATE_SECRET shared secret
(constant-time compare), that calls revalidatePostsListing() to refresh the
home page, all listings, and all article routes at once. Document the env var
in .env.example; it must be set in Vercel for production.
2026-07-15 21:24:02 -03:00
Francisco Ignácio Fontoura Solla
bcb6c6c014 Make posts seed idempotent against the shared Vercel Blob store
The Vercel Blob store is shared across environments and the
@payloadcms/storage-vercel-blob plugin uploads via put() without
allowOverwrite (and exposes no option to enable it). Cover images left
under the deterministic <slug>.<ext> key by an earlier run therefore made
the prod seed abort with "This blob already exists" on the first upload.

Delete any orphan blob at that key (via @vercel/blob del, idempotent) right
before creating a new media doc, so uploads are deterministic and the seed
stays re-runnable. Existing media rows are still reused, so no duplicate
media is created.
2026-07-15 21:18:16 -03:00
Francisco Ignácio Fontoura Solla
28647e4760 Add Post and Tag collections for news and publications
- Add Post + Tag collections (notícias/publicações) with tag-based
  "Esconder" visibility control for electoral-law compliance
- Add static SEO routes /[type]/[category]/[slug] plus /[type] and
  /[type]/[category] listings, with shared header/breadcrumb and PostCard
- Recreate the homepage and refresh the site color palette (styles.css)
- Add posts/slug/seo utilities and revalidation wiring (documents.ts)
- Add live-fetch seed script (scripts/seed-posts.mjs + seed-loader.mjs,
  db:seed:posts)
- Upgrade Payload 3.79.0 -> 3.82.0 (fixes admin relationship-filter crash)
- Remove obsolete Header component; add shadcn card/badge/breadcrumb;
  update AGENTS.md and components rule docs
2026-07-15 19:12:11 -03:00
Francisco Ignácio Fontoura Solla
712649eecf Replace state/city selects with type-to-filter comboboxes
Turn StateSelect and CitySelect into autocomplete comboboxes so long
lists no longer bias people toward the top option. A shared FormCombobox
wraps shadcn's (Base UI) Combobox and bridges it to react-hook-form via
useController, storing the state code / city name while displaying a
label. Matching is accent-insensitive and prefix-based; the list opens
after 1 character and results are alphabetical. State searches by both
full name and initials (new StateNames map).

Adds @base-ui/react + shadcn combobox/input-group primitives, and
documents our export-const and named-hook-import conventions in the
components rule (with the src/components/ui/* shadcn carve-out).
2026-07-15 14:41:58 -03:00
Francisco Ignácio Fontoura Solla
4f22824d4f Fix ESLint flat config so pnpm lint runs
The flat config spread eslint-config-next's subpath imports as if they were
flat-config arrays, but that package ships legacy eslintrc configs, so lint
crashed before checking any file. Wrap them with FlatCompat (add
@eslint/eslintrc) and fix the two pre-existing react/no-unescaped-entities
errors so lint passes.
2026-07-15 13:56:53 -03:00
Francisco Ignácio Fontoura Solla
4f0f997c32 Isolate local/dev and tests from the production database
Local dev and the test suite previously defaulted to the live production
Neon database, and running the tests mutated prod data. Add guardrails plus
a proper local Postgres + migrations workflow so production can't be hit by
mistake:

- docker-compose: local Postgres 17 (matches prod) + auto-created teqo_test
- dev guard refuses a non-local DATABASE_URL; tests refuse non-_test databases
- .env.test isolates the suite; vitest/playwright load it and fail closed
- Payload migrations set up (push disabled); build runs `payload migrate`,
  so deploys apply pending migrations to prod automatically
- baseline `initial` migration + idempotent consent.text varchar->jsonb fix
- `pnpm db:pull` copies prod content locally, excluding supporter PII
- docs (README, AGENTS.md) + agent skills for the local-db/migration workflow
2026-07-15 13:52:30 -03:00
Francisco Ignácio Fontoura Solla
715e3d051e Fix optional chaining for image metadata fields 2026-05-01 10:28:32 -03:00
Francisco Ignácio Fontoura Solla
166104bbac Fetch live count on mount to override stale initialCount 2026-05-01 10:21:55 -03:00
Francisco Ignácio Fontoura Solla
260f75abe8 Add secureUrl and type to OG image metadata 2026-05-01 02:55:37 -03:00
Francisco Ignácio Fontoura Solla
9313eb7f29 feat: Add schema-dts to package.json and update SEO metadata
Adds the `schema-dts` dependency to `package.json` for structured data.
Updates the petition page to include JSON-LD schema markup for improved
SEO and rich results. This involves extracting the first image from the
Lexical editor or falling back to a global image for Open Graph and
schema.org metadata.
2026-05-01 02:13:39 -03:00
Francisco Ignácio Fontoura Solla
135b9229a4 Refactor: Improve petition details and privacy message
Update the descriptive text for the petition to better reflect its
purpose and clarify data usage.
2026-05-01 01:53:49 -03:00
Francisco Ignácio Fontoura Solla
a862d0c582 feat: Add signature counter and display
Integrate a real-time signature counter component into petition pages.
This includes:

- A new `SignatureCounter` component that displays and animates the
  signature count.
- Server action `getSignatureCount` to fetch current signatures from
  Payload.
- Updates to `submitPetitionSignature` to return the signature number
  for immediate display.
- Event listeners for real-time updates when new signatures are
  submitted.
- Integration of the counter into both the hero section and card views
  of the petition page.
- Improved dialog for displaying signature success and number.
2026-05-01 01:51:07 -03:00
Francisco Ignácio Fontoura Solla
918d6f62a2 add petition success dialog 2026-05-01 01:09:31 -03:00
Francisco Ignácio Fontoura Solla
01779dfd71 fix zip code input field 2026-05-01 00:22:18 -03:00
Francisco Ignácio Fontoura Solla
12cc55b663 petition styles update 2026-04-30 23:32:29 -03:00
Francisco Ignácio Fontoura Solla
aff72f26af Improve FormInput 2026-03-20 17:54:22 -03:00
Francisco Ignácio Fontoura Solla
c72cd6a86e Improve NameInput 2026-03-20 15:44:11 -03:00
Francisco Ignácio Fontoura Solla
e13b55dadb Improve Inputs readability 2026-03-20 12:46:16 -03:00
Francisco Ignácio Fontoura Solla
d3577ceb6a Improve Inputs 2026-03-20 12:36:16 -03:00
Francisco Ignácio Fontoura Solla
fd4266dde6 Improve FormInput readability 2026-03-20 12:20:30 -03:00
Francisco Ignácio Fontoura Solla
1e186e5296 Improve form field behavior, phone formatting 2026-03-20 12:17:16 -03:00
Francisco Ignácio Fontoura Solla
135f456543 Add ThankStep 2026-03-18 23:55:28 -03:00
Francisco Ignácio Fontoura Solla
c8b34613db fix responsiveness 2026-03-18 22:33:51 -03:00
Francisco Solla
046f8a539f fix type isssues 2026-03-15 17:41:24 -03:00
Francisco Solla
a2ad8f7e20 revert changes made to run on cPanel 2026-03-15 15:28:48 -03:00
Francisco Solla
0695ae8082 solve payload next peer dependency conflict 2026-03-15 14:09:01 -03:00
Francisco Solla
4027eece0d fix issues to run from cPanel 2026-03-15 14:03:28 -03:00
Francisco Solla
3e2a0003d4 change path to whatsapp 2026-03-15 13:49:22 -03:00
Francisco Solla
f83d914133 prepare for deploy through cPanel 2026-03-15 13:46:44 -03:00
Francisco Solla
288ada421f prepare project to deploy on server host 2026-03-14 18:50:44 -03:00
Francisco Ignácio Fontoura Solla
f804da60eb Including page mandato-no-whatsapp 2026-03-14 18:07:40 -03:00
Francisco Ignácio Fontoura Solla
81da3dc0d7 remove autosave from petition collection 2026-03-08 22:56:23 -03:00