Drei Sub-Pakete: Keyboard-Shortcuts, Daily-Reminder-Notifications, WidgetKit-Extension mit App-Group-Daten-Sharing. Siri-Shortcuts und Share-Extension auf β-7 verschoben — niedrige Priorität, die drei großen Brocken decken 90% des Native-Polish ab. Keyboard-Shortcuts: - Hidden Buttons in StudySessionView mit .keyboardShortcut - Space = flip, 1/2/3/4 = again/hard/good/easy - iPad-Magic-Keyboard + macOS-tauglich Daily-Reminders: - NotificationManager @Observable mit UNUserNotificationCenter - Authorization-State + Permission-Request-Flow - UNCalendarNotificationTrigger täglich zur konfigurierten Zeit - SettingsView in AccountView mit Toggle + DatePicker - UserDefaults-Persistierung von Hour/Minute/Enabled WidgetKit-Extension: - WidgetSnapshot Codable mit topDecks (Top-3 by dueCount) + totalDueCount - WidgetSnapshotStore schreibt in group.ev.mana.cards-Container - DeckListStore.refresh schreibt Snapshot + WidgetCenter.reloadAllTimelines - CardsWidgetExtension-Target im project.yml (app-extension) - CardsWidgetBundle + CardsDueWidget mit 5 Familien (small/medium/ accessoryCircular/accessoryInline/accessoryRectangular) - DueProvider TimelineProvider mit 30-min-Refresh - DueWidgetView Family-Switch - WidgetSnapshot.swift shared in beiden Targets via XcodeGen sources - App-Group im Haupt- und Widget-Entitlement 35 Tests grün (keine neuen Tests in β-6 — WidgetKit + Notifications sind System-API-Integrationen, Tests wären überwiegend Mocks). Build inkl. Widget-Extension grün. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
65 lines
2.1 KiB
Swift
65 lines
2.1 KiB
Swift
import ManaCore
|
|
import SwiftUI
|
|
|
|
struct AccountView: View {
|
|
@Environment(AuthClient.self) private var auth
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
CardsTheme.background.ignoresSafeArea()
|
|
VStack(spacing: 24) {
|
|
Image(systemName: "person.crop.circle.fill")
|
|
.resizable()
|
|
.frame(width: 80, height: 80)
|
|
.foregroundStyle(CardsTheme.primary)
|
|
|
|
if let email = auth.currentEmail {
|
|
Text(email)
|
|
.font(.headline)
|
|
.foregroundStyle(CardsTheme.foreground)
|
|
}
|
|
|
|
NavigationLink {
|
|
SettingsView()
|
|
} label: {
|
|
Label("Einstellungen", systemImage: "gear")
|
|
.frame(maxWidth: .infinity)
|
|
.padding(.vertical, 12)
|
|
.background(CardsTheme.surface, in: RoundedRectangle(cornerRadius: 8))
|
|
.foregroundStyle(CardsTheme.foreground)
|
|
.overlay(
|
|
RoundedRectangle(cornerRadius: 8)
|
|
.stroke(CardsTheme.border, lineWidth: 1)
|
|
)
|
|
}
|
|
.buttonStyle(.plain)
|
|
.padding(.horizontal, 32)
|
|
|
|
Spacer()
|
|
|
|
Button(role: .destructive) {
|
|
Task { await auth.signOut() }
|
|
} label: {
|
|
Text("Abmelden")
|
|
.frame(maxWidth: .infinity)
|
|
.padding(.vertical, 12)
|
|
.background(CardsTheme.error.opacity(0.1), in: RoundedRectangle(cornerRadius: 8))
|
|
.foregroundStyle(CardsTheme.error)
|
|
}
|
|
.padding(.horizontal, 32)
|
|
}
|
|
.padding(.top, 48)
|
|
}
|
|
.navigationTitle("Account")
|
|
#if os(iOS)
|
|
.navigationBarTitleDisplayMode(.inline)
|
|
#endif
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
NavigationStack {
|
|
AccountView()
|
|
.environment(AuthClient(config: AppConfig.manaAppConfig))
|
|
}
|
|
}
|