Commit graph

11163 commits

Author SHA1 Message Date
David Culley
0578754954 Fix 'NoneType object is not subscriptable' error (#3286)
* fix: ensure none of the returned values is None

Fixes TypeError 'NoneType' object is not subscriptable

* refactor: reduce code duplication using a function

* refactor: prefer KeyError over None for dicts

If the key is not in the dictionary, we want to raise a KeyError rather
than returning None. That way, we can distinguish between whether the
value was None or the key was not found.

* chore: add myself to CONTRIBUTORS file

* refactor: simplify the code
2024-08-04 20:49:45 +07:00
Damien Elmes
43263d9167 Formatting fix
For some reason this didn't get caught by my pre-push hook :-(
2024-08-01 12:24:38 +07:00
Damien Elmes
7e983dbd25 Drop non-working tiff support
https://forums.ankiweb.net/t/anki-fails-to-attach-tif-images-to-cards/47609
2024-08-01 12:19:35 +07:00
Expertium
8ba19af766 SM2 -> SM-2.ftl (#3327)
Relevant: https://github.com/ankitects/anki-manual/pull/218
2024-07-26 21:24:29 +07:00
sorata
b7eb81c6e0 Updated tooltips (#3326)
* Update deck-config.ftl

* Update deck-config.ftl

* Update deck-config.ftl

* Update deck-config.ftl

* Update ftl/core/deck-config.ftl
2024-07-26 19:30:35 +07:00
Damien Elmes
039cbba5cf Update translations 2024-07-26 18:21:01 +07:00
Expertium
618658f643 Ignore reviews before -> Ignore cards reviewed before.ftl (#3314)
* Ignore review before -> Ignore cards reviewed before.ftl

* Revert the change.ftl

* Update CONTRIBUTORS
2024-07-26 18:19:51 +07:00
David Culley
59fb88588d Update type annotations to use | operator (#3323)
* refactor: update to `|` operator

* refactor: add missing type hint

* refactor: enable `|` operator for older versions

* refactor: remove obsolete import
2024-07-26 18:15:39 +07:00
sorata
6587f91e85 Rename review limit (#3320)
* maximum reviews/day —> maximum cards/day

* New cards ignore maximum limit
2024-07-26 18:05:33 +07:00
David Culley
51ec030125 style: reformat with black (#3324) 2024-07-26 17:58:57 +07:00
David Culley
db385f3dcf Update type annotations (#3322)
* refactor: update Callable type hint

* refactor: update type annotations for hooks
2024-07-26 17:57:25 +07:00
David Culley
599db38061 Refactor getting the index of a user's language (#3311)
* refactor: rename variables of tuple

* refactor: rename function argument

* refactor: use function to get index of language

* refactor: replace for-loop

* refactor: use variable

* refactor: assert values are not None

To satisfy the type checker.

* refactor: change generator expression to for-loop
2024-07-25 12:46:59 +07:00
Damien Elmes
1365a41375 Revert "About section transparent logo (#3284)" (#3315)
This reverts commit 018b645fd4.
2024-07-22 02:09:40 +07:00
Damien Elmes
d43a59b652 Latest openssl fix 2024-07-22 02:08:35 +07:00
Jarrett Ye
0a37d366f6 Feat/FSRS-5 (#3298)
* Feat/FSRS-5

* adapt the SimulatorConfig of FSRS-5

* update parameters from FSRS-4.5

* udpate to FSRS-rs v1.1.0

* ./ninja fix:minilints

* pass ci

* update cargo-deny to 0.14.24

* udpate to FSRS-rs v1.1.1

* update to fsrs-rs v1.1.2
2024-07-21 21:02:24 +07:00
sorata
bd69a0e687 Update AutoAdvance.svelte (#3313) 2024-07-21 20:49:42 +07:00
user1823
b076286b8a Update references to tooltip strings (#3312)
* Update string reference

* Update FsrsOptionsOuter.svelte
2024-07-21 17:24:41 +07:00
sorata
cd03b7191d Update Tooltip (#3288)
* Update Tooltip

updated the tooltips as described here: https://forums.ankiweb.net/t/update-tooltips/46849

* Update CONTRIBUTORS

* Update deck-config.ftl

* fixed punctuation, stylistic incoherence, etc.

* Update deck-config.ftl

https://github.com/open-spaced-repetition/fsrs4anki/pull/667

* Changed string requires new key (dae)

* Minor tweaks to tense for clarity (dae)

https://github.com/ankitects/anki/pull/3288#issuecomment-2223384500
2024-07-21 16:44:37 +07:00
Abdo
55fed69801 Fix change_notetype_of_notes's docstring (#3304) 2024-07-21 15:26:10 +07:00
David Culley
f99f3d5865 Refactor ephemeral_card of notes (#3307)
* refactor: fix type annotation

* fix: properly check if argument is None

Don't use Boolean expressions to implement a default value.

* fix: ensure that 'model' is not None

Don't use exceptions to control the flow.

* refactor: simplify if-else construct
2024-07-21 15:25:48 +07:00
David Culley
b01f89e7eb refactor: use list comprehension (#3308) 2024-07-21 15:21:41 +07:00
Abdo
fef30b48d3 Fix unused parent tags getting cleared (#3299)
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2024-07-21 15:00:39 +07:00
David Culley
5be8f423f2 Update type annotation syntax (#3283)
* chore: add myself to CONTRIBUTORS file

* refactor: use newer type hints for Union/Optional

* refactor: fix deprecated type annotations

use collections.abc rather than typing

* refactor: use lower letter type annotations

* style: reformat with black

* refactor: remove unused imports

* refactor: add missing imports for type hints

* fixup! refactor: use newer type hints for Union/Optional

* fix: add missing imports for type annotations

* fixup! refactor: use newer type hints for Union/Optional

* fixup! style: reformat with black

* refactor: fix remaining imports re: type hints
2024-07-21 14:00:52 +07:00
Ren Tatsumoto
79b3fb840d replace showWarning with show_warning (#3306)
* replace showWarning with show_warning

* run isort

* change imports
2024-07-21 13:22:47 +07:00
Damien Elmes
638bafb2ee Switch mask editor to non-conflicting shortcut
In the absence of better ideas, I've added alt

Closes #3276 and #3278
2024-07-21 13:05:56 +07:00
David Culley
8ea79dc033 isort: remove settings covered by profile (#3281)
* chore: remove isort settings covered by profile

https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#custom-configuration

* chore: add myself to CONTRIBUTORS file

* chore: use black profile for isort

* chore(isort): fix configuration to skip directories

When overwriting `skip`, `.git` and others would no longer be skipped.

`extend_skip` is the correct option.

* chore(isort): skip directory `qt/bundle`
2024-07-20 18:13:12 +07:00
Damien Elmes
bde039ca84 Allow Unicode-3 license 2024-07-20 18:07:06 +07:00
Damien Elmes
9d8854f71e Bump cargo deny version 2024-07-20 17:59:08 +07:00
Pedro Schreiber
7b7ed58479 keep-text-in-occlusion (#3277) 2024-07-20 17:48:37 +07:00
Ian Samir Yep Manzano
018b645fd4 About section transparent logo (#3284)
* changed anki-logo-thin.png to version with transparent background

* Revert "changed anki-logo-thin.png to version with transparent background"

This reverts commit 4c7e826a73.

* changed anki-logo-thin.png to version with transparent background

* added name to contributors as per contribution guidelines for first PR

* fixed contributors file rather than directly modifying about file
2024-07-20 17:46:12 +07:00
David Culley
2874a0a1cc Simplify the format string (#3293)
* refactor: simplify format string

* chore: add myself to CONTRIBUTORS file
2024-07-10 21:14:51 +07:00
Jean Khawand
b7f61c5d75 Update base images and introduce health endpoint (#3273)
* Update base images and introduce health endpoint

sync-server: introduce `/health` endpoint to check if the service is reachable.

bump(alpine): bump alpine base image from `3.19` to `3.20`

bump(rust): bump rust-alpine build image from `1.76` to `1.79`

* fix cargo fmt

* add allow clippy::extra_unused_type_parameters

* Remove unused type param (dae)

* Route /health directly (dae)

* Fix for latest axum (dae)
2024-07-10 20:35:21 +07:00
user1823
5cea4d536b Apply fuzz to SM2 lapse interval and respect max ivl (#3275)
* Apply fuzz to SM2 lapse interval and respect max ivl

Imo, there is no reason for not applying fuzz to SM2 lapse intervals

* Update review.rs

* Format

* Update review.rs

* Update review.rs

* Update review.rs

* Update review.rs
2024-07-10 20:28:21 +07:00
Damien Elmes
dd8f6405e7 Exclude gix from cargo-deny 2024-07-10 20:12:06 +07:00
Luc Mcgrady
da37614437 Fix profile manager used before checked for None (#3272)
* Fix: profile manager used before checked for None

* ./check
2024-07-10 20:00:15 +07:00
Abdo
c9419313de Limit cloze nesting level (#3264)
* Limit cloze nesting level

* Break cloze rendering at a lower limit
2024-07-10 19:59:31 +07:00
Rastislav Kish
9ffd0f511a A11Y: Improve the accessibility of the Preferences dialog (#3255)
* Configure buddy widgets for labels in the Preferences dialog

Labels are often used to describe the purpose of a different widget like a combobox, edit field or a spinbox by providing a textual name for their functionality. The relation between a label and a widget is typically expressed by placing the label next to the relevant object. In addition to this visual linking intended for human users, frameworks usually also offer semantic way to link labels with other widgets, so the relation can be noticed by programs like screenreaders, which can figure out the correct textual description for the focused widgets based on this information.

By default, labels on their own are not focusable elements, so users dependend on keyboard navigation and speech get to notice only the widget types (textbox, spinbox, etc.) while moving around without any contextual information if labels are not linked. When the linking is done, the component names get included as well.

QT provides the "buddy" property for QLabel, which creates a semantic link between the label and its buddy widget.

This commit configures the buddy properties on labels of the Anki Preferences dialog.

* Configure spinbox suffixes in Preferrences dialog

QSpinBox provides a suffix property. This property makes it possible to display a measurement unit next to the component value, which is linked to it both visually and semantically for the GUI framework without affecting the spinbox value itself. For purposes of accessibility, it's better to use this property than simply place a label next to the component, since it can be directly accessed by screenreaders and other assistive technology.

This commit configures suffix properties for spinboxes in the Anki Preferences dialog. Note: Removal of the original unit labels may have altered the UI a little bit.

* Assign buddy widgets in the ID and password retrieval dialog

Set buddy widgets of the labels in the Get ID and password for synchronization dialog.

* Fix positioning/size of text boxes

* Style the suffixes of Preferences' QSpinBoxes

Style QSpinBox suffixes (for those that have one) in the Preferences dialog by prepending them by a space character.
2024-07-10 19:58:47 +07:00
Abdo
9cd6886564 Fix remaining accessibility warnings (#3241)
* Remove unused build var

* Fix accessibility warnings in CollapseLabel

* Fix accessibility warnings in PlainTextBadge

* Add ARIA role to Autocompleteitem

* Fix accessibility warnings in HandleBackground

* Fix accessibility warnings in HandleControl

* Fix accessibility warnings in EditorField

* Fix accessibility warnings in RichTextBadge

* Fix accessibility warnings in StickyBadge

* Remove ignored a11y warnings
2024-07-10 19:55:08 +07:00
Damien Elmes
9d29e04cf6 Update translations 2024-07-06 19:08:03 +07:00
Damien Elmes
8335618549 Update axum/reqwest for hyper 1.0 2024-07-06 18:45:32 +07:00
Damien Elmes
734962827d Update Rust + Rust deps 2024-07-06 18:40:38 +07:00
Damien Elmes
59f707efa0 Some lint fixes for newer Rust 2024-07-06 18:40:37 +07:00
Damien Elmes
6a65866f43 Update web deps
Vite held back, as current version is breaking the build
2024-07-06 18:40:37 +07:00
Damien Elmes
74d7397a6e Bump Python deps
A few tweaks were required for PyLint
2024-07-06 18:40:37 +07:00
Damien Elmes
16e611c0d7 Fix check:svelte/vitest running indiscriminately 2024-07-06 18:40:36 +07:00
Damien Elmes
71b9df0f7a Uyghur is RTL
https://forums.ankiweb.net/t/rlt-ui-bug-uyghur-language-gui-direction/46610
2024-07-02 19:03:29 +07:00
Damien Elmes
01a1141c5e Update translations 2024-06-28 22:02:33 +08:00
Abdo
e27be4c85c Restore $deckOptions (#3265)
* Restore $deckOptions

* Avoid error in logs when using ./yarn dev or mobile clients (dae)
2024-06-28 19:38:18 +07:00
Abdo
bfe3119299 Shuffle identical values in filtered deck sort (#3259)
* Shuffle identical values in filtered deck sort

* Update test
2024-06-28 18:53:16 +07:00
Abdo
5f691208d5 Fix deck config input's background color regression (#3258)
* Fix deck config input's background color regression

* Move styles to base stylesheet
2024-06-28 18:52:51 +07:00