mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
Switch FSRS reschedule to a global option; don't persist
A global is easier to use in conjunction with the 'optimize all' action. The value is no longer persisted, as doing so makes it too easy for users to generate a lot of revlog entries when playing with different FSRS weights/retention settings, such as in https://forums.ankiweb.net/t/possible-syncing-limitation-by-fsrs-manual-scheduling-data-accumulation/37610
This commit is contained in:
parent
452e012c71
commit
8b6abd3f8f
8 changed files with 16 additions and 12 deletions
|
@ -384,10 +384,13 @@ deck-config-reschedule-cards-on-change-tooltip =
|
||||||
This option controls whether the due dates of cards will be changed when you enable FSRS, or optimize
|
This option controls whether the due dates of cards will be changed when you enable FSRS, or optimize
|
||||||
the parameters. The default is not to reschedule cards: future reviews will use the new scheduling, but
|
the parameters. The default is not to reschedule cards: future reviews will use the new scheduling, but
|
||||||
there will be no immediate change to your workload. If rescheduling is enabled, the due dates of cards
|
there will be no immediate change to your workload. If rescheduling is enabled, the due dates of cards
|
||||||
will be changed.
|
will be changed. This option is shared by all deck presets, and not saved.
|
||||||
deck-config-reschedule-cards-warning =
|
deck-config-reschedule-cards-warning =
|
||||||
Depending on your desired retention, this can result in a large number of cards becoming
|
Depending on your desired retention, this can result in a large number of cards becoming
|
||||||
due, so is not recommended when first switching from SM2.
|
due, so is not recommended when first switching from SM2.
|
||||||
|
|
||||||
|
Use this option sparingly, as it will add a review entry to each of your cards, and
|
||||||
|
increase the size of your collection.
|
||||||
deck-config-compute-optimal-weights-tooltip =
|
deck-config-compute-optimal-weights-tooltip =
|
||||||
Once you've done 1000+ reviews in Anki, you can use the Optimize button to analyze your review history,
|
Once you've done 1000+ reviews in Anki, you can use the Optimize button to analyze your review history,
|
||||||
and automatically generate parameters that are optimal for your memory and the content you're studying.
|
and automatically generate parameters that are optimal for your memory and the content you're studying.
|
||||||
|
|
|
@ -152,7 +152,8 @@ message DeckConfig {
|
||||||
|
|
||||||
// for fsrs
|
// for fsrs
|
||||||
float desired_retention = 37;
|
float desired_retention = 37;
|
||||||
bool reschedule_fsrs_cards = 39;
|
// used for fsrs_reschedule in the past
|
||||||
|
reserved 39;
|
||||||
float sm2_retention = 40;
|
float sm2_retention = 40;
|
||||||
string weight_search = 45;
|
string weight_search = 45;
|
||||||
|
|
||||||
|
@ -218,4 +219,5 @@ message UpdateDeckConfigsRequest {
|
||||||
bool new_cards_ignore_review_limit = 7;
|
bool new_cards_ignore_review_limit = 7;
|
||||||
bool fsrs = 8;
|
bool fsrs = 8;
|
||||||
bool apply_all_parent_limits = 9;
|
bool apply_all_parent_limits = 9;
|
||||||
|
bool fsrs_reschedule = 10;
|
||||||
}
|
}
|
||||||
|
|
|
@ -75,7 +75,6 @@ const DEFAULT_DECK_CONFIG_INNER: DeckConfigInner = DeckConfigInner {
|
||||||
fsrs_weights: vec![],
|
fsrs_weights: vec![],
|
||||||
desired_retention: 0.9,
|
desired_retention: 0.9,
|
||||||
other: Vec::new(),
|
other: Vec::new(),
|
||||||
reschedule_fsrs_cards: false,
|
|
||||||
sm2_retention: 0.9,
|
sm2_retention: 0.9,
|
||||||
weight_search: String::new(),
|
weight_search: String::new(),
|
||||||
};
|
};
|
||||||
|
|
|
@ -84,8 +84,6 @@ pub struct DeckConfSchema11 {
|
||||||
#[serde(default = "wait_for_audio_default")]
|
#[serde(default = "wait_for_audio_default")]
|
||||||
wait_for_audio: bool,
|
wait_for_audio: bool,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
reschedule_fsrs_cards: bool,
|
|
||||||
#[serde(default)]
|
|
||||||
sm2_retention: f32,
|
sm2_retention: f32,
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
weight_search: String,
|
weight_search: String,
|
||||||
|
@ -294,7 +292,6 @@ impl Default for DeckConfSchema11 {
|
||||||
bury_interday_learning: false,
|
bury_interday_learning: false,
|
||||||
fsrs_weights: vec![],
|
fsrs_weights: vec![],
|
||||||
desired_retention: 0.9,
|
desired_retention: 0.9,
|
||||||
reschedule_fsrs_cards: false,
|
|
||||||
sm2_retention: 0.9,
|
sm2_retention: 0.9,
|
||||||
weight_search: "".to_string(),
|
weight_search: "".to_string(),
|
||||||
}
|
}
|
||||||
|
@ -372,7 +369,6 @@ impl From<DeckConfSchema11> for DeckConfig {
|
||||||
bury_interday_learning: c.bury_interday_learning,
|
bury_interday_learning: c.bury_interday_learning,
|
||||||
fsrs_weights: c.fsrs_weights,
|
fsrs_weights: c.fsrs_weights,
|
||||||
desired_retention: c.desired_retention,
|
desired_retention: c.desired_retention,
|
||||||
reschedule_fsrs_cards: c.reschedule_fsrs_cards,
|
|
||||||
sm2_retention: c.sm2_retention,
|
sm2_retention: c.sm2_retention,
|
||||||
weight_search: c.weight_search,
|
weight_search: c.weight_search,
|
||||||
other: other_bytes,
|
other: other_bytes,
|
||||||
|
@ -479,7 +475,6 @@ impl From<DeckConfig> for DeckConfSchema11 {
|
||||||
bury_interday_learning: i.bury_interday_learning,
|
bury_interday_learning: i.bury_interday_learning,
|
||||||
fsrs_weights: i.fsrs_weights,
|
fsrs_weights: i.fsrs_weights,
|
||||||
desired_retention: i.desired_retention,
|
desired_retention: i.desired_retention,
|
||||||
reschedule_fsrs_cards: i.reschedule_fsrs_cards,
|
|
||||||
sm2_retention: i.sm2_retention,
|
sm2_retention: i.sm2_retention,
|
||||||
weight_search: i.weight_search,
|
weight_search: i.weight_search,
|
||||||
}
|
}
|
||||||
|
@ -510,7 +505,6 @@ static RESERVED_DECKCONF_KEYS: Set<&'static str> = phf_set! {
|
||||||
"secondsToShowAnswer",
|
"secondsToShowAnswer",
|
||||||
"answerAction",
|
"answerAction",
|
||||||
"waitForAudio",
|
"waitForAudio",
|
||||||
"rescheduleFsrsCards",
|
|
||||||
"sm2Retention",
|
"sm2Retention",
|
||||||
"weightSearch",
|
"weightSearch",
|
||||||
};
|
};
|
||||||
|
|
|
@ -105,6 +105,7 @@ impl From<anki_proto::deck_config::UpdateDeckConfigsRequest> for UpdateDeckConfi
|
||||||
new_cards_ignore_review_limit: c.new_cards_ignore_review_limit,
|
new_cards_ignore_review_limit: c.new_cards_ignore_review_limit,
|
||||||
apply_all_parent_limits: c.apply_all_parent_limits,
|
apply_all_parent_limits: c.apply_all_parent_limits,
|
||||||
fsrs: c.fsrs,
|
fsrs: c.fsrs,
|
||||||
|
fsrs_reschedule: c.fsrs_reschedule,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ pub struct UpdateDeckConfigsRequest {
|
||||||
pub new_cards_ignore_review_limit: bool,
|
pub new_cards_ignore_review_limit: bool,
|
||||||
pub apply_all_parent_limits: bool,
|
pub apply_all_parent_limits: bool,
|
||||||
pub fsrs: bool,
|
pub fsrs: bool,
|
||||||
|
pub fsrs_reschedule: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Collection {
|
impl Collection {
|
||||||
|
@ -241,7 +242,7 @@ impl Collection {
|
||||||
weights: c.inner.fsrs_weights.clone(),
|
weights: c.inner.fsrs_weights.clone(),
|
||||||
desired_retention: c.inner.desired_retention,
|
desired_retention: c.inner.desired_retention,
|
||||||
max_interval: c.inner.maximum_review_interval,
|
max_interval: c.inner.maximum_review_interval,
|
||||||
reschedule: c.inner.reschedule_fsrs_cards,
|
reschedule: req.fsrs_reschedule,
|
||||||
sm2_retention: c.inner.sm2_retention,
|
sm2_retention: c.inner.sm2_retention,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
@ -434,6 +435,7 @@ mod test {
|
||||||
new_cards_ignore_review_limit: false,
|
new_cards_ignore_review_limit: false,
|
||||||
apply_all_parent_limits: false,
|
apply_all_parent_limits: false,
|
||||||
fsrs: false,
|
fsrs: false,
|
||||||
|
fsrs_reschedule: false,
|
||||||
};
|
};
|
||||||
assert!(!col.update_deck_configs(input.clone())?.changes.had_change());
|
assert!(!col.update_deck_configs(input.clone())?.changes.had_change());
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
const config = state.currentConfig;
|
const config = state.currentConfig;
|
||||||
const defaults = state.defaults;
|
const defaults = state.defaults;
|
||||||
|
const fsrsReschedule = state.fsrsReschedule;
|
||||||
|
|
||||||
let computeWeightsProgress: ComputeWeightsProgress | undefined;
|
let computeWeightsProgress: ComputeWeightsProgress | undefined;
|
||||||
let computingWeights = false;
|
let computingWeights = false;
|
||||||
|
@ -264,13 +265,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="m-2">
|
<div class="m-2">
|
||||||
<SwitchRow bind:value={$config.rescheduleFsrsCards} defaultValue={false}>
|
<SwitchRow bind:value={$fsrsReschedule} defaultValue={false}>
|
||||||
<SettingTitle on:click={() => openHelpModal("rescheduleCardsOnChange")}>
|
<SettingTitle on:click={() => openHelpModal("rescheduleCardsOnChange")}>
|
||||||
{tr.deckConfigRescheduleCardsOnChange()}
|
{tr.deckConfigRescheduleCardsOnChange()}
|
||||||
</SettingTitle>
|
</SettingTitle>
|
||||||
</SwitchRow>
|
</SwitchRow>
|
||||||
|
|
||||||
{#if $config.rescheduleFsrsCards}
|
{#if $fsrsReschedule}
|
||||||
<Warning warning={tr.deckConfigRescheduleCardsWarning()} />
|
<Warning warning={tr.deckConfigRescheduleCardsWarning()} />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -44,6 +44,7 @@ export class DeckOptionsState {
|
||||||
readonly newCardsIgnoreReviewLimit: Writable<boolean>;
|
readonly newCardsIgnoreReviewLimit: Writable<boolean>;
|
||||||
readonly applyAllParentLimits: Writable<boolean>;
|
readonly applyAllParentLimits: Writable<boolean>;
|
||||||
readonly fsrs: Writable<boolean>;
|
readonly fsrs: Writable<boolean>;
|
||||||
|
readonly fsrsReschedule: Writable<boolean> = writable(false);
|
||||||
readonly currentPresetName: Writable<string>;
|
readonly currentPresetName: Writable<string>;
|
||||||
|
|
||||||
private targetDeckId: DeckOptionsId;
|
private targetDeckId: DeckOptionsId;
|
||||||
|
@ -204,6 +205,7 @@ export class DeckOptionsState {
|
||||||
newCardsIgnoreReviewLimit: get(this.newCardsIgnoreReviewLimit),
|
newCardsIgnoreReviewLimit: get(this.newCardsIgnoreReviewLimit),
|
||||||
applyAllParentLimits: get(this.applyAllParentLimits),
|
applyAllParentLimits: get(this.applyAllParentLimits),
|
||||||
fsrs: get(this.fsrs),
|
fsrs: get(this.fsrs),
|
||||||
|
fsrsReschedule: get(this.fsrsReschedule),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue