From 57e47a5f09a8c27539f5a44f000d8714903ca159 Mon Sep 17 00:00:00 2001 From: David Grundberg <75159519+individ-divided@users.noreply.github.com> Date: Fri, 9 Jan 2026 20:42:56 +0100 Subject: [PATCH] Interleaved Decks: New item to choose for 'new card gather order' option. --- ftl/core/deck-config.ftl | 9 +++++++++ proto/anki/deck_config.proto | 2 ++ rslib/src/scheduler/queue/builder/gathering.rs | 4 ++++ ts/routes/deck-options/choices.ts | 4 ++++ 4 files changed, 19 insertions(+) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index 4930dbe0e..1cf5475e5 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -142,6 +142,13 @@ deck-config-new-gather-priority-tooltip-2 = can stop before all subdecks have been checked. This order is fastest in large collections, and allows you to prioritize subdecks that are closer to the top. + `Interleaved Decks`: Gathers cards by taking one card at a time + from each deck in order. This allows new cards to be distributed + evenly across decks. Cards from each subdeck are gathered in + ascending position. If the number of decks are not equal to the + daily limit of the selected deck, the last round of cards will be + drawn from a random sample of decks. + `Ascending position`: Gathers cards by ascending position (due #), which is typically the oldest-added first. @@ -197,6 +204,8 @@ deck-config-display-order-will-use-current-deck = deck-config-new-gather-priority-deck = Deck # Gather new cards ordered by deck, then ordered by random notes, ensuring all cards of the same note are grouped together. deck-config-new-gather-priority-deck-then-random-notes = Deck, then random notes +# Gather new cards by interleaving decks, taking one card at a time from each deck in order. +deck-config-new-gather-priority-interleaved-decks = Interleaved Decks # Gather new cards ordered by position number, ascending (lowest to highest). deck-config-new-gather-priority-position-lowest-first = Ascending position # Gather new cards ordered by position number, descending (highest to lowest). diff --git a/proto/anki/deck_config.proto b/proto/anki/deck_config.proto index 5ed02423e..9a9be880d 100644 --- a/proto/anki/deck_config.proto +++ b/proto/anki/deck_config.proto @@ -69,6 +69,8 @@ message DeckConfig { // Notes are randomly picked from each deck in alphabetical order. // Siblings are consecutive, provided they have the same position. NEW_CARD_GATHER_PRIORITY_DECK_THEN_RANDOM_NOTES = 5; + // One card from each deck at a time, ascending position in each deck. + NEW_CARD_GATHER_PRIORITY_INTERLEAVED_DECKS = 6; // Ascending position. // Siblings are consecutive, provided they have the same position. NEW_CARD_GATHER_PRIORITY_LOWEST_POSITION = 1; diff --git a/rslib/src/scheduler/queue/builder/gathering.rs b/rslib/src/scheduler/queue/builder/gathering.rs index 293b50dc4..479595ad7 100644 --- a/rslib/src/scheduler/queue/builder/gathering.rs +++ b/rslib/src/scheduler/queue/builder/gathering.rs @@ -69,6 +69,10 @@ impl QueueBuilder { NewCardGatherPriority::DeckThenRandomNotes => { self.gather_new_cards_by_deck(col, NewCardSorting::RandomNotes(salt)) } + NewCardGatherPriority::InterleavedDecks => { + // TODO: Actually implement the new gathering option + self.gather_new_cards_by_deck(col, NewCardSorting::RandomNotes(salt)) + } NewCardGatherPriority::LowestPosition => { self.gather_new_cards_sorted(col, NewCardSorting::LowestPosition) } diff --git a/ts/routes/deck-options/choices.ts b/ts/routes/deck-options/choices.ts index 6f34eae0e..14a6286f0 100644 --- a/ts/routes/deck-options/choices.ts +++ b/ts/routes/deck-options/choices.ts @@ -25,6 +25,10 @@ export function newGatherPriorityChoices(): Choice