change factor wording

This commit is contained in:
Luc Mcgrady 2025-05-25 14:12:18 +01:00
parent 2bd9c3461f
commit 2a5fe775dd
No known key found for this signature in database
GPG key ID: 4F3D7A0B17CC3D9C
2 changed files with 7 additions and 28 deletions

View file

@ -470,9 +470,8 @@ deck-config-compute-optimal-retention-tooltip4 =
willing to invest more study time to achieve it. Setting your desired retention lower than the minimum
is not recommended, as it will lead to a higher workload, because of the high forgetting rate.
deck-config-please-save-your-changes-first = Please save your changes first.
deck-config-workload-percentage-increase = Your workload will increase by approximately { $percent }%.
deck-config-workload-percentage-decrease = Your workload will decrease by approximately { $percent }%.
deck-config-workload-percentage-unchanged = The higher this value, the more frequently cards will be shown to you.
deck-config-workload-factor-change = Approximate workload: {$factor}x (compared to {$previousDR}% desired retention).
deck-config-workload-factor-unchanged = The higher this value, the more frequently cards will be shown to you.
deck-config-desired-retention-too-low = Your desired retention is very low, which can lead to very long intervals.
deck-config-desired-retention-too-high = Your desired retention is very high, which can lead to very short intervals.

View file

@ -107,23 +107,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}
}
/**
* @param percent passed * 100, e.g 100% = 100
*/
function roundPercentage(percent: number) {
const absPercent = Math.abs(percent);
if (absPercent > 100) {
return Math.round(percent / 50) * 50;
} else if (absPercent >= 1) {
return parseFloat(percent.toPrecision(1));
} else {
return "<1";
}
}
async function getRetentionChangeInfo(retention: number, params: number[]) {
if (+startingDesiredRetention == roundedRetention) {
desiredRetentionChangeInfo = tr.deckConfigWorkloadPercentageUnchanged();
desiredRetentionChangeInfo = tr.deckConfigWorkloadFactorUnchanged();
return;
}
const request = new GetRetentionWorkloadRequest({
@ -133,16 +119,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
after: retention,
});
const resp = await getRetentionWorkload(request);
const percent = (resp.factor - 1) * 100;
if (percent > 0) {
desiredRetentionChangeInfo = tr.deckConfigWorkloadPercentageIncrease({
percent: roundPercentage(percent),
});
} else {
desiredRetentionChangeInfo = tr.deckConfigWorkloadPercentageDecrease({
percent: roundPercentage(-percent),
});
}
desiredRetentionChangeInfo = tr.deckConfigWorkloadFactorChange({
factor: resp.factor.toFixed(2),
previousDr: (+startingDesiredRetention * 100).toString(),
});
}
function getRetentionWarningClass(retention: number): string {