Commit graph

16 commits

Author SHA1 Message Date
Cursor Agent
2caa82b10a
fix(ops): logout always clears persisted outbox and mirror
Cold reload left IndexedDB/OPFS intact when executor/store singletons
were null. Wipe adapters directly, clear both mirror backends, and
always revoke the session even if storage wipe fails.
2026-08-02 06:30:40 +00:00
Cursor Agent
46f010211f
OH13: extract opsMirrorCollections to break outbox cycle
Move TanStack mirror row collections out of opsMirrorClient so
opsDomainOutbox can update them without a madge cycle through
collectOpsDomainOutboxKeys.
2026-08-02 03:18:53 +00:00
Cursor Agent
e8f315d67b
OH13: CAS writes for leadership, demand, activity, stateDeputy
Add baseUpdatedAt CAS on domain staff writes, assertCampaignDocCas helper,
opsDomainOutbox with hybrid forms (Manter/Usar), and int/unit pins.
Closes #176.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 03:10:18 +00:00
Cursor Agent
63cd15eef5
OH12: OpsListLocal read-only via registry + OfflineBoundary on lists
Wire OfflineBoundary + OpsListLocal on the eight ops list routes. Local
reads the ops mirror with subscribeChanges, applies canonical URL parsers
for filter/sort/page, and keeps KPIs/edit/saved-filter writes honest
offline. Extract demand/organization list URL modules for client use.

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 02:47:35 +00:00
Cursor Agent
0630995bb2
OH11 — SW static cache-first, logout campaignOps wipe, offline e2e
- Service worker: cache-first for same-origin /_next/static/ (before RSC guard)
- Logout: clearCampaignOpsStorage (abort sync → outbox → persistence) then Cache API
- E2E: full offline journey in campaignOpsOffline (write→reload→online→sync)
- Docs: CHANGELOG + ops-hibrido spec; test:e2e:ops-hybrid script

Closes #173

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 02:31:58 +00:00
Cursor Agent
0908f8d4d6
OH10: prettier format for gate:push 2026-08-02 01:44:31 +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
fb63c76363
OH9: resolve rebase conflicts with main (opsVotePledgeMirror + changelog)
Keep leadershipsCollection export; re-export votePledgesCollection from the
OH7 mirror module; preserve both OH9 and B114 changelog entries.
2026-08-02 01:10:15 +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
387cf90d0f
refactor(OH7): extrair opsVotePledgeMirror para quebrar ciclo de imports 2026-08-02 00:48:23 +00:00
Cursor Agent
c7a8dc7f64
style: format OH7 files 2026-08-02 00:46:16 +00:00
Cursor Agent
8fd5838914
OH7 — estimativas ligadas ao mirror completo
- HybridPledgeEstimateForm lê valores de votePledgesCollection (não props RSC)
- Outbox faz patch optimista no mirror e aplica write do servidor com estimatedAt
- Helpers read/subscribe/patch no opsMirrorClient + mapper mapVotePledgeWriteToOps
- Testes unitários para merge protegido, patch optimista e mapper de write

Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
2026-08-02 00:45:32 +00:00
Cursor Agent
03684a3df8
OH5: drop unused exports for knip 2026-08-02 00:15:05 +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