From 2879dc63c3a05889ef69448d00802e17ac1509e2 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Tue, 19 Aug 2025 17:58:25 +0100 Subject: [PATCH 1/4] Fix/Learn count not included in workload graph (#4274) Co-authored-by: Damien Elmes --- rslib/src/scheduler/fsrs/simulator.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rslib/src/scheduler/fsrs/simulator.rs b/rslib/src/scheduler/fsrs/simulator.rs index a26afda9c..c1f4df817 100644 --- a/rslib/src/scheduler/fsrs/simulator.rs +++ b/rslib/src/scheduler/fsrs/simulator.rs @@ -293,7 +293,8 @@ impl Collection { ( *result.memorized_cnt_per_day.last().unwrap_or(&0.), result.cost_per_day.iter().sum::(), - result.review_cnt_per_day.iter().sum::() as u32, + result.review_cnt_per_day.iter().sum::() as u32 + + result.learn_cnt_per_day.iter().sum::() as u32, ), )) }) From 79932aad41e9ec24677d2e0551333a0d4c8bc728 Mon Sep 17 00:00:00 2001 From: Abdo Date: Tue, 19 Aug 2025 20:02:51 +0300 Subject: [PATCH 2/4] Fix sync errors not being reported in some cases (#4281) * Set parent of sync error dialog * Explicitly mention parent arg in show_info() functions --- qt/aqt/sync.py | 2 +- qt/aqt/utils.py | 26 +++++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/qt/aqt/sync.py b/qt/aqt/sync.py index 94ce0c8c1..9b29ada20 100644 --- a/qt/aqt/sync.py +++ b/qt/aqt/sync.py @@ -73,7 +73,7 @@ def handle_sync_error(mw: aqt.main.AnkiQt, err: Exception) -> None: elif isinstance(err, Interrupted): # no message to show return - show_warning(str(err)) + show_warning(str(err), parent=mw) def on_normal_sync_timer(mw: aqt.main.AnkiQt) -> None: diff --git a/qt/aqt/utils.py b/qt/aqt/utils.py index 64d057082..43efc513f 100644 --- a/qt/aqt/utils.py +++ b/qt/aqt/utils.py @@ -226,29 +226,45 @@ def ask_user_dialog( ) -def show_info(text: str, callback: Callable | None = None, **kwargs: Any) -> MessageBox: +def show_info( + text: str, + callback: Callable | None = None, + parent: QWidget | None = None, + **kwargs: Any, +) -> MessageBox: "Show a small info window with an OK button." if "icon" not in kwargs: kwargs["icon"] = QMessageBox.Icon.Information return MessageBox( text, callback=(lambda _: callback()) if callback is not None else None, + parent=parent, **kwargs, ) def show_warning( - text: str, callback: Callable | None = None, **kwargs: Any + text: str, + callback: Callable | None = None, + parent: QWidget | None = None, + **kwargs: Any, ) -> MessageBox: "Show a small warning window with an OK button." - return show_info(text, icon=QMessageBox.Icon.Warning, callback=callback, **kwargs) + return show_info( + text, icon=QMessageBox.Icon.Warning, callback=callback, parent=parent, **kwargs + ) def show_critical( - text: str, callback: Callable | None = None, **kwargs: Any + text: str, + callback: Callable | None = None, + parent: QWidget | None = None, + **kwargs: Any, ) -> MessageBox: "Show a small critical error window with an OK button." - return show_info(text, icon=QMessageBox.Icon.Critical, callback=callback, **kwargs) + return show_info( + text, icon=QMessageBox.Icon.Critical, callback=callback, parent=parent, **kwargs + ) def showWarning( From 3e846c87565fae48c076d7a241caea392e12b330 Mon Sep 17 00:00:00 2001 From: user1823 <92206575+user1823@users.noreply.github.com> Date: Tue, 19 Aug 2025 22:33:53 +0530 Subject: [PATCH 3/4] Make simulator fill missing values of DR and decay too (#4269) * Make simulator fill missing values of DR and decay too If a card has missing memory states, it will likely have missing DR and decay too. So, it makes sense to simultaneously update them as well. * Fix error * Avoid causing sync conflicts when filling in missing memory in sim https://github.com/ankitects/anki/pull/4269#issuecomment-3201450124 --------- Co-authored-by: Damien Elmes --- rslib/src/scheduler/fsrs/simulator.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/rslib/src/scheduler/fsrs/simulator.rs b/rslib/src/scheduler/fsrs/simulator.rs index c1f4df817..005f7ca86 100644 --- a/rslib/src/scheduler/fsrs/simulator.rs +++ b/rslib/src/scheduler/fsrs/simulator.rs @@ -142,10 +142,11 @@ impl Collection { // calculate any missing memory state for c in &mut cards { if is_included_card(c) && c.memory_state.is_none() { - let original = c.clone(); - let new_state = self.compute_memory_state(c.id)?.state; - c.memory_state = new_state.map(Into::into); - self.update_card_inner(c, original, self.usn()?)?; + let fsrs_data = self.compute_memory_state(c.id)?; + c.memory_state = fsrs_data.state.map(Into::into); + c.desired_retention = Some(fsrs_data.desired_retention); + c.decay = Some(fsrs_data.decay); + self.storage.update_card(c)?; } } let days_elapsed = self.timing_today().unwrap().days_elapsed as i32; From 3d0a408a2b1f86a647e2f3e6eee20893fa0dc706 Mon Sep 17 00:00:00 2001 From: Expertium <83031600+Expertium@users.noreply.github.com> Date: Fri, 22 Aug 2025 13:23:29 +0300 Subject: [PATCH 4/4] A small clarification in deck-config.ftl (#4264) * A small clarification in deck-config.ftl * Tweak wording (dae) https://github.com/ankitects/anki/pull/4264#issuecomment-3188208351 --- ftl/core/deck-config.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index 5154f44c1..da3e4ea34 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -533,7 +533,7 @@ deck-config-health-check = Check health when optimizing deck-config-fsrs-bad-fit-warning = Health Check: Your memory is difficult for FSRS to predict. Recommendations: - - Suspend or reformulate leeches. + - Suspend or reformulate any cards you constantly forget. - Use the answer buttons consistently. Keep in mind that "Hard" is a passing grade, not a failing grade. - Understand before you memorize.