Deck-Liste mit Web-Parität: alle eigenen Decks aus cardecky-api, Card-/Due-Counts pro Deck (Web-Pattern: separate Calls), Pull-to- Refresh, Offline-Read via SwiftData, Inbox-Banner für Marketplace- Forks. - Deck-Codable-DTO mit snake_case-CodingKeys (DeckCategory, DeckVisibility, FsrsSettings) - ISO8601-Date-Decoder mit Fractional-Seconds-Toleranz - CardsAPI.listDecks() + cardCount() + dueCount() - CachedDeck SwiftData-Model mit lastFetchedAt - DeckListStore (API + Cache, paralleles Counts-Fetching via TaskGroup) - DeckListView mit forest-Theme, deck.color-Streifen, Inbox-Banner - AccountView mit Sign-out - DashboardView durch DeckListView ersetzt - 6 Unit-Tests + 1 UI-Test grün Phasen-Plan: mana/docs/playbooks/CARDS_NATIVE_GREENFIELD.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
30 lines
792 B
Swift
30 lines
792 B
Swift
import ManaCore
|
|
import SwiftData
|
|
import SwiftUI
|
|
|
|
@main
|
|
struct CardsNativeApp: App {
|
|
let container: ModelContainer
|
|
@State private var auth: AuthClient
|
|
|
|
init() {
|
|
do {
|
|
container = try ModelContainer(for: CachedDeck.self)
|
|
} catch {
|
|
fatalError("Failed to init ModelContainer: \(error)")
|
|
}
|
|
let auth = AuthClient(config: AppConfig.manaAppConfig)
|
|
auth.bootstrap()
|
|
_auth = State(initialValue: auth)
|
|
Log.app.info("Cards starting — auth status: \(String(describing: auth.status), privacy: .public)")
|
|
}
|
|
|
|
var body: some Scene {
|
|
WindowGroup {
|
|
RootView()
|
|
.environment(auth)
|
|
.tint(CardsTheme.primary)
|
|
}
|
|
.modelContainer(container)
|
|
}
|
|
}
|