Commit Graph

2000 Commits

Author SHA1 Message Date
Abdo
55d68c01d8
Shuffle identical values in filtered deck sort (#3259)
* Shuffle identical values in filtered deck sort

* Update test
2024-06-28 18:53:16 +07:00
Damien Elmes
f98fbbf298 Revert "Ensure minimum doesn't exceed maximum"
This reverts commit 37ce4e842601dc4198556c6157d0ddb61dfbe39c.

Also remove a stale comment that is no longer relevant after
b8ec76fb66
2024-06-28 19:49:23 +08:00
Jarrett Ye
6d13221ae5
Remove threshold of compute minimum recommended retention (#3246)
* remove threshold of compute minimum recommended retention

* update tool tip of compute-optimal-retention

* cargo clippy --fix

* Update FsrsOptionsOuter.svelte

* Remove 'from 0 cards' reference (dae)
2024-06-28 18:26:39 +07:00
user1823
8d11a909ed
Fix FSRS easy interval being same as good interval in relearning cards (#3256)
* Fix FSRS easy interval being same as good interval in relearning cards

https://github.com/ankitects/anki/pull/3236#issuecomment-2187787774

* Update relearning.rs

* Update relearning.rs

* Set min interval of easy to Good + 1

* Ensure minimum doesn't exceed maximum (dae)

With a maximum interval set, it would be possible to confuse with_review_fuzz()
by passing min > max.
2024-06-28 18:20:45 +07:00
James Elmore
930c97b1c7
Fix Renaming note fields not updating custom browser appearance (#3245)
* Added methods to parse browser templates

* Added method to get parsed browser templates

* Make field rename check browser templates for field updates

* Update tests

* Updated CONTRIBUTORS

* Formatting

* Refactored cloze field logic for question template into closure

* Refactored cloze field logic for answer template into closure
2024-06-24 08:39:56 +01:00
Jarrett Ye
79917bbd2d
Fix/Relearning cards' Intervals don't update after changing Desired Retention (#3236)
* Fix/Relearning cards' Intervals don't update after changing Desired Retention

* cargo clippy --fix
2024-06-22 10:44:02 +01:00
Abdo
e0a3768bf3
Mention missing field's name in CardTypeError (#3225) 2024-06-06 11:20:19 +01:00
Abdo
06f7aa393d
Add a preference to toggle LaTeX generation (#3218)
* Add a preference to toggle LaTeX generation

* Fix test

* Remove LaTeX security restrictions

* Show existing LaTeX images regardless of preference

* Lift config check out of loop (dae)

* Shift option to review settings; display warning when disabled (dae)
2024-06-01 09:26:28 +01:00
Voczi
9e3a34f17f
Add support for custom certificates (#3203)
* Add support for custom certificates

* Update lints

* Update licenses

* Changes after feedback

* More changes
2024-05-24 10:57:54 +01:00
user1823
1957566c39
Reschedule → Reposition (#3209) 2024-05-24 10:48:03 +01:00
Jarrett Ye
2b890b0eee
Fix/ignore revlogs when there is not learn entry after the last forget entry (#3199) 2024-05-17 06:07:15 +01:00
Jarrett Ye
c9dccb5217
Fix/exclude suspended cards when optimize all presets (#3198) 2024-05-15 13:12:52 +01:00
Abdo
ce8ddc84b9
Fix finished preview learning cards being repeated (#3196) 2024-05-15 12:55:25 +01:00
Abdo
df004b0b0c
Do not clear unused parent tags (#3174)
* Do not clear unused parent tags

* Update rslib/src/storage/note/mod.rs (dae)
2024-05-06 23:49:59 +10:00
Jarrett Ye
c9c7a3133c
Use median in calculating cost and remove outliers (#3181)
* Use median in calculating cost and remove outliers

* extract fn median_secs
2024-05-02 20:16:04 +10:00
Abdo
22ac77896f
Show review count for Evaluate/Optimize button (#3170)
* Revert "Show review count with FSRS evaluation results (#3165)"

This reverts commit b7e782c7e1.

* Show review count for Evaluate/Optimize button
2024-05-01 17:02:59 +10:00
Abdo
b7e782c7e1
Show review count with FSRS evaluation results (#3165) 2024-04-25 17:10:41 +10:00
Lucas Scharenbroch
ee8683587a
Add number truncation before back-end translation (#3162)
* Add number-truncation before backend translation

* Round instead of truncate (conform to testcases)

* Add test-case for plural rounding-to-one corner-case

* Move rounding into generated translation code

* Change unit test to test generated function

* Round any number in generation, ignore (int vs float)

(it seems that that type distinction is frequently inaccurate)

* Update formatting
2024-04-24 02:41:40 +01:00
Jarrett Ye
2c9accf595
update optimal retention and parameters tooltip (#3148)
* update optimal retention and parameters tooltip

* Revert "update optimal retention and parameters tooltip"

This reverts commit 32fdc5c1c3aea38461bef8fb31c28bcefd9d4190.

* update optimal retention and parameters tooltip

* check num of revlogs at first

* use new translation string

* Update deck-config.ftl

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

* Update deck-config.ftl

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

* Update deck-config.ftl

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

* Update ftl/core/deck-config.ftl

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

* fix position of translation string

* Update deck-config.ftl

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>

* Update deck-config.ftl

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>

* Update deck-config.ftl

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2024-04-24 02:38:52 +01:00
Abdo
351aa96dfc
Fix IO text size in review screen (#2986)
* Store relative font size

* Handle multi-line text

Thanks to @glutanimate
2024-04-17 20:45:40 +10:00
Jarrett Ye
d1b2ab5983
Return current weights if fsrs items is zero & handle error in evaluation and optimal retention (#3141)
* return current weights if fsrs_items is zero

* handle error of evaluation if items.is_empty()

* TODO: handle error of optimal retention

* Revert "TODO: handle error of optimal retention"

This reverts commit 80a5b3803ef4b8270d13aabb9a832291b55d4847.

* Revert "handle error of evaluation if items.is_empty()"

This reverts commit 7f0a5570e74ba5236fc02942550b4e00046b71bc.
2024-04-17 20:18:00 +10:00
Loudwig
d8f2782c26
Feature Show Reminder before answer (#3064) (#3119)
* Feature Question Action Show Reminder (#3064)

Added a option in the deck config that allow the user to choose in
Autoupdate mode between showing a reminder or revealing the card.
Also added my name to the contributors

* Update ftl/core/deck-config.ftl
2024-04-13 08:39:50 +01:00
Jarrett Ye
10d567f937
Update to FSRS-rs v0.6.1 (#3106)
* update to FSRS-rs 0.6.0

* update to crates.io version

* format

* update to FSRS-rs v0.6.01

* ./ninja fix:minilints

* update python backend code
2024-04-05 13:04:50 +01:00
jthulhu
3cd8c5700b
Corrected minor non-idiomatic snippet of code (#3108)
* Corrected minor non-idiomaticity.

* Added to CONTRIBUTORS.
2024-04-01 11:34:23 +01:00
Mani
038a0189d0
highlight io shapes in answer side (#3098) 2024-03-31 10:14:11 +01:00
Damien Elmes
9f55cf26fc
Switch to SvelteKit (#3077)
* Update to latest Node LTS

* Add sveltekit

* Split tslib into separate @generated and @tslib components

SvelteKit's path aliases don't support multiple locations, so our old
approach of using @tslib to refer to both ts/lib and out/ts/lib will no
longer work. Instead, all generated sources and their includes are
placed in a separate out/ts/generated folder, and imported via @generated
instead. This also allows us to generate .ts files, instead of needing
to output separate .d.ts and .js files.

* Switch package.json to module type

* Avoid usage of baseUrl

Incompatible with SvelteKit

* Move sass into ts; use relative links

SvelteKit's default sass support doesn't allow overriding loadPaths

* jest->vitest, graphs example working with yarn dev

* most pages working in dev mode

* Some fixes after rebasing

* Fix/silence some svelte-check errors

* Get image-occlusion working with Fabric types

* Post-rebase lock changes

* Editor is now checked

* SvelteKit build integrated into ninja

* Use the new SvelteKit entrypoint for pages like congrats/deck options/etc

* Run eslint once for ts/**; fix some tests

* Fix a bunch of issues introduced when rebasing over latest main

* Run eslint fix

* Fix remaining eslint+pylint issues; tests now all pass

* Fix some issues with a clean build

* Latest bufbuild no longer requires @__PURE__ hack

* Add a few missed dependencies

* Add yarn.bat to fix Windows build

* Fix pages failing to show when ANKI_API_PORT not defined

* Fix svelte-check and vitest on Windows

* Set node path in ./yarn

* Move svelte-kit output to ts/.svelte-kit

Sadly, I couldn't figure out a way to store it in out/ if out/ is
a symlink, as it breaks module resolution when SvelteKit is run.

* Allow HMR inside Anki

* Skip SvelteKit build when HMR is defined

* Fix some post-rebase issues

I should have done a normal merge instead.
2024-03-31 09:16:31 +01:00
Jarrett Ye
15506328e9
rename sm2 retention to historical retention (#3101)
* rename sm2 retention to historical retention

* ninja format

* keep sm2_retention in DeckConfSchema11

* update wording

* Update schema11.rs
2024-03-29 09:34:26 +00:00
Damien Elmes
c1877f9df6 Fix incorrect search results after preset used
https://forums.ankiweb.net/t/anki-24-04-beta-rc/41792/129
2024-03-29 13:19:15 +07:00
ijqq
22559929f9
Replace deprecated method chrono::NaiveDateTime::timestamp_millis (#3097)
* Replace deprecated method `chrono::NaiveDateTime::timestamp_millis`

* Update CONTRIBUTORS
2024-03-28 08:30:02 +00:00
laalsaas
798d9df4de
sync-server: add option to store hashed passwords (#3083) 2024-03-26 07:39:57 +00:00
Jarrett Ye
74a603e61b
use rmse in comparing parameters (#3087) 2024-03-24 08:28:15 +00:00
Damien Elmes
8fc4225b29 Update translations, and full sync -> one-way sync 2024-03-21 10:17:24 +07:00
Damien Elmes
656cfe0b9c When updating all FSRS parameters at once, exclude suspended cards 2024-03-20 12:56:36 +07:00
Jarrett Ye
8d197a1555
Feat/fsrs simulator backend part (#3075)
* [WIP] FSRS simulator

* add desired_retention as input

* cargo fmt

* fix format

* add standard copyright header

* support existing cards

* fix format

* pass days_elapsed into Card::convert & return None
2024-03-18 13:42:38 +00:00
Damien Elmes
e9d3b46d47 Shift FSRS optimization into top level; shown optimize all tip after 30 days 2024-03-17 17:46:26 +07:00
Brayan Oliveira
1bd6d2883e
fix: cloze_numbers_in_string treating {{c0::}} as valid (#3059)
* fix: cloze_numbers_in_string treating `{{c0::}}` as valid

* Update rslib/src/cloze.rs

Co-authored-by: Abdo <abdo@abdnh.net>

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2024-03-12 15:51:13 +07:00
Jarrett Ye
8c9d7d64d9
refactor optimal retention to minimize workload per memorization & fix progress goes backwards (#3065)
* Feat/optimal retention for minimal workload per memorization

* ./ninja fix:minilints

* update to FSRS-rs 0.5.2

* update to FSRS-rs 0.5.3

* ./ninja fix:minilints

* 'estimated retention' -> 'predicted optimal retention'; add warning (dae)
2024-03-11 16:16:37 +07:00
Jarrett Ye
f2acf40221
alert when the resp.weights is empty (#3061)
* alert when the resp.weights is empty

* format
2024-03-09 10:26:59 +00:00
Jarrett Ye
055b6e30f8
update FSRS-rs to 0.5.0 & export benchmark API (#3056)
* update fsrs to 0.4.5

* update to fsrs 0.4.6

* add benchmark API

* update fsrs to 0.5.0

* cargo fmt

* ./ninja fix:minilints

* ./ninja format

* Add a brief comment about the new method (dae)
2024-03-08 12:37:06 +00:00
Abdo
9228c87b3a
Show preset and original deck in card info (#3055)
* Show preset and original deck in card info

* Make original_deck optional
2024-03-07 07:47:55 +00:00
Jarrett Ye
eb597475c5
Fix/set pretrain_only by fsrs_items (#3051)
* Fix/set pretrain_only and insufficient reviews based on fsrs_items

* use review_count for FsrsInsufficientReviews

* Update weights.rs

* Update weights.rs
2024-03-05 07:54:34 +00:00
Jarrett Ye
c7556f17e6
update fsrs to 0.4.4 (#3045)
* update fsrs to 0.4.4

* fix bypassed_learning_is_handled
2024-03-03 14:30:34 +07:00
Damien Elmes
4fc535ec88
Dependency updates (#3040)
* Update JS deps

* Update semver-compat Rust deps

* Update some semver-incompat Rust deps

- hyper/axum held back because reqwests is not ready
- rusqlite held back due to burn-rs incompat version
- wiremock held back due to compile issue

* pylint wants changes to our _rsbridge.pyi

* Update Python deps

Also solves a security warning in orjson

Reformat with latest black
2024-02-28 16:28:04 +07:00
Abdo
60f8399aed
Show total review count when optimizing FSRS parameters (#3027)
* Show total review count when optimizing FSRS parameters

* Do not expose items
2024-02-26 13:27:22 +07:00
Jarrett Ye
103ea6ded0
clamp interval before fuzz_bounds (#3024)
* clamp interval before fuzz_bounds

* update unit test of with_review_fuzz
2024-02-25 12:18:01 +07:00
Viktor Ricci
68b374e65f
Fix regex skipping over all src except the last (#3021)
Adapting HTML_MEDIA_TAGS to allow for `>` inside '' and "" led to
multiple images inside a field sometimes being disregarded and
marked as "unused". This seems to have been caused by a missing
lazy (?) quantifier for the regex part skipping over non-`>`.
2024-02-24 15:27:38 +07:00
Abdo
6843d65ed1
Check required review count for FSRS after filtering (#3019)
* Check for required review count for FSRS after filtering

* Remove unreachable check

* Update minimum review count in optimal retention calculation

* Fix review check in optimal retention routine too
2024-02-24 14:53:38 +07:00
Luc Mcgrady
8b18a08b3b
FSRS - Ignore revlogs before date while optimizing (#2922)
* Added: Date input button

* Added: ignoreDate to config

* Added: Backend

* Optimize function passes value

* Fix: Spelling

* Moved: filter logic from revlog_for_srs to update_memory_state

* fmt

* Copyright header

* ./check

* Fix: Test

* Renamed: Ignore_date -> Ignore_before_date

* Neaten parameters

* evaluate weights

* ./check

* Optimize all presets

* Added: Label localizations

* Removed globe label

* Added: Tooltip

* Changed error type

* fmt

* Moved filter to own function

* missing function call replacement

* Fix: Typo

* Apply suggestions from code review

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>

* timestamp * 1000 -> timestamp_millis

* ignoreBefore -> ignore_before

* clarified ignore_before variables

* i64 -> TimestampMillis

* Un-traitified remove_revlogs_before

* Added: ms == 0 guard

* Added: Ignore_before affects scheduling

* Moved filter to fsrs_items_for_training

* removed filter from revlog_for_srs

* Tuple -> UpdateMemoryStateEntry

* Removed unused function

* Removed superfluous _ms from variables

* cid -> id

* Different ignore method

* Added: Unit test

* cid -> id

* Test: Exact ms edge case

* ./check

* Fix: re-learns could be before ignore date in cards without learning steps

* getignoreRevlogsBeforeMs -> getIgnoreRevlogsBeforeMs

* Removed pub(crate)

* Clarified unit test

* last_learn_entry -> first_of_last_learn_entries

* @user1823's method

* IOS fix

* ./check

* Fix: width defined twice
2024-02-22 11:01:10 +07:00
Damien Elmes
9642a69b88 FSRS items, not revlogs
https://forums.ankiweb.net/t/discrepancy-between-revlog-count-in-optimize-and-evaluate/41224/5
2024-02-19 17:51:07 +07:00
Abdo
2b4cb2992b
Fix deck names differing in case being duplicated in CSV import (#3008) 2024-02-14 20:25:54 +10:00