Commit graph

4 commits

Author SHA1 Message Date
Till JS
f5a26b2392 chore(format): disable redundantSelf + redundantSendable in swiftformat
Default `--self remove` strippt `self.` aus @autoclosure-Calls (Logger.info)
und Closure-Captures, was Swift-6-strict-concurrency dann als "implicit
use of self in closure" rejected. Default `redundantSendable` strippt
`Sendable` von Codable-DTOs, die über actor-Grenzen wandern müssen.

Beide Regeln aus. Zusätzlich Lauf über alle Files: harmlose Whitespace-/
Trailing-Comma-/Optional-Init-Normalisierung in 5 Files. `self.` und
`Sendable` bleiben überall erhalten. Build grün.

Hintergrund: η-0-Lauf hat das aktiv gemacht und Submit-DTOs zerschossen,
die ich dann von Hand revertieren musste. Dieser Commit verhindert die
Wiederholung in η-1+.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 12:37:46 +02:00
Till JS
c6127a2d31 ζ-3.6: Drop-Notification-Banner für Submission-Conflicts
Auto-Flush hat 4xx-Errors (duplicate, validation_failed, unauthorized)
bisher stillschweigend gedroppt — User offline einreichen, im Web
denselben Text posten, Online gehen → die Native-Submission war weg
ohne Hinweis.

SubmissionQueue:
- struct DropRecord (textPreview, authorName, code, message, droppedAt)
- private(set) var dropNotifications: [DropRecord]
- tryFlush sammelt jetzt einen Pre-Delete-Snapshot in dropNotifications
- consumeDropNotifications() leert die Liste — UI ruft beim
  Banner-Quittieren auf

SubmitQuoteView:
- droppedBanner zeigt alle gedroppten Drafts mit Text-Preview +
  lokalisierter Error-Message
- "Quittieren"-Button leert nur die UI-State (Server-Drop ist final)
- harvestDropNotifications() läuft nach jedem flushPending

iOS + macOS BUILD SUCCEEDED.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 16:49:17 +02:00
Till JS
53f8043a2d ζ-3.5b: Pending-Queue-UI + NWPathMonitor-Reconnect-Flush
Pending-Queue-UI:
- AccountView.pendingQueueCard listet alle wartenden Submissions
  mit Text-Preview (120c), Author, createdAt, retryCount, lastError
- "Jetzt versuchen"-Button triggert tryFlush(api:)
- Trash-Icon pro Row löscht einzeln aus der Queue
- Pull-to-Refresh aktualisiert beide Listen
- Card-View nur sichtbar wenn Queue-Tiefe > 0

ReachabilityWatcher:
- NWPathMonitor erkennt Reconnect-Flanke (offline → online)
- Bei Reconnect: SubmissionQueue.tryFlush auf @MainActor
- Filtert reine Wifi↔Mobil-Switches raus (nur "wieder erreichbar"
  zählt)
- Lebt im App-Root, startet nach Launch via .task

Files:
- Sources/Core/Submit/ReachabilityWatcher.swift (neu)
- Sources/App/ZitareNativeApp.swift: reachability.start in .task
- Sources/Features/Account/AccountView.swift: pendingQueueCard

iOS + macOS BUILD SUCCEEDED.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 16:26:55 +02:00
Till JS
61927d27a3 ζ-3.5: Offline-Submit-Queue mit SwiftData + Auto-Retry
Bei Network-Failure landet der Quote-Draft jetzt in einer persistenten
SwiftData-Queue (\`PendingSubmission\`) statt im Error-Banner. Beim
nächsten App-Launch ODER beim Wechsel auf scenePhase.active wird der
Flush automatisch versucht.

Retry-Policy:
- 5xx oder Transport-Failure (NSURLErrorDomain) → in Queue, Retry
- 4xx mit code (validation_failed, duplicate, unauthorized) →
  permanenter Fehler, kein Retry (User-Aktion nötig)
- Hard-Limit 50 Retries pro Entry, danach pausiert

App-Group-Store \`submissions.store\` (parallel zu snapshot.store) im
\`group.ev.mana.zitare\`-Container. Fallback auf In-Memory falls
Disk-Init scheitert (App-Group noch nicht aktiviert im Apple-Dev-Portal).

UI-Pieces:
- Pending-Banner zeigt Queue-Tiefe wenn > 0
- Queued-Banner nach erfolgreichem Enqueue
- Form-Reset nach Enqueue (User sieht: "weg, kommt nach")
- onChange(scenePhase) → Auto-Flush bei Foreground
- ZitareNativeApp.task: Flush am Launch

Files:
- Sources/Core/Submit/PendingSubmissionModel.swift (neu, @Model)
- Sources/Core/Submit/SubmissionQueue.swift (neu, @Observable @MainActor)
- Sources/App/ZitareNativeApp.swift: Container-Init + environment-Wiring
- Sources/Features/Submit/SubmitQuoteView.swift: enqueue + flush + banners

iOS + macOS BUILD SUCCEEDED.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 16:22:52 +02:00