Commit graph

11619 commits

Author SHA1 Message Date
Jarrett Ye
d52889f45c
Feat/simplified relearning steps logic with updated FSRS training API (#3867)
* Feat/simplified relearning steps logic with updated FSRS training API

* Update params.rs

* use ComputeParametersInput

* update fsrs-rs dependency

* update cargo/format/rust-toolchain
2025-03-20 14:04:38 +07:00
Jarrett Ye
5d7f6b25c0
Improve performance of stats revlog entries with memory state (#3866)
* improve performace of stats_revlog_entries_with_memory_state

* format

* move Vec<RevlogEntry> into FsrsItemForMemoryState
2025-03-20 14:02:40 +07:00
llama
d8c83ac075
Loosen csv metadata parsing (#3862)
* 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
2025-03-19 18:56:17 +07:00
Kris Cherven
ab8692a91e
Show "and others" at the end of the contributor list in the About dialog (#3863)
* Show "and others" at the end of the contributor list in the about dialog

* Make about addendum translatable

* Fix CONTRIBUTORS

* Fix CONTRIBUTORS

* Update ftl/qt/about.ftl (dae)
2025-03-19 18:16:51 +07:00
Kris Cherven
938c55ca01
Fix broken window decorations on unpackaged GNOME instances (#3858)
* Fix broken window decorations on unpackaged GNOME instances

* Fix CONTRIBUTORS detection

* Fix CONTRIBUTORS
2025-03-19 17:58:42 +07:00
Evgeny Kulikov
ffcc7612ab
Add-ons Dialog: disable View Config/Page/Files buttons when clicking them would not lead to useful result (#3869)
* Remove unused import

* Nit-pick on code comment

* Enable View Page/Config buttons only when 1 add-on selected

* Enable Cmd+W shortcut (on Mac only) to close Add-ons dialog
2025-03-19 04:27:34 +03:00
Arthur Milchior
6ef24739fc
NF: sligthly optimize cards.py (#3870)
As AnkiDroid wants to be similar to Anki, instead of making AnkiDroid
slightly less efficient, I prefer to slightly improve Anki.

AnkiDroid related PR:
https://github.com/ankidroid/Anki-Android/pull/18112.
2025-03-19 04:14:13 +03:00
Damien Elmes
83d0f5dae9 Add ES translator as requested 2025-03-17 22:11:29 +07:00
Damien Elmes
14dc979e44 Fix panic when a preset is missing 2025-03-15 19:40:48 +07:00
Expertium
d53f01064c
Fine-tune load balancer (#3864) 2025-03-15 18:40:17 +07:00
Jarrett Ye
0e31efac08
Feat/grade now (#3840)
* 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
2025-03-15 17:30:40 +07:00
Luc Mcgrady
79b6f658c3
Feat: Simulator suspend after lapse count (#3837)
* 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
2025-03-15 17:28:15 +07:00
chel-ou
122980e06b
Add hooks for comparing answers (#3855)
* Add hooks associated to compare answer feature

* Update CONTRIBUTORS

* Add type pattern to compare answer related hooks
2025-03-15 12:12:01 +07:00
Jarrett Ye
33b8235186
Fix/incorrect initialization of SchedTimingToday in graphs/retrievability.rs (#3857) 2025-03-14 17:06:25 +07:00
llama
d809ee92db
Fix cargo ignoring lockfile when building syncserver image (#3856)
* pass --locked to cargo invocation

* update Dockerfile.distroless as well

Co-authored-by: Simon <8466614+SimonBaars@users.noreply.github.com>

---------

Co-authored-by: Simon <8466614+SimonBaars@users.noreply.github.com>
2025-03-14 17:04:56 +07:00
Val Enfys
d0ed54a768
Update my name in Anki's credits (#3852)
* Update my name in about.py

* Add name to CONTRIBUTORS
2025-03-14 17:00:48 +07:00
Evgeny Kulikov
339bf436d1
Prevent accidental dragging of audio playback buttons and hint links (#3844)
* 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
2025-03-14 16:47:03 +07:00
Thomas Graves
f5f22edb6a
Don't recalculate remaining steps, conditionally (#3849)
* 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
2025-03-14 16:32:28 +07:00
Damien Elmes
9b5da546be Check collection size when syncing
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.
2025-03-10 20:28:57 +07:00
Luc Mcgrady
cad6e0b0bf
Added: Max interval too low warning. (#3847)
* Added: Max interval too low warning.

* Lower threshold to 180

* Add self to about.py
2025-03-10 16:14:35 +07:00
Brayan Oliveira
94e90dbf85
Add title for some dialogs and avoid hardcoding the text of the discard changes dialog (#3846)
* feat: add title to rename dialog

* fix: localize hardcoded message

* feat: add title to create deck dialog

* refactor: formatting fixes

* add name to about screen

adding my name to contributors for the third time
2025-03-10 15:53:43 +07:00
Jakub Fidler
d8460d354a
fix: Task manager exception handling (#3839)
* Raise exception from closures in run_in_background using run_on_main

* Add author to CONTRIBUTORS file

* Undo taskman changes

* Raise exceptions from _on_closures_pending using singleShot
2025-03-10 14:17:50 +07:00
Damien Elmes
b75f2798e6 Silence a warning about ring
https://github.com/ankitects/anki/issues/3081
2025-03-10 14:00:23 +07:00
Brayan Oliveira
63c2a09ef6
feat: add title to some of the sync dialogs (#3838)
* refactor: accept window title in some dialog methods

* feat: match sync initial title with state

Sync iniates in the `Checked` state, so the initial title is changed to match it instead of using the generic `Anki` title

* feat: use `Sync` as the tile of login screen

Maybe a new string should be created for that.

* feat: Use `Sync` as title of the sync conflict dialog

Maybe a new string should be used for that

* refactor: fix formatting

* fix: alias in CONTRIBUTORS

Even in 2025, the script isn't smart enough to handle different casing or use just the GitHub ID
2025-03-03 15:03:28 +03:00
Jarrett Ye
a6426bebe2
Feat/support load balance and easy days in FSRS simulator (#3829)
* 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>
2025-02-27 10:53:01 +07:00
Lukas Sommer
96df6becfc
Comments for translators about sort order (#3831)
* Comments for translators about sort order

* Group combobox entries together. More comments.

* Touch CONTRIBUTORS
2025-02-26 10:32:06 +03:00
GithubAnon0000
42620c4e60
Update uninstall.sh to give feedback to the user (#3834)
The uninstall script runs `xdg-mime uninstall` which takes >5 seconds to process.

There is no indication to the user though that the script is actually running. Adding an `echo` info message solves that.

Additionally we could `rm -rfv` to make it more verbose (the install script is verbose too). But the main thing that needs time to process is the `xdg-mime uninstall` part of the script.

The reason why I didn't make `rm -rf` verbose, too, is that the output text is greater than the buffer that the terminal provides – meaning you cannot view it from the beginning. And since `rm` is very fast even on old systems with slow hardware I didn't really see a reason to make it verbose here.
2025-02-26 10:24:52 +03:00
Damien Elmes
76c4ec7403 Add actions-processing based on qt-misc-processing 2025-02-21 18:29:41 +07:00
Damien Elmes
a7c5376063 Update translations 2025-02-21 18:21:28 +07:00
GithubAnon0000
00cc1b408a
Increase font size for accessibility (#3832)
Apparently no font size should be lower than 12px, see https://www.boia.org/blog/accessibility-tips-let-users-control-font-size.

With the current 55%, I get a computed font size of 8.25px though. Considering the text shows the helpful message "Press ⁨Enter⁩ to accept, ⁨Shift+Enter⁩ for new line.", I think we should add a minimum font size.
2025-02-21 17:14:15 +07:00
llama
8ec139f62a
Debounce mathjax rendering to avoid stalling (#3827)
* move change-timer to editable

* debounce mathjax rendering
2025-02-21 16:39:11 +07:00
mumtazrifai
e373b0ed9b
Use default flag name when flag is renamed to empty string (#3826)
* Add function to restore the default name of a flag

* Call function to restore default flag name if flag renamed to empty string

* Update _load_flags to use the default_flag_names dict

* Add name to contributors file

* Add trailing comma to pass tests

* Update to follow python style guide

* Update about.py

* Revert "Update _load_flags to use the default_flag_names dict"

This reverts commit caa8fea94b.

* Use require_refresh() instead of storing default flag names
2025-02-21 16:38:04 +07:00
Damien Elmes
2727cf39b2 Update to Rust 1.85
Edition update to follow later
2025-02-21 10:42:42 +07:00
Damien Elmes
8e13e6bfc1 Update n2 [action required]
Make sure to run tools/install-n2 after updating to this commit.
n2 have merged in some changes we were previously hosting in a fork,
but the parsing of the flags was altered.
2025-02-19 10:34:45 +07:00
llama
1c8c5a41f5
Cache rendered mathjax to avoid stalling when editing plaintext (#3828)
* add lru-cache

* cache mathjax rendering
2025-02-18 14:41:37 +07:00
Jake Probst
5552fc6e97
add hook for day rollover (#3817)
* add hook for day rollover

* rollover -> day_did_change
2025-02-18 13:46:15 +07:00
Jarrett Ye
59e143ec25
Feat/support load balance and easy days in rescheduling (#3815)
* Feat/support load balance and easy days in rescheduling

* ./ninja fix:minilints

* apply clippy

* reuse calculate_easy_days_modifiers()

* consider LoadBalancerEnabled

* move calculate_easy_days_modifiers out of struct

* improve naming & add comments

* apply clippy

* reschedule if easy days settings are changed

* Minor simplification

* refactor to share code between load balancer and rescheduler

* intervals_and_params -> intervals_and_weights

* find_best_interval -> select_weighted_interval

* cargo clippy

* add warning about easyDaysChanged

* compare arrays directly

* Don't show warning if fsrs+rescehdule is already enabled

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
Co-authored-by: Jake Probst <jake.probst@gmail.com>
2025-02-18 13:44:00 +07:00
GithubAnon0000
8fc822a6e7
Use tilted (filled and unfilled) sticky icons in the cards editor (#3825)
* Update icons.ts to include hollow and solid icons

* Update icons.ts

* Create sticky-pin-hollow.svg

* Create sticky-pin-solid.svg

* Update StickyBadge.svelte to reflect changed icons
2025-02-16 22:24:11 +07:00
Damien Elmes
7f8420255d Update n2
The flickering on Windows has been improved
2025-02-16 18:41:25 +07:00
dependabot[bot]
ee3da3d1aa
Bump esbuild from 0.21.5 to 0.25.0 (#3823)
* Bump esbuild from 0.21.5 to 0.25.0

Bumps [esbuild](https://github.com/evanw/esbuild) from 0.21.5 to 0.25.0.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.21.5...v0.25.0)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix lock

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2025-02-16 16:31:39 +07:00
GithubAnon0000
689eead99a
Update FsrsOptions.svelte to add margin / gap between simulator buttons (#3822)
* Update FsrsOptions.svelte to add margin / gap between simulator buttons

* Hopefully fix gh test error
2025-02-16 16:30:48 +07:00
GithubAnon0000
1beb0cfa8c
Update NoteEditor.svelte to swap pin and html view. (#3821) 2025-02-16 16:23:22 +07:00
llama
70b6cc9682
set editor's card when reopening (#3814) 2025-02-16 16:11:28 +07:00
Luc Mcgrady
5d07eca327
Fix: Close cards missing "copy card info" button (#3811) 2025-02-16 16:10:04 +07:00
Luc Mcgrady
4459e06f74
Copy card debug info (#3801)
* Added: Copy card debug info button

* Fix: Button margins

* Added: More info

* Deleted useless info

* Added: Revlog rows

* Added: cardRow

* Replaced button with shortcut

* Fix: Copying new cards info error

* ./check

* Added: Rollover

* Format outputted json

* neatened imports

* make linter happy

* revert button changes

* Value Error -> Assert

* preserve normal copy functionality
2025-02-16 16:06:12 +07:00
dependabot[bot]
055a8818bc
Bump esbuild from 0.19.12 to 0.25.0 (#3806)
Bumps [esbuild](https://github.com/evanw/esbuild) from 0.19.12 to 0.25.0.
- [Release notes](https://github.com/evanw/esbuild/releases)
- [Changelog](https://github.com/evanw/esbuild/blob/main/CHANGELOG-2024.md)
- [Commits](https://github.com/evanw/esbuild/compare/v0.19.12...v0.25.0)

---
updated-dependencies:
- dependency-name: esbuild
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-16 16:00:00 +07:00
Danika-Dakika
70771ca9da
Merge pull request #3820 from Danika-Dakika/user-about
Added translation contributor
2025-02-15 12:01:39 -08:00
Danika-Dakika
c8e4c366c1
Update about.py
Added translation contributor
2025-02-15 11:27:34 -08:00
Damien Elmes
038d85b1d9 Further tweaks to easy days
The previous commit added word-wrap, but it was not working after I'd
removed some other tweaks I'd made in testing, that I thought were not
required. I ended up switching to standard table columns and a fixed
layout, so that both the column and row headers will wrap properly.
2025-02-11 17:04:58 +07:00
Damien Elmes
348822a14b Quick hack to improve minimum deck options width
Partial fix for #3796
2025-02-11 16:11:43 +07:00