112cbe8b59
Basic proof of concept, where the 'delete note' operation in the reviewer has been updated to use mw.perform_op(). Instead of manually calling .reset() afterwards, a summary of the changes is returned as part of the undo status query, and various parts of the GUI can listen to gui_hooks.operation_did_execute and decide whether they want to redraw based on the scope of the changes. This should allow the sidebar to selectively redraw just the tags area in the future for example. Currently we're just listing out all possible areas that might be changed; in the future we could theoretically inspect the specific changes in the undo log to provide a more accurate report (avoiding refreshing the tags list when no tags were added for example). You can test it out by opening the browse screen while studying, and then deleting the current card - the browser should update to show (deleted) on the cards due the earlier change. If going ahead with this, aside from updating all the screens that currently listen for resets, some thought will be required on how we can integrate it with legacy code that expects to called when resets are made, and expects to call .reset() when it makes changes. Thoughts? |
||
---|---|---|
.. | ||
.cargo | ||
build | ||
cargo | ||
src | ||
templates | ||
tests/support | ||
.clang-format | ||
.gitignore | ||
backend.proto | ||
BUILD.bazel | ||
Cargo.toml | ||
clang_format.bzl | ||
proto_format.py | ||
README.md | ||
rustfmt.bzl |
Anki's Rust code.
backend.proto stores the interfaces used to communicate backend messages between Rust, Python and TypeScript.