Phase 7c + 7d: optimistic data updates and offline mutation queue

7c — Optimistic Data Updates:
- orchestration.sx: optimistic-cache-update/revert/confirm + submit-mutation
- pages.py: mount_action_endpoint at /sx/action/<name> for client mutations
- optimistic-demo.sx: live demo with todo list, pending/confirmed/reverted states
- helpers.py: demo data + add-demo-item action handler

7d — Offline Data Layer:
- orchestration.sx: connectivity tracking, offline-queue-mutation, offline-sync,
  offline-aware-mutation (routes online→submit, offline→queue)
- offline-demo.sx: live demo with notes, connectivity indicator, sync timeline
- helpers.py: offline demo data

Also updates plans.sx: marks Phase 7 fully complete (all 6 sub-phases 7a-7f).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-08 01:30:12 +00:00
parent 4c1853bc7b
commit 5f20a16aa0
8 changed files with 483 additions and 7 deletions

View File

@@ -525,6 +525,30 @@
:data (affinity-demo-data)
:content (~affinity-demo-content :components components :page-plans page-plans))
(defpage optimistic-demo
:path "/isomorphism/optimistic"
:auth :public
:layout (:sx-section
:section "Isomorphism"
:sub-label "Isomorphism"
:sub-href "/isomorphism/"
:sub-nav (~section-nav :items isomorphism-nav-items :current "Optimistic")
:selected "Optimistic")
:data (optimistic-demo-data)
:content (~optimistic-demo-content :items items :server-time server-time))
(defpage offline-demo
:path "/isomorphism/offline"
:auth :public
:layout (:sx-section
:section "Isomorphism"
:sub-label "Isomorphism"
:sub-href "/isomorphism/"
:sub-nav (~section-nav :items isomorphism-nav-items :current "Offline")
:selected "Offline")
:data (offline-demo-data)
:content (~offline-demo-content :notes notes :server-time server-time))
;; Wildcard must come AFTER specific routes (first-match routing)
(defpage isomorphism-page
:path "/isomorphism/<slug>"