Commit Graph

2270 Commits

Author SHA1 Message Date
Abdo
56d93bb3da fix: Parameterize inputs of prop:cd* queries (#4905)
It was possible to construct invalid SQLite queries for browser searches
in some cases, for example by searching for `prop:cds:foo=';`.
2026-05-27 16:29:42 +03:00
Abdo
5d1266eb8e fix: Strip HTML from note type names in Empty Cards (#4902)
Strip HTML from note type and template names in the Empty Cards screen.

## How to test
```
cargo test -p anki --lib notetype::emptycards
```

---------

Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com>
2026-05-26 18:55:43 +03:00
llama
e9830169b7 feat(check-media): case-insensitively dedupe media filenames (#4852)
<!--
Title (for the Pull Request title field at the top):
Use a short prefix so the change type is obvious. You do not need to
repeat it in the body below.

Examples:
- fix: — bugfix
- feat: — feature
- refactor: — internal change without user-facing feature
- docs: — documentation only
- chore: — tooling, CI, deps, build housekeeping
- test: — tests only
-->

## Linked issue (required)

- #4433
- #4716 

## Summary / motivation (required)

This PR modifies `Check Media` to dedupe filenames case-insensitively so
as to avoid files that were added on case-sensitive filesystems
potentially being overwritten on case-insensitive ones

## Steps to reproduce (required, use N/A if not applicable)

N/A

## How to test (required)

Given a.jpg (hash 1), A.JPG (hash 2) and a.JPG (hash 1) as existing
media files on a case-sensitive fs, see that `Check Media` renames A.JPG
to a-2.jpg and a.JPG to a.jpg

### Checklist (minimum)

- [x] I ran `./ninja check` or an equivalent relevant check locally.
- [ ] I added or updated tests when the change is non-trivial or
behavior changed.

## Scope

- [x] This PR is focused on one change (no unrelated edits).
2026-05-25 14:05:34 +03:00
llama
57e67f8408 fix(check-media): case-sensitivity in unused/missing check (#4861)
<!--
Title (for the Pull Request title field at the top):
Use a short prefix so the change type is obvious. You do not need to
repeat it in the body below.

Examples:
- fix: — bugfix
- feat: — feature
- refactor: — internal change without user-facing feature
- docs: — documentation only
- chore: — tooling, CI, deps, build housekeeping
- test: — tests only
-->

## Linked issue (required)

- #4716

## Summary / motivation (required)

Currently, on filesystems where the media folder is treated as
case-insensitive, `[sound:BLAH.mp3]` and `[sound:blah.mp3]` point to the
same file on disk (if any), but one of the two would be considered as a
ref pointing to a missing file by the media checker which assumes
case-sensitivity

## Steps to reproduce (required, use N/A if not applicable)

See linked pr

## How to test (required)

On windows/macos, add `blah.mp3`, rename `blah.mp3` to `Blah.mp3` in the
ref, run `Check Media` and see that `Blah.mp3` isn't considered missing

### Checklist (minimum)

- [x] I ran `./ninja check` or an equivalent relevant check locally.
- [ ] I added or updated tests when the change is non-trivial or
behavior changed.

## Scope

- [x] This PR is focused on one change (no unrelated edits).
2026-05-25 12:09:14 +03:00
llama
dfbd7d2399 fix(import): force lowercasing before adding hash suffix as well (#4860)
<!--
Title (for the Pull Request title field at the top):
Use a short prefix so the change type is obvious. You do not need to
repeat it in the body below.

Examples:
- fix: — bugfix
- feat: — feature
- refactor: — internal change without user-facing feature
- docs: — documentation only
- chore: — tooling, CI, deps, build housekeeping
- test: — tests only
-->

## Linked issue (required)

- #4851

## Summary / motivation (required)

I made a mistake in #4851 by not lowercasing in the case where a file
with the same name but different contents already exists, leading to
inconsistent behaviour across platforms

## Steps to reproduce (required, use N/A if not applicable)

See linked pr

## How to test (required)

Run ./check on linux and windows and see that the same lowercasing
behaviour occurs on both

### Checklist (minimum)

- [x] I ran `./ninja check` or an equivalent relevant check locally.
- [ ] I added or updated tests when the change is non-trivial or
behavior changed.

## Scope

- [x] This PR is focused on one change (no unrelated edits).
2026-05-19 06:58:47 +03:00
llama
3479499569 fix(import): avoid case-folding already existing media filenames (#4851)
<!--
Title (for the Pull Request title field at the top):
Use a short prefix so the change type is obvious. You do not need to
repeat it in the body below.

Examples:
- fix: — bugfix
- feat: — feature
- refactor: — internal change without user-facing feature
- docs: — documentation only
- chore: — tooling, CI, deps, build housekeeping
- test: — tests only
-->

## Linked issue (required)

Fixes #4716 

## Summary / motivation (required)

#4435 made it so that all new added media would have lowercased names,
but this was bugged and led to media refs pointing to inexistent files
on case-insensitive filesystems

The fix proposed is to try adding new files with lowercased names only
if they don't already exist, using the existing file otherwise

## Steps to reproduce (required, use N/A if not applicable)

See linked issue

## How to test (required)

Try copy-pasting a media file from the Edit window of an existing note
to the Add window and see that the filename in the resulting media ref
isn't forced to be lowercased

When pasting a new file, see that the filename is now lowercased

### Checklist (minimum)

- [x] I ran `./ninja check` or an equivalent relevant check locally.
- [ ] I added or updated tests when the change is non-trivial or
behavior changed.

## Scope

- [x] This PR is focused on one change (no unrelated edits).
2026-05-18 18:56:54 +03:00
Jeremy Fleischman
1482fb0937 fix: atomic_rename now works with single component relative paths (#4773)
## Linked issue (required)

[[<!-- Fixes #123 / Closes #123 / Refs #123
-->](https://forums.ankiweb.net/t/anki-collection-collection-export-anki-package-crashes-if-given-a-relative-path-with-one-component/69562)](https://forums.ankiweb.net/t/anki-collection-collection-export-anki-package-crashes-if-given-a-relative-path-with-one-component/69562)

## Summary / motivation (required)

See discussion about this on [the

forum](https://forums.ankiweb.net/t/anki-collection-collection-export-anki-package-crashes-if-given-a-relative-path-with-one-component/69562)

## Steps to reproduce (required, use N/A if not applicable)

`demo.py`:

```python
import tempfile
from pathlib import Path

import anki.collection

with tempfile.TemporaryDirectory() as tempdir:
    tempdir = Path(tempdir)
    col = anki.collection.Collection(str(tempdir / "temp.anki2"))
    col.export_anki_package(
        out_path="output.apkg",
        options=anki.collection.ExportAnkiPackageOptions(),
        limit=None,
    )
```

```console
$ python demo.py
Traceback (most recent call last):
  [... some noise elided here ...]
  File "/nix/store/1w7swjzmjp7171yspih1q07a9vgacjzb-dev-env/lib/python3.14/site-packages/anki/_backend_generated.py", line 2037, in export_anki_package
    raw_bytes = self._run_command(37, 4, message.SerializeToString())
  File "/nix/store/1w7swjzmjp7171yspih1q07a9vgacjzb-dev-env/lib/python3.14/site-packages/anki/_backend.py", line 171, in _run_command
    raise backend_exception_to_pylib(err)
anki.errors.BackendIOError: Failed to open '': No such file or directory (os error 2)
```

## How to test (required)

I added a unit test. It passes.

### Checklist (minimum)

- [ ] I ran `./ninja check` or an equivalent relevant check locally.
- [x] I added or updated tests when the change is non-trivial or
behavior changed.

### Details

<!-- Commands, manual steps, edge cases, and what you observed -->

## Before / after behavior (optional)

<!-- For bugfixes: behavior before vs after. For other types: N/A or a
short note. -->

## Risk / compatibility / migration (optional)

<!-- Breaking changes, rollout notes, or N/A for small / low-risk PRs
-->

## UI evidence (required for visual changes; otherwise N/A)

<!-- Screenshot or short video -->

## Scope

- [x] This PR is focused on one change (no unrelated edits).

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2026-05-15 16:53:17 +03:00
Abdo
cd2f15b4ee feat: Enable Windows ARM64 support for Briefcase (#4798)
## Linked issue

#4678

## Summary

This enables native Windows ARM64 builds for Briefcase. Depends on #4797

## How to test

- Run `./tools/ninja installer` in a Windows ARM64 machine.
- Check the architecture of the installer under `./out/installer/dist`
by going to Properties > Compatibility and confirming emulation settings
are disabled.
- Install the package and confirm Anki.exe is a native binary.
- Open Anki, go to the [debug
console](https://docs.ankiweb.net/misc.html#debug-console) and run the
following code to check the architecture of the Python build:
```python
import platform

print(platform.machine(), platform.python_compiler())
```
2026-05-08 16:58:40 +03:00
Andrew Sanchez
5a9b54e938 Briefcase Installer (#4629)
migrates Anki Desktop packaging from the legacy
NSIS/uv-based installer to [BeeWare
Briefcase](https://briefcase.readthedocs.io/). This branch integrates
work from many related issues and PRs to deliver cross-platform native
installers (MSI on Windows, .app on macOS, PyInstaller on Linux) with
code signing, notarization, and file association support.

## Integrated PRs

- #4585 — Set up Briefcase
- #4596 — Add Briefcase icons
- #4598 — Handle Briefcase file associations
- #4601 — Add Briefcase app permissions
- #4609 — Customize Briefcase's MSI installer
- #4616 — Set up Briefcase code signing and notarization
- #4618 — Fix Briefcase packaging for x86 Macs
- #4623 — Customize Briefcase's Linux template
- #4627 — List required Debian packages for Briefcase installer
- #4630 — Update Briefcase's Windows template
- #4631 — Rewrite Linux install/uninstall scripts for PyInstaller
- #4638 — Use PyInstaller on Linux
- #4645 — Update installer docs
- #4654 — Disable Briefcase's universal builds for macOS
- #4672 — Deal with existing NSIS installations in MSI installer
- #4676 — Remove duplicate Briefcase icons
- #4677 — Tweak Linux scripts for new installer
- #4709 — Add anki-console.bat to Briefcase's Windows package

## Related Issues

- #4557 — Evaluate BeeWare Briefcase for Anki packaging and distribution
- #4678 — Support native Windows ARM64 builds for Briefcase
- #4688 — Linux installer: migrate to PyInstaller and rewrite install
scripts
- #4689 — Investigate startup performance with Briefcase
- #4690 — Specify required Linux system packages for Briefcase
- #4691 — Investigate Windows ARM64 support with Briefcase
- #4692 — Test on Linux ARM with Briefcase
- #4693 — Separate ARM and Intel macOS releases
- #4694 — Update developer documentation for Briefcase installer
- #4695 — Support upgrade/downgrade with the Briefcase installer
- #4696 — Update user documentation for new installer
- #4702 — Update Briefcase's Windows template with upstream security fix
and OS version check
- #4703 — Follow-up tweaks to Linux install/uninstall scripts

## Related PRs

- #4619 — Enable Windows ARM64 support
- #4632 — Release action

---------

Co-authored-by: Abdo <abdo@abdnh.net>
Co-authored-by: Andrew Sanchez <andrewsanchez@users.noreply.github.com>
Co-authored-by: Fernando Lins <1887601+fernandolins@users.noreply.github.com>
2026-05-05 17:29:18 -04:00
user1823
abc5d10c55 Feat/Prioritize previously attempted cards in intraday learning queue (#4393)
The Problem
The "learn now" add-on can bulk-add many new cards to the learn queue
with due == now. When a user answers some of those and fails them, the
failed cards are scheduled for a few minutes later, but the current
queue-building behavior requires the user to finish the remaining "learn
now" cards (due == now) before the failed cards are shown again. This
increases the chance of repeated failures and reduces learning
efficiency.

The Change
The queue builder now partitions intraday learning cards into two
groups: previously-attempted (reps > 0) and never-attempted (reps == 0).
Within each group cards remain ordered by due time. The builder
concatenates the groups with previously-attempted cards first.

Why this fixes the problem
Failed learning cards (which now have reps > 0 and a later due
timestamp) will be prioritized ahead of never-attempted cards added by
"learn now". This ensures the user sees the failed cards as soon as they
are due, reducing repeated failures.

Why changes to Anki rather than the add-on
As far as I know, there is nothing that the add-on can do to improve
this situation. Secondly, I think that Anki should, at some point,
natively include the "Learn now" feature as it is quite useful when the
user wants to introduce specific cards (for e.g., for an upcoming exam)
without creating a temporary deck for that purpose. "Learn now" is also
a good way to solve one aspect of the Set Due Date misuse problem (see
https://github.com/open-spaced-repetition/fsrs4anki/issues/675#issuecomment-2548839346).
2026-04-20 17:03:39 +03:00
maskady
d051be6290 fix: contains_cloze_replacement now checks nested conditionals (#4581) (#4651)
Fixes #4581

`contains_cloze_replacement()` was doing a shallow check, missing cloze
fields nested inside conditionals. Delegating to
`all_referenced_cloze_field_names()` fixes the inconsistency with
`contains_field_replacement()`
2026-04-14 21:37:49 +03:00
Luc Mcgrady
922953acf4 Feat/Different method for ratio graph in Help Me Decide. (#4452)
Forum link:

-
https://forums.ankiweb.net/t/replace-cmrr-with-workload-vs-dr-graph-more/63234/27?u=a_blokee

@snorpdorp notified me that the logic behind the ratio graph is flawed
as it doesn't properly account for the number of cards that are
memorized to begin with.

I have implemented his (and @1DWalker's) proposed solution

<img width="1267" height="657" alt="image"
src="https://github.com/user-attachments/assets/41eded79-8f76-41dd-b98f-0bf1a968ab9b"
/>

Now the graph is inverted so that the higher the value, the more
efficient it is, in @snorpdorp's own words:

> The previous equation was flawed in that it displayed the total
knowledge at the end of the simulation, not the relative gain in
knowledge from the amount of studying done during the simulation
timeframe. The new (correct) equation is (relative gain in knowledge as
a result of studying during the simulation) / (time spent studying
during simulation) -
https://discord.com/channels/368267295601983490/1443273721878937650/1444447278344437833
2026-04-03 19:59:18 +03:00
Jake Probst
b5f15323c3 load balancer: improve sibling dispersal (#4640)
the load balancer only looks at cards in the same preset when balancing
cards. which means that if a sibling is in a different preset, it
doesn't get avoided. this is not ideal. so heres a fix.

and while I was here I added some extra weighting so it tries to spread
siblings out a bit.
2026-04-02 22:31:37 +03:00
Moamen Abdelsattar
c8f97d3c8a Fix deck-specific load balancer is not used in filtered deck study (#4574)
Originally I reported here >1mo ago
[https://forums.ankiweb.net/t/bug-filtered-decks-are-possibly-not-respecting-easy-days-settings/68257](https://forums.ankiweb.net/t/bug-filtered-decks-are-possibly-not-respecting-easy-days-settings/68257)

Note: I can not build and test Anki. I only assume (by reading code)
that this is the source of the bug. If this does not help, feel free to
reject.
2026-04-02 16:22:28 +03:00
Abdo
23dcc4158c Update AV_TAGS regex (#4580)
The AV_TAGS regex matches an old format of the `anki:tts` tag
(`[anki:tts][lang=en_US]` rather than `[anki:tts lang=en_US]`). It was
originally updated when the feature got introduced in
0942ffbff6
but then was never adjusted to reflect later changes to the syntax.
I removed it from the pattern rather than updating it to match, because
AV_TAGS is only used for matching filenames nowadays (stripping is
handled by a different module).
2026-03-31 17:33:01 +03:00
Daniel Pechersky
9679923046 Speed up update_memory_state by batching FSRS memory state calculation (#4335)
* Speed up update_memory_state by batching FSRS memory state calculation

* Replace [].as_slice() with &[]

* Improve test to test fsrs param clearing behaviour

* Rename test

* Fix bug introduced during resolving merge conflict

* Update rslib/src/scheduler/fsrs/memory_state.rs

Fix comment

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
2026-03-04 18:23:40 +03:00
Jarrett Ye
5fa8544f23 Fix/don't reschedule suspended cards (#4453)
* Fix/don't reschedule suspended cards

* format
2026-02-11 16:59:47 +07:00
user1823
db811351e5 Fix/Make descending R a pure R sort (#4400)
* Feat/Add pure R-based review sorting orders

https://forums.ankiweb.net/t/follow-up-make-descending-retrievability-a-pure-r-sort/67082

* cleanup

* fix

* Update test
2026-02-11 16:54:37 +07:00
Luc Mcgrady
c12fe7c507 Feat/Quantiles for FSRS percentage stats (#4425)
* Added: Difficulty zoom

* Fix: quantiles, Extract: PercentageRange component
(I accidentally staged the second commit before comiting the first)

* Add to retrievability graph

* Fix: Typo

* Fix: Half the percentiles

* Remove 50% option

* Fix: Add minimum bin width

* Revert "Remove 50% option"

This reverts commit 372d15578f.

* Remove magic number

* Fix: tickSize not updated

* unfix sqlite.rs

* remove console.log
2026-02-11 16:37:55 +07:00
Jarrett Ye
d64ced8846 Fix/FSRS short-term schedule doesn't work with default params (#4412) 2026-02-11 15:56:39 +07:00
Yuuki
3d813c83c3 Adding Tests for the Card Generation in the Rust side (#4551)
* Adding Tests for the Card Generation in the Rust side

* Fix rustfmt formatting
2026-02-10 17:00:04 +03:00
Yuuki
c41668026f Fix {{#Tags}} conditional not generating cards. Fixes #4522 (#4533) 2026-02-09 21:07:57 +03:00
Brett Schwartz
046063595d Add regression test for #1909 (media check long filenames) (#4476)
* Add regression test for #1909 (long filename rename not reported as unused)

* Add Brett Schwartz to CONTRIBUTORS

* Use MAX_MEDIA_FILENAME_LENGTH constant and 'a'
2026-01-17 16:19:02 +03:00
Abdo
93c44335f6 Update to Rust 1.92 (#4461)
* Update to Rust 1.90

* Fix clippy errors

* Update to 1.92

* Update cargo-deny again

Deno crate was using a CVSS version 4.0, which wasn't supported

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2026-01-11 18:50:16 +07:00
Luc Mcgrady
62252f7216 Fix/Retrievability SQL (#4424)
* Fix/SQL Retrievability Underflow

* Added: Reminder

* ./check

* Apply code diff changes

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

* Slight cleanup

* fix bug again

* extra label comment

* Update rslib/src/storage/sqlite.rs

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

* Fix: Ignore new cards

* use const

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
2025-12-16 19:51:13 +03:00
llama
a245f8ce61 fix(build): treat proto/i18n's implicit outputs as inputs (#4439)
* fix(build): make proto/i18n's implicit outputs explicit

* use option_env! instead of rerun-if-env-changed

> As of 1.46, using env! and option_env! in source code will automatically detect changes and trigger rebuilds.
https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-env-changed

* ditto for STRINGS_PY and STRINGS_TS

* fix comment

* remove space
2025-12-16 19:38:18 +03:00
llama
5614d20bed fix(Import): case-fold media filenames when checking uniqueness (#4435)
* add wrapper struct with case-folding get impl

* use wrapper struct

* restrict case-folding to windows

* Revert "restrict case-folding to windows"

This reverts commit aad01d904f.

* case-fold filenames for newly added media

* add test

* fix incorrect comment
2025-11-20 18:43:14 +03:00
llama
dda192f24c fix(import): support variable field count with notetype column (#4421) 2025-11-19 22:48:14 +03:00
Luc Mcgrady
5d4b00a11d Fix/Per deck retention not used when card is moved to filtered deck (#4413)
* Fix/Per deck retention not used for filtered decks

* improve error

* Perf: prevent double "home_deck" read

* Perf: prevent duplicate database read when home deck
2025-11-10 16:03:53 +03:00
Luc Mcgrady
dac26ce671 Fix/Exclude BackendFrontendService from write_python_interface (#4410)
* Fix/Missing python import in write_header

* Revert "Fix/Missing python import in write_header"

This reverts commit 7c736d984d.

* exclude BackendFrontendService

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2025-10-29 20:15:56 +03:00
jariji
da5b8cb5b4 Show text on occlusion cards regardless of occludeInactive (#4387)
* Show text on occlusion cards regardless of `occludeInactive`.

Before this change, on an image occlusion card, a text box was visible
during editing but not visible during review. This change makes text
visible even if other shapes would be hidden.

* Move fix to render_image_occlusion()

---------

Co-authored-by: jariji <jariji>
Co-authored-by: Abdo <abdo@abdnh.net>
2025-10-29 08:51:55 +03:00
Eltaurus
9eb6ec4db8 Fix unescaped HTML in correct type-in answers (#4407)
* Fix unescaped HTML in correct type-in answers

* unit test for correct answer escaping

* fix string conversion
2025-10-27 19:41:40 +07:00
Arold0
76d3237139 Fix notetype original_stock_kind using wrong enum (#4382)
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
2025-10-09 01:50:50 +03:00
AmandaSternberg-creator
1f9d943c8d Localize FSRS error message and update contributors (#4342)
Co-authored-by: Amanda Sternberg <mandis.sternberg@gmail.com>
2025-10-02 21:52:49 +07:00
Toby Penner
72d83ffc98 Add syntax for multi-card cloze deletions (#4333)
* Add multi-card cloze support

* Add Toby Penner to CONTRIBUTORS
2025-09-28 18:56:07 +03:00
llama
e0b0d0d19b feat: add i18n to launcher (#4361)
* add anki_i18n and locale_config crates to launcher

* add launcher.ftl

* add tr to state

* replace most hardcoded strings with translations

* add support for `launcher` rustcfg to trim translations

* use marker structs to denote type of translations

* move underscores into generated code

* Update cargo-license, which may fix the license order issue (dae)
2025-09-27 16:58:46 +10:00
user1823
b0665a8ef1 Fix/Ensure fuzz doesn't go backward during rescheduling (#4364)
* Fix/Ensure fuzz doesn't go backward during rescheduling

Fixes https://github.com/ankitects/anki/issues/2694

* Fix

* Get previous_interval from LastRevlogInfo

* Fix

* Format

* Format

* Exclude lapses

* Force reconfigure in CI

The cached build.ninja may reference files that don't exist in the PR.
On a local build this tends to auto-fix itself as the build scripts detect
a quick failure and re-run the configure, but CI tends to be too slow.

https://github.com/ankitects/anki/pull/4364#issuecomment-3338026129

* Rename min/max to make it clear they restrict interval, not fuzz

* Wording tweaks/comments for clarity

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2025-09-27 16:43:34 +10:00
user1823
d8aa244a5a Export last_interval to Python (#4365)
* Export last_interval to Python

* Add last_interval field to StatsRevlogEntry

* Implement last_interval_secs function

* Update last_interval field type in stats.proto

* Update last_interval to use last_interval_secs
2025-09-27 15:58:41 +10:00
Jarrett Ye
03f3a005f4 Fix/first and latest review dates should only consider entries with a rating. (#4360)
* Fix/first and latest review dates should only only consider entries with a rating.

* Update rslib/src/stats/card.rs

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
2025-09-27 15:46:50 +10:00
Jarrett Ye
3a5a2b1afb Improve performance of reviews_for_fsrs function (#4339)
* Refactor reviews_for_fsrs function for improved performance

Replaced the previous implementation with a more efficient approach using a single loop and pre-allocated vectors. This change reduces the complexity of creating FSRSItems and enhances overall performance, especially for larger datasets.

* collapse `if` statement

* When not training, only create the final FSRS item
2025-09-27 15:37:24 +10:00
llama
436590f4c2 feat: add support for tag:nc:... searches (#4344)
* feat: add support for `tag:nc:...` searches

* add test
2025-09-25 07:11:07 +03:00
llama
c56e6e55ec feat: show saved custom colours as options in fill tool colour picker on mobile (#4348)
* add GetCustomColours rpc method

* save colours as rgb instead of argb

* show saved custom colours as possible options in colour picker

this is primarily for mobile clients, as qt currently ignores this

* save custom colours on colour picker change (for desktop)
2025-09-25 06:34:27 +03:00
Luc Mcgrady
9e415869b8 Fix/Add lower review limit to health check. (#4334) 2025-09-17 14:04:27 +10:00
maxr777
5280cb2f1c Enable nc: to only search in a specific field (#4276) (#4312)
* Enable nc: to only search in a specific field

* Add FieldSearchMode enum to replace boolean fields

* Avoid magic numbers in enum

* Use standard naming so Prost can remove redundant text

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2025-09-04 11:52:08 +10:00
llama
153b972dfd Show the number of cards added when adding (#4310)
* modify `generate_cards_for_note` to return count

* modify `add_note` to return count

* show the number of cards added when adding
2025-09-02 18:06:49 +10:00
Jarrett Ye
4ac80061ca Add desired_retention field to NormalDeckSchema11 (#4292)
* Add desired_retention field to NormalDeckSchema11

* pass ci
2025-09-02 17:55:23 +10:00
Jarrett Ye
4fdb4983dd Fix/recompute memory state when deck-specific DR is changed (#4293) 2025-09-01 15:07:35 +10:00
Damien Elmes
71ec878780 Fixes for Rust 1.89
Closes #4287
2025-09-01 14:55:49 +10:00
user1823
6dd9daf074 Increase randomness in random sorting of new cards (#4286)
* Increase randomness in random sorting of new cards

Currently, the new cards appear roughly in the same order on consecutive days (if they are skipped by burying). This change aims to increase randomness by spreading out the salt across the hash space.

* Fix errors
2025-09-01 14:22:27 +10:00
user1823
3b33d20849 Fix LRT database check for cards with no usable reviews (#4284)
Fixes https://forums.ankiweb.net/t/anki-25-08-beta-3/64738/62
2025-09-01 14:19:36 +10:00