Commit graph

999 commits

Author SHA1 Message Date
Damien Elmes
d89c538c48 in/out -> request/response
The saved characters weren't worth the increased difficulty when
reading, and the fact that we were deviating from protobuf norms.
2021-06-20 15:49:20 +10:00
Damien Elmes
532ac8b511 Merge pull request #1230 from RumovZ/fields-check
Check for misplaced or missing clozes when adding and in the editor
2021-06-17 21:26:16 +10:00
Damien Elmes
3442ba36a9 fix 'set due date' not being remembered in browser
https://forums.ankiweb.net/t/anki-2-1-45-beta/10664/19
2021-06-16 18:50:05 +10:00
Damien Elmes
521a158406 update to latest mypy
mypy's move to external types-* packages is a PITA, as it requires them
to be installed in site-packages, and provides no way to specify a custom
site-packages folder, necessitating extra scripts to mock the
site-packages path, and copy+rename the stub packages into a separate
folder.
2021-06-16 16:04:59 +10:00
Damien Elmes
51d0fc29a6 multiple assignment confuses mypy 2021-06-15 08:42:34 +02:00
RumovZ
2aa16eadce Fix typo 2021-06-13 08:59:58 +02:00
RumovZ
0e49e74080 Use fields_check() instead of duplicate_or_empty() 2021-06-12 17:34:46 +02:00
RumovZ
46ee710a06 Check for out-of-place/missing clozes when adding 2021-06-12 10:05:42 +02:00
RumovZ
4fb2299386 Add check for out-of-place/missing clozes 2021-06-12 10:02:21 +02:00
Damien Elmes
cd303de619 specific encoding of strings.json
https://forums.ankiweb.net/t/win10-build-error-unicodedecodeerror-gbk-codec-cant-decode-byte-0x91/10714
2021-06-11 20:12:38 +10:00
Damien Elmes
153e1e8d41 new change notetype implementation for the frontend
- changes can now be undone
- the same field can now be mapped to multiple target fields, allowing
fields to be cloned
- the old Qt dialog has been removed
- the old col.models.change() API calls the new code, to avoid
breaking existing consumers. It requires the field map to always
be passed in, but that appears to have been the common case.
- closes #1175
2021-06-10 22:19:24 +10:00
cherryblossom
462da55fd5 fix documentation links 2021-06-03 16:51:03 +10:00
Damien Elmes
b56616066b fix styling changes not updating preview
regression caused by 691a5c5c44
2021-06-02 15:13:34 +10:00
Damien Elmes
d38f57cf3c Merge pull request #1213 from RumovZ/new-flags
Add pink, turquoise and purple flags
2021-06-02 11:22:26 +10:00
Damien Elmes
512dfd59cd limit custom study to 100 tags
The hard limit from sqlite may be larger, but things slow down as more
tags are selected.

https://forums.ankiweb.net/t/unable-to-create-custom-test/10467

There are a number of things that could be improved here:

- we should show a live count so users are aware of the limit
- we should be filling in the parent tags when they're not explicitly
listed on a card
- we should reconsider disabling the 'tags to include' by default

It may make sense to defer these changes until we can move this screen
into Svelte/handle the processing in the backend.
2021-06-02 11:15:39 +10:00
RumovZ
9e56a4421b Add violet, turquoise and purple flags 2021-05-31 12:03:30 +02:00
Damien Elmes
0b6beaa1da remove deck protobuf from frontend
Like the previous change, avoid exposing the protobuf as a public API
for now. It requires more thought, and is probably better done with
either extra helper accessors like decks.name(), or via a native class.
2021-05-31 16:31:06 +10:00
Damien Elmes
2044ed7f31 remove deck config and notetype protobuf from frontend
Not yet used by anything yet, and we may want to use native classes
for these instead, like is done for Notes and Cards. Decks to follow.
2021-05-31 16:27:58 +10:00
Damien Elmes
3d0a3a5707 fix exporting of non-default deck configs 2021-05-31 16:27:58 +10:00
Damien Elmes
8730e98778 Merge pull request #1200 from RumovZ/template-checks
Template checks
2021-05-29 10:28:06 +10:00
RumovZ
b1dbebb1a6 Allow empty field name in templates 2021-05-28 11:37:05 +02:00
RumovZ
613320aca3 Adjusts tests to pass new template checks 2021-05-28 10:08:55 +02:00
Damien Elmes
b0bde454ff add v3 scheduler to prefs screen 2021-05-27 23:09:49 +10:00
Damien Elmes
b810ee4b3b next_states() didn't need to be public 2021-05-26 15:12:48 +10:00
Damien Elmes
52a98ce0ce change get_queued_cards() to no longer return congrats info 2021-05-26 12:59:45 +10:00
RumovZ
d4a163f893 Update tests to avoid duplicate front templates 2021-05-25 21:58:12 +02:00
Damien Elmes
22b05be570 expose the ability to get/set aux notetype/template keys
template keys are not currently adjusted when card templates are
repositioned.
2021-05-25 22:13:53 +10:00
Damien Elmes
691a5c5c44 pass css and latex svg flag back from rendering op
This could potentially help us avoid having to refetch the notetype
during study in the future, though updates to Note initialization and
the LaTeX handling would be required first.
2021-05-25 18:41:43 +10:00
Damien Elmes
12b4080dd3 support passing in a native notetype object to render_uncommitted_card() 2021-05-25 16:58:06 +10:00
Damien Elmes
9fed62c6a4 prevent models.setCurrent() clearing the undo queue 2021-05-24 14:54:31 +10:00
Damien Elmes
1f7118a8e3 config updates by the frontend now skip undo by default 2021-05-24 14:50:46 +10:00
abdo
9cbbdc1270 Fix wrong stock note type being used
https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/49
2021-05-23 07:56:59 +03:00
Damien Elmes
5427668303 expose undoable config changes to frontend; refresh sidebar
The browser header handling still needs updating
2021-05-21 17:50:41 +10:00
Damien Elmes
ba727735bd report changed cards when changing deck/flag
+ fix repeated flag shortcut not toggling
2021-05-21 16:03:05 +10:00
Damien Elmes
2b2689f630 add v3 scheduler to col.sched type union
Will allow us to catch issues like the custom study one in the future
2021-05-19 16:06:52 +10:00
Damien Elmes
af90dd5d45 fix custom study in v3 scheduler 2021-05-19 15:58:18 +10:00
Damien Elmes
91931ed7a7 compat fixes for add-on usage of col.decks.active() 2021-05-19 15:41:37 +10:00
Damien Elmes
0767754ca6 enable redo support
Also:

- fix issues where the Undo action in the Browse screen was not
consistent with the main window. The existing hook signature has been
changed; from a snapshot of the add-on code from a few months ago, it
was not a hook that was being used by anyone.
- change the undo shortcut in the Browse window to match the main
window. It was different because undoing a change in the editing area
could accidentally trigger an undo of an operation, but the damage is
limited now that (most) operations can be redone. If it still proves to
be a problem, perhaps we should just always swallow ctrl+z when an
editing field is focused.
2021-05-19 15:18:39 +10:00
RumovZ
f220165c0f Fix black workaround for format calls 2021-05-18 22:19:09 +02:00
Damien Elmes
376ec09d1a add legacy NoteType alias
https://github.com/johnpincock/SpecialFields/issues/28
2021-05-18 09:18:46 +10:00
Damien Elmes
fe5dee2a67 rework various aspects of the test scheduler
- Daily limits are no longer inherited - each deck limits its own
cards, and the selected deck enforces a maximum limit.
- Fetching of review cards now uses a single query, and sorts in advance.
In collections with a large number of overdue cards and decks, this is
faster than iterating over each deck in turn.
- Include interday learning count in review count & review limit, and
allow them to be buried.
- Warn when parent review limit is lower than child deck in deck options.
- Cap the new card limit to the review limit.
- Add option to control whether new card fetching short-circuits.
2021-05-16 20:23:07 +10:00
Damien Elmes
78b431cbf1 work around Windows issue on latest Black
Thanks Rumo!
552a53495e
2021-05-13 20:15:51 +10:00
Damien Elmes
5f7590c4b4 expose new sorting options in test scheduler options; move things around 2021-05-13 15:23:16 +10:00
Damien Elmes
7e324a6ec0 use new API for test scheduler
Avoids duplicate work, and is a step towards allowing the next
states to be modified by third-party code.

Also:

- fixed incorrect underlined count, due to reviews being labeled as
learning cards
- fixed reviewer not refreshing when undoing a test review, by splitting
up backend queue rebuilding from frontend reviewer refresh
- moved answering into a CollectionOp
2021-05-11 13:06:03 +10:00
Damien Elmes
6f3225fb2a drop leech hook in test scheduler
The explicit flush was clearing undo history, and the hook will need
re-working to support propagating OpChanges correctly. It will likely
come back as a GUI hook, instead of one in pylib.
2021-05-10 16:18:29 +10:00
Damien Elmes
eb0a60b539 ensure v2 scheduler before test scheduler enabled 2021-05-10 14:57:30 +10:00
Damien Elmes
2e312eb13d update find_duplicates to use QueryOp/CollectionOp 2021-05-08 16:58:18 +10:00
Damien Elmes
26e9fba1f7 update docstrings for latest black 2021-05-07 18:12:56 +10:00
Damien Elmes
2a6cd2ff72 default to the v2 scheduler in new collections
ported from 9e91785d98
2021-05-06 19:09:28 +10:00
Damien Elmes
42dd2350d0 don't throw an error when an invalid sort order is provided 2021-05-06 17:00:58 +10:00