- 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.
* 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`
* 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
- 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)
* 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
* 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
* 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
* 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
* CHANGE collection size too large error to add MB values and info about compressed vs. uncompressed
* Round f64 to 2 decimals
* Remove line breaks from ftl/core
* Remove string 'uncompressed' from code
* Add string 'uncompressed' to ftl/core
* Remove if statement change introduced to test changes locally
* Run ./check
* Check if self.card.reps>0 before substracing 1
* Fix formatting
* Use a more rust-y way to avoid the Panic for underflow, especially wé're talking seed value
Co-Authored-By: jake <jake@sharnoth.com>
---------
Co-authored-by: jake <jake@sharnoth.com>
* Clarify logic in reviews_for_fsrs
Prior to this change, the second check of `first_of_last_learn_entries`
was dead code because the first check would always break out of the loop
before it could succeed. Re-order the code for clarity and add a
comment to explain the logic.
* Update CONTRIBUTORS
* Feat/FSRS-6
* update comment
* add decay to Card
* ./ninja fix:minilints
* pass check
* fix NaN in evaluation
* remove console
* decay should fallback to 0.5 when it's None.
* Update SimulatorModal.svelte
* Update a few comments
* Update FSRS decay defaults to use constants for better maintainability and clarity
* Update rslib/src/storage/card/data.rs
* Fix: Recalculate memory states on simulate
* Fix: Wrong cards included
* Save states to cards
* ./check
* Update rslib/src/scheduler/fsrs/simulator.rs
* NF: document that cloze number are kept as they are in the field
I needed to know because {{c1 generate card 0 for example. And storing
the card ordinal would have been another consistent choice.
* NF: introduce method that return the cloze number in fields
This slightly reduce code duplication.
* Apply suggestions from code review
* NF: replace `disabled` by `enabled`
This allows to remove the negations and, in my opinion, make the code
easier to understand and edit.
* Cloze button get disabled outside of cloze field
More specifically, if the user focus in a field that is not a cloze
field, the button are still there but appear as disabled. The shortcut
instead of adding the cloze context shows an alert explaining why this
can't be done.
While this message is already displayed when the user tries to add a
note with cloze in non-cloze field, I suspect it will save time to
stop the user as soon as possible from making mistake. This should
make very clear what is authorized and what is not.
It'll also be a reminder of whether the current field is a cloze or
not.
In order to do this, I added a back-end method (that I expect we may
reuse in ankidroid) to get the index of the fields used in cloze. This
set is sent to the note editor, which propagates it where needed.
In mathjax, the cloze symbol is removed when the selected field is not
a cloze field.
* Improve natural unit conversion for a time b/w 360 to 365 days
Previously, 363 days would be converted to 12.1 months, which is quite confusing because
- a user would think that if the value is more than 12 months, why it isn't displayed in years
- the value is actually less than a year, which is counterintuitive as 12.1 m suggests a value more than a year.
* precise
* Update time.ts to match timespan.rs
* Add another test
* Use average duration of a month instead
* Update time.ts
* Update test_schedv3.py
* Update time.test.ts
* Display median interval in Stats instead of mean
Median is better suited than mean for reporting skewed data.
* Display median ease in Stats instead of mean
* Update difficulty.ts
* Update ease.ts
* Update statistics.ftl
* Format eases.rs
* Remove unused import
* Change Median back to Average in UI
* Revert "Change Median back to Average in UI"
This reverts commit e0c1e3f8e4.
* Preserve the old translations for now (dae)
* modify render_card to return whether card was empty
* plumbing
* add flag to proto message
* plumbing: pass flag along to PartiallyRenderedCard
* add tests
* Use a custom return type for clarity (dae)
* Move the solution to the Rust layer
* CONTRIBUTORS fix (1)
* CONTRIBUTORS fix (2)
* Fix CI issues
* Simplify reparenting solution
* Fix reparenting message with tags
* Revert "Fix reparenting message with tags"
This reverts commit 199958c1c5.
* tags: Return None in reparented_name when the name is unchanged
* add qsv-sniffer crate
* use qsv-sniffer before falling back to old delimiter heuristic
* update test metadata macro
* revert impl
* trim potential suffixed delimiters from non-freeform meta lines
* add test
* Feat/grade now
* pass ci
* fix from_queue
* Refactor card answering to support from_queue flag
- Add `from_queue` field to `CardAnswer` struct and proto message
- Modify `answer_card_inner` to handle queue updates based on `from_queue`
- Remove `grade_card` method and consolidate card answering logic
- Update related test cases to set `from_queue` flag
* fix current_changes() called when no op set
* Optimize queue updates for batch card processing
- Refactor `grade_now` to collect processed card IDs first
- Add new `update_queues_for_processed_cards` method for efficient batch queue updates
- Improve queue management by removing entries and updating counts in a single pass
- Remove individual queue update method in favor of batch processing
* pass ci
* keep the same style
* remove ineffective code
* remove unused imports
* Added: Leech suspend to simulator
* Added: leech threshold spin box
* Update git rev
* Added: Save to preset options
* ./check
* Added: "Advanced settings" dropdown
* Removed: Indent
* Added: Easy days
* Added: Sticky header
* Removed: Easy Day updating without saving
* un-nest disclosure
* bump fsrs
* Update a VSCode setting to match recent releases
* Move Easy Days above the Advanced settings
I think it's a bit more logical to have Advanced come last.
* Ensure graph fits inside screen height
* Bump fsrs version
* Add myself to CONTRIBUTORS
* Set draggable="false" attribute on .replay-button
Because currently if a user drags slightly (even unintentionally) upon clicking a play button, play does not happen
* Prevent dragging hint links
Because if a user moves cursor a little after `mousedown`, action (expanding the hint) does not occur. Which might cause issues from accessibility standpoint
* Don't recalculate remaining steps, conditionally
Bug report reproduction steps:
Create a new profile so that everything is set to default.
Create a new card.
Click Good.
Open deck options and empty learning steps. Save.
No go back and put 1m 10m as LS.
Go back to the card and it should show 10m on the Good button.
Check if old_steps is empty and if it is just use remaining
steps for the new_remaining steps. Add test.
* Update contributers
* Format code
* Fix clippy error
* Use more idiomatic imports
Currently we only check the size on a one-way sync, allowing users
to bypass the limits by incrementally syncing a lot of material.
To prevent this:
- The server now checks if the collection is already oversize,
and forces a one-way sync if it is
- The client checks if the local collection is oversize and refuses
to proceed, so they don't waste time uploading material that will
likely trigger the limit the next time they sync.
* Feat/support load balance and easy days in FSRS simulator
* format
* consider LoadBalancerEnabled
* use fsrs::PostSchedulingFn
* add load balance and easy days to compute_optimal_retention
* move simulator to a pop-over
* fix incorrect simulationNumber when error 500
* Feat: Save to Preset Options
* update tabs when update newPerDay & reviewsPerDay
* don't reset deckSize & daysToSimulate when save options
* fix missing easy days
* plan to support review priority
* Fix graph line rendering with non-scaling stroke
* simplify review priority function with helper wrapper
* fallback to default ReviewPriority for Added & ReverseAdded
* Update ts/routes/deck-options/SimulatorModal.svelte
Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>
* Wrap review priority function in Arc for thread-safe sharing
* more granularity for R sorting
* Add graph smoothing option to FSRS simulator
* Improve graph resize handling in FSRS simulator
* simplify review priority calculation
* Add review order selection to FSRS simulator modal
* Refactor review priority function using macro for conciseness
* Add copyright and license header to SimulatorModal.svelte
* cargo clippy
* ./ninja fix:eslint
* update fsrs-rs
* Update FSRS dependencies and refactor load balancing functions
- Update fsrs-rs dependency to latest commit
- Modify retention and simulator modules to use Arc instead of Box
- Update function signatures and imports in simulator module
- Simplify review card order handling with direct enum usage
* resolve reviewed changes
* replace .unwrap() with ?
* move simulating into SimulatorModal
* add (crate) to interval_to_weekday
* Update FsrsOptions.svelte
* format
---------
Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>
* Fix/re-optimize FSRS if short-term param is weird
* Reset progress when another run is required (dae)
* only count the same-day steps
* Fix flicker when optimizing again (dae)
* Subtract introduced:1 count from learn count of first day of simulator.
* Fix: Cards filtered
* Tidy up
* Fix: Cards filtered (2)
* ./check
* Removed unnecessary filter
* Fix: Doesn't work for real new cards
* ./check
* Fix: .is_none()
* Limit to 1 day
* Removed "days_to_simulate" argument from convert
* Match calc of relative overdueness in SM2 and FSRS
* Fix calculation of FSRS relative overdueness
* Improve readability by avoiding double negative
* Move comment line
Making it configurable would be complicated, so this just restores
the limit to close to the protobuf limit we were butting up against
for now.
Related: #3637
* add Note::set_modified_with_mtime
* add struct for Collection::update_note_inner_without_cards's args
* refactor Collection::update_note_inner_without_cards to use the arg struct
* add Collection::update_note_inner_without_cards_using_mtime
* use incoming note's mtime when updating notes during import
* add support for comments to templates
* add tests
* add support for comments to CardLayout
* fix lints
* revert current impl
* extract parsing logic from legacy_text_token
* add support for comments to templates
* add tests
* refactor take_until_handlebar_start_or
* remove redundant rest
* Require full subclause match when locating next token (dae)
* Rework legacy template handling (dae)
The handlebar parser is now an instance method of a TemplateMode
enum, allowing us to avoid duplicate code for the legacy code path,
and the necessity to box up the iterator.
This does result in a change in behaviour: when the user has specified
the alternate syntax, the standard syntax will no longer be accepted.
* Remove stale comment (dae)
* Feat/support new cards ignore review limit in simulator
* ./ninja fix:minilints & ./ninja format
* use published crate
* make newCardsIgnoreReviewLimit reactive
* format
---------
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
* new easy days algorithm
* take easy day percent totals in account when determining reduced scheduling
* Use variant method to avoid repeated mapping to a constant (dae)
It was probably not worth the time I took to change this ^_^;
* Add some unit tests
Covers most of the cases encountered in https://github.com/ankitects/anki/pull/3639
* Format
* Update params.rs
Makes the test more robust.
* Update params.rs
When training, the first FSRS item is removed. That's why none of the other tests includes it.
Co-authored-by: Jarrett Ye <jarrett.ye@outlook.com>
* Improve naming
* Fix typo
---------
Co-authored-by: Jarrett Ye <jarrett.ye@outlook.com>
* Fix/fallback to non-manual entry when first_of_last_learn_entries non found
* refactor single_card_revlog_to_item(s)
* update unit test of bypassed_learning_is_handled
* move comment line
* remove first_relearn_entries
* skip cram entry
* only pick non_manual_entries after ignore date
* fallback to non_manual_entries if the first learning step is before the ignore date
* pass ci
* update ignore_before_date_between_learning_steps_when_reviewing
* shorten the comment
* Minor refactoring
- fsrs_items_for_memory_state - fsrs_items_for_memory_states
- single_card_revlog_to_item -> fsrs_item_for_memory_state
(to match fsrs_items_for_training)
- single_card_revlog_to_items -> reviews_for_fsrs
- Use struct instead of tuple for reviews_for_fsrs output
- Don't return count, since we're already returning the filtered list
* More renaming/comment tweaks
- non_manual_entries -> first_user_grade_idx
- change comments to reflect the fact that we're working backwards
- Use "user-graded" rather than "non-manual"
* Add extra unit test
* Some wording tweaks