Commit Graph

1141 Commits

Author SHA1 Message Date
RumovZ
31155f2dcd Refactor note_ease_str() 2021-03-30 23:44:16 +02:00
RumovZ
f530c6d852 Fix comment typo 2021-03-30 21:40:35 +02:00
RumovZ
1ad91a5312 Add note due column 2021-03-30 21:39:15 +02:00
RumovZ
e9c14a763c Refactor card_due_str() 2021-03-30 20:50:09 +02:00
RumovZ
da156cd759 Rename browser_rows to browser_table
Reflects the addition of column handling.
2021-03-30 12:08:35 +02:00
RumovZ
ffe77b1291 Add browser column enum for backend 2021-03-30 11:59:52 +02:00
RumovZ
4933b922f7 Add note lapses column 2021-03-29 16:06:15 +02:00
RumovZ
32e538d0db Add note reps column 2021-03-29 15:52:02 +02:00
Damien Elmes
3383f1742a rename BrowserCardState
Use a more verbose name, and use 'note' rather than 'card', so we
can rely on the default of False
2021-03-29 17:12:45 +10:00
RumovZ
0d8b1c9d0b squash merge browser refactor
Closes #1100
2021-03-29 16:14:54 +10:00
Damien Elmes
0a5222c400 add a few more ftl type hints 2021-03-29 15:55:15 +10:00
Damien Elmes
6ca690a14c gate qt template inclusion on extra_ftl_root name
Bazel was not noticing that the build script needs to be recompiled
when the qt templates flag was changed.
2021-03-29 13:17:38 +10:00
Damien Elmes
cfac40febc switch NoteType to Notetype
When used as a variable, we were typically calling it a 'notetype', not
a 'note type'.
2021-03-27 22:03:19 +10:00
Damien Elmes
9f4a06abee ID -> Id in protobuf and Python
follow-up to dc81a7fed0
2021-03-27 21:38:20 +10:00
Damien Elmes
fcfa6bab4e update to latest Rust 2021-03-27 20:49:10 +10:00
Damien Elmes
561d160590 fix some clippy lints in tests 2021-03-27 20:44:31 +10:00
Damien Elmes
1055acb9f2 fix more issues uncovered by the latest clippy 2021-03-27 20:25:34 +10:00
Damien Elmes
dc81a7fed0 use mixed case for abbreviations in Rust code
So, this is fun. Apparently "DeckId" is considered preferable to the
"DeckID" were were using until now, and the latest clippy will start
warning about it. We could of course disable the warning, but probably
better to bite the bullet and switch to the naming that's generally
considered best.
2021-03-27 19:53:33 +10:00
Damien Elmes
89d249b3b6 update to the latest rules_rust + security framework update 2021-03-27 19:28:19 +10:00
Damien Elmes
dd99059218 address some new clippy lints 2021-03-27 19:28:19 +10:00
Damien Elmes
a96ac98605 update Rust deps 2021-03-27 14:47:16 +10:00
Damien Elmes
b5b21edd11 add string/number distinction to generated Rust methods 2021-03-27 14:31:23 +10:00
Damien Elmes
e4002d7a5e update to latest Fluent 2021-03-27 13:24:11 +10:00
Damien Elmes
3433c02242 i18n->tr in rslib/ to match Python/TS code 2021-03-27 12:09:51 +10:00
Damien Elmes
d6b9cc4d9b drop the legacy enum from rslib, and pass separate module/message idx 2021-03-27 11:56:31 +10:00
Damien Elmes
f485efce16 update remaining TR references in rslib 2021-03-27 11:18:34 +10:00
Damien Elmes
c45ab78b73 update multi-arg TR references, where some needed reordering 2021-03-27 10:49:40 +10:00
Damien Elmes
698ae855d3 update 1 arg tr strings in rslib 2021-03-27 10:39:53 +10:00
Damien Elmes
d5e5722dc8 preserve variable order when extracting from ftl files 2021-03-27 09:09:13 +10:00
Damien Elmes
dc5fdd30d4 update no-arg TR references in rslib/ 2021-03-26 23:16:08 +10:00
Damien Elmes
5abc48932c write methods into generated.rs 2021-03-26 23:07:18 +10:00
Damien Elmes
cca1d29cc8 fix warning in latest Rust 2021-03-26 23:06:15 +10:00
Damien Elmes
b57e9be46f allow js to request specific i18n modules
Brings the payload on the congrats page with a non-English language
down from about 150k to 15k
2021-03-26 21:43:36 +10:00
Damien Elmes
df93ed0b15 update TR references with args in *.ts; fix average answer time 2021-03-26 19:10:39 +10:00
Damien Elmes
3d366d5264 add types to some more Fluent variables 2021-03-26 16:52:54 +10:00
Damien Elmes
8cc6758eb1 declare variables with some common names as int instead of a union 2021-03-26 16:33:53 +10:00
Damien Elmes
3199fa80d5 delimit variables in docstrings to make them easier to read 2021-03-26 14:38:30 +10:00
Damien Elmes
8294b18c68 catch variables only used in plural selection 2021-03-26 14:20:44 +10:00
Damien Elmes
3c19708684
Merge pull request #1094 from shaunren/fix-tts-html
Fix extraneous whitespaces from strip_html_for_tts
2021-03-26 11:00:41 +10:00
Damien Elmes
c697eb1086 embed strings.json into write_json.rs
It appears that including the build script as a dependency is not
enough to make the file available at runtime, so the build breaks
if ts/ is built first.
2021-03-26 09:55:21 +10:00
Damien Elmes
9aece2a7b8 rework translation handling
Instead of generating a fluent.proto file with a giant enum, create
a .json file representing the translations that downstream consumers
can use for code generation.

This enables the generation of a separate method for each translation,
with a docstring that shows the actual text, and any required arguments
listed in the function signature.

The codebase is still using the old enum for now; updating it will need
to come in future commits, and the old enum will need to be kept
around, as add-ons are referencing it.

Other changes:

- move translation code into a separate crate
- store the translations on a per-file/module basis, which will allow
us to avoid sending 1000+ strings on each JS page load in the future
- drop the undocumented support for external .ftl files, that we weren't
using
- duplicate strings in translation files are now checked for at build
time
- fix i18n test failing when run outside Bazel
- drop slog dependency in i18n module
2021-03-26 09:41:32 +10:00
Shaun Ren
1f3751d191 Fix extraneous whitespaces from strip_html_for_tts 2021-03-25 11:44:42 -04:00
Damien Elmes
d382b33585 rework filtered deck screen & search errors
- Filtered deck creation now happens as an atomic operation, and is
undoable.
- The logic for initial search text, normalizing searches and so on
has been pushed into the backend.
- Use protobuf to pass the filtered deck to the updated dialog, so
we don't need to deal with untyped JSON.
- Change the "revise your search?" prompt to be a simple info box -
user has access to cancel and build buttons, and doesn't need a separate
prompt. Tweak the wording so the 'show excluded' button should be more
obvious.
- Filtered decks have a time appended to them instead of a number,
primarily because it's easier to implement. No objections going back to
the old behaviour if someone wants to contribute a clean patch.
The standard de-duplication will happen if two decks are created in the
same minute with the same name.
- Tweak the default sort order, and start with two searches. The UI
will still hide the second search by default, but by starting with two,
the frontend doesn't need logic for creating the starting text.
- Search errors now have their own error type, instead of using
InvalidInput, as that was intended mainly for bad API calls. The markdown
conversion is done when the error is converted from the backend, allowing
errors to printed as a string without any special handling by the calling
code.

TODO: when building a new filtered deck, update_active() is clobbering
the undo log when the overview is refreshed
2021-03-24 22:04:35 +10:00
Damien Elmes
12597e1094 support undo of filtered deck build/empty 2021-03-24 12:56:06 +10:00
Damien Elmes
2a168adb66 move filter code into scheduler/ 2021-03-23 23:55:28 +10:00
Damien Elmes
b5c58ff8e6 nest search term message/order enum 2021-03-23 23:28:50 +10:00
Damien Elmes
ff0d346927 move browser_row method into search service
For want of a better place to put it. Also split the node conversion
into a separate file.
2021-03-23 18:55:05 +10:00
Damien Elmes
95dea7f20a move activeCols into config/ 2021-03-23 18:40:50 +10:00
Damien Elmes
5fd79d9246
Merge pull request #1082 from RumovZ/backend-rows
Backend rows
2021-03-23 18:31:42 +10:00
Damien Elmes
01161c8ed2 use perform_op() for deck creation 2021-03-22 23:17:07 +10:00