Commit graph

7127 commits

Author SHA1 Message Date
Henrik Giesel
99f2ca0b99 Remove jQuery from _updateQA 2021-04-13 00:22:00 +02:00
Damien Elmes
5dfd8aa89c Merge pull request #1113 from RumovZ/backend-columns
Backend columns
2021-04-12 16:05:11 +10:00
Damien Elmes
19d9492380 handle missing default sort column in notes view
Switching to notes mode was throwing:

  File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/browser.py", line 449, in on_table_state_changed
    self.table.toggle_state(checked, self._lastSearchTxt)
  File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 206, in toggle_state
    self._state = self._model.toggle_state(
  File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 996, in toggle_state
    self.search(context)
  File "/Users/dae/Work/code/dtop/bazel-copy/runanki.runfiles/net_ankiweb_anki/qt/aqt/table.py", line 1005, in search
    context.order = self.columns[self._state.sort_column]
2021-04-12 16:02:51 +10:00
Damien Elmes
c6da01c4aa disable Jest tests on Windows again
It looks like the templated_args change only masked the error last time;
Jest seems broken on Windows with both the patched .24 version, latest
stable, and the new beta version too, presumably because symlinks are
being handled differently on Windows somehow. It might be possible to
hack around the issue by patching the following file, but I'm not sure:

https://github.com/facebook/jest/blob/master/packages/jest-haste-map/src/crawlers/node.ts
2021-04-12 15:39:46 +10:00
Damien Elmes
9d03e266e3 add naturalWholeUnit() and basic tests to lib/time.ts
naturalWholeUnit() is not currently used
2021-04-12 14:42:06 +10:00
Damien Elmes
3c3258251d force number in protobuf generation
Anki's object IDs and millisecond timestamps fit within MAX_SAFE_INTEGER.
2021-04-12 14:33:20 +10:00
Damien Elmes
43a8b8fec3 stop Svelte warnings from failing the build
+ check for them at test time
2021-04-12 14:28:09 +10:00
Damien Elmes
8c64cc38d7 fix jest
- templated_args was missing --node_modules= prefix, and was causing
tests to pass unconditionally
- update to beta of jest 27, which introduces an option to fix the
symlink handling, and is approx twice as fast to start up
2021-04-12 09:43:31 +10:00
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