Commit graph

10984 commits

Author SHA1 Message Date
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
Damien Elmes
429bc9e14c Update translations 2024-03-31 13:57:06 +07: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
snowtimeglass
ddccfb805f
Use "importing-added" string in importing detail table (#3104)
Supplement to the task of commit 184ad80 (Clone "added" string for importing)
2024-03-31 07:33:31 +01:00
Jarrett Ye
15506328e9
rename sm2 retention to historical retention (#3101)
* rename sm2 retention to historical retention

* ninja format

* keep sm2_retention in DeckConfSchema11

* update wording

* Update schema11.rs
2024-03-29 09:34:26 +00:00
Damien Elmes
c1877f9df6 Fix incorrect search results after preset used
https://forums.ankiweb.net/t/anki-24-04-beta-rc/41792/129
2024-03-29 13:19:15 +07:00
Damien Elmes
99524848b1 Update translations 2024-03-28 16:02:47 +07:00
Damien Elmes
6e1ae5231b Update optimal retention tooltip, and add a few extra translations 2024-03-28 16:02:05 +07: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
ijqq
22559929f9
Replace deprecated method chrono::NaiveDateTime::timestamp_millis (#3097)
* Replace deprecated method `chrono::NaiveDateTime::timestamp_millis`

* Update CONTRIBUTORS
2024-03-28 08:30:02 +00:00
antecrescent
58ce29f461
Refactor offline build process and add offline generation of Sphinx docs (#3082)
* Simplify the offline build

The two environment variables OFFLINE_BUILD and NO_VENV jointly provide
the ability to build Anki fully offline. This commit boils them down
into just one, namely OFFLINE_BUILD.

The rationale being that first, OFFLINE_BUILD implies the use of
a custom non-networked Python environment.
Second, building Anki with a custom Python environment in a networked
setting is a use case, that we currently do not support.
Developers in need of such a solution may want to give containerized
development environments a try. Users could also look into building
Anki fully offline instead.

* Add documentation for offline builds.

* Add support for offline generation of Sphinx documentation.

Control installation of Sphinx dependencies via the network through the
OFFLINE_BUILD environment variable.

* Add documentation for offline generation of Sphinx documentation.
2024-03-27 13:51:09 +00:00
laalsaas
798d9df4de
sync-server: add option to store hashed passwords (#3083) 2024-03-26 07:39:57 +00: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
Damien Elmes
5062cb37c7 Update translations 2024-03-25 16:44:52 +07:00
Damien Elmes
0c02c669c1 Fix spurious warning when comparing optimal and desired retention 2024-03-25 16:44:07 +07:00
Damien Elmes
f79a6c9480 Update black for security issue 2024-03-25 16:44:07 +07:00
Abdo
5938456069
Disable ligatures in type-in highlighting (#3093) 2024-03-25 09:42:07 +00:00
RumovZ
426d5ae8a9
Fix summary string for notes failed to be imported (#3092) 2024-03-25 09:41:42 +00:00
Jarrett Ye
74a603e61b
use rmse in comparing parameters (#3087) 2024-03-24 08:28:15 +00:00
RumovZ
36287888cc
Reset original id when cloning notetypes (#3089) 2024-03-24 08:18:59 +00:00
vasll
eee02d5e8c
Refactored "Forget" to "Reset" (#3078) (#3088)
The respective *.ftl file keys `actions-forget-card` and `qt-accel-forget` will keep the same name to prevent having to force a retranslation for other languages, only the string value was changed
2024-03-24 07:41:56 +00:00
Damien Elmes
8fc4225b29 Update translations, and full sync -> one-way sync 2024-03-21 10:17:24 +07:00
Damien Elmes
b84fce4887 Update translations 2024-03-20 12:57:30 +07:00
Damien Elmes
656cfe0b9c When updating all FSRS parameters at once, exclude suspended cards 2024-03-20 12:56:36 +07:00
Mani
f413274fba
better pan zoom with space for drag, shift for horizontal scroll and ctrl for zoom (#3080)
* more better pan zoom with space for drag, shift for horizontal scroll and ctrl for zoom

* use middle mouse button for drag

* improve panning with space + mousemove, remove middle mouse implementation

* handle tool change after mouseup event
2024-03-18 14:26:41 +00: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
Jarrett Ye
8d197a1555
Feat/fsrs simulator backend part (#3075)
* [WIP] FSRS simulator

* add desired_retention as input

* cargo fmt

* fix format

* add standard copyright header

* support existing cards

* fix format

* pass days_elapsed into Card::convert & return None
2024-03-18 13:42:38 +00:00
Damien Elmes
bbfe83a8d3 Update translations 2024-03-17 20:13:09 +07:00
Damien Elmes
c462f64862 Move (most) FSRS options into their own section 2024-03-17 18:25:25 +07:00
Damien Elmes
e9d3b46d47 Shift FSRS optimization into top level; shown optimize all tip after 30 days 2024-03-17 17:46:26 +07:00
Mani
5eafd82521
fix: ensure proper drawing of shape tools after pan/zoom (#3066)
* fix: ensure proper drawing of shape tools after pan/zoom

* remove sticky bottom toolbar

* make bounding-box not selectable after undo/redo

* fix: resize issue, added option to pan using alt/shift + mouse wheel

* drag with touchpad

* use isDesktop and move globalThis to index.ts

* gesture event not required, use preventDefault with passive false in wheel event

* use shift in mac and ctrl in pc
2024-03-16 14:05:51 +07: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
Jarrett Ye
e8d95de426
speed up computing optimal retention (#3072)
* speed up computing optimal retention

* ./ninja fix:minilints
2024-03-12 15:57:41 +07:00
Brayan Oliveira
1bd6d2883e
fix: cloze_numbers_in_string treating {{c0::}} as valid (#3059)
* fix: cloze_numbers_in_string treating `{{c0::}}` as valid

* Update rslib/src/cloze.rs

Co-authored-by: Abdo <abdo@abdnh.net>

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2024-03-12 15:51:13 +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
Jarrett Ye
8c9d7d64d9
refactor optimal retention to minimize workload per memorization & fix progress goes backwards (#3065)
* Feat/optimal retention for minimal workload per memorization

* ./ninja fix:minilints

* update to FSRS-rs 0.5.2

* update to FSRS-rs 0.5.3

* ./ninja fix:minilints

* 'estimated retention' -> 'predicted optimal retention'; add warning (dae)
2024-03-11 16:16:37 +07:00
arbyste
04fe3655e2
Adding a note to the import options to indicate that leech and marked tags will be removed if disabled (#3067)
* Adding a note to the import options to indicate that leech and marked tags will be removed if not enabled.

* Adding my details to CONTRIBUTORS
2024-03-11 15:45:28 +07:00
Damien Elmes
de8b81ca7a Fix consolas not being used in editor 2024-03-10 12:52:53 +07:00
Damien Elmes
d516a9d9a6 Update translations 2024-03-09 17:36:44 +07:00
Mani
ea8f0c1491
fix: blur in io, remove panzoom and use fabricjs for panzoom (#3052)
* fix: blur in io, remove panzoom and use fabricjs for panzoom
- remove panzoom
- implement panzoom using fabricjs
- set background image for canvas
- add bounding rect for canvas
- draw or add point inside in bounding rect
- update zoom tool

* support pinch to zoom on mobile client

* fix lagging of canvas, zoom in draw mode

* panning in touch events
2024-03-09 10:35:23 +00:00
Jarrett Ye
f2acf40221
alert when the resp.weights is empty (#3061)
* alert when the resp.weights is empty

* format
2024-03-09 10:26:59 +00: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
Jarrett Ye
055b6e30f8
update FSRS-rs to 0.5.0 & export benchmark API (#3056)
* update fsrs to 0.4.5

* update to fsrs 0.4.6

* add benchmark API

* update fsrs to 0.5.0

* cargo fmt

* ./ninja fix:minilints

* ./ninja format

* Add a brief comment about the new method (dae)
2024-03-08 12:37:06 +00:00
Abdo
9228c87b3a
Show preset and original deck in card info (#3055)
* Show preset and original deck in card info

* Make original_deck optional
2024-03-07 07:47:55 +00:00
Damien Elmes
184ad8068e Clone "added" string for importing
https://forums.ankiweb.net/t/inquiry-about-adding-one-more-string-for-added/41998
2024-03-07 12:03:12 +07:00
Damien Elmes
2d2b5f663a Update translations 2024-03-07 11:57:54 +07:00
Brayan Oliveira
d16131c534
Use Card %d for Cloze and IO template names (#3049) 2024-03-06 08:03:31 +00:00
Jarrett Ye
eb597475c5
Fix/set pretrain_only by fsrs_items (#3051)
* Fix/set pretrain_only and insufficient reviews based on fsrs_items

* use review_count for FsrsInsufficientReviews

* Update weights.rs

* Update weights.rs
2024-03-05 07:54:34 +00:00