ζ-0 Setup: Repo-Skelett, iOS-Build grün, Healthz live

- project.yml mit Bundle ev.mana.zitare + Widget + ShareExt-Targets
- ManaSwiftCore (ManaCore + ManaTokens) + ManaSwiftUI (ManaAuthUI)
  als Package-Dependencies via path:
- Pure SwiftUI für Native-Surfaces, WKWebView nur für Lese-Tabs
  (Hybrid-Sonderfall vs cards/memoro/manaspur, dokumentiert im
  Playbook ZITARE_NATIVE_GREENFIELD.md)
- Theme: paper-Variant aus @mana/themes
- ZitareAPI.healthCheck via direct URLSession (öffentlicher
  Endpoint, kein AuthenticatedTransport-Gate)
- 6/6 AppConfigTests + 1/1 UI-Smoke grün auf iPhone 16e Simulator
- Live: zitare-api.mana.how/healthz → HTTP/2 200

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till 2026-05-14 12:15:22 +02:00
commit 0bd59ed148
25 changed files with 1468 additions and 0 deletions

View file

@ -0,0 +1,106 @@
import ManaCore
import SwiftUI
/// Phase ζ-0 minimal: zeigt Auth-Status und Healthz-Probe-Ergebnis.
/// Phase ζ-3 erweitert um ManaAuthUI-Login-Sheet und Submission-
/// History-Link (via WebShell auf `zitare.mana.how/me`).
struct AccountView: View {
@Environment(AuthClient.self) private var auth
let healthStatus: HealthStatus
var body: some View {
ScrollView {
VStack(spacing: 24) {
header
statusCard
Spacer(minLength: 32)
aboutCard
}
.padding()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(ZitareTheme.background)
}
private var header: some View {
VStack(spacing: 8) {
Image(systemName: "quote.opening")
.font(.system(size: 48))
.foregroundStyle(ZitareTheme.primary)
Text("Zitare")
.font(.largeTitle)
.fontWeight(.semibold)
Text("Öffentlicher Zitat-Korpus von mana e.V.")
.font(.callout)
.foregroundStyle(ZitareTheme.mutedForeground)
.multilineTextAlignment(.center)
}
.padding(.top, 32)
}
private var statusCard: some View {
VStack(alignment: .leading, spacing: 12) {
row("Auth", value: authStatusLabel)
Divider()
row("API", value: healthLabel)
}
.padding()
.background(ZitareTheme.surface)
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(
RoundedRectangle(cornerRadius: 12)
.stroke(ZitareTheme.border, lineWidth: 1)
)
}
private var aboutCard: some View {
VStack(alignment: .leading, spacing: 8) {
Text("Phase ζ-0 — Setup")
.font(.caption)
.foregroundStyle(ZitareTheme.mutedForeground)
Text(
"Diese App ist noch im Aufbau. Web-App live auf "
+ "zitare.com und zitare.mana.how. "
+ "Plan in mana/docs/playbooks/ZITARE_NATIVE_GREENFIELD.md."
)
.font(.footnote)
.foregroundStyle(ZitareTheme.foreground)
}
.padding()
.frame(maxWidth: .infinity, alignment: .leading)
}
private func row(_ label: String, value: String) -> some View {
HStack {
Text(label)
.foregroundStyle(ZitareTheme.mutedForeground)
Spacer()
Text(value)
.foregroundStyle(ZitareTheme.foreground)
.fontWeight(.medium)
}
}
private var authStatusLabel: String {
switch auth.status {
case .unknown: ""
case .signedOut: "Nicht eingeloggt"
case .guest: "Gast"
case .signingIn: "Login läuft …"
case .twoFactorRequired: "2FA erforderlich"
case let .signedIn(email): email
case .error: "Fehler"
}
}
private var healthLabel: String {
switch healthStatus {
case .unknown: ""
case .ok: "OK"
case .down: "nicht erreichbar"
}
}
}

View file

@ -0,0 +1,19 @@
import SwiftUI
/// Phase ζ-5 Placeholder.
///
/// Aufgabenliste in ζ-5:
///
/// - Theme-Toggle (System / Light / Dark) propagiert per
/// `localStorage['zitare-mode']` an den WebView.
/// - Reader-Schriftgröße (S/M/L/XL) per JS-Bridge an die Web-CSS-
/// Variable `--zit-reader-size`.
/// - DSGVO-Daten-Export (öffnet `zitare.mana.how/me` Export-Page im
/// WebView).
/// - About / Impressum / Lizenz (CC-BY-SA-4.0).
struct SettingsView: View {
var body: some View {
Text("Einstellungen — ζ-5 TODO")
.foregroundStyle(.secondary)
}
}

View file

@ -0,0 +1,32 @@
import SwiftUI
/// Phase ζ-3 Placeholder native Submit-View für Quote-Drafts.
///
/// Aufgabenliste in ζ-3:
///
/// - SwiftUI-Form mit Feldern: text (TextEditor), attribution (Author-
/// Name mit Auto-Complete aus lokalem Snapshot), language (Picker),
/// optional source (Werk, Jahr, URL), optional theme-Chips.
/// - `ManaAuthGate`-Wrap: nicht-eingeloggter Tap auf Einreichen"
/// öffnet `ManaAuthUI`-Login-Sheet.
/// - `POST /api/v1/quotes` mit `status: 'draft'` (Endpoint existiert
/// schon, Phase 2.A im Web-Repo).
/// - Offline-Queue: bei Network-Failure Draft in SwiftData
/// `PendingSubmission` persistieren, beim Reconnect retry.
/// - Erfolg: Toast + Link Im Web ansehen" (öffnet WebView auf
/// `zitare.mana.how/me` bzw. `/admin/queue` wenn Moderator).
struct SubmitQuoteView: View {
var body: some View {
VStack(spacing: 12) {
Image(systemName: "square.and.pencil")
.font(.system(size: 36))
.foregroundStyle(ZitareTheme.primary)
Text("Quote vorschlagen")
.font(.headline)
Text("ζ-3 — TODO: SwiftUI-Form + ManaAuthGate")
.font(.caption)
.foregroundStyle(.secondary)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}

View file

@ -0,0 +1,38 @@
import SwiftUI
/// Phase ζ-1 Placeholder.
///
/// Wird in ζ-1 zu einer echten `UIViewRepresentable`/
/// `NSViewRepresentable` um `WKWebView`. Aufgabenliste in ζ-1:
///
/// - WebView-Konfiguration: `WKWebViewConfiguration` mit non-persistent
/// DataStore in Debug-Builds; Persistent in Release.
/// - Cookie-Bridge: nach ManaCore-Login JWT als `mana.access`-Cookie
/// für `.mana.how` ins `WKHTTPCookieStore` schreiben.
/// - Pull-to-Refresh via `UIRefreshControl` (iOS) /
/// `NSScrollView` (macOS).
/// - `WKNavigationDelegate` für Deep-Link-Catching: wenn der WebView
/// eine Navigation auf `zitare://` oder eine andere mana-Domain
/// versucht, abfangen und natively routen.
/// - `WKUIDelegate` für `target=_blank`-Links (Safari öffnen, nicht
/// im WebView).
/// - Native-Toolbar overlay (ζ-5).
///
/// Heute nur die Signatur, damit `RootView` schon den finalen
/// Import-Pfad nutzt.
struct WebShellView: View {
let initialURL: URL
var body: some View {
VStack(spacing: 12) {
Text("WebShellView")
.font(.headline)
Text("ζ-1 — TODO: WKWebView auf \(initialURL.absoluteString)")
.font(.caption)
.foregroundStyle(.secondary)
.multilineTextAlignment(.center)
.padding(.horizontal)
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
}
}