diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index bb79800e0..1ed72fceb 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -314,7 +314,7 @@ deck-config-confirm-remove-name = Remove { $name }? deck-config-save-button = Save deck-config-save-to-all-subdecks = Save to All Subdecks -deck-config-save-and-optimize = Optimize All Presets +deck-config-save-and-optimize = Optimize All deck-config-revert-button-tooltip = Restore this setting to its default value? ## These strings are shown via the Description button at the bottom of the @@ -363,10 +363,10 @@ deck-config-must-have-400-reviews = deck-config-weights = FSRS parameters deck-config-compute-optimal-weights = Optimize FSRS parameters deck-config-compute-minimum-recommended-retention = Minimum recommended retention -deck-config-optimize-button = Optimize +deck-config-optimize-button = Optimize Current deck-config-compute-button = Compute deck-config-ignore-before = Ignore cards reviewed before -deck-config-optimize-all-tip = You can optimize all presets at once by using the dropdown button next to "Save". +deck-config-time-to-optimize = It's been a while - using the Optimize All button is recommended. deck-config-evaluate-button = Evaluate deck-config-desired-retention = Desired retention deck-config-historical-retention = Historical retention @@ -542,3 +542,4 @@ deck-config-invalid-weights = Parameters must be either left blank to use the de deck-config-fsrs-on-all-clients = 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. +deck-config-optimize-all-tip = You can optimize all presets at once by using the dropdown button next to "Save". diff --git a/ts/routes/deck-options/FsrsOptions.svelte b/ts/routes/deck-options/FsrsOptions.svelte index 921319ca4..fbdb1496c 100644 --- a/ts/routes/deck-options/FsrsOptions.svelte +++ b/ts/routes/deck-options/FsrsOptions.svelte @@ -26,7 +26,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import SwitchRow from "$lib/components/SwitchRow.svelte"; import GlobalLabel from "./GlobalLabel.svelte"; - import { fsrsParams, type DeckOptionsState } from "./lib"; + import { commitEditing, fsrsParams, type DeckOptionsState } from "./lib"; import SpinBoxFloatRow from "./SpinBoxFloatRow.svelte"; import SpinBoxRow from "./SpinBoxRow.svelte"; import Warning from "./Warning.svelte"; @@ -45,6 +45,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import TableData from "../graphs/TableData.svelte"; import { defaultGraphBounds, type TableDatum } from "../graphs/graph-helpers"; import InputBox from "../graphs/InputBox.svelte"; + import { UpdateDeckConfigsMode } from "@generated/anki/deck_config_pb"; export let state: DeckOptionsState; export let openHelpModal: (String) => void; @@ -57,7 +58,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html const daysSinceLastOptimization = state.daysSinceLastOptimization; $: lastOptimizationWarning = - $daysSinceLastOptimization > 30 ? tr.deckConfigOptimizeAllTip() : ""; + $daysSinceLastOptimization > 30 ? tr.deckConfigTimeToOptimize() : ""; let computeParamsProgress: ComputeParamsProgress | undefined; let computingParams = false; @@ -300,6 +301,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html return tr.deckConfigPredictedOptimalRetention({ num: retention.toFixed(2) }); } + async function computeAllParams(): Promise { + await commitEditing(); + state.save(UpdateDeckConfigsMode.COMPUTE_ALL_PARAMS); + } + let tableData: TableDatum[] = []; const bounds = defaultGraphBounds(); bounds.marginLeft += 8; @@ -436,8 +442,14 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html {tr.statisticsReviews({ reviews: totalReviews })} {/if} + +
+ +
diff --git a/ts/routes/deck-options/SaveButton.svelte b/ts/routes/deck-options/SaveButton.svelte index 8efb8db3a..d46b1a750 100644 --- a/ts/routes/deck-options/SaveButton.svelte +++ b/ts/routes/deck-options/SaveButton.svelte @@ -8,7 +8,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import { withCollapsedWhitespace } from "@tslib/i18n"; import { getPlatformString } from "@tslib/shortcuts"; import { createEventDispatcher, tick } from "svelte"; - import { get } from "svelte/store"; import DropdownDivider from "$lib/components/DropdownDivider.svelte"; import DropdownItem from "$lib/components/DropdownItem.svelte"; @@ -56,10 +55,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html async function save(mode: UpdateDeckConfigsMode): Promise { await commitEditing(); - if (mode === UpdateDeckConfigsMode.COMPUTE_ALL_PARAMS && !get(state.fsrs)) { - alert(tr.deckConfigFsrsMustBeEnabled()); - return; - } state.save(mode); } @@ -118,11 +113,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html > {tr.deckConfigSaveToAllSubdecks()} - save(UpdateDeckConfigsMode.COMPUTE_ALL_PARAMS)} - > - {tr.deckConfigSaveAndOptimize()} -