Commit graph

3318 commits

Author SHA1 Message Date
Mani
f0f9535200
fix io draw in mobile client (#3160) 2024-04-23 22:39:26 +10:00
Harvey R
839fd7bc8b
Add minimalist mode tooltip (#3155)
* Add preferences-minimalist-mode-tooltip

* Update preferences.ui

* Update preferences.ui

* Add preferences_minimalist_mode_tooltip

* Update preferences.ui

* Update preferences.ui
2024-04-23 00:32:55 +10:00
Abdo
e6c7d89443
Fix auto sync not working on Windows shutdown (#3153)
* Fix auto sync not working on Windows shutdown

* Fix mypy error

* Use translated string
2024-04-23 00:32:00 +10:00
Abdo
0a706c5dd9
Ignore errors in do_window_cleanup to fix shutdown issue (#3142)
* Ignore errors in do_window_cleanup to fix shutdown issue

* Only catch RuntimeError
2024-04-17 20:50:41 +10:00
Loudwig
d8f2782c26
Feature Show Reminder before answer (#3064) (#3119)
* Feature Question Action Show Reminder (#3064)

Added a option in the deck config that allow the user to choose in
Autoupdate mode between showing a reminder or revealing the card.
Also added my name to the contributors

* Update ftl/core/deck-config.ftl
2024-04-13 08:39:50 +01:00
Wu Yi-Wei
31439e325d
Add Margins on the Buttons on the About Page (#3137)
* Add Margins on the Buttons on the About Page

* Fix contributors

* Fix format
2024-04-12 05:21:26 +01:00
Escape0707
97efd49cd8
Ignore exception raised by pip_system_certs not found (#3114)
This dependency usually doesn't benefit Linux distros with requests library configured to use system certificate already. And is not packaged by most distros. Making it optional will make most Linux users' installation much easier.
2024-04-05 13:12:06 +01:00
Antoine Q
068f14378e
Update about.py (#3112)
Update about.py to add my name.
2024-04-03 10:22:40 +01:00
Damien Elmes
bdc9be2bbb Ensure ankihelper is rebuilt on arch change
https://forums.ankiweb.net/t/24-04-breaks-dark-mode-on-mac/43048
2024-04-03 15:07:50 +07:00
Damien Elmes
a5154635dc Possible fix for crash on first sync
https://forums.ankiweb.net/t/desktop-app-closes-itself-after-i-try-to-log-in/43132
2024-04-03 14:11:34 +07:00
Damien Elmes
9c733848b8 Revert "Revert "Preserve HTML formatting inside clozes (#3038)""
This reverts commit e911b4b69a.

Trying again now that 24.04 is out.
2024-03-31 15:55:30 +07:00
Damien Elmes
9f55cf26fc
Switch to SvelteKit (#3077)
* Update to latest Node LTS

* Add sveltekit

* Split tslib into separate @generated and @tslib components

SvelteKit's path aliases don't support multiple locations, so our old
approach of using @tslib to refer to both ts/lib and out/ts/lib will no
longer work. Instead, all generated sources and their includes are
placed in a separate out/ts/generated folder, and imported via @generated
instead. This also allows us to generate .ts files, instead of needing
to output separate .d.ts and .js files.

* Switch package.json to module type

* Avoid usage of baseUrl

Incompatible with SvelteKit

* Move sass into ts; use relative links

SvelteKit's default sass support doesn't allow overriding loadPaths

* jest->vitest, graphs example working with yarn dev

* most pages working in dev mode

* Some fixes after rebasing

* Fix/silence some svelte-check errors

* Get image-occlusion working with Fabric types

* Post-rebase lock changes

* Editor is now checked

* SvelteKit build integrated into ninja

* Use the new SvelteKit entrypoint for pages like congrats/deck options/etc

* Run eslint once for ts/**; fix some tests

* Fix a bunch of issues introduced when rebasing over latest main

* Run eslint fix

* Fix remaining eslint+pylint issues; tests now all pass

* Fix some issues with a clean build

* Latest bufbuild no longer requires @__PURE__ hack

* Add a few missed dependencies

* Add yarn.bat to fix Windows build

* Fix pages failing to show when ANKI_API_PORT not defined

* Fix svelte-check and vitest on Windows

* Set node path in ./yarn

* Move svelte-kit output to ts/.svelte-kit

Sadly, I couldn't figure out a way to store it in out/ if out/ is
a symlink, as it breaks module resolution when SvelteKit is run.

* Allow HMR inside Anki

* Skip SvelteKit build when HMR is defined

* Fix some post-rebase issues

I should have done a normal merge instead.
2024-03-31 09:16:31 +01:00
Antoine Q
32c129656e
Improve timer interval display (#3096) (#3100)
* Improve update interval of timer display

Timer calculation frequency increased and aligned with new card apparition.

* Update CONTRIBUTORS

* Update timer interval to 0.333 sec

* Restore timer to 1 sec

- Restoring timer to 1sec value as it is not necessary to increase the frequency.

- Adding a time update directy after new card is displayed so that the timer display immediatly restarts to 0.
2024-03-31 07:49:16 +01:00
kelciour
111f3bd138
Fix mpv loadfile syntax change (#3105) 2024-03-31 07:46:59 +01:00
Damien Elmes
67062da924 Possible workaround for toolbar height issue
https://forums.ankiweb.net/t/anki-24-04-beta-rc/41792/125
2024-03-28 15:37:49 +07:00
Damien Elmes
e911b4b69a Revert "Preserve HTML formatting inside clozes (#3038)"
This reverts commit 58b2475f42.

Rolling this back for now, as it may cause regressions. We can give it
another try at the start of the next beta-testing period.
2024-03-25 16:47:54 +07:00
Abdo
58b2475f42
Preserve HTML formatting inside clozes (#3038)
* Preserve HTML formatting inside clozes

* Place caret after/inside cloze

To match the old behavior

* Fix clozing in mathjax

* Formatting

* Avoid .extractContents() and handle partially covered tags

* Exclude range end if endOffset == 0

* Remove unnecessary branches

* Use nodeIsElement

* Let extractContents() handle partially selected nodes
2024-03-18 13:44:19 +00:00
Pedro Schreiber
6ff42155ad
Display deck names when deleting (#3058)
* -  update remove decks function to return names of all deleted decks
- update protobuf message to display deck names
- update python files to receive message in the frontend.
- add message template to ftl

* update CONTRIBUTORS

* format

* refactor: move up deck names concatenation to tooltip api call
to fix type expectations

* restore core behavior and get deck name from view

* fix type specs

* remove new type and use str instead
restore incorrectly removed lines
2024-03-13 12:29:06 +07:00
Kai Knoblich
057733d02e
qt/aqt/__init__.py: Skip GL library workaround for FreeBSD (#3071)
* qt/aqt/__init__.py: Skip GL library workaround for FreeBSD

The workaround to load explicitly "libGL.so.1" isn't required for
FreeBSD and leads to segmentation faults if used in environments that
have nVidia drivers loaded.

See also FreeBSD bug 270778 for further details. [1]

[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=270778

* Update CONTRIBUTORS
2024-03-12 15:50:21 +07:00
Damien Elmes
1d4d7ee7ed Fix full sync dialog failing to appear
The changed timing in 7784321b90 caused
the question dialog to use the progress window as the parent, which
meant it got closed when the progress window closes moments afterwards.

https://forums.ankiweb.net/t/anki-24-04-beta-rc/41792/69
2024-03-12 14:39:46 +07:00
Foxy_null
6ac60f8032
Added new translator name (#3060)
* Add my name to about.py

* Add my name to CONTRIBUTORS
2024-03-08 12:55:16 +00:00
Brayan Oliveira
d16131c534
Use Card %d for Cloze and IO template names (#3049) 2024-03-06 08:03:31 +00:00
Abdo
3d184073d7
Adjust HTML editor / add-on config editor font (#3054)
* Reduce font size of add-on config editor

* Change HTML editor font to Consolas

* Remove unused form
2024-03-05 07:29:05 +00:00
Abdo
fa771991ca
Use system certificate store (#3050) 2024-03-04 05:48:16 +00:00
Damien Elmes
b2df6546aa When cards become due, show overview instead of study screen
https://forums.ankiweb.net/t/anki-automatically-switches-from-decks-view-to-card-when-it-is-left-open-overnight/41853/3
2024-03-03 11:58:15 +07:00
Damien Elmes
4fc535ec88
Dependency updates (#3040)
* Update JS deps

* Update semver-compat Rust deps

* Update some semver-incompat Rust deps

- hyper/axum held back because reqwests is not ready
- rusqlite held back due to burn-rs incompat version
- wiremock held back due to compile issue

* pylint wants changes to our _rsbridge.pyi

* Update Python deps

Also solves a security warning in orjson

Reformat with latest black
2024-02-28 16:28:04 +07:00
Kieran Black
7784321b90
fix processEvents() reentrancy bug in progress manager window handling (#3030)
* fix progress manager close window race condition

* use monotonic clock for time deltas in progress manager

* restructure progress manager finish logic
2024-02-27 12:25:53 +07:00
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
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
Lucas Scharenbroch
a7f7f3f67b
Make a deep copy in reviewer/create-copy (#3013) 2024-02-18 13:09:53 +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
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
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
5f9e07ea7a
Make sure editor note is saved before triggering buttons (#2995) 2024-02-11 16:07:49 +10:00
Abdo
3110e2d235
Fix code completion in Qt forms (#2993) 2024-02-08 15:24:12 +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
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
Viktor Ricci
fd685f29fe
Don't urllib.unquote when using requests (#2943) 2024-01-19 16:09:13 +10:00
Abdo
f480ecea0c
Default to 'Bury Card' action consistently (#2950) 2024-01-19 15:49:16 +10:00
mjuhanne
22bab988c6
Fix crash in Reviewer (#2945) 2024-01-19 15:36:11 +10:00
Damien Elmes
d6549623af Update Python
Closes #2923
2024-01-19 15:11:17 +10:00
Damien Elmes
7d37fe3daf Apply workaround for wasyncore error 2024-01-16 16:01:40 +10:00
Damien Elmes
4ccb814fb3 Shift the default network timeout back to 60 seconds
There have been a number of reports from people that were having trouble
with 30 seconds
2024-01-11 14:31:30 +10:00
Damien Elmes
cf5f716037 Fix update suppression
The check got lost in the recent refactor.

https://forums.ankiweb.net/t/bug-report-anki-23-10-1-linux-flatpak-ignore-this-update-does-not-work/39408
2024-01-09 14:12:26 +10:00
BlueGreenMagick
d5b57262fd
Fix toolbar button shifting on hover (#2928) 2024-01-03 16:53:37 +10:00
Abdo
cef7338b96
Initialize Browser.aspect_ratio earlier to fix AttributeError (#2924) 2024-01-03 15:59:16 +10:00
Abdo
dbfb46e6c8
Use our translation of 'Discard' (#2920)
* Use our translation of 'Discard'

* Update qt/aqt/utils.py (dae)
2024-01-01 14:20:31 +10:00