diff --git a/Conjuga/Conjuga/Services/VocabSessionQueue.swift b/Conjuga/Conjuga/Services/VocabSessionQueue.swift index f73ecb9..a5ca85d 100644 --- a/Conjuga/Conjuga/Services/VocabSessionQueue.swift +++ b/Conjuga/Conjuga/Services/VocabSessionQueue.swift @@ -116,9 +116,13 @@ struct VocabSessionQueue { /// sitting is bounded — proper SRS behaviour rather than a 100+ card slog. enum VocabVerbPool { - /// Maximum verbs in one session. Overdue cards are pulled first, then new - /// (never-reviewed) verbs fill the rest. - static let sessionCardLimit = 20 + /// Maximum verbs in one session, from the "Cards per session" setting + /// (`vocabSessionCardLimit`). Defaults to 20 when unset; 999 means "All". + /// Overdue cards are pulled first, then new (never-reviewed) verbs. + static var sessionCardLimit: Int { + let stored = UserDefaults.standard.integer(forKey: "vocabSessionCardLimit") + return stored == 0 ? 20 : stored + } static func sessionVerbs( localContext: ModelContext, diff --git a/Conjuga/Conjuga/Views/Settings/SettingsView.swift b/Conjuga/Conjuga/Views/Settings/SettingsView.swift index 057e342..e2a8ea8 100644 --- a/Conjuga/Conjuga/Views/Settings/SettingsView.swift +++ b/Conjuga/Conjuga/Views/Settings/SettingsView.swift @@ -10,6 +10,10 @@ struct SettingsView: View { @State private var showVosotros: Bool = true @State private var autoFillStem: Bool = false + /// Cards per vocab-practice session. 999 = "All" (no cap). + @AppStorage("vocabSessionCardLimit") private var vocabSessionCardLimit: Int = 20 + private let vocabSessionSizes: [Int] = [10, 15, 20, 25, 30, 50, 999] + private let levels = VerbLevel.allCases private let irregularCategories: [IrregularSpan.SpanCategory] = [ .spelling, .stemChange, .uniqueIrregular @@ -42,6 +46,18 @@ struct SettingsView: View { } } + Section { + Picker("Cards per session", selection: $vocabSessionCardLimit) { + ForEach(vocabSessionSizes, id: \.self) { size in + Text(size == 999 ? "All" : "\(size)").tag(size) + } + } + } header: { + Text("Vocab Flashcards") + } footer: { + Text("How many verbs a Vocab Flashcards session draws. Overdue verbs are pulled first, then new ones.") + } + Section { ForEach(levels, id: \.self) { level in Toggle(level.displayName, isOn: Binding(