Commit Graph

7131 Commits

Author SHA1 Message Date
RumovZ
88086596b6 Move find_and_replace.py into browser/dialogs 2021-04-13 11:21:36 +02:00
RumovZ
7ee40e3dce Refactor sidebar.py into browser folder 2021-04-13 11:05:49 +02:00
Damien Elmes
dac990e4c2 fix misnamed timer property in deck config
The old JSON stored it as an int, but it's used as a boolean
2021-04-13 14:04:33 +10:00
Damien Elmes
32ffd20c23
Merge pull request #1117 from RumovZ/browser-folder
Refactor browser and table into folders
2021-04-13 14:03:47 +10:00
RumovZ
2000c80fd2 Refactor browser and table into folders 2021-04-12 09:50:44 +02:00
Damien Elmes
3f3c509bad
Merge pull request #1113 from RumovZ/backend-columns
Backend columns
2021-04-12 16:05:11 +10:00
Damien Elmes
12ce632605 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
26ac64526c 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
9440898e60 add naturalWholeUnit() and basic tests to lib/time.ts
naturalWholeUnit() is not currently used
2021-04-12 14:42:06 +10:00
Damien Elmes
829b99e5b2 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
6e4cdc52a6 stop Svelte warnings from failing the build
+ check for them at test time
2021-04-12 14:28:09 +10:00
Damien Elmes
94330fc0eb 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
d4159fef19 Save separate browser mode headers 2021-04-11 12:28:11 +02:00
RumovZ
fadec3dc5b Merge branch 'master' into backend-columns 2021-04-11 11:18:15 +02:00
RumovZ
db32179a25 Add browser_did_fetch_columns hook and some doc 2021-04-11 10:27:43 +02:00
RumovZ
eafa2afc0d Resolve config sort in table model 2021-04-10 11:33:59 +02:00
RumovZ
801f52df40 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
5982a777aa Rename SearchItems to ReturnItemtype 2021-04-10 10:14:41 +02:00
RumovZ
331df75b72 Remove internal clones of pb BrowserRow structs 2021-04-10 09:49:29 +02:00
RumovZ
48b70873cb Rename column label fields 2021-04-10 09:14:20 +02:00
RumovZ
b723159b3b Remove unused Serialize 2021-04-10 09:13:48 +02:00
RumovZ
d7f7deafd4 Store active browser columns in col state 2021-04-09 22:53:02 +02:00
RumovZ
769b5ac833 Remove superfluous muts 2021-04-09 22:51:18 +02:00
RumovZ
f04ea5a2c7 Move Column logic into main rslib 2021-04-09 19:09:48 +02:00
RumovZ
055a5e8a04 Remove pb SortKind enum and use pb Columns instead 2021-04-09 18:50:30 +02:00
RumovZ
bdd257e140 Merge SortKind enum into Column enum 2021-04-09 18:03:29 +02:00
Damien Elmes
1cc63f9267 update to latest rules_rust incremental compilation 2021-04-09 12:48:24 +10:00
RumovZ
c74078ea9e 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
dd56dc6650 Rename columns for future mode-independent use 2021-04-08 23:43:48 +02:00
RumovZ
7a0cb08ac2 Merge browser row str methods 2021-04-08 20:45:47 +02:00
RumovZ
4692a48ef3 Add card mod column for notes mode 2021-04-08 20:14:10 +02:00
RumovZ
2350cd6e91 Add deck column for notes mode 2021-04-08 19:46:06 +02:00
RumovZ
c6ebb9b441 Merge row contexts 2021-04-08 13:51:46 +02:00
RumovZ
8a131da9a2 Add enum for column sorting 2021-04-08 11:40:24 +02:00
RumovZ
d8a0aa922c Add enum for column alignment 2021-04-08 11:28:29 +02:00
RumovZ
f78401619a Remove Column class and use pb class instead 2021-04-08 11:17:25 +02:00
RumovZ
6c3c479906 Move BrowserColumn into BrowserColumns message 2021-04-08 10:16:06 +02:00
Damien Elmes
605ec7898f switch to new upstream rules_nodejs release 2021-04-08 11:56:09 +10:00
Damien Elmes
1ee4385fcf i18n tts error message 2021-04-08 09:35:19 +10:00
Damien Elmes
28f830730e 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
9ce129efbc update rules_nodejs for public toolchain fix 2021-04-07 18:28:53 +10:00
Damien Elmes
c1c14419a2 switch esbuild to a toolchain 2021-04-07 15:19:23 +10:00
Damien Elmes
4975f47ea3 update to latest esbuild 2021-04-07 14:54:40 +10:00
RumovZ
ee0ad6f5d6 Fix deck column serialization string 2021-04-06 23:03:30 +02:00
RumovZ
6abb05d074 Save key for unsupported add-on columns 2021-04-06 23:02:58 +02:00
RumovZ
a5c02910a6 Use backend column objects on frontend 2021-04-06 19:47:03 +02:00
RumovZ
11bdeb9ca4 Add column logic on backend 2021-04-06 19:46:12 +02:00
RumovZ
929b7dc15b Make Column a strum 2021-04-06 16:54:09 +02:00
RumovZ
08226e2004 Change notes mode shortcut 2021-04-06 16:48:35 +02:00
Damien Elmes
6e954e82a5 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