Commit graph

1881 commits

Author SHA1 Message Date
RumovZ
cf28ec1437 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
Damien Elmes
e5153fde78 Fix some build steps being re-run a second time unnecessarily 2023-11-13 13:35:54 +10:00
Abdo
cb9d5218f7 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
48d38bb9af Show due date of buried/suspended cards in card info (#2820)
* Show due date of buried/suspended cards in card info

* Simplify match and handle relearning cards

* Omit ctype checks

* Test due, not card.due (dae)
2023-11-13 10:23:46 +10:00
Damien Elmes
b989c98639 Update fsrs-rs 2023-11-13 10:13:20 +10:00
Abdo
92b88fc3e2 Move anki.utils.html_to_text_line() to backend (#2816) 2023-11-09 09:57:23 +10:00
Damien Elmes
7bcb31b65b Check video tags in media check
https://forums.ankiweb.net/t/video-tag-does-not-recognize-the-source-file-in-check-media/36850/2
2023-11-08 14:00:41 +10:00
Damien Elmes
3c31386c1f Change color of info box depending on retention; increase limit to 0.99
Closes #2803
2023-11-07 13:05:43 +10:00
Damien Elmes
a2adbf0bf2 Expose fuzz delta for FSRS add-on 2023-11-06 12:27:53 +10:00
Damien Elmes
4cbb9a36d2 Remove redundant FSRS revlog code
Closes https://github.com/open-spaced-repetition/fsrs-rs/issues/113
2023-11-06 09:44:07 +10:00
Damien Elmes
c22cf9fc50 Handle stability < 0.5 in stability graph 2023-11-05 13:44:39 +10:00
Gustaf-C
5ff618b7ac 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
aa5ccad26e Fix panic when enabling FSRS with add-on-rescheduled cards
https://forums.ankiweb.net/t/error-upon-fsrs-activation-on-anki-23-10/36488
2023-11-03 10:07:47 +10:00
RumovZ
2d03f6a55c Time out after 60s when checking URLs (#2785) 2023-11-01 07:46:49 +10:00
Damien Elmes
2b07464ca4 Fix D/R graphs excluding values of 1.0
Closes #2783
2023-10-29 07:45:10 +10:00
Damien Elmes
dbfbd356f1 Fix sm2_retention getting reset on downgrade/sync 2023-10-28 14:45:24 +10:00
Damien Elmes
04b5f53896 Expose method to check for v2 as well 2023-10-27 02:47:04 +10:00
Damien Elmes
9b496816b2 Don't lock collection while generating TTS 2023-10-26 11:45:17 +10:00
Damien Elmes
301405da5c Revert "Use scheduling flag instead of checking revlog when importing decks (#2730)"
This reverts commit 068d79329e.

The previous change breaks the assumption on this line:

                DeckKind::Filtered(_) => unreachable!(),

This will likely need a bigger refactor to handle this properly, and separate
out importing of deck configs from other scheduling data.
2023-10-26 11:23:24 +10:00
Damien Elmes
4b05cda8e2 Add public method to determine if v3 is enabled 2023-10-25 11:41:05 +10:00
Abdo
ebcbed1b83 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
c9eb57ec7a Add image occlusion to stock notetypes 2023-10-22 11:00:39 +10:00
Aristotelis
e4d904444d Add ordinals to IO clozes (#2763)
Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
2023-10-22 10:52:22 +10:00
Damien Elmes
cdf8fcaaaf Fix browser query not matching stats
- Round instead of floor when binning
- Account for rounding in search

https://forums.ankiweb.net/t/anki-23-10-release-candidate/35967/4
2023-10-21 12:00:43 +10:00
Damien Elmes
9e218e115b "Notetype" -> "Note Type" in browser column
While we may want to update things in the other direction in the future
(https://github.com/ankitects/anki/pull/1456#issuecomment-951767922),
this is more consistent with the existing other strings

Closes #2754
2023-10-21 11:35:30 +10:00
Gustaf-C
5c8bcd577d Tweak browser column labels to card type, note type (#2751)
* Tweak browser column labels to card type, note type

* Apply suggestions from code review
2023-10-20 12:46:09 +10:00
Aristotelis
8726ef8fff 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
Sam Waechter
6547376845 Trim extra colons on conversion to NativeDeckName (#2748)
This fixes issue #2692. Leading/trailing colons are remove along with whitespace so " : : :foo:bar: : : " becomes "foo:bar"
2023-10-19 13:42:57 +10:00
Abdo
b09bf31748 Fix misleading warning when changing notetype from/to cloze (#2744) 2023-10-18 16:50:32 +10:00
Damien Elmes
695bb9e291 Update to latest fsrs 2023-10-18 09:03:23 +10:00
Damien Elmes
e41e7cc508 Fix stuttering in FSRS progress display 2023-10-14 14:03:20 +10:00
Abdo
10966394fd 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
068d79329e Use scheduling flag instead of checking revlog when importing decks (#2730)
Closes #2714
2023-10-14 10:30:20 +10:00
Damien Elmes
ec8990dc11 Use sm2 retention when deriving memory state
Closes #2702
2023-10-13 10:37:35 +10:00
Abdo
495dc4d87c 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
3a52080eeb 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
Damien Elmes
eaff6b466b Rust 1.73 2023-10-09 19:22:43 +10:00
Damien Elmes
bd6f0d2d92 Fix 'PanicException: command requires weights to be set' 2023-10-09 18:39:18 +10:00
Damien Elmes
6394a449bc Fix 'Expression tree is too large' when user has many decks
+ Allow 'did:' searches to match multiple decks at once
2023-10-09 18:39:18 +10:00
Damien Elmes
3738d9ce28 Apply tag fix from Abdo
https://forums.ankiweb.net/t/drag-and-drop-tag-groups-crashes-anki/35505/3
2023-10-09 13:55:37 +11:00
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
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
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
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
cf69ca38ad Allow cards with no learning history when not training 2023-09-30 16:10:23 +10:00