Commit graph

9886 commits

Author SHA1 Message Date
Damien Elmes
84ac2415a3 Formatting tweak
Triggered by './ninja format', though curiously it did not get picked
up in a check.
2022-12-28 11:53:21 +10:00
Damien Elmes
660d559054 Fix images not being constrained to field width
Appears to have regressed in #2071. I'd used 'inherit' so that the default
editable styling would impose a 100% limit, but it appears that variable
interpolation prevents the parent styling from being applied.
2022-12-24 12:57:38 +10:00
Damien Elmes
900bba1cde Fix lack of marked color in day mode
The call to .lighter() was turning the already-light color into white.

https://forums.ankiweb.net/t/2-1-55-marked-cards-not-colored-in-browser/25568
2022-12-24 11:38:46 +10:00
Damien Elmes
f4c4b64855 Fix incorrect macOS minimum limit in alternate build 2022-12-24 11:09:53 +10:00
Damien Elmes
d33addcf82 Fix dark mode display issues on macOS/Qt5 2022-12-24 11:02:59 +10:00
Damien Elmes
0b0a8e0b46 Add Debug impl for Collection 2022-12-24 10:44:41 +10:00
Damien Elmes
b18d0c54bb Remove unused before_upload method 2022-12-24 10:44:41 +10:00
Damien Elmes
a0222f6d57 Migrate from slog to tracing
The Rust community appear to have converged on tracing - it's used by
the Rust compiler, and receives close to 10x the number of downloads
that slog does. Its API is more ergonomic, and it does a much nicer
job with async rust.

To make this change, we no longer pass around explicit loggers, and rely
on a globally-registered one. The log file location has been changed
from one in each profile folder to a single one in the base folder. This
will remain empty for most users, since only errors are logged by default,
but may be useful for debugging future changes.
2022-12-24 10:44:40 +10:00
Damien Elmes
eec27f6656 Update openssl
.44 was yanked
2022-12-23 16:03:43 +10:00
Damien Elmes
265c9d9705 Fix incorrect packaging of fcitx libs
Transform was being applied to ./symlinks

Closes #2278
2022-12-21 19:31:13 +10:00
Abdo
5afd4d1419 Use a webview to show add-on's config help (#2281)
* Use a webview to show add-on's config help

This allows add-ons to embed images for example.

* Improve initial size of splitter widgets

* Decrease font size and margin of webview
2022-12-21 16:55:31 +10:00
Damien Elmes
6d85f9857b Ensure py.typed file added to _aqt folder in wheel
Closes #2276
2022-12-21 11:49:49 +10:00
Abdo
68eefd3fdf Tweak focus highlight of some widgets (#2280)
* Highlight QComboBox on focus

* Improve visibility of selected menu items

* ANH -> Abdo in About screen
2022-12-21 11:41:57 +10:00
Damien Elmes
ec1141e399 Handle case where Linux distros patch out certifi library
49256e0d08 (commitcomment-93512291)
2022-12-20 11:21:09 +10:00
Damien Elmes
aa3399c51a Simplify solution for #2279 2022-12-19 18:13:34 +10:00
Damien Elmes
5e1bf95af2 Fix panic when adding non-Latin text to fields
Closes #2279
2022-12-19 18:02:43 +10:00
Damien Elmes
e28474d961 Add contributor as requested 2022-12-19 12:12:25 +10:00
Hikaru Y
fe970c363b Fix possible unexpected flash of pop-up menu (#2274)
When a pop-up menu was closed by clicking on an empty space
outside the fields, the variable controlling the display state
was not changed, causing the pop-up menu to flash momentarily
the next time a field was focused.
2022-12-19 12:07:47 +10:00
TRIAEIOU
53ddc6f107 Nested clozes and increased cloze meta data (#2141)
* Nested clozes and increased cloze meta data

* Update contributors

* This reverts commit 3423df73f8.

* Update CONTRIBUTORS

* Formating

* Formating

* Formating

* Formating

* Formating

* Formating

* Formating

* Formating

* Code refactor

* Formating

* Formating

* Formating

* Formating and dead code

* Correct test case

* Remove Hint and Close storage of token string

* Update

* Formating

* Formating

* Formating

* Use write! instead of .push_str(&format).

* Formating
2022-12-19 12:03:15 +10:00
Damien Elmes
5c87111f3d Fix old graphs failing to appear
https://forums.ankiweb.net/t/2-1-55-old-statistics-window-broken/25491
2022-12-19 11:46:38 +10:00
Damien Elmes
5fdd3f48d4 Update crate name in docstrings to fix 'cargo test' 2022-12-16 22:30:54 +10:00
Damien Elmes
0a5bb6439b Bump version 2022-12-16 22:18:27 +10:00
Damien Elmes
778e02415b Move more of the graph processing into the backend
The existing architecture serializes all cards and revlog entries in
the search range into a protobuf message, which the web frontend needs
to decode and then process. The thinking at the time was that this would
make it easier for add-ons to add extra graphs, but in the ~2.5 years
since the new graphs were introduced, no add-ons appear to have taken
advantage of it.

The cards and revlog entries can grow quite large on large collections -
on a collection I tested with approximately 2.5M reviews, the serialized
data is about 110MB, which is a lot to have to deserialize in JavaScript.

This commit shifts the preliminary processing of the data to the Rust end,
which means the data is able to be processed faster, and less needs to
be sent to the frontend. On the test collection above, this reduces the
serialized data from about 110MB to about 160KB, resulting in a more
than 2x performance improvement, and reducing frontend memory usage from
about 400MB to about 40MB.

This also makes #2043 more feasible - while it is still about 50-100%
slower than protobufjs, with the much smaller message size, the difference
is only about 10ms.
2022-12-16 21:42:17 +10:00
Damien Elmes
786eef6d79 Minor Rust cleanups (#2272)
* Run cargo +nightly fmt

* Latest prost-build includes clippy workaround

* Tweak Rust protobuf imports

- Avoid use of stringify!(), as JetBrains editors get confused by it
- Stop merging all protobuf symbols into a single namespace

* Remove some unnecessary qualifications

Found via IntelliJ lint

* Migrate some asserts to assert_eq/ne

* Remove mention of node_modules exclusion

This no longer seems to be necessary after migrating away from Bazel,
and excluding it means TS/Svelte files can't be edited properly.
2022-12-16 21:40:27 +10:00
Damien Elmes
0fb1b0034e Merge pull request #2255 from RumovZ/replace-pct-str-2
Replace pct-str with local percent_encoding crate
2022-12-16 11:21:04 +00:00
Damien Elmes
3b53be29bd Fix wrong Qt version in macOS bundle 2022-12-16 16:53:58 +10:00
Damien Elmes
7bf30ccfae Revert "Always scan for media changes"
This reverts commit e20b93e1c1.

Overhead on larger folders/slower devices is more than I originally
anticipated, and can run into multiple seconds. This seems to be
particularly egregious on mobile, which I presume is due to sandboxing
overhead.
2022-12-15 20:40:20 +10:00
Damien Elmes
ada53855b9 Fix sync spinner not showing
Regressed in #2137

Closes #2270
2022-12-15 19:10:05 +10:00
Damien Elmes
24abd88dff Revert to Qt 6.3.1 on macOS
Due to flicker reported on #2263. 6.3.1 was used in the 2.1.54 and is
the more conservative choice; we can trial 6.3.2 after release.
2022-12-14 15:25:10 +10:00
Damien Elmes
fa5244556f Update translations 2022-12-14 14:35:40 +10:00
Hikaru Y
8dbe436b91 Fix MathJax popup fails to appear (#2268)
* Fix MathJax popup fails to appear when adding MathJax via Fx button

* Revert "Fix MathJax popup fails to appear when adding MathJax via Fx button"

This reverts commit 11115f59bc.

* Fix MathJax popup fails to appear when adding MathJax via Fx button

Use setTimeout() according to the PR review
2022-12-14 14:10:23 +10:00
Damien Elmes
d17c487259 Use 6 digit hex codes for default colors
The color selector prints a warning otherwise.
2022-12-13 11:35:21 +10:00
Damien Elmes
06d8f4502b Another attempt at fixing reversed toolbar on first startup
May close https://github.com/ankitects/anki/issues/2269
2022-12-13 10:51:13 +10:00
Damien Elmes
29b1bde928 Revert "Avoid setting RTL on first run"
This reverts commit 1bb6afb394.

I appear to have been confused in my earlier testing, as reverting
this change seems to make no difference the top bar on first startup,
and fixes a bunch of other regressions that the original change introduced.

https://github.com/ankitects/anki/issues/2269
2022-12-13 10:45:36 +10:00
Matthias Metelka
ee065485ad Add slight inset shadow to hovered buttons (#2267)
* Replace border-with inset shadow on button hover

* Align gradient-end with base color for primary buttons too

to achieve a more natural hover effect.
2022-12-12 15:41:23 +10:00
Damien Elmes
de1f6488cc Add a small unit test
pct-str encoded the / character as well, but the difference shouldn't
matter in our case.
2022-12-12 14:54:11 +10:00
Matthias Metelka
e38886a3c9 Do not append description button for filtered deck (#2266) 2022-12-11 15:03:11 +10:00
Matthias Metelka
4f48fb3c41 Add style for disabled DropdownItem (#2265)
* Add style for disabled DropdownItem

* Switch back to using disabled as attribute instead of class
2022-12-11 13:06:18 +10:00
Damien Elmes
625d725f0f Fix color defaulting to black
Closes #2261
2022-12-11 11:58:21 +10:00
Damien Elmes
9cb57bebcb Update certifi to fix security alert 2022-12-11 11:42:08 +10:00
Damien Elmes
728683ffcb Fix cursor moving to field start when closing MathJax editor
Closes #2258
2022-12-11 11:39:03 +10:00
Matthias Metelka
32ac6dc5a0 Remove dark theme exclusive inset shadow from FloatingArrow (#2257) 2022-12-11 11:18:59 +10:00
RumovZ
5e89e1f795 Replace pct-str with local ascii_percent_encoding 2022-12-09 11:49:39 +01:00
RumovZ
11bb42e447 Ignore non-ASCII chars in ascii_percent_encoding 2022-12-09 11:47:59 +01:00
RumovZ
ef7bfa3e3b Add local copy of percent_encoding crate 2022-12-09 11:46:00 +01:00
Matthias Metelka
da5796bb9e Fix dropdown items wrapping (#2252) 2022-12-09 13:44:06 +10:00
Damien Elmes
ba521bbd1b Update translations 2022-12-09 12:37:27 +10:00
Damien Elmes
02d0f714e0 Increase initial add-on dialog size
I can't reproduce the reported issue, but this will probably help.

https://forums.ankiweb.net/t/anki-2-1-55-beta-7/25130/10
2022-12-09 12:36:28 +10:00
Henrik Giesel
0b57cc8482 Fix overwrite surround (#2247)
* Revert "Revert to setFormat() to fix color setting"

This reverts commit ed77c9d4fa.

* Fix overwrite-surround
2022-12-09 10:10:58 +10:00
Damien Elmes
db0fc7f334 Fix MathJax editor not hiding on blur again
Originally fixed with 39b021f54e,
accidentally reverted in #2070
2022-12-08 22:46:23 +10:00