Commit Graph

11119 Commits

Author SHA1 Message Date
Abdo
60f8399aed
Show total review count when optimizing FSRS parameters (#3027)
* Show total review count when optimizing FSRS parameters

* Do not expose items
2024-02-26 13:27:22 +07:00
Kieran Black
d2ae0d9ada
fix text input custom style wiping out base user style (#3031) 2024-02-26 13:07:45 +07:00
Damien Elmes
f9a970be9b Use smaller default height
https://forums.ankiweb.net/t/import-dialog-is-too-big/41549/10
2024-02-26 12:13:38 +07:00
Kieran Black
d4a52b7548
fix progress manager window race condition (#3029)
The progress manager was indicating windows were in a clean state before actually ensuring they were in a clean state. The update to mark things as clean now occurs after cleanup has occurred.
2024-02-25 13:17:04 +07:00
Jarrett Ye
103ea6ded0
clamp interval before fuzz_bounds (#3024)
* clamp interval before fuzz_bounds

* update unit test of with_review_fuzz
2024-02-25 12:18:01 +07:00
Viktor Ricci
68b374e65f
Fix regex skipping over all src except the last (#3021)
Adapting HTML_MEDIA_TAGS to allow for `>` inside '' and "" led to
multiple images inside a field sometimes being disregarded and
marked as "unused". This seems to have been caused by a missing
lazy (?) quantifier for the regex part skipping over non-`>`.
2024-02-24 15:27:38 +07:00
Damien Elmes
1a7f8b4fdf Fix cargo deny in CI
The 0.14.12 release appears to have broken "-A duplicate". Fix by
updating our checks to use the latest release/format.

Also update iana-time-zone, which was yanked, and ignore safemem,
which is only used when bundling.
2024-02-24 15:22:57 +07:00
Abdo
6843d65ed1
Check required review count for FSRS after filtering (#3019)
* Check for required review count for FSRS after filtering

* Remove unreachable check

* Update minimum review count in optimal retention calculation

* Fix review check in optimal retention routine too
2024-02-24 14:53:38 +07:00
Abdo
0018f126ea
Fix misaligned image occlusions in RTL languages (#3018) 2024-02-22 11:10:36 +07:00
Abdo
00c67fc0c7
Show message if current FSRS parameters are optimal (#3014)
* Show message if current FSRS parameters are optimal

* Fix message shown with default parameters

* Use alert()
2024-02-22 11:09:17 +07:00
Luc Mcgrady
8b18a08b3b
FSRS - Ignore revlogs before date while optimizing (#2922)
* Added: Date input button

* Added: ignoreDate to config

* Added: Backend

* Optimize function passes value

* Fix: Spelling

* Moved: filter logic from revlog_for_srs to update_memory_state

* fmt

* Copyright header

* ./check

* Fix: Test

* Renamed: Ignore_date -> Ignore_before_date

* Neaten parameters

* evaluate weights

* ./check

* Optimize all presets

* Added: Label localizations

* Removed globe label

* Added: Tooltip

* Changed error type

* fmt

* Moved filter to own function

* missing function call replacement

* Fix: Typo

* Apply suggestions from code review

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>

* timestamp * 1000 -> timestamp_millis

* ignoreBefore -> ignore_before

* clarified ignore_before variables

* i64 -> TimestampMillis

* Un-traitified remove_revlogs_before

* Added: ms == 0 guard

* Added: Ignore_before affects scheduling

* Moved filter to fsrs_items_for_training

* removed filter from revlog_for_srs

* Tuple -> UpdateMemoryStateEntry

* Removed unused function

* Removed superfluous _ms from variables

* cid -> id

* Different ignore method

* Added: Unit test

* cid -> id

* Test: Exact ms edge case

* ./check

* Fix: re-learns could be before ignore date in cards without learning steps

* getignoreRevlogsBeforeMs -> getIgnoreRevlogsBeforeMs

* Removed pub(crate)

* Clarified unit test

* last_learn_entry -> first_of_last_learn_entries

* @user1823's method

* IOS fix

* ./check

* Fix: width defined twice
2024-02-22 11:01:10 +07:00
Damien Elmes
9642a69b88 FSRS items, not revlogs
https://forums.ankiweb.net/t/discrepancy-between-revlog-count-in-optimize-and-evaluate/41224/5
2024-02-19 17:51:07 +07:00
Lucas Scharenbroch
a7f7f3f67b
Make a deep copy in reviewer/create-copy (#3013) 2024-02-18 13:09:53 +07:00
Lucas Scharenbroch
97dcb776de
Refactor text attribute button components (#3012)
* Factor out common code in bold/italic/underline/sub/sup buttons

* Update exclusiveNames' states on click

* Update exclusiveNames' states on keyboard shortcut
2024-02-18 13:09:05 +07:00
Damien Elmes
f09fbea3b9 Update to Qt 6.6.2
- Mac binary build stuff still todo
- Windows/Linux currently untested; please report any problems
2024-02-18 11:21:50 +07:00
Lucas Scharenbroch
df70564079
Add edge-case to type-in-answer filter in reviewer (#3010) 2024-02-14 20:38:10 +10:00
Lucas Scharenbroch
b80057440e
Fix visual behavior of modal buttons in editor (#3009)
* Fix behavior of justification buttons

* Make list buttons update each other when clicked
2024-02-14 20:35:37 +10:00
Abdo
2b4cb2992b
Fix deck names differing in case being duplicated in CSV import (#3008) 2024-02-14 20:25:54 +10:00
Abdo
23291e7172
Fix circular import (#3007) 2024-02-14 20:23:14 +10:00
Damien Elmes
a2301c58ee Update translations 2024-02-13 11:59:16 +10:00
Damien Elmes
09f032b2e8 Ensure PyOxidizer checked out when bundling 2024-02-13 10:56:53 +10:00
Damien Elmes
efa9c5a39a Remove inverted print statement from recent PR 2024-02-13 10:54:39 +10:00
Lucas Scharenbroch
c6a63cf959
Add log-in button to preferences screen (#2994)
* Add log-in button to preferences screen

* Fix to python to conform to linter

* Add translations for log in/out

* Clean up whitespace/naming

* Move translations from python to qt forms

* Remove sync-not-enabled text on prefs screen

* Add my name to about.py

* Add "sync now?" dialog upon successful login

* Close preferences dialog before syncing

* Yet another Qt 6.6.1 focus fix (dae)

Like 9364dad49a
2024-02-12 16:29:16 +10:00
Abdo
12681ae2e7
Add View Files button to Check Media screen (#3006)
* Add View Files button

* Remove Close button
2024-02-12 16:17:47 +10:00
Jarrett Ye
492178c107
Fix/ignore revlogs before Forget entry (#3002)
* Fix/ignore revlogs before Forget entry

* Update weights.rs
2024-02-12 16:09:39 +10:00
Han Yeong-woo
9ba527afa2
Improve typing deck_due_tree() (#3003)
* Improve typing `deck_due_tree()`

* Add me to CONTRIBUTORS
2024-02-12 15:56:29 +10:00
cav71
f4a8f7d9c7
Add support for python logging (#2969)
* adds log module

* enable logging in the app

* adds a getLogger method to AddonManager

* change log level depending on ANKIDEV

* fix undefined module variable

* - fix addons log file path
- remove a breakpoint leftover

set the addons log files under pm.addonFolder()/NNNNNN/user_files/logs/NNNNNN.log

* fix path bug

* move log closing handling into AddonManager deleteAddon/backupUserFiles methods

* logging module level import
fix undefined variable in backupUserFiles

* pretty format log records

* move MediaServer log into logging

* update CONTRIBUTORS

* documentation cleanup

* capture warnings into log messages
fix waitress verbosity

* remove record_factory function

* add get_logger method alias to getLogger in AddonManager
switch to TimedRotatingFileHandler handler
fix minor typo

* set main log level to DEBUG if ANKIDEV is not 0 (or unset)
added two new methods to AddonManager addon_get_logger/addon_toggle_log_level

* add new find_logger_output to AddonManager

* move logs under pm.base

* change log output

* update addonmanager getlogger

* Format imports

* Refactor logging set-up slightly and tweak docstring

* Remove obsolete log closing statements

As logs are no longer stored in user_files, we do not need to close their handlers

* Refactor and try to simplify log module

* Remove demo code

* Refactor and update add-on manager logging API

* Simplify writing unit tests for add-ons that use logging

Loggers are likely to be also employed in non UI code, so it seems like a good idea to decouple them from requiring a running Anki instance to work (thus freeing add-on authors from the need to mock Anki APIs in their tests).

* Fix arguments and drop obsolete inline instructions

Lets add a section on logging to the add-on docs instead

* Drop unnecessary import

* Supply logging basicConfig force option by default

Until we change the module import order and thus ensure that `log` is always evaluated before third-party dependencies have a chance to initialize the root logger, `force` is non-optional.

* Fix formatting and type errors

* Restore mediasrv type ignore comments

* Add note on prefix API stability

* Consistently use addon_from_module in new code

* Use logFolder rather than profileFolder

* Adjust method name for PEP8

* Change loggerDict access path, satisfying pylint

* Drop unused import and use lazy % formatting

* lint fix

* refactor .log_folder -> .addon_logs
store anki.log under logdir

* Fix method name (dae)

* Disable file-based logging in the backend (dae)

I have never found this useful, and it logs nothing by default, so
creating/opening the file is a waste. Removing it also ensures that
addon_logs() is solely used for add-ons.

---------

Co-authored-by: Glutanimate <5459332+glutanimate@users.noreply.github.com>
2024-02-11 16:41:50 +10:00
Abdo
4ef389b580
Keep previous FSRS parameters if they get worse when optimizing (#2996)
* Update to fsrs-rs 0.3.0

* Keep previous FSRS parameters if they get worse when optimizing
2024-02-11 16:26:04 +10:00
Abdo
e136ec65e9
Fix preset: search ignoring cards in filtered decks (#2997) 2024-02-11 16:11:05 +10:00
Abdo
5f9e07ea7a
Make sure editor note is saved before triggering buttons (#2995) 2024-02-11 16:07:49 +10:00
Abdo
db02c95eb5
Fix maybe_coalesce_note_undo_entry() (#2992)
* Fix maybe_coalesce_note_undo_entry()

* Use .count()

* Only check .first()

* Explicitly match on [note change, collection modification] (dae)
2024-02-11 16:04:10 +10:00
Abdo
3110e2d235
Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +10:00
Abdo
80c14aa6e9
Maintain original IO cloze order in editing mode (#2987)
* Maintain original IO cloze order in editing mode

* Fix ordinal propery name
2024-02-07 13:42:47 +10:00
Abdo
85a8824c8c
Do not reset original_due when card stays in filtered deck (#2988) 2024-02-07 13:27:54 +10:00
Lucas Scharenbroch
146a3d936e
Fix corner rounding of alignment buttons in editor (#2989)
* Fix corner rounding of alignment buttons in editor

* Fix formatting

* Fix cascading button-rounding issues
2024-02-07 13:11:14 +10:00
Abdo
312d396505
Change default font in code editors (#2985)
* Change default font in code editors

* Fall back to system font
2024-02-02 17:03:29 +10:00
Kai Knoblich
54b1cc5689
Honor NINJA_STATUS if already set (#2984)
* Honor NINJA_STATUS if already set

Allow build environments at downstream to use their own configured
NINJA_STATUS if set.

* Update CONTRIBUTORS
2024-02-01 14:56:14 +10:00
Kai Knoblich
42cc2c913c
Add support for offline builds (#2963)
* CONTRIBUTORS: Add myself to the contributors list

* Add support for offline builds

Downloading files during build time is a non-starter for FreeBSD ports
(and presumably for other *BSD ports and some Linux distros as well).

In order to still be able to build Anki successfully, two new
environment variables have been added that can be set accordingly:

* NO_VENV: If set, the Python system environment is used instead of
  a venv. This is necessary if there are no usable Python wheels for a
  platform, e.g. PyQt6.

* OFFLINE_BUILD: If set, the git repository synchronization (translation
  files, build hash, etc.) is skipped.

To successfully build Anki offline, following conditions must be met:

1. All required dependencies (node, Python, rust, yarn, etc.) must be
   present in the build environment.

2. The offline repositories for the translation files must be
   copied/linked to ftl/qt-repo and ftl/core-repo.

3. The Python pseudo venv needs to be setup:

   $ mkdir out/pyenv/bin
   $ ln -s /path/to/python out/pyenv/bin/python
   $ ln -s /path/to/protoc-gen-mypy out/pyenv/bin/protoc-gen-mypy

4. Create the offline cache for yarn and use its own environment
   variable YARN_CACHE_FOLDER to it:

   YARN_CACHE_FOLDER=/path/to/the/yarn/cache
   $ /path/to/yarn install --ignore-scripts

5. Build Anki:

   $ /path/to/cargo build --package runner --release --verbose --verbose
   $ OFFLINE_BUILD=1 \
     NO_VENV=1 \
     ${WRKSRC}/out/rust/release/runner build wheels
2024-01-31 09:13:46 +10:00
Jarrett Ye
2fffe4b7ba
update FSRS to v0.2.0 (#2977)
* update FSRS to v0.2.0

* update comments

* ./ninja fix:minilints

* 1000 -> 400 in translation (dae)
2024-01-30 16:27:12 +10:00
Mani
ec3698502b
add select all tool (#2981)
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2024-01-30 15:43:15 +10:00
Damien Elmes
6aa51cc933 Fix Ukranian language name
https://github.com/ankitects/anki/pull/2979
2024-01-30 15:11:24 +10:00
RumovZ
e7a2242262
Increase parent limits in custom study when 'limits start from top' is enabled (#2971)
Closes #2965.
2024-01-29 13:15:44 +10:00
RumovZ
69a51ec296
Fix notetype conflict resolution (#2967)
* Fix undoing notetype conflict resolution

* Fix field/template mapping after notetype conflict resolution
2024-01-29 13:00:57 +10:00
Pedro Lameiras
5849fc6f64
Make image occlusion's option buttons tabbable (#2966)
* Make image occlusion's option buttons tabbable

* Added myself to contributors

* Removed two-way binding
2024-01-29 12:49:28 +10:00
Damien Elmes
e1246a0f37 Tweak 'optimize all' hint
https://forums.ankiweb.net/t/move-optimize-all-presets-next-to-optimize/39684/6
2024-01-29 09:35:02 +10:00
Damien Elmes
29f9f0dca7 Update translations 2024-01-25 13:08:23 +10:00
Damien Elmes
9994743b06 Clarify a translation string 2024-01-25 13:08:11 +10:00
Abdo
0291847712
Fix Image field not hidden until user selects an image (#2960) 2024-01-23 14:24:12 +10:00
Abdo
462c9e76b1
Fix flicker when hovering over deck list (#2958)
* Remove backdrop-filter from deck browser

* Remove transition
2024-01-23 14:20:32 +10:00
Harvey R
e116a53b70
Americanize "synchronisation" (#2935)
* Americanize "synchronisation"

* Update CONTRIBUTORS

* Add name to CONTRIBUTORS

* Americanize "synchronisation"

* Revert change

* Revert change to key name
2024-01-23 14:06:52 +10:00