Commit graph

11802 commits

Author SHA1 Message Date
Damien Elmes
a41c60c016 Trigger uv sync if user approves update 2025-06-20 16:13:50 +07:00
Damien Elmes
8e20973c52 Drop remaining qt5 code 2025-06-20 16:13:50 +07:00
Damien Elmes
cd411927cc Split libankihelper into a separate module
It's rarely updated, and the old approach resulted in a 'proper' aqt
build only being done on a Mac.
2025-06-20 16:13:49 +07:00
Damien Elmes
344cac1ef4 Update translations 2025-06-19 14:42:08 +07:00
Damien Elmes
f98f620116 Avoid committing release deps
These will only get bumped on a new publish, and keeping the file
around leads to spurious security alerts.
2025-06-19 14:14:57 +07:00
Damien Elmes
04996c77f3
Migrate build system to uv (#4074)
* Migrate build system to uv

Closes #3787, and is a step towards #3081 and #4022

This change breaks our PyOxidizer bundling process. While we probably
could update it to work with the new venvs & lockfile, my intention
is to use this as a base to try out a uv-based packager/installer.

Some notes about the changes:

- Use uv for python download + venv installation
- Drop python/requirements* in favour of pyproject files / uv.lock
- Bumped to latest Python 3.9 version. The move to 3.13 should be
a fairly trivial change when we're ready.
- Dropped the old write_wheel.py in favour of uv/hatchling. This has
the unfortunate side-effect of dropping leading zeros in our wheels,
which we could try hack around in the future.
- Switch to Qt 6.7 for the dev repo, as it's the first PyQt version
with a Linux/ARM WebEngine wheel.
- Unified our macOS deployment target with minimum required for ARM.
- Dropped unused fluent python files
- Dropped unused python license generation
- Dropped helpers to run under Qt 5, as our wheels were already
requiring Qt 6 to install.

* Build action to create universal uv binary

* Drop some PyOxidizer-related files

* Use Windows ARM64 cargo/node binaries during build

We can't provide ARM64 wheels to users yet due to #4079, but we can
at least speed up the build.

The rustls -> native-tls change on Windows is because ring requires
clang to compile for ARM64, and I figured it's best to keep our Windows
deps consistent. We already built the wheels with native-tls.

* Make libankihelper a universal library

We were shipping a single arch library in a purelib, leading to
breakages when running on a different platform.

* Use Python wheel for mpv/lame on Windows/Mac

This is convenient, but suboptimal on a Mac at the moment. The first
run of mpv will take a number of seconds for security checks to run,
and our mpv code ends up timing out, repeating the process each time.
Our installer stub will need to invoke mpv once first to get it validated.

We could address this by distributing the audio with the installer/stub,
or perhaps by putting the binaries in a .pkg file that's notarized+stapled
and then included in the wheel.

* Add some helper scripts to build a fully-locked wheel

* Initial macOS launcher prototype

* Add a hidden env var to preload our libs and audio helpers on macOS

* qt/bundle -> qt/launcher

- remove more of the old bundling code
- handle app icon

* Fat binary, notarization & dmg

* Publish wheels on testpypi for testing

* Use our Python pin for the launcher too

* Python cleanups

* Extend launcher to other platforms + more

- Switch to Qt 6.8 for repo default, as 6.7 depends on an older
libwebp/tiff which is unavailable on newer installs
- Drop tools/mac-x86, as we no longer need to test against Qt 5
- Add flags to cross compile wheels on Mac and Linux
- Bump glibc target to 2_36, building on Debian Stable
- Increase mpv timeout on macOS to allow for initial gatekeeper checks
- Ship both arm64 and amd64 uv on Linux, with a bash stub to pick
the appropriate arch.

* Fix pylint on Linux

* Fix failure to run from /usr/local/bin

* Remove remaining pyoxidizer refs, and clean up duplicate release folder

* Rust dep updates

- Rust 1.87 for now (1.88 due out in around a week)
- Nom looks involved, so I left it for now
- prost-reflect depends on a new prost version that got yanked

* Python 3.13 + dep updates

Updated protoc binaries + add helper in order to try fix build breakage.
Ended up being due to an AI-generated update to pip-system-certs that
was not reviewed carefully enough:
https://gitlab.com/alelec/pip-system-certs/-/issues/36

The updated mypy/black needed some tweaks to our files.

* Windows compilation fixes

* Automatically run Anki after installing on Windows

* Touch pyproject.toml upon install, so we check for updates

* Update Python deps

- urllib3 for CVE
- pip-system-certs got fixed
- markdown/pytest also updated
2025-06-19 14:03:16 +07:00
user1823
bbf533b172
Update the default value of FSRS-6 decay in forgetting curve (#4096)
Changed in 037345fd57
2025-06-19 13:25:30 +07:00
user1823
ba0d590c16
Clear desired retention and decay when changing decks (#4095)
These values are preset-specific and entries from previous deck may cause issues.
2025-06-19 13:23:49 +07:00
Damien Elmes
a63e4ef1c8 Revert "Ignore TaskManager's on_done callback if collection unloaded (#4076)"
This reverts commit ccc42227d8.

Closes #4094
2025-06-19 13:17:30 +07:00
Damien Elmes
c5eb00cb42 Experiment with Claude
*grumbles about lack of support for a dot prefix*
2025-06-19 13:17:30 +07:00
user1823
44f3bbbbc9
Limit study time to hours in reviews graph (#4086)
* Add maxUnit argument to naturalUnit

* Limit study time to hours in reviews graph

Relevant discussions:
- https://forums.ankiweb.net/t/reviews-graph-units-of-total-time-studied-suggestion/61237
- https://forums.ankiweb.net/t/why-does-anki-display-study-time-in-months/37722
- https://forums.ankiweb.net/t/poll-use-hours-in-total-time-stats/62076
- https://github.com/ankitects/anki/pull/3901#issuecomment-2973161601

* Use the new approach for native stability in Card Info

* Use a simpler approach
2025-06-18 14:34:58 +07:00
Damien Elmes
4040a3c1f9 Fix stale 'now' in timing info
Closes #4089
2025-06-18 12:18:38 +07:00
llama
669312d5eb
Fix unescaped deck names potentially missing from overview (#4084)
* html-escape deck name in overview

* move escaping past hook
2025-06-18 11:35:02 +07:00
Lukas Sommer
b4cee124c0
Comments for translators (#4075)
* Update deck-config.ftl

* Update deck-config.ftl

* Update comment

* Udpate comments
2025-06-18 11:34:29 +07:00
llama
5cb191d624
Fix IO text labels' fill attr being saved even if default colour (#4083)
* move exporting of fill attr to subclasses

* set text colour for new labels
2025-06-16 13:07:05 +03:00
Jarrett Ye
615bbf95a1
update to fsrs-rs 4.0.0 (#4080)
* update to fsrs-rs 4.0.0

* fix ci

* update test
2025-06-14 12:48:33 +07:00
Luc Mcgrady
11cc9287ff
Fix/Missing cardID special field (#4078) 2025-06-13 10:47:16 +07:00
sorata
b1f3783a6a
use abbr. for days of week (#4077) 2025-06-13 10:46:17 +07:00
Abdo
ccc42227d8
Ignore TaskManager's on_done callback if collection unloaded (#4076)
* Ignore TaskManager's on_done callback if collection unloaded

* Check col.db
2025-06-13 10:45:41 +07:00
Luc Mcgrady
6004616672
Feat/Health check tooltip (#4068)
* Feat/Health check tooltip

* Update ftl/core/deck-config.ftl

* split deckConfigHealthCheckTooltip

* wording change

* separate "(slow)"

* Add title to health check messages
2025-06-13 10:42:47 +07:00
Damien Elmes
e728e8bcb1 Recreate pyenv if it was created with uv
Temporary fix for #4074 breaking normal builds
2025-06-12 12:20:02 +07:00
Damien Elmes
22f4a83222 Bump requests for CVE 2025-06-11 13:35:03 +07:00
Luc Mcgrady
83131cb48e
Feat/Message at 100% progress for optimize (#4069) 2025-06-11 13:31:17 +07:00
sorata
fe750dba9f
style hr element (#4067) 2025-06-11 13:02:08 +07:00
Sunong2008
ccc9d9027a
Delay retention workload info display after FSRS optimization alerts (#4066)
* Update FsrsOptions.svelte

* Update CONTRIBUTORS

* Make it full width too, so it doesn't resize when transitioning past 90

* Make sure the Warning appears after the alert

* Update FsrsOptions.svelte

* Update FsrsOptions.svelte

* Update FsrsOptions.svelte
2025-06-11 13:01:47 +07:00
Jarrett Ye
ce6497cd2b
Fix/remove the lower limit of interval when set due date (#4063)
* Fix/remove the lower limit of interval when set due date

* don't affect SM-2

* Apply patch from user1823

* Fix build

* More suggestions from user1823
2025-06-08 15:36:32 +07:00
sorata
e5d34fbb18
Update default styles (#4060)
* add margin for hr

* add line height to default styles

* update my email

* change margin to 1em
2025-06-08 11:24:46 +07:00
Damien Elmes
c1fc45928d Bump version 2025-06-06 14:05:33 +07:00
Damien Elmes
e66bbc62ec Update translations 2025-06-06 13:20:08 +07:00
Damien Elmes
2427743751 Formatting fix
I have checks running on push, but must have confused the build system
by modifying the file at the wrong time.
2025-06-06 13:19:47 +07:00
Damien Elmes
933d63545a Stop collapsing reschedule entries
Closes #3316
2025-06-06 13:13:48 +07:00
Damien Elmes
50b7588231
Treat play_file() and co as internal routines without protection (#4059)
* Treat play_file() and co as internal routines without protection

Our code and add-ons need a way to play audio from arbitrary locations. I propose we treat the _tag API as suitable for user input, and the _file API for internal use.

* Mention basename in the *_file() paths
2025-06-06 12:55:04 +07:00
Luc Mcgrady
55ecbc1125
Feat/Health check (#4047)
* Message on low log loss

* make console.log permanent

* Added: Health check option

* disable button

* change health check conditions

* i18n

* ./check

* Apply suggestions from code review

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

* delete shadowed fsrs

* Update ts/routes/deck-options/FsrsOptions.svelte

Co-authored-by: llama <gh@siid.sh>

* Update ftl/core/deck-config.ftl

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

* anon's suggestions

* snake_case

* capital slow

* make global

* on by default

* Adjusted loss values

* Show message on pass

* ./check

* ComputeParamsRequest

* update coefficients

* update thresholds

* fix thresholds

* Apply suggestions from code review

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
Co-authored-by: llama <gh@siid.sh>
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2025-06-06 12:43:33 +07:00
Jarrett Ye
8add993fca
improve the accuracy of the expected workload calculation (#4056)
* improve the accuracy of the expected workload calculation

* ./ninja fix:minilints

* implement smoothing & a separate struct for return value

* set TERMINATION_PROB to 0.001
2025-06-04 18:20:12 +07:00
Ren Tatsumoto
3ab8c2294d
Restore ability for add-ons to provide full paths to media (#4054)
* fix #4053

* check if file exist

AJT Japanese needs to play files stored in all possible locations on disk

* check absolute path

* add comment

* check if passed name is basename

* Add a security note to reduce the chance of a regression

* Tweak comment in the non-add-on case
2025-06-04 18:11:37 +07:00
Ren Tatsumoto
29e3146e1f
trim file to basename before creating SoundOrVideoTag (#4057)
* trim file to basename before creating SoundOrVideoTag

* add import
2025-06-04 18:03:14 +07:00
llama
996fa8bcb0
add answer key shortcuts to grade now dialog (#4055) 2025-06-04 12:15:33 +07:00
llama
174b199164
Add IO mask colour fill tool (#4048)
* add fill tool

* add fill tool logic

* open colour picker on fill tool activation

* refactor/add fill attr to io clozes

* fill masks in editor

* fill text and inactive masks in reviewer

* fix lint

* remove debug option
2025-06-04 11:45:34 +07:00
GithubAnon0000
27c1ed1899
FIX diacrititcs being cutoff in input card templates (#4049) 2025-06-03 16:27:32 +07:00
Luc Mcgrady
bbac90d97d
Fix/Invalid parameter counts saveable (#4052)
* Add frontend check for parameters

* Fix backend

* ./check

* Fix: Wrong type
2025-06-03 16:27:04 +07:00
Expertium
4e928fd7ca
Optimize All -> Optimize All Presets (#4050) 2025-06-03 16:23:35 +07:00
Jarrett Ye
2de0c79ba5
Feat/evaluate FSRS with time series split (#3962) 2025-06-03 15:26:33 +07:00
Damien Elmes
37984233cc Restore cert error check
https://forums.ankiweb.net/t/bug-unknown-error-on-startup-anki-25-02/61232/3
2025-06-02 16:52:09 +07:00
Luc Mcgrady
a99beb71fe
Feat/Card ID special field (#4046)
* Feat/Card ID special field

* remove clone
2025-06-02 16:35:13 +07:00
Luc Mcgrady
06c0e4c14a
Fix/CMRR style (#4043) 2025-06-01 13:18:35 +07:00
Damien Elmes
f81a9bfdfb
Fix mpv being left around on abrupt termination (#4042)
Closes #4015
2025-06-01 13:16:28 +07:00
Damien Elmes
96ff27d1fb
Ensure media files are passed relative to the media folder (#4041)
We were (partially) doing this for MpvManager, but not for
Windows' SimpleMpvPlayer. By passing a media file starting
with a special scheme, a malicious actor could have caused a file to
be written to the filesystem on Windows.

Thanks once again to Michael Lappas for the report.
2025-06-01 13:16:04 +07:00
Damien Elmes
757247d424 Use more secure API key
https://github.com/ankitects/anki/pull/3925#discussion_r2051494659
2025-05-31 16:01:03 +07:00
Damien Elmes
6cdebd7638 Fix inverted margin logic
https://github.com/ankitects/anki/pull/4040#issuecomment-2921626962
2025-05-30 22:48:31 +07:00
llama
f9f0894162
Add left margin to browser when sidebar is closed (#4040)
* add left margin to browser when sidebar is closed

* listen for event instead of explicit user action

* refresh sidebar on visibility change

* Add a margin on macOS even when not collapsed

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2025-05-30 13:35:06 +07:00