style(13-03): apply Prettier formatting across repo

Mechanical reformat — no logic changes. 398 files changed, 19125
insertions(+), 16457 deletions(-). Prettier 3.8.4 with .prettierrc
(singleQuote:true, semi:true, tabWidth:2, trailingComma:all,
printWidth:100). Isolated per D-13-08 for reviewability.
This commit is contained in:
Lucas Berger
2026-06-11 20:35:18 -04:00
parent 4bc0445173
commit 982438dc10
398 changed files with 19050 additions and 16382 deletions
@@ -18,16 +18,18 @@ Requirements: CAL-04 (create timed/all-day), CAL-05 (edit), CAL-06 (delete),
CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (guided install).
**Out of scope (other phases / later):**
- Single-occurrence and "this-and-following" recurring edits (CAL-09 / CAL-10) — **v1.x**.
- Shared lists + live SSE sync (Phase 4); Web Push notifications (Phase 5).
- Wall-display / kiosk theme (v2).
- SSE as a transport — **must not be relied on in Phase 3** (unverified until Phase 4 gate, D-14).
</domain>
</domain>
<decisions>
## Implementation Decisions
### Target-calendar selection (write target)
- **D-01:** **Default target = remember last-used per member.** Seed/first-time default is
the **creator's own personal calendar** (always exists; no shared calendar may exist yet, D-16).
- **D-02:** **Calendar picker is shown only when the member has >1 writable calendar.** With a
@@ -43,6 +45,7 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
vice-versa) safely.
### Write feedback & sync (the load-bearing architecture decision)
- **D-05:** **Optimistic-accept + server-side outbox.** On save the UI optimistically reflects
the change with a "syncing…" indicator; the API writes a **`pending` row to a MariaDB outbox**
and returns immediately. A **backend worker drains the outbox** against Fastmail.
@@ -52,9 +55,9 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
initial "forced re-sync, then show" — same authoritative-cache guarantee, without a blocking
spinner.)
- **D-07:** **Retry policy — backoff transient, fail-fast hard errors.**
- *Transient* (network error, 5xx, timeout) → retry with **exponential backoff over a bounded
- _Transient_ (network error, 5xx, timeout) → retry with **exponential backoff over a bounded
window** (a few minutes), keeping the "not synced yet" toast visible.
- *Hard* (401/403 auth, 400 validation) → **stop immediately** and surface a real
- _Hard_ (401/403 auth, 400 validation) → **stop immediately** and surface a real
"didn't save" error to the user. (Transient failures must be short; anything non-transient
is a hard fail that won't self-resolve.)
- **D-08:** **Edit-conflict handling = detect + warn + reload latest.** Writes send `If-Match`
@@ -67,6 +70,7 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
is unverified until the Phase 4 entry gate (D-14). Do **not** build Phase 3 sync feedback on SSE.
### Carried forward — locked, NOT re-discussed
- **D-10:** The **edit/delete surface reuses `EventDetailPopover`** — it was built in Phase 2 with
a reserved footer action area specifically for this (Phase 2 D-08). Create can reuse the same
surface shell.
@@ -78,6 +82,7 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
Authelia verification is the Gate 2 item folded into this phase.
### Claude's Discretion (researcher / planner decide)
- **Event form & fields** — exact field set (title, start/end, all-day toggle, location,
description) and layout. Build it into / alongside the reused `EventDetailPopover` surface (D-10).
Must be slick and low-friction for the non-technical Apple member.
@@ -97,11 +102,13 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
</decisions>
<canonical_refs>
## Canonical References
**Downstream agents MUST read these before planning or implementing.**
### Project decisions & scope
- `.planning/PROJECT.md` — core value, constraints, Key Decisions incl. **D-14** (dev-auth
bypass; live AUTH + iOS smoke folded into Phase 3), **D-15** (local Newt test rig for Gate 2),
**D-16** (shared Family calendar is a collection on the operator's primary account, may not
@@ -112,6 +119,7 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
PWA-01/02 (installable + guided install); v1.x CAL-09/10 (single-occurrence edits — OUT).
### Phase 1/2 foundation this builds on
- `.planning/phases/02-calendar-display/02-CONTEXT.md` — design-token layer (D-01/02/03),
`EventDetailPopover` reuse-as-edit-surface (Phase 2 D-08), server-side expansion, color/owner model.
- `.planning/phases/01-foundation-broker-spike/CAL-08-DECISION.md` — per-member app-password
@@ -120,6 +128,7 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
PWA) and the dev-auth bypass context. **Required reading for success criterion 6.**
### Code this phase extends
- `apps/api/src/broker/client.ts` — tsdav `createDAVClient`; add PUT/DELETE write methods here
(broker boundary, D-12).
- `apps/api/src/broker/sync.ts` — REPORT→ical.js→upsert; the targeted single-calendar re-sync
@@ -139,9 +148,11 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
</canonical_refs>
<code_context>
## Existing Code Insights
### Reusable Assets
- `EventDetailPopover` (Phase 2) — read-only detail overlay with a **reserved footer for Phase 3
edit/delete** (D-10); responsive bottom-sheet/popover, focus trap, XSS-safe plain-text rendering.
- `apps/pwa/src/api/client.ts` — typed `fetch` client (`fetchMe`, windowed `fetchEvents`,
@@ -151,6 +162,7 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
- Design-token layer + Zustand UI store + TanStack Query — server state in Query, UI state in Zustand.
### Established Patterns
- **Broker boundary (T-03-02):** routes read the MariaDB cache only; never import tsdav in a route.
Write-back must keep this — endpoint enqueues to the outbox; the broker worker does the CalDAV PUT.
- **D-13 schema split** for all-day (dtstartDate) vs timed (dtstartUtc) — write-back must produce
@@ -159,6 +171,7 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
- Hono app exported without auto-start (testable); add write routes + outbox worker in that shape.
### Integration Points
- **New MariaDB outbox table** (D-05): pending create/edit/delete operations with status, attempt
count, target calendar URL, payload/UID, etag for If-Match.
- **Outbox worker** (sibling to the ctag poller) drains the queue, applies D-07 retry/backoff,
@@ -201,5 +214,5 @@ CAL-07 (create recurring — whole-series only), PWA-01 (installable), PWA-02 (g
---
*Phase: 3-Event Write-Back + PWA Install*
*Context gathered: 2026-06-05*
_Phase: 3-Event Write-Back + PWA Install_
_Context gathered: 2026-06-05_