Commit graph

10515 commits

Author SHA1 Message Date
RumovZ
fd94ad49a0 Invalid sorting (#2709)
* Rollback if toggling state fails

Previously, if the search triggered by a state toggle failed, the switch
and the model would move to the new state, while the table would remain
in the previous state.

* Fix reversed sort orders of FSRS columns

* Add sep. default sort orders for notes and cards

* Add test for consistent default sort orders

* Add launch config for debugging in VSC

* Extend launch config for macOS and Linux
2023-10-07 06:36:15 +00:00
Damien Elmes
db6dc5a30f Update FSRS for performance improvement 2023-10-05 16:27:10 +10:00
RumovZ
c7d058aa0b Merge all conflicting notetypes (#2707)
* Refactor import apkg tests

* Merge conflicting notetypes regardless of id match

Original ids are a new thing, and we need to handle previous remappings.
This is done separately from the conflict resolution for notetypes with
matching ids, because 1) we need to look at the notes to determine
conflicts, and 2) we don't want to change the notetype of *all* existing
notes with the conflicting notetype. The main reason is that for 2
existing notes with the same noteype, their incoming counterparts could
have *different* notetypes. So to get rid of all conflicts, they must be
resolved on a note-by-note basis.

* Delete merged, now unused notetypes
2023-10-05 06:18:10 +00:00
Damien Elmes
5977937800 Use 0 when there are no relearning steps; ensure not NaN 2023-10-05 09:55:05 +10:00
Damien Elmes
518dc1f303 Improve Python Protobuf speed
upb was being included in the bundle, but not found at run time due
to src files being embedded in the binary.
2023-10-04 13:36:47 +10:00
dependabot[bot]
0d47830896 Bump postcss from 8.4.24 to 8.4.31 (#2704)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.24 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.24...8.4.31)

---
updated-dependencies:
- dependency-name: postcss
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-04 13:36:35 +10:00
Dominique Martinet
db87b4ed57 Update rust-csv (#2703)
Upstream rust-csv 1.3.0 includes our patch and can be used instead of
the ankitects repo.

This fixes `cargo vendor`
2023-10-04 13:21:47 +10:00
Damien Elmes
db0cb6df8f Update translations 2023-10-03 14:41:11 +10:00
Damien Elmes
facd798000 Clarify stability subtitle
Based on #2699. Closes #2699.
2023-10-03 14:40:41 +10:00
Damien Elmes
c4d00bce05 When the user has no relearning steps, synthesize the value 2023-10-03 13:50:29 +10:00
Damien Elmes
e8154d8678 Ensure fuzz doesn't go backwards
Closes #2694
2023-10-03 13:23:27 +10:00
Damien Elmes
0e50cef207 Show tooltip on sync completion
Closes #2695
2023-10-03 12:57:39 +10:00
Damien Elmes
c07b7915c5 Update translations 2023-10-03 12:39:01 +10:00
Damien Elmes
09030edd40 Update urllib3
Minor CVEs
2023-10-03 12:25:06 +10:00
Damien Elmes
32ca7d237f When learning steps are missing, start from the SM-2 state
Closes https://github.com/open-spaced-repetition/fsrs-rs/issues/87
2023-10-03 12:20:10 +10:00
Damien Elmes
9168e33ac6 Update FSRS crate 2023-10-03 11:28:56 +10:00
Damien Elmes
8731a1f7ce Add stability graph 2023-10-01 15:44:33 +10:00
Damien Elmes
49fcbe8f8f Support rescheduling on weight/retention change 2023-10-01 15:20:58 +10:00
Damien Elmes
1f93e0111f Fix TypeError when deck list or overview refreshes during optimal retention
Caused by legacy code blocking the main thread.

https://forums.ankiweb.net/t/anki-23-10-beta/34912/79
2023-09-30 16:10:23 +10:00
Damien Elmes
cf69ca38ad Allow cards with no learning history when not training 2023-09-30 16:10:23 +10:00
Damien Elmes
6b0bc2ce71 Display the default weights as a placeholder 2023-09-30 16:10:23 +10:00
Damien Elmes
63088b0caf Update FSRS
- up to 10x performance increase in optimal retention
- expose loss aversion
- use SpinBoxes
2023-09-30 16:10:22 +10:00
Abdo
fb9c814e6c Allow creating an image occlusion from the clipboard (#2689)
* Allow creating an image occlusion from the clipboard

* Refactor pasted image name construction into methods

* Reduce button's top padding

* Fix capitalization

* Fix quality parameter of pasted image

* Fix lint errors

* setup_mask_editor_for_file -> setup_mask_editor

* Select -> Paste

* Extract image reading logic

* Fix inlinedImageToFilename
2023-09-29 15:51:44 +10:00
Damien Elmes
a0e32286bb Update incompatible Rust deps 2023-09-28 10:00:47 +10:00
Damien Elmes
8ff65fff81 Update compatible Rust deps
Fixes a CVE in tungstenite
2023-09-28 09:54:56 +10:00
Damien Elmes
d631a7fb9c Shift weight calculation to backend so it can be run in parallel 2023-09-28 09:10:54 +10:00
Damien Elmes
00825d015c Expose the ability to train weights from items (#2687) 2023-09-28 08:28:24 +10:00
Jarrett Ye
742b7a7daa Fix first_rating_count & learn_cost (#2688)
* fix first_rating_count & learn_cost

* Update CONTRIBUTORS

* cargo clippy --fix

* cargo fmt
2023-09-27 18:31:40 +10:00
Damien Elmes
b6039b583f Update translations 2023-09-27 16:37:37 +10:00
Damien Elmes
0530027ec9 Tweak some wordings 2023-09-27 16:37:03 +10:00
Damien Elmes
f1e8f171d4 x% complete 2023-09-27 16:24:25 +10:00
Damien Elmes
170d0c737d Use revlog to determine days_elapsed when studying/for card info
Currently prop searches and the retrievability column will continue to
derive the days from the card only, as it's difficulty to integrate revlog
upgrade lookups into those code paths, especially in a performant way.
One possible way we could solve this in the future is to store last_review_day
in the card data, so we can know it even if the due date has been shifted.
Check DB could fill it in for existing cards.
2023-09-27 16:17:47 +10:00
Damien Elmes
68d4878d55 Fix days_since_last_review() when used in filtered deck 2023-09-27 16:17:47 +10:00
Michael Eliachevitch
e6088c46e3 Button to set desired FSRS retention to optimal/calculated (#2685)
* Draft set optimal/calculated retention button

Temporarily save the calculated optimal retention and display it with a button
that sets the desired retention above to this value.Don't show button until
attention had been calculated. Disable button when optimal and desired
attention are equal.

I find this nicer than the current alert-popup solution, as it avoids a popup
and gives a choice to the user to accept the calculated retention or not, while
also persisting the calculated retention on the screen for a bit.

TODO: What's still missing is that the `optimalRetention` variable is global and
persists when I change presets. When changing presets the variable should reset to
`undefined`, which would also makes the button disappear. Ideally it should also
disappear when changing the FSRS parameters. So probably it should be made part
of some deck options state and subscribe to some events. But with that I might
need some help. Also I thought whether that variable should go into the deck
options schema but tbh it's not something we want to persist between sessions,
users should recalculate it.

* Add me to contributors for tests so pass

* Add formatting ant type fixes to make tests pass

* Minor fixes (dae)

* Remove the period
2023-09-27 16:12:49 +10:00
Abdo
97bd06dc49 Implement "stop timer on answer" as a preset option (#2686)
* Implement "stop timer on answer" as a preset option

* Hide timer setting on AnkiMobile (dae)
2023-09-27 16:10:14 +10:00
Damien Elmes
c9b35c4fc6 Update FSRS; fix handling of invalid revlogs
State is now inferred from SM-2 data when the revlog is not suitable
2023-09-27 13:13:10 +10:00
Damien Elmes
a82021cb05 Fix invalid utf-8 in tags 2023-09-27 10:06:31 +10:00
Damien Elmes
676c5bb3ce Fix optimal retention caps 2023-09-26 14:17:55 +10:00
Damien Elmes
02d6420893 Fix weight computation progress not showing 2023-09-26 14:02:12 +10:00
Michael Eliachevitch
e226f74e42 More sensible lower FSRS progress indicator precision (#2684)
It's very helpful having a sub-permille precision in a progress
indicator, percent-precision or at most a tenth of a percent should be
sufficient for any indicator.

But in particular the compute-retention progress has 10 steps, i.e. the progress
increases in 10%-intervals (10%, 20%, ...), it *cannot* have sub-decimal
progress-percentages, see 2d5b19b494/src/optimal_retention.rs (L365-L368). So there integer percents should be
enough, everything else is misleading.

The compute-weights progress is currently (as of beta-2) not showing up at all.
Maybe if the bug is fixed it can show sub-percent percentages, so for know I changed that
to 0.1% precision. But I think integer percentages should be fine here as well,
so upon request I can fix that.

Also see my comment on this problem in https://forums.ankiweb.net/t/anki-23-10-beta/34912/39.
2023-09-26 14:01:05 +10:00
Abdo
da4d6f547c Match IO extensions in a case-insensitive manner (#2683) 2023-09-26 13:14:59 +10:00
Abdo
babce8ec8c Fix wrong mask position after merging groups (#2682) 2023-09-26 13:14:13 +10:00
Damien Elmes
3a6dd627d7 Allow desired retention to be set to 0.7
https://github.com/open-spaced-repetition/fsrs-rs/issues/79#issuecomment-1733779005
2023-09-26 13:03:49 +10:00
Damien Elmes
189b4f51d6 Fix changes_since_open() 2023-09-26 11:02:16 +10:00
Damien Elmes
a5fff918ec Don't show multiple cancel buttons 2023-09-25 16:40:11 +10:00
Damien Elmes
35bcfa8679 Fix cancel signal being ignored if sent quickly 2023-09-25 16:32:12 +10:00
Damien Elmes
7f787a0e62 Prohibit weight generation when reps < 1000 2023-09-25 16:17:00 +10:00
Damien Elmes
e9f6d181ed Allow cards with no learning history when not training 2023-09-25 15:57:35 +10:00
Damien Elmes
790644de66 UI tweaks
https://forums.ankiweb.net/t/anki-23-10-beta-1/34912/19
2023-09-25 15:54:18 +10:00
Damien Elmes
620a55c6e5 Support retrievability calculation for (re)learning cards 2023-09-25 14:58:39 +10:00