Commit graph

7119 commits

Author SHA1 Message Date
RumovZ
b33e81c215 Save separate browser mode headers 2021-04-11 12:28:11 +02:00
RumovZ
d58af0dd95 Merge branch 'master' into backend-columns 2021-04-11 11:18:15 +02:00
RumovZ
dadeaa75b7 Add browser_did_fetch_columns hook and some doc 2021-04-11 10:27:43 +02:00
RumovZ
a6f5a52fc1 Resolve config sort in table model 2021-04-10 11:33:59 +02:00
RumovZ
531e08a711 Remove from_config variant in pb SortOrder
Instead, fetch the config order on the frontend and pass a builtin
variant into the backend.
That makes the following unnecessary:
* Resolving the config sort in search/mod.rs
* Deserializing the Column enum
* Config accessors for the sort columns
2021-04-10 11:13:42 +02:00
RumovZ
1891ecf6e6 Rename SearchItems to ReturnItemtype 2021-04-10 10:14:41 +02:00
RumovZ
ee83528da2 Remove internal clones of pb BrowserRow structs 2021-04-10 09:49:29 +02:00
RumovZ
dd4f08a90f Rename column label fields 2021-04-10 09:14:20 +02:00
RumovZ
e2b1c0da51 Remove unused Serialize 2021-04-10 09:13:48 +02:00
RumovZ
94d52de9da Store active browser columns in col state 2021-04-09 22:53:02 +02:00
RumovZ
18b3938025 Remove superfluous muts 2021-04-09 22:51:18 +02:00
RumovZ
c81cf7ffaf Move Column logic into main rslib 2021-04-09 19:09:48 +02:00
RumovZ
3b23248983 Remove pb SortKind enum and use pb Columns instead 2021-04-09 18:50:30 +02:00
RumovZ
93c6e258aa Merge SortKind enum into Column enum 2021-04-09 18:03:29 +02:00
Damien Elmes
cf623731a2 update to latest rules_rust incremental compilation 2021-04-09 12:48:24 +10:00
RumovZ
e28f2320b8 Unify state columns
* Remove duplicate backend columns
* Remove duplicate column routines
* Move columns on frontend from state to model
* Generate available columns from Colum enum
* Add second column label for notes mode
2021-04-08 23:48:24 +02:00
RumovZ
8c499ed5bf Rename columns for future mode-independent use 2021-04-08 23:43:48 +02:00
RumovZ
dc9a7b024e Merge browser row str methods 2021-04-08 20:45:47 +02:00
RumovZ
3845ccc846 Add card mod column for notes mode 2021-04-08 20:14:10 +02:00
RumovZ
f4081084a9 Add deck column for notes mode 2021-04-08 19:46:06 +02:00
RumovZ
0acab27b0a Merge row contexts 2021-04-08 13:51:46 +02:00
RumovZ
0ff193cd5d Add enum for column sorting 2021-04-08 11:40:24 +02:00
RumovZ
47eeb5da14 Add enum for column alignment 2021-04-08 11:28:29 +02:00
RumovZ
d7e0da3786 Remove Column class and use pb class instead 2021-04-08 11:17:25 +02:00
RumovZ
7ea1dbd4a4 Move BrowserColumn into BrowserColumns message 2021-04-08 10:16:06 +02:00
Damien Elmes
0046fae7c3 switch to new upstream rules_nodejs release 2021-04-08 11:56:09 +10:00
Damien Elmes
43105d62cf i18n tts error message 2021-04-08 09:35:19 +10:00
Damien Elmes
2eec071b22 fix '\\' being converted to single backslash
Appears the default changed in 3.x
https://github.com/mathjax/MathJax/issues/2532

https://forums.ankiweb.net/t/double-backslashes-in-text-of-notes-are-turned-into-single-backslashes-on-display/9048
2021-04-07 21:50:33 +10:00
Damien Elmes
081ad6090f update rules_nodejs for public toolchain fix 2021-04-07 18:28:53 +10:00
Damien Elmes
dc8c0a2e73 switch esbuild to a toolchain 2021-04-07 15:19:23 +10:00
Damien Elmes
fb1111623f update to latest esbuild 2021-04-07 14:54:40 +10:00
RumovZ
c316783517 Fix deck column serialization string 2021-04-06 23:03:30 +02:00
RumovZ
b59a7c72a1 Save key for unsupported add-on columns 2021-04-06 23:02:58 +02:00
RumovZ
3c84749973 Use backend column objects on frontend 2021-04-06 19:47:03 +02:00
RumovZ
82b9c9f320 Add column logic on backend 2021-04-06 19:46:12 +02:00
RumovZ
d70a7eb9a4 Make Column a strum 2021-04-06 16:54:09 +02:00
RumovZ
460e79ba73 Change notes mode shortcut 2021-04-06 16:48:35 +02:00
Damien Elmes
ae7a327cae current deck change is now undoable
- make sure we set flag in changes when config var changed
- move current deck get/set into backend
- set_config() now returns a bool indicating whether a change was
made, so other operations can be gated off it
- active decks generation is deferred until sched.reset()
2021-04-06 21:52:06 +10:00
RumovZ
49ebf1a9ae Fix get_item_from_card_id() 2021-04-06 12:06:08 +02:00
RumovZ
dec8fd6181 Tweak new browsing strings 2021-04-06 11:41:18 +02:00
Damien Elmes
a8af070f9a update find&replace, and remove perform_op() 2021-04-06 17:07:38 +10:00
Damien Elmes
1b81653e0e update scheduling ops
- migrate to CollectionOp()
- return actual change count when suspending/burying
- add helper to convert vec to vec of newtype
2021-04-06 16:38:42 +10:00
Damien Elmes
783e0ec224 update note ops
remove_note() now returns the count of removed cards, allowing us
to unify the tooltip between browser and review screen

I've left the old translation in - we'll need to write a script at
one point that gathers all references to translations in the code,
and shows ones that are unused.
2021-04-06 14:56:36 +10:00
Damien Elmes
3669e948c4 migrate more ops to CollectionOp 2021-04-06 14:36:13 +10:00
Damien Elmes
f030fdbfa4 it seems mypy ignores the generic class bound if it's a type alias 2021-04-06 14:14:55 +10:00
Damien Elmes
45636877f4 start migrating perform_op() into builder in separate file
By passing back the builder to the calling code to run, we don't need
to plumb extra arguments like success= and handler= through each
operation, and the ability to override the default tooltip behaviour
comes free on all operations
2021-04-06 12:47:55 +10:00
Damien Elmes
427424c660 shift keep-current-selection logic into sidebar's refresh()
By calling refresh() manually after performing an op, we were refreshing
twice, and the selection was being lost when changes were made outside
of the sidebar.

Also drop the after_hooks arg to perform_op(), since nothing is using
it now.
2021-04-06 11:18:13 +10:00
Damien Elmes
c3b0fb35b7 more perform_op() tweaks
- pass the handler directly
- reviewer special-cases for flags and notes are now applied at
call site
- drop the kind attribute on OpChanges which is not needed
2021-04-06 10:14:11 +10:00
Damien Elmes
7666d1fc22 fix error when opening browser during review while notes mode active 2021-04-05 21:57:06 +10:00
Damien Elmes
085f63ac1b cache scheduling info
Saves us having to recalculate it for each browser row
2021-04-05 17:09:53 +10:00