Commit graph

2255 commits

Author SHA1 Message Date
Luc Mcgrady
8da0491ae5
Refactor PlayAudio 2025-10-31 08:28:39 +00:00
Luc Mcgrady
4897ea8173
Merge remote-tracking branch 'upstream/main' into svelte-reviewer-bottom 2025-10-30 15:49:29 +00:00
Luc Mcgrady
28d41c8a9c
Revert "Fix/Missing python import in write_header"
This reverts commit 385d487220.
2025-10-30 15:49:01 +00: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
Luc Mcgrady
385d487220
Fix/Missing python import in write_header 2025-10-29 14:19:07 +00: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
Luc Mcgrady
45120aef14
Merge branch 'main' into svelte-reviewer-bottom 2025-10-27 21:08:43 +00: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
Luc Mcgrady
b0a8c341a1
add bodyclass field 2025-10-21 15:44:19 +01:00
Luc Mcgrady
dc17cb1e81
add css as field 2025-10-21 15:31:21 +01:00
Luc Mcgrady
6d62fcc096
next_card_data mediasrv function 2025-10-21 15:16:08 +01: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
Luc Mcgrady
a48dcb0bb5
encode_iri_paths 2025-10-07 13:11:12 +01:00
Luc Mcgrady
f49d7d5fd7
use QueuedCards 2025-10-04 22:52:47 +01:00
Luc Mcgrady
953e6c9360
Re-implement answer buttons 2025-10-04 20:50:31 +01:00
Luc Mcgrady
44cc5f82e9
Added: Untested easeButtonPressed 2025-10-04 18:02:21 +01:00
Luc Mcgrady
0db28a7101
Add style 2025-10-04 17:08:43 +01:00
Luc Mcgrady
aa42d87558
Added: NextCardData 2025-10-04 16:29:13 +01: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
Luc Mcgrady
542c557404
Fix/Workload deck_size unset (#4283) 2025-09-01 14:18:30 +10:00
Luc Mcgrady
211cbfe660
Fix/Simulator intervals decending overflows (#4275)
* Fix/Simulator intervals decending overflows

* saturating_sub

* oops
2025-09-01 14:16:40 +10:00
user1823
3e846c8756
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 <gpg@ankiweb.net>
2025-08-20 03:03:53 +10:00
Luc Mcgrady
2879dc63c3
Fix/Learn count not included in workload graph (#4274)
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2025-08-20 02:58:25 +10:00
Damien Elmes
37f7872565 Fix crash when disabling FSRS
https://forums.ankiweb.net/t/anki-25-08-beta-3/64738/51?u=dae
2025-08-19 23:34:09 +10:00
user1823
a0c1a398f4
Improve elapsed seconds calculation for learning cards in browser table (#4255)
* Improve calculation of elapsed seconds for learning cards in browser_table.rs

https://github.com/ankitects/anki/pull/4231/files#r2257105522

* Format
2025-08-09 16:16:36 +10:00
user1823
d3e8dc6dbf
Fix/Exclude new cards from is_due_in_days (#4249)
https://github.com/ankitects/anki/pull/4231/files#r2238901958
2025-08-08 20:28:13 +10:00
Jarrett Ye
62e01fe03a
Fix Cards with Missing Last Review Time During Database Check (#4237)
* Fix Cards with Missing Last Review Time During Database Check

* clippy

* Apply suggestions from code review

Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>

* Apply suggestions from code review

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

* Add is_reset method to RevlogEntry and update scheduling logic

This commit introduces the `is_reset` method to the `RevlogEntry` struct, which identifies entries representing reset operations. Additionally, the scheduling logic in `memory_state.rs` and `params.rs` has been updated to utilize this new method, ensuring that reset entries are handled correctly during review scheduling.

* Implement is_cramming method in RevlogEntry and update scheduling logic

This commit adds the `is_cramming` method to the `RevlogEntry` struct, which identifies entries representing cramming operations. The scheduling logic in `params.rs` has been updated to utilize this new method, improving the clarity and maintainability of the code.

* Refactor rating logic in RevlogEntry and update related scheduling functions

This commit introduces a new `has_rating` method in the `RevlogEntry` struct to encapsulate the logic for checking if an entry has a rating. The scheduling logic in `params.rs` and the calculation of normal answer counts in `card.rs` have been updated to use this new method, enhancing code clarity and maintainability.

* update revlog test helper function to assign button_chosen correctly

* Refactor card property fixing logic to use CardFixStats struct

* Add one-way sync trigger for last review time updates in dbcheck

* Update documentation for is_reset method in RevlogEntry to clarify ease_factor condition

* Apply suggestions from code review

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

* Minor wording tweak

---------

Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>
Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
2025-08-06 19:49:30 +10:00
user1823
5c6e2188e2
Limit time studied today to minutes (#4242)
* Limit time studied today to minutes

* Update timespan.rs

* Update today.rs

* Update timespan.rs

* Update today.rs

* Update today.rs

* Update time.ts

* Update time.ts

* Update timespan.rs

* Update timespan.rs

* Update timespan.rs

* Update today.rs
2025-08-06 19:30:44 +10:00
Luc Mcgrady
402008950c
Feat/expected_workload_with_existing_cards implementation (#4243)
* https://github.com/open-spaced-repetition/fsrs-rs/pull/355

* add is_included card

* bump version

* ./check

* update package.lock

* parallellify

* bump fsrs
2025-08-06 18:01:06 +10:00
Luc Mcgrady
f7e6e9cb0d
Feat/Card stats update review time (#4236)
* Feat/Card stats update review time

* Update rslib/src/stats/card.rs

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

* fix

* self.storage.update_card

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
2025-08-06 17:55:50 +10:00
Jarrett Ye
2b55882cce
Fix/use real step count to simulate (#4240)
* Fix/use real step count to simulate

* Update licenses.json
2025-08-04 16:01:26 +10:00
user1823
f7974568c9
Update stale comment (#4235) 2025-08-04 15:31:22 +10:00
Jarrett Ye
4dc00556c1
Fix/use current_retrievability_seconds in SQL to keep consistent with card info (#4231)
* Feat/use current_retrievability_seconds in SQL

* replace `days_since_last_review` with `seconds_since_last_review`

* Update is_due_in_days logic to include original or current due date check
2025-07-28 19:06:20 +10:00
Luc Mcgrady
c947690aeb
Feat/Use cached workload values (#4208)
* Feat/Use cached workload values

* Fix: Calculation when unchanged

* Modify constants

* Cache clearing logic

* Use function params

* use https://github.com/open-spaced-repetition/fsrs-rs/pull/352

* Revert "use https://github.com/open-spaced-repetition/fsrs-rs/pull/352"

This reverts commit 72efcf230c.

* Reapply "use https://github.com/open-spaced-repetition/fsrs-rs/pull/352"

This reverts commit 49eab2969f.

* ./check

* bump fsrs
2025-07-28 19:00:16 +10:00