Commit graph

11894 commits

Author SHA1 Message Date
Damien Elmes
f89ab00236 Update to Rust 1.88
We'll need to handle https://github.com/ankitects/anki/issues/4134 before
we get access to let chains.
2025-06-29 11:50:49 +07:00
Damien Elmes
b872852afe Store uv cache inside AnkiProgramFiles, and allow disabling 2025-06-29 11:50:49 +07:00
Damien Elmes
aa8dfe1cf4 Fix icon/menu entries on macOS after update
We need to exec() Python from a GUI context so that the app name and
icon are inherited from our launcher bundle. And we need to munge
sys.argv[0] prior to main window instantiation so that we don't get
app menu entries like "Hide -c". We do that in the launcher instead
of __init__.py so that older versions display correctly too.
2025-06-29 11:50:49 +07:00
Damien Elmes
f5073b402a Inject Upgrade/Downgrade menu item and audio support into older versions 2025-06-29 11:50:49 +07:00
GithubAnon0000
a587343f29
FIX: Margin between icon was selectable but shouldn't be (#4122) 2025-06-28 21:47:29 +03:00
GithubAnon0000
cfeb71724d
CHANGE right-click in the editor to show option to open folder in linux (#4125)
* CHANGE right-click in the editor to show option to open folder in linux

* FIX checks

* Use heuristics

* ./ninja format

* Use fallback from main instead of xdg-open
2025-06-28 21:33:17 +03:00
Damien Elmes
aae970bed9 Bump version 2025-06-27 21:08:56 +07:00
Damien Elmes
63dcfde005 Update translations 2025-06-27 21:08:56 +07:00
Jarrett Ye
fe5dfe9ec2
Fix/update card.decay in card_state_updater (#4127) 2025-06-27 16:50:29 +07:00
David Allison
5f73725a64
Remove newline: 'Restore to default confirmation' (#4128) 2025-06-27 16:50:06 +07:00
Luc Mcgrady
ad0dbb563a
Feat/Cmrr target selector (#4116)
* backend

* Add: Frontend

* us

* Added: Loss aversion

* change proto format

* Added: Loss aversion

* Added: Future retention targets

* update default fail cost multiplier

* Future Retention -> Post Abandon Memorized

* superfluous as const

* Fix: Wrong default

* Fix: Wrong import order
2025-06-27 16:44:19 +07:00
Luc Mcgrady
e505ca032b
Fix/Add check_output_timestamps to PythonEnvironment (#4113)
* Fix/explicitly set restat

* Revert "Fix/explicitly set restat"

This reverts commit ace2e5ef6a.

* add check_output_timestamps to python.rs
2025-06-27 16:41:50 +07:00
Abdo
fdce765861
Make PYTHONPYCACHEPREFIX point to an absolute path (#4111) 2025-06-27 16:36:27 +07:00
Luc Mcgrady
ae6cf98f40
Fix/unapplied scss (#4103)
* deck options + change notetype

* graphs

* image occlusion

* congrats

* imports

* ./check

* style

* $lib

* delete unused index.ts files
2025-06-27 16:28:35 +07:00
Damien Elmes
bedab0a54b Drop psutil from wheel requirements
We're not using it ourselves, and usage appears isolated to a couple of
add-ons (notably ankirestart)
2025-06-27 16:10:12 +07:00
Damien Elmes
de7de82f76 Refactor launcher + various tweaks
- Launcher can now be accessed via Tools>Upgrade/Downgrade
- Anki closes automatically on update
- When launcher not available, show update link like in the past
- It appears that access to the modern console host requires an app
to be built with the windows console subsystem, so we introduce an
extra anki-console.exe binary to relaunch ourselves with. Solves
https://forums.ankiweb.net/t/new-online-installer-launcher/62745/50
- Windows now requires you to close the terminal like on a Mac,
as I couldn't figure out how to have it automatically close. Suggestions
welcome!
- Reduce the amount of duplicate/near-duplicate code in the various
platform files, and improve readability
- Add a helper to install the current code into the launcher env
- Fix cargo test failing to build on ARM64 Windows
2025-06-27 16:10:12 +07:00
Damien Elmes
73edf23954 Drop Pauker and SuperMemo importers from legacy importer
The legacy importer has only been kept around to support some add-ons,
and these are so infrequently used that they're better off shifted
to add-ons (even they even still work)
2025-06-27 16:10:12 +07:00
Damien Elmes
9b287dc51a Python dependency/wheel tweaks
- Use --locked to assert that the lockfile won't change, so we need
to explicitly 'uv lock' when making changes. Still trying to get to
the bottom of why the lockfile sometimes has editable entries, which
break things when switching between platforms.
- Exclude __pycache__ from wheels
- Move the typing stubs to our dev deps
(https://github.com/ankitects/anki/pull/4074#pullrequestreview-2948088436)
2025-06-27 16:10:12 +07:00
Damien Elmes
7edd9221ac Avoid Qt's automatic About labeling
It gets confused by our launcher process, and provides no way to
alter the default assigned text while keeping the About role on a Mac.
2025-06-27 16:10:12 +07:00
Luc Mcgrady
630bdd3189
Fix/Optimize button alignment (#4117)
* Fix/Button alignment

* add hr
2025-06-25 16:44:47 +03:00
Jarrett Ye
992fb054bd
Refactor FSRS data clearing into Card::clear_fsrs_data (#4123)
Extracted repeated logic for clearing FSRS-related fields into a new Card::clear_fsrs_data() method. Updated set_deck and FSRS disabling code paths to use this method for improved code reuse and maintainability.
2025-06-25 16:40:51 +03:00
llama
d6f93fab76
adjust top toolbar height on body class update (#4120) 2025-06-25 14:20:31 +03:00
llama
06195d1268
add bottom and right margins to account for focus outline (#4115) 2025-06-25 14:15:45 +03:00
llama
a73f1507ba
use KeyboardEvent.key instead of code (#4114) 2025-06-25 14:08:25 +03:00
Damien Elmes
b250a2f724 Add terminal support for *nix 2025-06-22 21:52:44 +07:00
Damien Elmes
d2f818fad2 macOS launcher improvements
- do mpv initial run in parallel
- improve messages, show dots regularly
2025-06-22 21:03:02 +07:00
Damien Elmes
eb6c977e08 Add menu to launcher, and improve terminal display on Windows 2025-06-22 20:25:15 +07:00
Damien Elmes
782645d92e Bump beta version 2025-06-21 19:17:48 +07:00
Damien Elmes
246fa75a35 Create release wheel as part of normal build
Avoids the need for a separate publish
2025-06-21 19:17:48 +07:00
Damien Elmes
cfd448565a Fix sync-server separate compile
https://forums.ankiweb.net/t/anki-25-06-beta/62271/96
2025-06-21 19:17:48 +07:00
user1823
5cc3a2276b
Fix repeated ticks in reviews graph (#4108)
Regressed in #4086
2025-06-21 19:17:18 +07:00
user1823
c28306eb94
Save dr and decay in card even if item is None (#4106)
* Document the purpose of storing dr and decay in card

* Format

* Fix type mismatch errors

* Update memory_state.rs

* Save dr and decay in card even if item is None

* Format

* Fix mismatched types

* Update memory_state.rs
2025-06-21 19:16:54 +07:00
Jarrett Ye
88538d8bad
Fix/set due date on intraday learning card (#4101)
- Introduced `next_day_start` parameter to `set_due_date` for improved due date handling.
- Updated logic to account for Unix epoch timestamps when calculating due dates.
2025-06-21 19:15:30 +07:00
llama
cc395f7c44
Upgrade to nom 8.0.0 (#4105)
* bump nom to 8.0.0

* update cloze.rs

* update template.rs

* update imageocclusion.rs

* update search/parser.rs

* update card_rendering/parser.rs

* replace use of fold_many0 with many0

in nom 8, `many0` doesn't accumulate when used within `recognize`
2025-06-21 19:15:19 +07:00
Jarrett Ye
a4c95f5fbd
include decay in ComputeMemoryStateResponse (#4102)
* include decay in ComputeMemoryStateResponse

* Add decay attribute to ComputedMemoryState and update Collection methods

* Refactor decay calculation into a helper function for improved readability and maintainability in memory state management

* format & clippy
2025-06-20 20:59:35 +03:00
Damien Elmes
b781dfabf5 Add helpers to run Qt 6.7 and 6.9
Removed the 6.8 one, as that's our default
2025-06-20 21:55:38 +07:00
Damien Elmes
718f39fdf3 Temporarily force-enable prereleases
Some users are struggling to read or understand the steps to enable
it.
2025-06-20 19:05:30 +07:00
Damien Elmes
b2dc5a0263 Bump version 2025-06-20 16:52:25 +07:00
Damien Elmes
d542ae9065 Fix check action on Windows ARM
- Update nextest (not required)
- Build nextest without self-update, which pulls in ring
- Disable running of tests in rsbridge, as it has no tests, and
requires host arch's python.lib to execute
- A double \ in CARGO_TARGET_DIR was breaking update_* tests
2025-06-20 16:52:25 +07:00
Damien Elmes
cd71931506 Launcher tweaks
- Handle beta/rc tags in .version when launching Anki
- Update pyproject.toml/.python_version if distributed version newer
- Support prerelease marker to opt in to betas
- Check for updates when using uv sync
- Avoid system Python by default, as it can cause breakages
(e.g. ARM Python installed on Windows)
2025-06-20 16:13:50 +07:00
Damien Elmes
4abc0eb8b8 Use same version for anki-release; publish to main index 2025-06-20 16:13:50 +07:00
Damien Elmes
a60a955c61 Handle beta/rc tags, bump beta, add exact version pin to aqt 2025-06-20 16:13:50 +07:00
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