Commit graph

6465 commits

Author SHA1 Message Date
Damien Elmes
869324e9b7 update translations 2021-02-21 18:19:33 +10:00
Damien Elmes
9008ba753e use v2 scheduler+new timezone handling by default for new users
- In corner cases, enabling the new timezone handling later can cause
reviews to shift forward or back a day, so it's best to have it on
by default.
- https://github.com/ankidroid/Anki-Android/issues/5805 has not landed
in a stable release yet, but will hopefully not be too far off by the
time 2.1.41 is released.
- Existing users will be unaffected, as the upgrade prompt in the previous
commit asks them if they use AnkiDroid.
- Users starting on AnkiDroid will be unaffected, as their collections
will still be on V1.
- The error message AnkiWeb gives when syncing an older AnkiDroid
with the new timezone enabled has been updated to direct users to the
preferences screen.
2021-02-21 17:18:08 +10:00
Damien Elmes
125c2b232a rework v2 scheduler upgrade; drop downgrade
- Rework V2 upgrade so that it no longer resets cards in learning,
or empties filtered decks.
- V1 users will receive a message at the top of the deck list
encouraging them to upgrade, and they can upgrade directly from that
screen.
- The setting in the preferences screen has been removed, so users
will need to use an older Anki version if they wish to switch back to
V1.
- Prevent V2 exports with scheduling from being importable into a V1
collection - the code was previously allowing this when it shouldn't
have been.
- New collections still default to v1 at the moment.

Also add helper to get map of decks and deck configs, as there were
a few places in the codebase where that was required.
2021-02-21 15:50:41 +10:00
Damien Elmes
0b310f00b1 Merge pull request #1035 from BlueGreenMagick/sidebar-on-click-index
change _on_click_current to _on_click_index
2021-02-21 10:36:03 +10:00
BlueGreenMagick
400da2e389 Update CONTRIBUTORS
Add email so it recognizes the change of email
2021-02-20 23:11:46 +09:00
bluegreenmagick
8c5ffa5c19 change _on_click_current to _on_click_index
fix bug where clicking on a blank space below sidebar item
would still trigger currentIndex item's click event
2021-02-20 22:58:02 +09:00
Damien Elmes
685b0fefdb initial work on moving v2 card answering into backend
Not plugged into the Python code yet. Still a work in progress.

Other changes:

- move a bunch of From implementations out of the giant backend/mod.rs
file into separate submodules.
- reorder backend methods to match proto order
- fix some clippy lints
2021-02-20 14:48:07 +10:00
Damien Elmes
ac3530a0d1 add some flush() calls and fix a card type in test_schedv2
Will help test when code is moved to backend
2021-02-20 14:00:26 +10:00
Damien Elmes
57d48d4bda stop checking "steps left today" in test_schedv2 2021-02-20 13:59:07 +10:00
Damien Elmes
80f3f43860 fix __repr__ in collection 2021-02-20 13:57:53 +10:00
Damien Elmes
9ee68c974b add issue template config.yml 2021-02-19 14:11:21 +10:00
Damien Elmes
9e61ea77e3 tweak issue template again
re: https://github.com/ankitects/anki/issues/988
2021-02-19 14:06:16 +10:00
Damien Elmes
fa260b8393 tweak issue template 2021-02-19 13:44:14 +10:00
Damien Elmes
be823c39f0 tweak getFile() arguments in editor to be more readable 2021-02-19 10:18:40 +10:00
Damien Elmes
17396dc89b disable card shifting in reposition by default
https://forums.ankiweb.net/t/uncheck-shift-position-of-existing-cards-by-default/7550
2021-02-19 10:09:01 +10:00
Damien Elmes
14fc5bbef6 tidy up doc string 2021-02-19 10:04:57 +10:00
Damien Elmes
ac5efb4775 Merge pull request #1030 from abdnh/col-docs
Add docstrings to find_cards() and find_notes()
2021-02-19 10:00:59 +10:00
abdo
ce48f26f96 Add docstrings to find_cards() and find_notes() 2021-02-17 17:30:38 +03:00
Damien Elmes
5b890d1d6f Merge pull request #1029 from abdnh/tag-repl-fix
Fix tag replacement matching substrings
2021-02-17 15:54:57 +10:00
Damien Elmes
d8a3a0b360 Merge pull request #1028 from hgiesel/imgmaxwidth
Add max-width: 100% to editable.scss
2021-02-17 15:54:01 +10:00
abdo
53f255f1d3 Fix tag replacement matching substrings
https://github.com/ankitects/anki/issues/1027
2021-02-17 03:57:07 +03:00
Henrik Giesel
7c31e7f09d Increase the padding in the editable to 6px 2021-02-16 18:40:58 +01:00
Henrik Giesel
70e09bf70a Add max-width: 100% to editable.scss 2021-02-16 18:28:40 +01:00
Damien Elmes
0b2ee8dcff use add-on id if name is blank
https://forums.ankiweb.net/t/support-for-rtl-layout-in-ankiweb-add-on-page/7522
2021-02-16 11:12:05 +10:00
Damien Elmes
149fcb1355 update translations 2021-02-12 13:45:16 +10:00
Damien Elmes
1e9b891b56 switch 'set due date' to leaving the interval alone for now
The previous approach worked when the user pushes their due date back,
or moves it forward a little bit, but breaks down if they reschedule
shortly after the previous answer - a card that was only just answered
will have had an effective delay of 0, causing the interval to be
reset, which is not great.

I thought about limiting interval reductions, but that means the
behaviour is inconsistent when sending a card forward and moving it
back again.

We could apply a cap to the amount of interval we'll reduce, but that
will either doing something like dividing by 2 (which breaks down when
the action is performed repeatedly), or or looking up the review log
to try and determine the previous interval we should not go below.

One other option we might want to consider in the future is using
the revlog to calculate the actual elapsed time at answer time instead
of reschedule time, falling back to existing behaviour when the revlog
doesn't match or is missing.
2021-02-12 11:19:58 +10:00
Damien Elmes
7ac267a54b Merge pull request #1019 from hgiesel/cardspreviewfix
Note.ephemeral_card() fix
2021-02-12 11:19:46 +10:00
Henrik Giesel
c2410ded9c Remove unused imports 2021-02-12 02:16:05 +01:00
Henrik Giesel
72253e129f Allow for passing in custom note type and template 2021-02-12 02:12:03 +01:00
Henrik Giesel
6e22b8b145 Allow for passing in custom note types for rendering ephemeral cards 2021-02-12 01:53:03 +01:00
Damien Elmes
0907b77fef Revert "Use new note.ephemeral_card method in clayout"
This partially reverts commit 4ca24f1d84.
2021-02-12 10:05:46 +10:00
Damien Elmes
a5c728a124 avoid wrapping outermost search in parens 2021-02-12 09:30:21 +10:00
Damien Elmes
bce9892fa0 Merge pull request #1015 from ankitects/search
Search API bikeshedding
2021-02-12 09:19:24 +10:00
Damien Elmes
28a9ba473d tweak search wording and tidy up API
- SearchTerm -> SearchNode
- Operator -> Joiner; share between messages
- build_search_string() supports specifying AND/OR as a convenience
- group_searches() makes it easier to negate
2021-02-11 19:57:19 +10:00
Damien Elmes
6e28b096f8 more search bikeshedding
While implementing the overdue search, I realised it would be nice to
be able to construct a search string with OR and NOT searches without
having to construct each part individually with build_search_string().

Changes:

- Extends SearchTerm to support a text search, which will be parsed
by the backend. This allows us to do things like wrap text in a group
or NOT node.
- Because SearchTerm->Node conversion can now fail with a parsing error,
it's switched over to TryFrom
- Switch concatenate_searches and replace_search_term to use SearchTerms,
so that they too don't require separate string building steps.
- Remove the unused normalize_search()
- Remove negate_search, as this is now an operation on a Node, and
users can wrap their search in SearchTerm(negated=...)
- Remove the match_any and negate args from build_search_string

Having done all this work, I've just realised that perhaps the original
JSON idea was more feasible than I first thought - if we wrote it out
to a string and re-parsed it, we would be able to leverage the existing
checks that occur at parsing stage.
2021-02-11 17:11:17 +10:00
Damien Elmes
13da94b4cf switch search parser to using owned values
I was a bit too enthusiastic with using borrowed values in structs
earlier on in the Rust porting. In this case any performance gains are
dwarfed by the cost of querying the DB, and using owned values here
simplifies the code, and will make it easier to parse a fragment in
the From<SearchTerm> impl.
2021-02-11 12:19:36 +10:00
Damien Elmes
fd5f4b233f expose the ability to create search groups 2021-02-11 11:21:33 +10:00
Damien Elmes
5ad2cd56d1 switch some existing code to use SearchTerm(negated=...) 2021-02-11 10:55:02 +10:00
Damien Elmes
fe503ba009 split due into 'due today' and 'overdue' 2021-02-11 10:49:36 +10:00
Damien Elmes
b9e08b0699 add "due on day" search 2021-02-11 10:46:40 +10:00
Damien Elmes
f161cfff5f make it easier to negate a search term 2021-02-11 10:45:47 +10:00
Damien Elmes
e871ec68b5 Revert "experiment with using right click for AND/OR/NOT"
This reverts commit cbf0cdd30e and
manually comments out the setSelectionMode() call.

Switching back to the old behaviour until issues can be worked through.
https://forums.ankiweb.net/t/anki-2-1-41-beta/7305/24
2021-02-11 10:14:26 +10:00
Damien Elmes
9146c79f9e Revert "add escape hatch for new clicking behaviour, in case it causes problems"
This reverts commit e618756998.
2021-02-11 10:10:45 +10:00
Damien Elmes
42a44875ab convert qt strings to f-strings with flynt
Also revealed an incorrect type def in editor.py that mypy wasn't
noticing before :-(
2021-02-11 10:09:06 +10:00
Damien Elmes
92bdc90b44 convert some pylib strings to f-strings with flynt
excluded some changes where readability got noticeably worse
2021-02-11 09:51:09 +10:00
Damien Elmes
bf7528d90a minor code cleanups with pyupgrade
- pyupgrade --py38-plus --keep-runtime-typing --keep-percent-format
- third-party mpv and winpaths excluded
2021-02-11 09:43:40 +10:00
Damien Elmes
e64e807782 catch TTS runtime error 2021-02-10 16:30:51 +10:00
Damien Elmes
e7a0f22ebf ignore manually scheduled cards in hour graph 2021-02-10 09:36:51 +10:00
Damien Elmes
5cda46e622 update translations 2021-02-09 19:37:28 +10:00
Damien Elmes
e618756998 add escape hatch for new clicking behaviour, in case it causes problems 2021-02-09 19:29:59 +10:00