Commit Graph

138 Commits

Author SHA1 Message Date
Damien Elmes
562787bce1 add options to sort reviews by deck
https://forums.ankiweb.net/t/is-studying-subdeck-by-subdeck-broken-in-2-1-44-mac/10458/2
2021-06-01 13:22:39 +10:00
Damien Elmes
93459cc48f
Merge pull request #1200 from RumovZ/template-checks
Template checks
2021-05-29 10:28:06 +10:00
RumovZ
2e923db6bd Add checks for parsed templates
Combine existing check for unparsable templates with a check for unknown
field names and a check for front sides without any field replacement.
Updating the notetype's fields now mutates the parsed templates, so the
checks can run on the final templates.
2021-05-28 10:07:31 +02:00
RumovZ
f97b1559a2 Escape braces in fluent string 2021-05-27 16:46:33 +02:00
Damien Elmes
d02b4b7eed tweak wording of full sync message 2021-05-27 22:42:10 +10:00
RumovZ
e247da5ba8
Apply suggestions from code review
Tweak wording of template check errors.

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2021-05-27 13:40:33 +02:00
RumovZ
c61587b1de Use HashMap in identical template check 2021-05-27 12:45:17 +02:00
RumovZ
3dfa1de68b Check for clozes when saving notetype
Error if:
- Cloze notetype lacks a cloze field on either template side.
- Non-cloze notetype has a cloze field on any template.
2021-05-27 12:01:05 +02:00
Damien Elmes
f26c7ed99e ask user to confirm which deck they want when opening options in reviewer
Also fixes https://forums.ankiweb.net/t/anki-2-1-45-alpha/10061/57
2021-05-27 13:15:28 +10:00
Damien Elmes
7c5e974ae5 hook up some missing translations in deck options screen 2021-05-26 14:41:18 +10:00
RumovZ
60131eab23 Check for identical templates before saving 2021-05-25 21:57:49 +02:00
RumovZ
fa19f590e8 Add details to TemplateSaveError 2021-05-25 21:01:03 +02:00
Damien Elmes
f91f00a542 mention new limit bound by reviews in tooltip 2021-05-24 19:04:00 +10:00
Damien Elmes
93ace8b96e move v3 options into separate section; more description/section tweaks 2021-05-24 18:25:17 +10:00
Damien Elmes
3d4cf26758 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
99b7da49a9 report changed cards when changing deck/flag
+ fix repeated flag shortcut not toggling
2021-05-21 16:03:05 +10:00
RumovZ
b5c29fb498 Pronounce "[...]" as "blank" with TTS 2021-05-20 09:42:38 +02:00
Damien Elmes
6b53c0c175 support markdown in JS tooltips
`marked` adds about 44k to the bundle size unfortunately :-(
2021-05-16 21:43:58 +10:00
Damien Elmes
13519a929c 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
dbbcb3e38c expose new sorting options in test scheduler options; move things around 2021-05-13 15:23:16 +10:00
Damien Elmes
e9e1edc64d move action names out of undo.ftl into actions.ftl 2021-05-08 17:11:54 +10:00
Damien Elmes
2ff8c20686 update backend to support undoing of notetype changes 2021-04-30 12:54:59 +10:00
Damien Elmes
a639048a6b i18n deckoptions; move some options into separate 'advanced' section 2021-04-26 23:34:58 +10:00
Damien Elmes
09629e4e4a add translations for deck option warnings
+ cap maximum recommended review limit to 9999, since we don't allow
the user to set it higher
2021-04-25 23:06:35 +10:00
Damien Elmes
f6a1a35113 update translations 2021-04-25 22:06:05 +10:00
RumovZ
458d891d28 Add dec to make methods no-op if no selection 2021-04-25 08:36:22 +02:00
Damien Elmes
047072182b
change file comment to group comment 2021-04-23 08:55:04 +10:00
Henrik Giesel
57357a42a5 Satisfy formatter 2021-04-22 15:24:27 +02:00
Henrik Giesel
4a264cd8b7 Add editing fluent strings without attached keyboard shortcuts 2021-04-22 13:38:37 +02:00
Henrik Giesel
e95e78da9c Add getPlatformString for making shortcuts to platform string 2021-04-22 13:04:24 +02:00
Damien Elmes
1210858075 use "decrease indent" instead of "outdent" 2021-04-20 21:40:52 +10:00
RumovZ
3cecc7157b Add sidebar filter "first review today" 2021-04-18 13:27:10 +02:00
Damien Elmes
76eb119870 add schema change prompt to removal, tweak return struct 2021-04-18 17:33:12 +10:00
Henrik Giesel
3eab17ed0f Add Fluent translations 2021-04-16 16:08:00 +02:00
RumovZ
a1277b0919 Tweak new browsing strings 2021-04-06 11:41:18 +02:00
Damien Elmes
2168dfe63d add routine to set deck collapse state
Updating a deck via protobuf is now exposed on the backend, but not
currently on the frontend - I suspect we'll be better off writing
separate routines for the actions we need instead, and we get a better
undo description for free.

This is currently causing an ugly redraw in the browse screen, which
will need fixing.
2021-04-05 11:19:04 +10:00
Damien Elmes
f55fe6e518 i18n error shown when attempting to rebuild normal deck 2021-04-01 22:55:10 +10:00
Damien Elmes
ba541076aa convert card template error to tuple, and report notetype name in error
Older translations will note have the $notetype variable, but that is
not an error in Fluent - it would only cause problems if we tried to
use the new string on older Anki versions.
2021-04-01 17:59:33 +10:00
RumovZ
52b66dc985 Add shortcut and tooltip to switch 2021-03-31 18:53:36 +02:00
RumovZ
8779fb5ede Add note interval column 2021-03-30 23:44:35 +02:00
RumovZ
ad7ac06398 Add switch for browser states 2021-03-29 12:24:24 +02:00
RumovZ
0d8b1c9d0b squash merge browser refactor
Closes #1100
2021-03-29 16:14:54 +10:00
Damien Elmes
8eaa7fa162 add note to translators 2021-03-27 15:03:33 +10:00
Damien Elmes
d382b33585 rework filtered deck screen & search errors
- Filtered deck creation now happens as an atomic operation, and is
undoable.
- The logic for initial search text, normalizing searches and so on
has been pushed into the backend.
- Use protobuf to pass the filtered deck to the updated dialog, so
we don't need to deal with untyped JSON.
- Change the "revise your search?" prompt to be a simple info box -
user has access to cancel and build buttons, and doesn't need a separate
prompt. Tweak the wording so the 'show excluded' button should be more
obvious.
- Filtered decks have a time appended to them instead of a number,
primarily because it's easier to implement. No objections going back to
the old behaviour if someone wants to contribute a clean patch.
The standard de-duplication will happen if two decks are created in the
same minute with the same name.
- Tweak the default sort order, and start with two searches. The UI
will still hide the second search by default, but by starting with two,
the frontend doesn't need logic for creating the starting text.
- Search errors now have their own error type, instead of using
InvalidInput, as that was intended mainly for bad API calls. The markdown
conversion is done when the error is converted from the backend, allowing
errors to printed as a string without any special handling by the calling
code.

TODO: when building a new filtered deck, update_active() is clobbering
the undo log when the overview is refreshed
2021-03-24 22:04:35 +10:00
Damien Elmes
12597e1094 support undo of filtered deck build/empty 2021-03-24 12:56:06 +10:00
RumovZ
76b4b7f6b1 Add context action 'Update with Current Search' 2021-03-23 11:20:46 +01:00
Damien Elmes
6a11c0398c use perform_op() for deck drag&drop 2021-03-22 18:23:56 +10:00
Damien Elmes
4c61c92806 speed up tag drag&drop and finish tag tidyup
approx 4x speedup when reparenting 10-15 tags and their children at once
2021-03-19 19:45:21 +10:00
Damien Elmes
0331d8b588 make reposition undoable 2021-03-19 19:45:21 +10:00
Damien Elmes
de668441b5 clear_unused_tags and browser redraw improvements
- clear_unused_tags() is now undoable, and returns the number of removed
notes
- add a new mw.query_op() helper for immutable queries
- decouple "freeze/unfreeze ui state" hooks from the "interface update
required" hook, so that the former is fired even on error, and can be
made re-entrant
- use a 'block_updates' flag in Python, instead of setUpdatesEnabled(),
as the latter has the side-effect of preventing child windows like
tooltips from appearing, and forces a full redrawn when updates are
enabled again. The new behaviour leads to the card list blanking out
when a long-running op is running, but in the future if we cache the
cell values we can just display them from the cache instead.
- we were indiscriminately saving the note with saveNow(), due to the
call to saveTags(). Changed so that it only saves when the tags field
is focused.
- drain the "on_done" queue on main before launching a new background
task, to lower the chances of something in on_done making a small query
to the DB and hanging until a long op finishes
- the duplicate check in the editor was executed after the webview loads,
leading to it hanging until the sidebar finishes loading. Run it at
set_note() time instead, so that the editor loads first.
- don't throw an error when a long-running op started with with_progress()
finishes after the window it was launched from has closed
- don't throw an error when the browser is closed before the sidebar
has finished loading
2021-03-19 19:45:21 +10:00