Commit graph

7587 commits

Author SHA1 Message Date
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
060ef67b26 remove some duplicate code & add deck.or() helper 2021-05-14 22:35:52 +10:00
Damien Elmes
a42648a418 fix test scheduler undo + implement look-ahead
Instead of using a separate undo queue, the code now defers checking for
newly-due learning cards until the answering stage, and logs the updated
cutoff time as an undoable change, so that any newly-due learning cards
won't appear instead of a new/review card that was just undone.

Queue redo now uses a similar approach to undo, instead of rebuilding the
queues.
2021-05-14 22:16:53 +10:00
Damien Elmes
127b7e28fc drop binary heap in test scheduler
The original rationale was avoiding a possible O(n) insertion if
the learning card was due outside the cutoff, but the increased code
complexity doesn't seem worth it, given that learning cards will
rarely grow above 1000.

Also added a currently-disabled test that demonstrates the current undo
handling behaviour is yielding incorrect counts; that will be reworked
in the next commit, and this change will make that easier.
2021-05-14 16:19:46 +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
9f49dca545 re-enable leech notification for test scheduler 2021-05-13 15:51:02 +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
9ff8727e68 pass sort options into test scheduler
- split new card fetch order and subsequent sort order; use latter
when building queues
- default to spacing siblings when burying is off, with options to
show each sibling in turn, and shuffle the fetched cards
2021-05-13 15:21:20 +10:00
Damien Elmes
2142cdbd24 fix burying in test scheduler
The bury new/review flags are now pulled from each card's home deck,
instead of using a global setting that had not been hooked up. This
unfortunately means we need to fetch the map of all decks up front, as
we need to be able to look up a deck configuration for cards that are
in filtered decks.

Fixes a "card was modified" error caused by cards being buried during
review, when they weren't removed up-front.
2021-05-12 12:00:15 +10:00
Damien Elmes
5a10f007e7 is_stale() doesn't need to be passed deck
Deck changes will trigger a queue rebuild via requires_study_queue_rebuild()
2021-05-12 09:44:10 +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
4d51a13259 roll back bootstrap until 5.0.1 comes out
Modals are currently broken:
https://github.com/twbs/bootstrap/issues/33840
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
75589e3eba better leech tag handling for test scheduler 2021-05-10 14:58:04 +10:00
Damien Elmes
eb0a60b539 ensure v2 scheduler before test scheduler enabled 2021-05-10 14:57:30 +10:00
Damien Elmes
d5dfac98ed update translations 2021-05-08 19:16:22 +10:00
Damien Elmes
5e44a34f20 expose step counter and undone op changes in hook 2021-05-08 17:51:36 +10:00
Damien Elmes
57fada3be0 move action names out of undo.ftl into actions.ftl 2021-05-08 17:11:54 +10:00
Damien Elmes
d6eeab3722 remove some unnecessary checkpoints 2021-05-08 17:04:05 +10:00
Damien Elmes
2e312eb13d update find_duplicates to use QueryOp/CollectionOp 2021-05-08 16:58:18 +10:00
Damien Elmes
db415b08e4 move query_op into operations/, and add the ability to show progress 2021-05-08 16:35:43 +10:00
Damien Elmes
34c26a8b1c split browser dialogs into separate files 2021-05-08 15:08:45 +10:00
Damien Elmes
d8cea1385c the find_and_replace alias is not required
Was only added recently, so nothing should depend on it yet.
2021-05-08 14:34:57 +10:00
Damien Elmes
9c51aa5a64 move "find duplicates" into separate file
As far as I'm aware, no add-ons were extending that screen, so I've
dropped the old context object and the export in browser/__init__.py
2021-05-08 14:33:43 +10:00
Damien Elmes
2dab3f0487 disable broken svelte_check test on Windows for now
Likely caused by a lack of sandboxing on Windows, causing the generated
.d.ts files to be visible to svelte_check, and being picked up in
preference over the .svelte file.
2021-05-08 12:15:49 +10:00
Damien Elmes
6dd78b0ea5 Merge pull request #1159 from hgiesel/newapproach
Prefer idiomatic Svelte features over dynamic components
2021-05-08 11:35:31 +10:00
Henrik Giesel
755b39b59e Check for id when inserting dynamic elements
* I'm not sure it behaved, if there were multiple elements
  inserted by different add-ons into the same container
2021-05-07 16:50:17 +02:00
Henrik Giesel
c894d32c14 Fix remaining errors in editor/*.svelte files 2021-05-07 15:10:28 +02:00
Henrik Giesel
9379477e09 Use MouseEvent instead of KeyboardEvent in WithShortcut
* otherwise the disabled button will allow it to pass through
2021-05-07 14:46:08 +02:00
Henrik Giesel
3d4224a886 Rename Detachable.detach to detached 2021-05-07 14:31:08 +02:00
Henrik Giesel
840191d358 Use json.dumps instead of backticks in editor.py 2021-05-07 14:22:06 +02:00
Damien Elmes
7f5972c080 update license checker for security issue in dependency 2021-05-07 18:50:25 +10:00
Damien Elmes
552a53495e roll back black for now due to Windows breakage 2021-05-07 18:50:25 +10:00
Damien Elmes
f9d5eda3f8 update Rust deps 2021-05-07 18:22:27 +10:00
Damien Elmes
0bfd03d781 update Python deps 2021-05-07 18:13:17 +10:00
Damien Elmes
26e9fba1f7 update docstrings for latest black 2021-05-07 18:12:56 +10:00
Damien Elmes
5213ff8dbb update JS deps
Unfortunately we're still stuck with a security alert about underscore,
because the latest jsdoc uses an old underscore, and protobufjs depends
on it.

https://github.com/jsdoc/jsdoc/issues/1908
2021-05-07 18:03:22 +10:00
Damien Elmes
4fe03e1f22 tweak hover css to work with latest js deps 2021-05-07 17:57:28 +10:00
Damien Elmes
4242d82adf fix find&replace 2021-05-07 14:02:40 +10:00
Henrik Giesel
cd6599c301 Fix module name formatting 2021-05-07 02:14:54 +02:00
Henrik Giesel
8c32691d30 Fix Preview Button after changing from f-string to normal string 2021-05-07 02:12:37 +02:00
Henrik Giesel
1e5feffba0 Fix Preview tooltip 2021-05-07 02:04:44 +02:00
Henrik Giesel
8a558eb297 Fix unused CSS selector issue in graphs introduced by updating Svelte 2021-05-07 02:04:44 +02:00
Henrik Giesel
fbc9c8a250 Use any in toolbar.ts for using context as parameter 2021-05-07 02:04:44 +02:00
Henrik Giesel
8f2c5a0c1c Turn on editor:eslint 2021-05-07 02:04:44 +02:00
Henrik Giesel
147617dff2 Add copyright header 2021-05-07 02:04:44 +02:00
Henrik Giesel
17bca7be6e Add ts-expect-error for module import in EditorToolbar 2021-05-07 02:04:44 +02:00
Henrik Giesel
bb2fb8e9f5 Fix ButtonDropdown 2021-05-07 02:04:44 +02:00
Henrik Giesel
0a979d789a Make LabelButtons support active notion 2021-05-07 02:04:44 +02:00
Henrik Giesel
95b6b386dc Only initialize extension apis if necessary 2021-05-07 02:04:44 +02:00