Damien Elmes
83aa43d97b
remove AnkiDroid timezone confirmation
...
By the time this update reaches stable, AnkiDroid 2.15 should already
be out.
2021-05-06 19:05:15 +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
Damien Elmes
7f7dd7b6c9
add support for custom undo steps, and merging multiple actions
...
Allows add-on authors to define their own label for a group of undoable
operations. For example:
def mark_and_bury(
*,
parent: QWidget,
card_id: CardId,
) -> CollectionOp[OpChanges]:
def op(col: Collection) -> OpChanges:
target = col.add_custom_undo_entry("Mark and Bury")
col.sched.bury_cards([card_id])
card = col.get_card(card_id)
col.tags.bulk_add(note_ids=[card.nid], tags="marked")
return col.merge_undo_entries(target)
return CollectionOp(parent, op)
The .add_custom_undo_entry() is for adding your own custom actions.
When extending a standard Anki action, instead store `target =
col.undo_status().last_step` after executing the standard operation.
This started out as a bigger refactor that required a separate
.commit_undoable() call to be run after each operation, instead of
having each operation return changes directly. But that proved to be
somewhat cumbersome in unit tests, and ran the risk of unexpected
behaviour if the caller invoked an operation without remembering to
finalize it.
2021-05-06 16:39:06 +10:00
Damien Elmes
b0e59df5a8
fix dmypy action
2021-05-05 15:54:41 +10:00
Damien Elmes
126d27585f
add a valid, empty file so the check action works in Rust Analyzer
2021-05-05 15:53:27 +10:00
Damien Elmes
54309bab73
add script to run Rust Analyzer using Bazel's build products
...
Considerably speeds up initial load, but have not done much testing
yet.
2021-05-04 20:06:42 +10:00
Damien Elmes
b4cb2baa0e
fix properties missing from generated Svelte .d.ts files
...
They're currently being set to 'any', as we're not providing the dependencies
to the tsc invocation. Older Anki versions had the same issue, and we'll
want to fix that as well, but for now this at least restores the missing
props.
2021-05-04 18:55:58 +10:00
Damien Elmes
585072635d
bump version
2021-05-04 16:24:28 +10:00
Damien Elmes
1802066afe
support undo for (renamed) unbury_deck() action
2021-04-30 20:03:20 +10:00
Damien Elmes
994d26937f
remove some unneeded transactions from tests
2021-04-30 19:18:02 +10:00
Damien Elmes
65e2bfb16d
fix invalid outer transaction in clear_unused_tags()
2021-04-30 19:09:02 +10:00
Damien Elmes
09f3e1db07
empty/restore media trash shouldn't clear undo
2021-04-30 19:07:30 +10:00
Damien Elmes
e468daa060
undoing of notetype templates
2021-04-30 17:30:48 +10:00
Damien Elmes
e161b9049a
undoing of notetype fields
...
- fix stale cache issue
- update add cards screen in response to op changes
2021-04-30 17:15:59 +10:00
Damien Elmes
3049eaf47c
notetype rename+options undo
2021-04-30 16:09:44 +10:00
Damien Elmes
46bcfa00fd
notetype removal undoable
2021-04-30 16:01:47 +10:00
Damien Elmes
8a9796ee5a
update GUI to allow notetype addition undo
...
- backend now updates current notetype as part of addition
- frontend no longer implicitly adds, so we can assign a new name and
add in a single operation
2021-04-30 15:58:08 +10:00
Damien Elmes
df068c2a17
update backend to support undoing of notetype changes
2021-04-30 12:54:59 +10:00
Damien Elmes
03ca227fd4
make it more ergonomic to search directly via nodes in Rust
2021-04-30 11:37:55 +10:00
Damien Elmes
acac1ae1f2
move note/card removal for notetype out of storage layer
2021-04-29 19:44:09 +10:00
Damien Elmes
df42d466b9
make config prefix removal undoable
2021-04-29 19:16:02 +10:00
Damien Elmes
b3d3768baa
use aux var when retrieving last deck for notetype
...
The adding case was already covered by defaults_for_adding(), but we
the code was using the old variable when adding new cards to an existing
note.
2021-04-29 19:15:27 +10:00
Damien Elmes
9c3cf8b25b
move pub functions to top of notetype/mod.rs
2021-04-29 15:32:59 +10:00
Damien Elmes
adec449ad4
move pub functions to top of notes/mod.rs
2021-04-29 14:08:15 +10:00
Damien Elmes
4f128aa330
confirm deletion is requiring a full sync
2021-04-28 22:21:16 +10:00
Damien Elmes
4216dd6d7e
add some unit tests to deck config updating
2021-04-28 22:00:39 +10:00
Damien Elmes
77038ae554
DeckConfId -> DeckConfigId
2021-04-28 21:09:26 +10:00
Damien Elmes
985d256e7a
sort deck on config update; fix id not being updated after deletion
2021-04-28 21:08:09 +10:00
Damien Elmes
deabb30dea
report pinned package issues upstream
2021-04-27 23:11:22 +10:00
Damien Elmes
d76ef9cde5
update Rust deps
...
- tokio 1.0
- updated reqwest, thanks to Rumo
- other minor dep updates
the reqwest build file has been split into two, as it was awkward
to manually update the combined file, and the platform gate is now
on the target in rslib/
2021-04-27 22:18:12 +10:00
Damien Elmes
0d113fd447
i18n deckoptions; move some options into separate 'advanced' section
2021-04-26 23:34:58 +10:00
Damien Elmes
dca53ae1e2
Merge pull request #1156 from RumovZ/trigger-dec
...
Add separate no_arg_trigger decorator
2021-04-26 20:22:07 +10:00
Damien Elmes
7999682f6d
defer bounds checking in SpinBox to focus loss
...
The previous behaviour was preventing a backspace to remove the
current text when a minimum of 1 or greater was supplied
2021-04-26 20:17:48 +10:00
RumovZ
8e0298120d
Add separate no_arg_trigger decorator
2021-04-26 08:46:08 +02:00
Damien Elmes
532840bbfc
Merge pull request #1154 from RumovZ/fix-skip-dec
...
Fix skip_if_selection_is_empty() for triggers
2021-04-26 09:21:42 +10:00
Damien Elmes
b2f56fff7c
Merge pull request #1153 from hgiesel/goodbyewebcomp
...
Make EditorToolbar more similar to DeckOptions
2021-04-26 09:20:06 +10:00
RumovZ
7ac84a38d6
Remove some unnecessary lambdas
2021-04-25 19:51:57 +02:00
RumovZ
4b91c2b9f1
Fix skip_if_selection_is_empty() for triggers
...
It seems to be enough if one decorator calls pyqtSlot(), but to avoid
problems in the future, let's have all decorators do that.
2021-04-25 19:50:56 +02:00
Henrik Giesel
b0988e43e1
Move EditorToolbar API into EditorToolbar.svelte
2021-04-25 19:15:00 +02:00
Henrik Giesel
a21a4d330b
Initialize editor toolbar via function, not web component
2021-04-25 18:32:01 +02:00
Damien Elmes
bd45967129
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
ddf7c5bb89
update translations
2021-04-25 22:06:05 +10:00
Damien Elmes
7aceb9fd3f
subLabel->tooltip
2021-04-25 21:37:21 +10:00
Damien Elmes
9a25f8480d
slide warnings in/out
2021-04-25 21:10:53 +10:00
Damien Elmes
68a4f4bade
Merge pull request #1151 from RumovZ/no-sel-dec
...
Fix some problems with browser actions while selection is empty
2021-04-25 20:48:40 +10:00
Damien Elmes
1a6c5f594d
enable the new deck options by default
...
- The old options are still available with a shift+click
- Translations still need updating
- See d8ca46e6e9 for some examples
of extending the screen in an add-on
2021-04-25 19:58:58 +10:00
Damien Elmes
e5264c909b
use lodash instead of json in RevertButton
2021-04-25 19:34:07 +10:00
Damien Elmes
f3b344a571
fix error when user cancels out of set due date/reposition
2021-04-25 19:33:25 +10:00
Damien Elmes
d8ca46e6e9
experimental support for extending add-ons screen with Svelte
2021-04-25 19:33:18 +10:00
Damien Elmes
fdb814cbcd
deckconfig->deckoptions
2021-04-25 19:02:30 +10:00