Commit Graph

347 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
Abdo
4ef389b580
Keep previous FSRS parameters if they get worse when optimizing (#2996)
* Update to fsrs-rs 0.3.0

* Keep previous FSRS parameters if they get worse when optimizing
2024-02-11 16:26:04 +10:00
Abdo
80c14aa6e9
Maintain original IO cloze order in editing mode (#2987)
* Maintain original IO cloze order in editing mode

* Fix ordinal propery name
2024-02-07 13:42:47 +10:00
Abdo
eab5c02251
Add by creation date review sort order (#2957)
* Add by creation date review sort order

* Order by template after nid in ReverseAdded of filtered decks too
2024-01-21 20:29:19 +10:00
Damien Elmes
bf06020855
Use card.reps - 1 when calculating fuzz (#2933)
https://github.com/open-spaced-repetition/fsrs4anki-helper/issues/343#issuecomment-1879584562

https://forums.ankiweb.net/t/reschedule-is-inconsistent-with-normal-schedule-in-fuzz/39363
2024-01-09 12:26:46 +10:00
Damien Elmes
4678b0cc4a Use seconds instead of minutes for preview delay
Since this is not compatible with older clients, preview_delay has been
brought back so the configured value will still sync.
2023-12-21 11:02:29 +10:00
Damien Elmes
e778cba089 Allow user to configure hard/good buttons when rescheduling off
Closes #2858
2023-12-08 11:04:34 +10:00
Gustaf-C
63260631e4
Include elapsed_secs in learning card state (#2862)
* Include elapsed_time in learning card state

* Suggested updates, elapsed_time -> elapsed_secs

* Remove outdated comment
2023-12-06 16:40:22 +10:00
Damien Elmes
063b6f60fd Rework error dialog
- Hide traceback
- Include full add-on info in 'copy debug info' button, like about
screen
- Link to troubleshooting page
- Use non-modal pop-up in the common case, to avoid potential conflicts
with other modals.

Closes #2830
2023-11-29 10:25:32 +10:00
Damien Elmes
8b6abd3f8f Switch FSRS reschedule to a global option; don't persist
A global is easier to use in conjunction with the 'optimize all' action.
The value is no longer persisted, as doing so makes it too easy for users
to generate a lot of revlog entries when playing with different FSRS
weights/retention settings, such as in https://forums.ankiweb.net/t/possible-syncing-limitation-by-fsrs-manual-scheduling-data-accumulation/37610
2023-11-27 11:24:31 +10:00
Damien Elmes
452e012c71 Add option to calculate all weights at once 2023-11-27 11:24:31 +10:00
Mani
be1f889211
fixes: remove unfinished shapes, remove selectable and make shapes remain inside canvas (#2809)
* remove unfinished polygon and remove selectable for shapes in polygon mode

* make group and polygon position remain inside canvas area

* click through transparent area in grouped object

* add some shortcuts for basic usages

* tools button icon in center & switch mode border

* fix load svg image

* basic rtl support, panzoom have issues in rtl mode

* better zoom option both in ltr and rtl

* handle zoom event in mask editor

* add h button to handle toggle mask

* add more mime type

* use capital M (shift+m) for toggle mask

* allow io shortcuts in mask editor only

* make other shapes also remain in canvas bound area

* better zoom implementation, zoom from center
add zoom to resize event listener

* add a border to corner to handle blend of control

* add refresh button to go to  selection menu

* add tooltip to shortcuts and also add shortcut for other tools

* make opacity remain in same state when toggled on

* opacity for group/ungroup objects

* update shortcuts implementation
2023-11-24 14:06:40 +10:00
Damien Elmes
366f78715b Include next_day timestamp in revlog export 2023-11-23 14:46:48 +10:00
Damien Elmes
a9d73fc3be Add a method for exporting revlogs in binary 2023-11-22 11:57:40 +10:00
Abdo
390935d4ea
Persist FSRS weights search in preset (#2827) 2023-11-14 11:47:08 +10:00
RumovZ
39a60bc3a4
Allow applying limits of inactive parents (#2824)
* Allow applying limits of inactive parents

* Tweak label/help text (dae)
2023-11-13 14:30:19 +10:00
RumovZ
f200d6248e
Allow im-/exporting with or without deck configs (#2804)
* Allow im-/exporting with or without deck configs

Closes #2777.

* Enable webengine remote debugging in launch.json

* Reset deck limits and counts based on scheduling

Also:
- Fix `deck.common` not being reset.
- Apply all logic only depending on the source collection in the
gathering stage.
- Skip checking for scheduling and only act based on whether the call
wants scheduling. Preservation of filtered decks also depends on all
original decks being included.
- Fix check_ids() not covering revlog.

* Fix importing legacy filtered decks w/o scheduling

* Disable 'include deck options' by default, and fix tab order (dae)

* deck options > deck presets (dae)
2023-11-13 13:54:41 +10:00
Abdo
ae7b14bf40
Add auto-advance options to deck preset (#2765)
* Move stop-timer-on-answer strings to correct section

* Add auto-advance options to deck preset

* Implement answer actions

* Fix error when last card is answered before timeout

* Fix deserialization of answerAction

* Add answerAction to reserved key list

* Fix inverted boolean

* Add option to wait for audio to finish

* Add auto-advance toggle

* Add shortcut

* Disable auto-advance when main window state changes

* Start auto-advance timer after option is toggled

* Disable auto-advance when main window loses focus

* Use existing translations

* Add Answer Hard and Show Reminder
2023-11-13 10:41:51 +10:00
Abdo
6a2d1f94d4
Move anki.utils.html_to_text_line() to backend (#2816) 2023-11-09 09:57:23 +10:00
Damien Elmes
9268dce707 Expose fuzz delta for FSRS add-on 2023-11-06 12:27:53 +10:00
Gustaf-C
e071fb471b
Allow creation of empty filtered decks (#2788)
* Add new button to UI

* Add bool to allow creating empty filtered in back end

* Implement logic into front end for passing on bool

* Hide option on old decks

* Show option again if any settings are changed

* Revert "Show option again if any settings are changed"

This reverts commit 094acd9c65936823fa206594da5c1f3e4eb09248.

* Revert "Hide option on old decks"

This reverts commit d20a9a240b4fd85d080e8cc52d94318416ca753f.

* Update string

* Update ftl/core/decks.ftl

---------

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2023-11-05 12:23:14 +10:00
Damien Elmes
633d246306 Don't lock collection while generating TTS 2023-10-26 11:45:17 +10:00
Abdo
14940a617b
Fix IO groups breaking upon editing (#2766)
* Fix IO groups breaking upon editing

* Emit change signal after group/ungroup
2023-10-23 09:43:31 +10:00
Damien Elmes
9bbc6c9405 Add image occlusion to stock notetypes 2023-10-22 11:00:39 +10:00
Aristotelis
c828a2eb6f
Add APIs for IO card rendering (#2739)
* Refactor: Add index to shapes package

* Add shape draw callback API to setupImageCloze

* Expose IO drawing API, switch away from image cloze naming

We currently use "image occlusion" in most places, but some references to "image cloze" still remain. For consistency's sake and to make it easier to quickly find IO-related code, this commit replaces all remaining references to "image cloze", only maintaining those required for backwards compatibility with existing note types.

* Add cloze ordinal to shapes

* Do not mutate original shapes during (de)normalization

Mutating shapes would be a recipe for trouble when combined with IO API use by external consumers.

(makeNormal(makeAbsolute(makeNormal())) is not idempotent,
and keeping track of the original state would introduce
additional complexity with no discernible performance benefit
or otherwise.)

* Tweak IO API, allowing modifications to ShapeProperties

* Tweak drawShape parameters

* Switch method order

For consistency with previous implementation

* Run Rust formatters

* Simplify position (de)normalization

---------

Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
2023-10-20 09:36:46 +10:00
Abdo
bba67fdab4
Fix misleading warning when changing notetype from/to cloze (#2744) 2023-10-18 16:50:32 +10:00
Abdo
5cde4b6941
Remove v1/v2 support from the backend (#2727)
* Remove v1/v2 support from deck list

* Remove v1/v2 support from most routines and show error

* Remove scheduler_version from preferences

* Fix formatting

* Remove v1/v2 conditionals from Python code

* Fix legacy importer

* Remove legacy hooks

* Add missing scheduler checks

* Remove V2 logic from deck options screen

* Remove the review_did_undo hook

* Restore ability to open old options with shift (dae)
2023-10-14 10:50:59 +10:00
Damien Elmes
003cdfd2ec Use sm2 retention when deriving memory state
Closes #2702
2023-10-13 10:37:35 +10:00
Abdo
9e147c6335
Add text tool to image occlusion (#2705)
* Add text tool to IO

* Remove unnecessary parentheses

* Fix text objects always grouped

* Remove log

* Fix text objects hidden on back side

* Implement text scaling

* Add inverse text outline

* Warn about IO notes with only text objects

This will result in a different error message than the case where no
objects are added at all though, and the user can bypass the warning.
Maybe this is better to avoid discarding the user's work if they have
spent some time adding text.

* Add isValidType

* Use matches!

* Lock aspect ratio of text objects

* Reword misleading comment

The confusion probably comes from the Fabric docs, which apparently need updating: http://fabricjs.com/docs/fabric.Canvas.html#uniformScaling

* Do not count text objects when calculating current index

* Make text objects respond to size changes

* Fix uniform scaling not working when editing

* Use Arial font

* Escape colons and unify parsing

* Handle scale factor when restricting shape to view

* Use 'cloned'

* Add text background

* Tweak drawShape's params
2023-10-12 13:40:11 +10:00
Abdo
c052be9e25
Add a backend method to extract static media references (#2716)
* Add a backend method to extract static media references

* Extract into Notetype.gather_media_names()
2023-10-11 14:10:02 +10:00
RumovZ
23f29a6ecc
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
9fd8a8bb40 Add stability graph 2023-10-01 15:44:33 +10:00
Damien Elmes
072cd37b42 Support rescheduling on weight/retention change 2023-10-01 15:20:58 +10:00
Damien Elmes
50c8a1ba9f Update FSRS
- up to 10x performance increase in optimal retention
- expose loss aversion
- use SpinBoxes
2023-09-30 16:10:22 +10:00
Damien Elmes
b8390d096e Shift weight calculation to backend so it can be run in parallel 2023-09-28 09:10:54 +10:00
Damien Elmes
1f55ad1d44
Expose the ability to train weights from items (#2687) 2023-09-28 08:28:24 +10:00