From e2ee6b7d4485cf841143934c8a80f25893d3c8ca Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Mon, 6 Nov 2023 12:04:31 +1000 Subject: [PATCH] Add an info box so the non-linear nature of desired retention can be seen --- ftl/core/deck-config.ftl | 6 ++++++ ts/deck-options/FsrsOptions.svelte | 11 +++++++++++ ts/deck-options/Warning.svelte | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index 4fd8ab631..04149e2d2 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -390,6 +390,12 @@ deck-config-compute-optimal-retention-tooltip = or too high for the amount of cards you're trying to learn. This number can be useful as a reference, but it is not recommended to copy it into the desired retention field. deck-config-please-save-your-changes-first = Please save your changes first. +deck-config-a-100-day-interval = + { $days -> + [one] A 100 day interval will become { $days } day. + *[other] A 100 day interval will become { $days } days. + } + deck-config-wait-for-audio = Wait for audio deck-config-show-reminder = Show Reminder deck-config-answer-again = Answer Again diff --git a/ts/deck-options/FsrsOptions.svelte b/ts/deck-options/FsrsOptions.svelte index 388eef561..c604c7818 100644 --- a/ts/deck-options/FsrsOptions.svelte +++ b/ts/deck-options/FsrsOptions.svelte @@ -43,6 +43,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } $: computing = computingWeights || checkingWeights || computingRetention; $: customSearch = `preset:"${$presetName}"`; + $: desiredRetentionWarning = getRetentionWarning($config.desiredRetention); let computeRetentionProgress: | ComputeWeightsProgress @@ -58,6 +59,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html $: if (optimalRetentionRequest.daysToSimulate > 3650) { optimalRetentionRequest.daysToSimulate = 3650; } + + function getRetentionWarning(retention: number): string { + const days = Math.round(9 * 100 * (1.0 / retention - 1.0)); + if (days === 100) { + return ""; + } + return tr.deckConfigA100DayInterval({ days }); + } async function computeWeights(): Promise { if (computingWeights) { await setWantsAbort({}); @@ -219,6 +228,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html + + {#if warning} -
+
{withoutUnicodeIsolation(warning)}