Review breakdown: show each deck's own activity total

Follow-up to the smart-review breakdown: "I only have 2 decks" turned out to
be three deck cards (one clipped at the window edge) and 15 + 13 + 6 = 34
due. The line now carries each deck's activity total next to its due count -
"Due by deck: Sky deck - 15 of 15 - Humanismus - 13 of 15 - ... - 6 of 13" -
so the arithmetic is checkable inline without opening a deck.

groupByDeck returns {label, count, total}; new i18n key review.dueOfTotal
(en + cs). review-test pins the format. Version 0.6.9, SW v91.
This commit is contained in:
Martin Dvořák 2026-10-15 21:20:53 +00:00
commit 71c56ad06f
7 changed files with 24 additions and 8 deletions

View file

@ -680,13 +680,17 @@ export function LibraryScreen({ initialTab = "decks" }: { initialTab?: "decks" |
);
}
/** "Sky deck · 17 · Biology · 14 (+2 more)" — capped so the line stays short. */
/** "Sky deck · 17 of 17 · Biology · 14 of 15 (+2 more)" — the deck's own
* activity total rides along, so a count that mixes decks can be checked
* against the decks instead of looking impossible. Capped at three decks. */
function deckBreakdown(
items: ReviewItem[],
t: (key: string, vars?: Record<string, string | number>) => string,
): string {
const groups = groupByDeck(items);
const shown = groups.slice(0, 3).map((group) => `${group.label} · ${group.count}`);
const shown = groups
.slice(0, 3)
.map((group) => `${group.label} · ${t("review.dueOfTotal", { due: group.count, total: group.total })}`);
const rest = groups.length - shown.length;
if (rest > 0) shown.push(t("review.moreDecks", { n: rest }));
return shown.join(" · ");