Commit graph

1144 commits

Author SHA1 Message Date
RumovZ
d87f80c74a Refactor get_row_color() 2021-03-31 08:56:54 +02:00
RumovZ
ad7563effb Pass Column by value 2021-03-31 00:02:10 +02:00
RumovZ
6233a125fc Add note interval column 2021-03-30 23:44:35 +02:00
RumovZ
fb4dd05dd4 Refactor note_ease_str() 2021-03-30 23:44:16 +02:00
RumovZ
af153f9c09 Fix comment typo 2021-03-30 21:40:35 +02:00
RumovZ
ca87a6fc45 Add note due column 2021-03-30 21:39:15 +02:00
RumovZ
44ae21c0b1 Refactor card_due_str() 2021-03-30 20:50:09 +02:00
RumovZ
9e34c0f80c Rename browser_rows to browser_table
Reflects the addition of column handling.
2021-03-30 12:08:35 +02:00
RumovZ
880e6dc651 Add browser column enum for backend 2021-03-30 11:59:52 +02:00
RumovZ
34d3d24003 Add note lapses column 2021-03-29 16:06:15 +02:00
RumovZ
1eb1747365 Add note reps column 2021-03-29 15:52:02 +02:00
Damien Elmes
7323866a88 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
1f79a8766d squash merge browser refactor
Closes #1100
2021-03-29 16:14:54 +10:00
Damien Elmes
5ef618d8fa add a few more ftl type hints 2021-03-29 15:55:15 +10:00
Damien Elmes
3dee049128 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
d793c30526 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
6b72aaf8c2 ID -> Id in protobuf and Python
follow-up to a90d5aa359
2021-03-27 21:38:20 +10:00
Damien Elmes
d52a34d414 update to latest Rust 2021-03-27 20:49:10 +10:00
Damien Elmes
cefa8d0e9d fix some clippy lints in tests 2021-03-27 20:44:31 +10:00
Damien Elmes
e934bd8e9a fix more issues uncovered by the latest clippy 2021-03-27 20:25:34 +10:00
Damien Elmes
a90d5aa359 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
2338998304 update to the latest rules_rust + security framework update 2021-03-27 19:28:19 +10:00
Damien Elmes
effb0e2ab8 address some new clippy lints 2021-03-27 19:28:19 +10:00
Damien Elmes
0a4bcd3faa update Rust deps 2021-03-27 14:47:16 +10:00
Damien Elmes
c9eddfabac add string/number distinction to generated Rust methods 2021-03-27 14:31:23 +10:00
Damien Elmes
66d84336d7 update to latest Fluent 2021-03-27 13:24:11 +10:00
Damien Elmes
9a7f0f9f5d i18n->tr in rslib/ to match Python/TS code 2021-03-27 12:09:51 +10:00
Damien Elmes
4676d2f3b1 drop the legacy enum from rslib, and pass separate module/message idx 2021-03-27 11:56:31 +10:00
Damien Elmes
cf32bb034a update remaining TR references in rslib 2021-03-27 11:18:34 +10:00
Damien Elmes
27c35cf2c5 update multi-arg TR references, where some needed reordering 2021-03-27 10:49:40 +10:00
Damien Elmes
d7005803bc update 1 arg tr strings in rslib 2021-03-27 10:39:53 +10:00
Damien Elmes
0421ae3e6d preserve variable order when extracting from ftl files 2021-03-27 09:09:13 +10:00
Damien Elmes
51f5df600f update no-arg TR references in rslib/ 2021-03-26 23:16:08 +10:00
Damien Elmes
26d265ce08 write methods into generated.rs 2021-03-26 23:07:18 +10:00
Damien Elmes
5e70b9ff0e fix warning in latest Rust 2021-03-26 23:06:15 +10:00
Damien Elmes
0006a385e1 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
0e50259e6b update TR references with args in *.ts; fix average answer time 2021-03-26 19:10:39 +10:00
Damien Elmes
d7bef83f98 add types to some more Fluent variables 2021-03-26 16:52:54 +10:00
Damien Elmes
afdca58e31 declare variables with some common names as int instead of a union 2021-03-26 16:33:53 +10:00
Damien Elmes
c52bafd1ef delimit variables in docstrings to make them easier to read 2021-03-26 14:38:30 +10:00
Damien Elmes
ee2d3500e5 catch variables only used in plural selection 2021-03-26 14:20:44 +10:00
Damien Elmes
83ed037b83 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
834a7217d6 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
0c63a7c8c4 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
04ab176a16 Fix extraneous whitespaces from strip_html_for_tts 2021-03-25 11:44:42 -04:00
Damien Elmes
be9e46a9ea 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
d80ed5ff3b support undo of filtered deck build/empty 2021-03-24 12:56:06 +10:00
Damien Elmes
14026f2811 move filter code into scheduler/ 2021-03-23 23:55:28 +10:00
Damien Elmes
1d1f18bd59 nest search term message/order enum 2021-03-23 23:28:50 +10:00
Damien Elmes
d7a577e3af 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