Commit graph

10559 commits

Author SHA1 Message Date
Damien Elmes
90539a71fa Bump urllib3 for CVE 2023-10-18 08:56:48 +10:00
Abdo
ed3ec0386e Drop support for checkpoints (#2742)
* Drop support for checkpoints

* Deprecate .flush()

* Remove .begin/.commit

* Remove rollback() and deprecate save/autosave/reset()

There's no need to commit anymore, as the Rust code is handling
transactions for us.

* Add safer transact() method

This will ensure add-on authors can't accidentally leave a transaction
open, leading to data loss.

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2023-10-17 12:43:34 +10:00
user1823
b0effff30b Rename Analyze to Evaluate in FSRS Deck Options (#2741)
* Update deck-config.ftl

* Update FsrsOptions.svelte

* Update CONTRIBUTORS
2023-10-17 09:53:24 +10:00
Abdo
e76c67b26c Prevent media syncing from blocking collection tasks (#2740) 2023-10-17 09:47:50 +10:00
Hikaru Y
d31b0b2cff Another approach to preventing selected shapes from shifting (#2735)
* Revert "Fix selected shapes shifting to canvas origin"

This reverts commit d81b96fed0.

This introduced a regression where the selection of objects was cleared
when it should not have been. For example, if multiple objects were
selected and the mouse was released while moving them around, the
selection would be cleared.

* Another approach to preventing selected shapes from shifting

Prevent fabric objects from shifting to the wrong position when the
active selection contains multiple objects by calculating their
coordinates relative to the canvas, as in the case of the fabric.Group.
2023-10-15 10:11:23 +10:00
Abdo
8b5204ef88 Reduce shaking of bottom bar (#2734) 2023-10-15 10:06:28 +10:00
Damien Elmes
3b4fd4eb77 Update to Qt 6.5.3 on Windows/Mac
+ Fix incorrect version selection on Mac

Closes #2733 (except for Linux users)
2023-10-15 09:48:36 +10:00
Damien Elmes
e41e7cc508 Fix stuttering in FSRS progress display 2023-10-14 14:03:20 +10:00
Damien Elmes
79ef44987f Fix startup failure in macOS bundle
Closes #2731
2023-10-14 13:49:33 +10:00
Damien Elmes
63382c21dc Reduce maximum deck size in retention calculation
https://forums.ankiweb.net/t/anki-23-10-beta-5/35677/11
2023-10-14 12:00:22 +10:00
Damien Elmes
9819a71f40 Switch Qt5 shims from opt-out to opt-in
If you have an add-on that hasn't been updated yet, please contact
the add-on author. You can temporarily restore functionality by defining
an ENABLE_QT5_COMPAT=1 env var.
2023-10-14 11:46:46 +10:00
Abdo
10966394fd Remove v1/v2 support from the backend (#2727)
* Remove v1/v2 support from deck list

* Remove v1/v2 support from most routines and show error

* Remove scheduler_version from preferences

* Fix formatting

* Remove v1/v2 conditionals from Python code

* Fix legacy importer

* Remove legacy hooks

* Add missing scheduler checks

* Remove V2 logic from deck options screen

* Remove the review_did_undo hook

* Restore ability to open old options with shift (dae)
2023-10-14 10:50:59 +10:00
Damien Elmes
068d79329e Use scheduling flag instead of checking revlog when importing decks (#2730)
Closes #2714
2023-10-14 10:30:20 +10:00
Abdo
c3150b2b35 Turn edit window into a QMainWindow (#2732)
* Turn edit window into a QMainWindow

* Ensure dialog is garbage collected (dae)
2023-10-14 10:29:57 +10:00
Damien Elmes
2ad77ec240 Keep badge out of natural tab order
If I've understood things correctly, this should allow regular
users to skip over the badge elements with Tab, while still
allowing screen reader apps to read/focus the badge elements.

https://github.com/ankitects/anki/pull/2721#issuecomment-1761740985
https://forums.ankiweb.net/t/anki-23-10-beta-5/35677/18
2023-10-14 10:20:14 +10:00
Damien Elmes
7669dd3d2a Update to merged PR commit 2023-10-13 14:07:53 +10:00
Damien Elmes
c8f14d36af Update fsrs-rs for partial fix for #2706 2023-10-13 14:05:31 +10:00
Damien Elmes
c1007f211c Fix reversed float left/right icons
Closes #2713
2023-10-13 13:04:42 +10:00
Gulshan Singh
5c19f91315 Add Sphinx documentation generation functionality (#2720)
* Add Sphinx documentation generation functionality

* sphinx-docs -> python/sphinx

* Use ninja instead of make

* Update copyright info in sphinx docs

* Run sphinx-apidoc before building Sphinx docs

* Cleanup Sphinx path insertion

* Don't write build outputs into source; use autoapi

* aqt -> _aqt

* Mention sphinx in development.md

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2023-10-13 13:03:54 +10:00
Damien Elmes
64e540e008 Update translations 2023-10-13 12:50:32 +10:00
Damien Elmes
568b24887f Add help entries for FSRS options 2023-10-13 12:50:15 +10:00
Damien Elmes
41e7cad28e Don't provide a button to copy estimated retention into desired retention
It's too easy for the user to end up with silly values if their configured
time/day is not reasonable.
2023-10-13 12:38:47 +10:00
Damien Elmes
6ca186e31c Hide SM2-specific items in help pages when FSRS enabled 2023-10-13 11:00:51 +10:00
Damien Elmes
97a28a8dd8 Hide loss aversion 2023-10-13 10:38:56 +10:00
Damien Elmes
ec8990dc11 Use sm2 retention when deriving memory state
Closes #2702
2023-10-13 10:37:35 +10:00
Damien Elmes
f7405f85cb Update translations 2023-10-13 10:10:05 +10:00
Hikaru Y
dbb7f507bd Fix selected shapes shifting to canvas origin (#2729)
* Fix selected shapes shifting to canvas origin

* Make only newly added shape selected even if it...

... overlaps with another
2023-10-13 09:58:43 +10:00
Abdo
bb27aa3ce3 Fix previewer geometry not being restored sometimes (#2728) 2023-10-13 08:50:40 +10:00
Aristotelis
64718ac63a Change IO text background color to white (#2726)
Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
2023-10-13 08:49:31 +10:00
Aristotelis
534b5f10c1 Propagate editor UI state transitions to add-ons (#2711)
* Propagate editor UI state transitions to add-ons

* Also set initial Python state to EditorState.INITIAL

---------

Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
2023-10-13 08:47:50 +10:00
Abdo
495dc4d87c Add text tool to image occlusion (#2705)
* Add text tool to IO

* Remove unnecessary parentheses

* Fix text objects always grouped

* Remove log

* Fix text objects hidden on back side

* Implement text scaling

* Add inverse text outline

* Warn about IO notes with only text objects

This will result in a different error message than the case where no
objects are added at all though, and the user can bypass the warning.
Maybe this is better to avoid discarding the user's work if they have
spent some time adding text.

* Add isValidType

* Use matches!

* Lock aspect ratio of text objects

* Reword misleading comment

The confusion probably comes from the Fabric docs, which apparently need updating: http://fabricjs.com/docs/fabric.Canvas.html#uniformScaling

* Do not count text objects when calculating current index

* Make text objects respond to size changes

* Fix uniform scaling not working when editing

* Use Arial font

* Escape colons and unify parsing

* Handle scale factor when restricting shape to view

* Use 'cloned'

* Add text background

* Tweak drawShape's params
2023-10-12 13:40:11 +10:00
chandraiyengar
0f9fdd4dae Add profile name in profile deletion confirmation message (#2722)
* Add profile name in profile deletion confirmation message

* Update contributors

* leave old translation and add new one
2023-10-12 13:34:52 +10:00
Kenny
3d5773bf2a Fix a11y issues with Badge component (#2721)
* fix: a11y issues in badge component

* fix: spacing issues with button element
2023-10-12 13:33:36 +10:00
virinci
8d0d28e3a2 Fix ModuleNotFoundError: No module named 'distutils' (#2723) 2023-10-11 14:12:18 +10:00
Carlo Quick M.Ed
8b9a80c26c Updated README (#2718)
* Update README.md

* Update CONTRIBUTORS

* Removed unnecessary elements to README.md
2023-10-11 14:11:07 +10:00
Abdo
3a52080eeb Add a backend method to extract static media references (#2716)
* Add a backend method to extract static media references

* Extract into Notetype.gather_media_names()
2023-10-11 14:10:02 +10:00
Damien Elmes
7e7c934ba1 Fix n2 missing hide-success code 2023-10-11 13:04:54 +10:00
Hikaru Y
02aea8f06d Fix polygon tool not working (#2712)
* Fix polygon not converting correctly to cloze

* Fix first polygon disappearing when creating se...

...cond one during editing

Previously, a fabric object was passed directly to a `Shape` such as
`Rectangle` or `Polygon`, so mutating a non-primitive property of the
shape would lead to mutating the original fabric object as well.

* Commit addition of polygon immediately

Unlike the rect or ellipse tools, when the polygon tool was active,
clicking on the canvas did not fire the `object:removed` event and the
`change` event was not dispatched. As a result, an addition of a polygon
was not saved to the DB when switching to another note or closing the
editor in edit mode without performing an action that dispatched the
`change` event.
2023-10-10 13:51:35 +10:00
Aristotelis
ebad86eb03 Refactor IO image pickers into separate component (#2710)
* Refactor IO image pickers into separate component

* Adjust import path

* Move styles to component and tweak class names

* Remove unused import

---------

Co-authored-by: Glutanimate <glutanimate@users.noreply.github.com>
2023-10-10 13:26:20 +10:00
Damien Elmes
eaff6b466b Rust 1.73 2023-10-09 19:22:43 +10:00
Damien Elmes
bd6f0d2d92 Fix 'PanicException: command requires weights to be set' 2023-10-09 18:39:18 +10:00
Damien Elmes
6394a449bc Fix 'Expression tree is too large' when user has many decks
+ Allow 'did:' searches to match multiple decks at once
2023-10-09 18:39:18 +10:00
Damien Elmes
3738d9ce28 Apply tag fix from Abdo
https://forums.ankiweb.net/t/drag-and-drop-tag-groups-crashes-anki/35505/3
2023-10-09 13:55:37 +11:00
Damien Elmes
452fcb1bc1 Update n2 for bugfix 2023-10-09 13:42:39 +11:00
RumovZ
fd94ad49a0 Invalid sorting (#2709)
* Rollback if toggling state fails

Previously, if the search triggered by a state toggle failed, the switch
and the model would move to the new state, while the table would remain
in the previous state.

* Fix reversed sort orders of FSRS columns

* Add sep. default sort orders for notes and cards

* Add test for consistent default sort orders

* Add launch config for debugging in VSC

* Extend launch config for macOS and Linux
2023-10-07 06:36:15 +00:00
Damien Elmes
db6dc5a30f Update FSRS for performance improvement 2023-10-05 16:27:10 +10:00
RumovZ
c7d058aa0b Merge all conflicting notetypes (#2707)
* Refactor import apkg tests

* Merge conflicting notetypes regardless of id match

Original ids are a new thing, and we need to handle previous remappings.
This is done separately from the conflict resolution for notetypes with
matching ids, because 1) we need to look at the notes to determine
conflicts, and 2) we don't want to change the notetype of *all* existing
notes with the conflicting notetype. The main reason is that for 2
existing notes with the same noteype, their incoming counterparts could
have *different* notetypes. So to get rid of all conflicts, they must be
resolved on a note-by-note basis.

* Delete merged, now unused notetypes
2023-10-05 06:18:10 +00:00
Damien Elmes
5977937800 Use 0 when there are no relearning steps; ensure not NaN 2023-10-05 09:55:05 +10:00
Damien Elmes
518dc1f303 Improve Python Protobuf speed
upb was being included in the bundle, but not found at run time due
to src files being embedded in the binary.
2023-10-04 13:36:47 +10:00
dependabot[bot]
0d47830896 Bump postcss from 8.4.24 to 8.4.31 (#2704)
Bumps [postcss](https://github.com/postcss/postcss) from 8.4.24 to 8.4.31.
- [Release notes](https://github.com/postcss/postcss/releases)
- [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md)
- [Commits](https://github.com/postcss/postcss/compare/8.4.24...8.4.31)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-04 13:36:35 +10:00