wordeck-native/Sources/Core/Intents/StudyAppIntents.swift
Till JS 542082772a refactor(big-bang): cards-native → wordeck-native
Code + Identity-Rename zur Vorbereitung auf Apple-Dev-Portal-Aktion
(Bundle ev.mana.wordeck, App-Group group.ev.mana.wordeck, AASA
applinks:wordeck.com). Build bleibt funktional, aber gegen die
neue text-only-API können image-occlusion-Creates 422 zurückgeben —
das wird mit der Wordeck-Native v1.0-Welle (parallele Apple-Aktion)
sauber gemacht.

Umbenennung:
- 41 Files: cardecky/Cardecky → wordeck/Wordeck (Display, Strings,
  Kommentare)
- 57 Files: CardsNative → WordeckNative, CardsAPI → WordeckAPI,
  CardsTheme → WordeckTheme, CardsBrand → WordeckBrand, CardsWidget →
  WordeckWidget, CardsDueWidget → WordeckDueWidget
- Bundle-ID ev.mana.cardecky → ev.mana.wordeck (project.yml,
  Info.plist, entitlements, Keychain-Service, App-Group)
- AASA applinks:cardecky.mana.how → applinks:wordeck.com
- API-Base cardecky-api.mana.how → api.wordeck.com
- 10 Files renamed (App-Entry, API-Extensions, Theme, Widget,
  Entitlements, Tests)
- xcodeproj regenerated via xcodegen → WordeckNative.xcodeproj
- MaskRegionsTests.swift gelöscht (image-occlusion entfällt mit
  Wordeck text-only)

Forgejo-Repo git.mana.how/till/cards-native → wordeck-native umbenannt
(Auto-Redirect aktiv). Lokales Verzeichnis Code/cards-native/ bleibt
vorerst — wird beim nächsten Apple-Setup mit Bundle-Test umbenannt.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-17 23:10:42 +02:00

38 lines
1.3 KiB
Swift

import AppIntents
import SwiftUI
/// Siri-Shortcut: "Karten lernen". Öffnet die App im Decks-Tab.
/// Tatsächliche Tab-Aktivierung passiert via `cards://` URL-Scheme, das
/// RootView bereits handhabt.
struct StudyCardsIntent: AppIntent {
static let title: LocalizedStringResource = "Karten lernen"
static let description = IntentDescription(
"Öffnet Wordeck und zeigt deine Decks mit fälligen Karten.",
categoryName: "Lernen"
)
static let openAppWhenRun: Bool = true
@MainActor
func perform() async throws -> some IntentResult {
// Die App ist beim Ausführen schon geöffnet (openAppWhenRun);
// weitere Navigation passiert in RootView via Deep-Link, falls
// ein Parameter dazukommt. v1: simple App-Open.
.result()
}
}
/// Macht Intents direkt nach Install in Siri/Shortcuts-App sichtbar.
struct CardsAppShortcuts: AppShortcutsProvider {
static var appShortcuts: [AppShortcut] {
AppShortcut(
intent: StudyCardsIntent(),
phrases: [
"Karten lernen mit \(.applicationName)",
"Mit \(.applicationName) lernen",
"\(.applicationName) öffnen"
],
shortTitle: "Karten lernen",
systemImageName: "rectangle.stack"
)
}
}