Reuse opsListLocalCopy for saved-filter gates, drive OfflineBoundary from
useBrowserOffline, drop dead registry null-check and unused exports, and
tighten municipality Local sorting/casts.
Co-authored-by: Francisco Solla <fsolla@users.noreply.github.com>
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>
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>
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>
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>
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>
- 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>
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>
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>
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>