Don't provide a button to copy estimated retention into desired retention

It's too easy for the user to end up with silly values if their configured
time/day is not reasonable.
This commit is contained in:
Damien Elmes 2023-10-13 12:14:55 +10:00
parent 8b4c57fbce
commit bfe340c163
2 changed files with 4 additions and 18 deletions

View file

@ -338,7 +338,7 @@ deck-config-get-params = Get Params
deck-config-fsrs-on-all-clients = deck-config-fsrs-on-all-clients =
Please ensure all of your Anki clients are Anki(Mobile) 23.10+ or AnkiDroid 2.17+. FSRS will Please ensure all of your Anki clients are Anki(Mobile) 23.10+ or AnkiDroid 2.17+. FSRS will
not work correctly if one of your clients is older. not work correctly if one of your clients is older.
deck-config-set-optimal-retention = Set desired retention to { $num } deck-config-estimated-retention = Estimated retention: { $num }
deck-config-complete = { $num }% complete. deck-config-complete = { $num }% complete.
deck-config-reschedule-cards-on-change = Reschedule cards on change deck-config-reschedule-cards-on-change = Reschedule cards on change

View file

@ -188,18 +188,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
return tr.deckConfigComplete({ num: pct }); return tr.deckConfigComplete({ num: pct });
} }
function stringForSetOptimalRetention(retention: number): String { function estimatedRetention(retention: number): String {
if (!retention) { if (!retention) {
return ""; return "";
} }
return tr.deckConfigSetOptimalRetention({ num: retention.toFixed(2) }); return tr.deckConfigEstimatedRetention({ num: retention.toFixed(2) });
}
function setDesiredRetentionToOptimal() {
if (!optimalRetention) {
return;
}
$config.desiredRetention = optimalRetention;
} }
</script> </script>
@ -319,14 +312,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</button> </button>
{#if optimalRetention} {#if optimalRetention}
<button {estimatedRetention(optimalRetention)}
class="btn {'btn-primary'}"
disabled={!optimalRetention ||
optimalRetention === $config.desiredRetention}
on:click={() => setDesiredRetentionToOptimal()}
>
{stringForSetOptimalRetention(optimalRetention)}
</button>
{/if} {/if}
<div>{computeRetentionProgressString}</div> <div>{computeRetentionProgressString}</div>
</details> </details>