Anki/rslib/src/backend
Damien Elmes 1e849316be more reset refactoring
'card modified' covers the common case where we need to rebuild the
study queue, but is also set when changing the card flags. We want to
avoid a queue rebuild in that case, as it causes UI flicker, and may
result in a different card being shown. Note marking doesn't trigger
a queue build, but still causes flicker, and may return the user back
to the front side when they were looking at the answer.

I still think entity-based change tracking is the simplest in the
common case, but to solve the above, I've introduced an enum describing
the last operation that was taken. This currently is not trying to list
out all possible operations, and just describes the ones we want to
special-case.

Other changes:

- Fire the old 'state_did_reset' hook after an operation is performed,
so legacy code can refresh itself after an operation is performed.
- Fire the new `operation_did_execute` hook when mw.reset() is called,
so that as the UI is updated to the use the new hook, it will still
be able to refresh after legacy code calls mw.reset()
- Update the deck browser, overview and review screens to listen to
the new hook, instead of relying on the main window to call moveToState()
- Add a 'set flag' backend action, so we can distinguish it from a
normal card update.
- Drop the separate added/modified entries in the change list in
favour of a single entry per entity.
- Add typing to mw.state
- Tweak perform_op()
- Convert a few more actions to use perform_op()
2021-03-19 19:45:21 +10:00
..
scheduler 'set due date' now undoable 2021-03-12 14:50:31 +10:00
sync split out sync, notetypes and config code 2021-03-11 15:47:31 +10:00
adding.rs Simplify note adding and the deck/notetype choosers 2021-03-10 11:53:27 +10:00
card.rs more reset refactoring 2021-03-19 19:45:21 +10:00
cardrendering.rs split out remaining rpc methods 2021-03-11 17:04:32 +10:00
collection.rs more reset refactoring 2021-03-19 19:45:21 +10:00
config.rs 'set due date' now undoable 2021-03-12 14:50:31 +10:00
dbproxy.rs move collection mtime bump into backend 2021-03-19 19:45:21 +10:00
deckconfig.rs split out tags, deck config and card rendering 2021-03-11 16:05:06 +10:00
decks.rs Merge branch 'master' into sidebar-tools 2021-03-11 12:08:32 +01:00
err.rs move sync/err backend code into separate files 2021-03-10 11:53:27 +10:00
generic.rs Merge branch 'master' into sidebar-tools 2021-03-11 12:08:32 +01:00
i18n.rs split out remaining rpc methods 2021-03-11 17:04:32 +10:00
media.rs split out stats, media and search 2021-03-11 16:16:40 +10:00
mod.rs derive reset scope from last undoable operation 2021-03-19 19:45:21 +10:00
notes.rs more reset refactoring 2021-03-19 19:45:21 +10:00
notetypes.rs split out sync, notetypes and config code 2021-03-11 15:47:31 +10:00
ops.rs more reset refactoring 2021-03-19 19:45:21 +10:00
progress.rs move progress and search backend code into separate files 2021-03-10 11:53:27 +10:00
search.rs split out stats, media and search 2021-03-11 16:16:40 +10:00
stats.rs split out stats, media and search 2021-03-11 16:16:40 +10:00
tags.rs Merge branch 'master' into sidebar-tools 2021-03-11 12:08:32 +01:00