From 0986af4f81e59668cce049697f5a739bf9a86a58 Mon Sep 17 00:00:00 2001 From: Dan <92204353+dspilleb@users.noreply.github.com> Date: Tue, 30 Sep 2025 19:18:26 +0200 Subject: [PATCH 1/7] fix(Occlusion): remember toggle translucency setting (#4366) * remember translucency Adding myself to contributors Added braces surrounding if statement to comply with ninja checks * ninja fix format --- CONTRIBUTORS | 1 + ts/routes/image-occlusion/Toolbar.svelte | 3 ++- ts/routes/image-occlusion/mask-editor.ts | 17 +++++++++++++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index d8ac8caf5..a6334b0d9 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -246,6 +246,7 @@ Aldlss Hanna Nilsén Elias Johansson Lara Toby Penner +Danilo Spillebeen ******************** diff --git a/ts/routes/image-occlusion/Toolbar.svelte b/ts/routes/image-occlusion/Toolbar.svelte index 5b627ffdf..b00e42087 100644 --- a/ts/routes/image-occlusion/Toolbar.svelte +++ b/ts/routes/image-occlusion/Toolbar.svelte @@ -32,6 +32,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html saveNeededStore, opacityStateStore, } from "./store"; + import { get } from "svelte/store"; import { drawEllipse, drawPolygon, drawRectangle, drawText } from "./tools/index"; import { makeMaskTransparent, SHAPE_MASK_COLOR } from "./tools/lib"; import { enableSelectable, stopDraw } from "./tools/lib"; @@ -233,7 +234,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } onMount(() => { - opacityStateStore.set(maskOpacity); + maskOpacity = get(opacityStateStore); removeHandlers = singleCallback( on(document, "click", onClick), on(window, "mousemove", onMousemove), diff --git a/ts/routes/image-occlusion/mask-editor.ts b/ts/routes/image-occlusion/mask-editor.ts index 6d4d0d284..41adbe423 100644 --- a/ts/routes/image-occlusion/mask-editor.ts +++ b/ts/routes/image-occlusion/mask-editor.ts @@ -8,10 +8,22 @@ import { fabric } from "fabric"; import { get } from "svelte/store"; import { optimumCssSizeForCanvas } from "./canvas-scale"; -import { hideAllGuessOne, notesDataStore, saveNeededStore, tagsWritable, textEditingState } from "./store"; +import { + hideAllGuessOne, + notesDataStore, + opacityStateStore, + saveNeededStore, + tagsWritable, + textEditingState, +} from "./store"; import Toast from "./Toast.svelte"; import { addShapesToCanvasFromCloze } from "./tools/add-from-cloze"; -import { enableSelectable, makeShapesRemainInCanvas, moveShapeToCanvasBoundaries } from "./tools/lib"; +import { + enableSelectable, + makeMaskTransparent, + makeShapesRemainInCanvas, + moveShapeToCanvasBoundaries, +} from "./tools/lib"; import { modifiedPolygon } from "./tools/tool-polygon"; import { undoStack } from "./tools/tool-undo-redo"; import { enablePinchZoom, onResize, setCanvasSize } from "./tools/tool-zoom"; @@ -83,6 +95,7 @@ export const setupMaskEditorForEdit = async ( window.requestAnimationFrame(() => { onImageLoaded({ noteId: BigInt(noteId) }); }); + if (get(opacityStateStore)) { makeMaskTransparent(canvas, true); } }; return canvas; From b2bb85b1a28ee30512beba066a863031fc004157 Mon Sep 17 00:00:00 2001 From: matbe766 Date: Thu, 2 Oct 2025 11:59:09 +0200 Subject: [PATCH 2/7] Avoid QProgressBar overflow by normalizing to kilobytes (fixes #4341) (#4354) * qt: normalize large progress totals to kilobytes to avoid QProgressBar overflow (#4341); docs: update CONTRIBUTORS * update * revert: keep ProgressManager generic; no autoscaling in progress.py * revert: keep ProgressManager generic; do scaling only in full sync * Simplify sync progress update by scaling to KB, fix CONTRIBUTORS --- CONTRIBUTORS | 2 ++ qt/aqt/sync.py | 13 +++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a6334b0d9..c66588274 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -247,6 +247,8 @@ Hanna Nilsén Elias Johansson Lara Toby Penner Danilo Spillebeen +Matbe766 + ******************** diff --git a/qt/aqt/sync.py b/qt/aqt/sync.py index 9b29ada20..75bdeca89 100644 --- a/qt/aqt/sync.py +++ b/qt/aqt/sync.py @@ -209,11 +209,20 @@ def on_full_sync_timer(mw: aqt.main.AnkiQt, label: str) -> None: return sync_progress = progress.full_sync + # If we've reached total, show the "checking" label if sync_progress.transferred == sync_progress.total: label = tr.sync_checking() + + total = sync_progress.total + transferred = sync_progress.transferred + + # Scale both to kilobytes with floor division + max_for_bar = total // 1024 + value_for_bar = transferred // 1024 + mw.progress.update( - value=sync_progress.transferred, - max=sync_progress.total, + value=value_for_bar, + max=max_for_bar, process=False, label=label, ) From 969c2b43b52ff7ceaf83b494b1d772d1c3f1b037 Mon Sep 17 00:00:00 2001 From: GithubAnon0000 <160563432+GithubAnon0000@users.noreply.github.com> Date: Thu, 2 Oct 2025 10:00:09 +0000 Subject: [PATCH 3/7] CHANGE launcher strings to clarify installing for novices (#4327) * CHANGE strings to clarify for novices * Update launcher.ftl including suggestions from @dae --- ftl/core/launcher.ftl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ftl/core/launcher.ftl b/ftl/core/launcher.ftl index 13d419a0c..46a08df5a 100644 --- a/ftl/core/launcher.ftl +++ b/ftl/core/launcher.ftl @@ -1,9 +1,9 @@ launcher-title = Anki Launcher -launcher-press-enter-to-start = Press enter to start Anki. +launcher-press-enter-to-start = Press the Enter/Return key on your keyboard to install or update Anki. launcher-anki-will-start-shortly = Anki will start shortly. launcher-you-can-close-this-window = You can close this window. launcher-updating-anki = Updating Anki... -launcher-latest-anki = Latest Anki (just press Enter) +launcher-latest-anki = Install Latest Anki (default) launcher-choose-a-version = Choose a version launcher-sync-project-changes = Sync project changes launcher-keep-existing-version = Keep existing version ({ $current }) From 1ba4512011af1b0e1d1fa404d53d15defe20ffbf Mon Sep 17 00:00:00 2001 From: user1823 <92206575+user1823@users.noreply.github.com> Date: Thu, 2 Oct 2025 20:20:44 +0530 Subject: [PATCH 4/7] Fix launcher strings (#4375) * Fix launcher strings * Add prompt to press enter for installation * Prompt should appear after ensuring that the OS is supported --- ftl/core/launcher.ftl | 5 +++-- qt/launcher/src/main.rs | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ftl/core/launcher.ftl b/ftl/core/launcher.ftl index 46a08df5a..ee3aa6320 100644 --- a/ftl/core/launcher.ftl +++ b/ftl/core/launcher.ftl @@ -1,5 +1,6 @@ launcher-title = Anki Launcher -launcher-press-enter-to-start = Press the Enter/Return key on your keyboard to install or update Anki. +launcher-press-enter-to-install = Press the Enter/Return key on your keyboard to install or update Anki. +launcher-press-enter-to-start = Press enter to start Anki. launcher-anki-will-start-shortly = Anki will start shortly. launcher-you-can-close-this-window = You can close this window. launcher-updating-anki = Updating Anki... @@ -13,7 +14,7 @@ launcher-on = on launcher-off = off launcher-cache-downloads = Cache downloads: { $state } launcher-download-mirror = Download mirror: { $state } -launcher-uninstall = Uninstall +launcher-uninstall = Uninstall Anki launcher-invalid-input = Invalid input. Please try again. launcher-latest-releases = Latest releases: { $releases } launcher-enter-the-version-you-want = Enter the version you want to install: diff --git a/qt/launcher/src/main.rs b/qt/launcher/src/main.rs index cdfc54d8c..26fbe86a7 100644 --- a/qt/launcher/src/main.rs +++ b/qt/launcher/src/main.rs @@ -173,6 +173,8 @@ fn run() -> Result<()> { ensure_os_supported()?; + println!("{}\n", state.tr.launcher_press_enter_to_install()); + check_versions(&mut state); main_menu_loop(&state)?; From 1f9d943c8d33020301d449af3070f95617faf734 Mon Sep 17 00:00:00 2001 From: AmandaSternberg-creator Date: Thu, 2 Oct 2025 16:52:49 +0200 Subject: [PATCH 5/7] Localize FSRS error message and update contributors (#4342) Co-authored-by: Amanda Sternberg --- CONTRIBUTORS | 1 + ftl/core/deck-config.ftl | 2 +- rslib/src/scheduler/fsrs/error.rs | 8 +------- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index c66588274..7d44671ca 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -248,6 +248,7 @@ Elias Johansson Lara Toby Penner Danilo Spillebeen Matbe766 +Amanda Sternberg ******************** diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index 1e193dc04..4930dbe0e 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -382,7 +382,7 @@ deck-config-which-deck = Which deck would you like to display options for? ## Messages related to the FSRS scheduler deck-config-updating-cards = Updating cards: { $current_cards_count }/{ $total_cards_count }... -deck-config-invalid-parameters = The provided FSRS parameters are invalid. Leave them blank to use the default parameters. +deck-config-invalid-parameters = The provided FSRS parameters are invalid. Leave them blank to use the default values. deck-config-not-enough-history = Insufficient review history to perform this operation. deck-config-must-have-400-reviews = { $count -> diff --git a/rslib/src/scheduler/fsrs/error.rs b/rslib/src/scheduler/fsrs/error.rs index d5b596a36..404ee3605 100644 --- a/rslib/src/scheduler/fsrs/error.rs +++ b/rslib/src/scheduler/fsrs/error.rs @@ -13,13 +13,7 @@ impl From for AnkiError { FSRSError::OptimalNotFound => AnkiError::FsrsUnableToDetermineDesiredRetention, FSRSError::Interrupted => AnkiError::Interrupted, FSRSError::InvalidParameters => AnkiError::FsrsParamsInvalid, - FSRSError::InvalidInput => AnkiError::InvalidInput { - source: InvalidInputError { - message: "invalid params provided".to_string(), - source: None, - backtrace: None, - }, - }, + FSRSError::InvalidInput => AnkiError::FsrsParamsInvalid, FSRSError::InvalidDeckSize => AnkiError::InvalidInput { source: InvalidInputError { message: "no cards to simulate".to_string(), From d11b74fd38835f69adab31573b50fc305337615d Mon Sep 17 00:00:00 2001 From: Arold0 <165577303+arold0@users.noreply.github.com> Date: Sun, 5 Oct 2025 14:58:16 +0200 Subject: [PATCH 6/7] Fix fatal error when double clicking Add button (#4377) Prevent adding a note that has already been added by checking if note.id is set before attempting to add it. This fixes a race condition when the Add button is clicked multiple times quickly. Fixes #4376 --- CONTRIBUTORS | 1 + qt/aqt/addcards.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index 7d44671ca..a18833b04 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -249,6 +249,7 @@ Toby Penner Danilo Spillebeen Matbe766 Amanda Sternberg +arold0 ******************** diff --git a/qt/aqt/addcards.py b/qt/aqt/addcards.py index a27d86234..01d7423d8 100644 --- a/qt/aqt/addcards.py +++ b/qt/aqt/addcards.py @@ -289,6 +289,10 @@ class AddCards(QMainWindow): def _add_current_note(self) -> None: note = self.editor.note + # Prevent adding a note that has already been added (e.g., from double-clicking) + if note.id != 0: + return + if not self._note_can_be_added(note): return From 76d3237139b3e73b98f5a5b4dfeeeea2f0554644 Mon Sep 17 00:00:00 2001 From: Arold0 <165577303+arold0@users.noreply.github.com> Date: Thu, 9 Oct 2025 00:50:50 +0200 Subject: [PATCH 7/7] Fix notetype original_stock_kind using wrong enum (#4382) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use OriginalStockKind instead of StockKind when setting original_stock_kind for basic notetype variants. The two enums have different numeric values, causing 'Restore to Default' to restore the wrong template. For example, StockKind::BasicTyping has value 3, but when read back as OriginalStockKind, value 3 corresponds to BasicOptionalReversed instead of BasicTyping (which is 4). This fixes the off-by-one behavior where: - Basic (type in the answer) → Basic (optional reversed card) - Basic (and reversed card) → Basic (optional reversed card) - Basic (optional reversed card) → Basic (and reversed card) Fixes #4353 --- CONTRIBUTORS | 2 +- rslib/src/notetype/stock.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTORS b/CONTRIBUTORS index a18833b04..cc651e198 100644 --- a/CONTRIBUTORS +++ b/CONTRIBUTORS @@ -249,7 +249,7 @@ Toby Penner Danilo Spillebeen Matbe766 Amanda Sternberg -arold0 +arold0 ******************** diff --git a/rslib/src/notetype/stock.rs b/rslib/src/notetype/stock.rs index 9b5df66d5..b27881809 100644 --- a/rslib/src/notetype/stock.rs +++ b/rslib/src/notetype/stock.rs @@ -122,7 +122,7 @@ pub(crate) fn basic(tr: &I18n) -> Notetype { pub(crate) fn basic_typing(tr: &I18n) -> Notetype { let mut nt = basic(tr); - nt.config.original_stock_kind = StockKind::BasicTyping as i32; + nt.config.original_stock_kind = OriginalStockKind::BasicTyping as i32; nt.name = tr.notetypes_basic_type_answer_name().into(); let front = tr.notetypes_front_field(); let back = tr.notetypes_back_field(); @@ -138,7 +138,7 @@ pub(crate) fn basic_typing(tr: &I18n) -> Notetype { pub(crate) fn basic_forward_reverse(tr: &I18n) -> Notetype { let mut nt = basic(tr); - nt.config.original_stock_kind = StockKind::BasicAndReversed as i32; + nt.config.original_stock_kind = OriginalStockKind::BasicAndReversed as i32; nt.name = tr.notetypes_basic_reversed_name().into(); let front = tr.notetypes_front_field(); let back = tr.notetypes_back_field(); @@ -156,7 +156,7 @@ pub(crate) fn basic_forward_reverse(tr: &I18n) -> Notetype { pub(crate) fn basic_optional_reverse(tr: &I18n) -> Notetype { let mut nt = basic_forward_reverse(tr); - nt.config.original_stock_kind = StockKind::BasicOptionalReversed as i32; + nt.config.original_stock_kind = OriginalStockKind::BasicOptionalReversed as i32; nt.name = tr.notetypes_basic_optional_reversed_name().into(); let addrev = tr.notetypes_add_reverse_field(); nt.add_field(addrev.as_ref());