Commit graph

1908 commits

Author SHA1 Message Date
Abdo
b09bf31748 Fix misleading warning when changing notetype from/to cloze (#2744) 2023-10-18 16:50:32 +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
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
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
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
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
c1007f211c Fix reversed float left/right icons
Closes #2713
2023-10-13 13:04:42 +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
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
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
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
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
8731a1f7ce Add stability graph 2023-10-01 15:44:33 +10:00
Damien Elmes
49fcbe8f8f Support rescheduling on weight/retention change 2023-10-01 15:20:58 +10:00
Damien Elmes
6b0bc2ce71 Display the default weights as a placeholder 2023-09-30 16:10:23 +10:00
Damien Elmes
63088b0caf Update FSRS
- up to 10x performance increase in optimal retention
- expose loss aversion
- use SpinBoxes
2023-09-30 16:10:22 +10:00
Abdo
fb9c814e6c Allow creating an image occlusion from the clipboard (#2689)
* Allow creating an image occlusion from the clipboard

* Refactor pasted image name construction into methods

* Reduce button's top padding

* Fix capitalization

* Fix quality parameter of pasted image

* Fix lint errors

* setup_mask_editor_for_file -> setup_mask_editor

* Select -> Paste

* Extract image reading logic

* Fix inlinedImageToFilename
2023-09-29 15:51:44 +10:00
Damien Elmes
0530027ec9 Tweak some wordings 2023-09-27 16:37:03 +10:00
Damien Elmes
f1e8f171d4 x% complete 2023-09-27 16:24:25 +10:00
Michael Eliachevitch
e6088c46e3 Button to set desired FSRS retention to optimal/calculated (#2685)
* Draft set optimal/calculated retention button

Temporarily save the calculated optimal retention and display it with a button
that sets the desired retention above to this value.Don't show button until
attention had been calculated. Disable button when optimal and desired
attention are equal.

I find this nicer than the current alert-popup solution, as it avoids a popup
and gives a choice to the user to accept the calculated retention or not, while
also persisting the calculated retention on the screen for a bit.

TODO: What's still missing is that the `optimalRetention` variable is global and
persists when I change presets. When changing presets the variable should reset to
`undefined`, which would also makes the button disappear. Ideally it should also
disappear when changing the FSRS parameters. So probably it should be made part
of some deck options state and subscribe to some events. But with that I might
need some help. Also I thought whether that variable should go into the deck
options schema but tbh it's not something we want to persist between sessions,
users should recalculate it.

* Add me to contributors for tests so pass

* Add formatting ant type fixes to make tests pass

* Minor fixes (dae)

* Remove the period
2023-09-27 16:12:49 +10:00
Abdo
97bd06dc49 Implement "stop timer on answer" as a preset option (#2686)
* Implement "stop timer on answer" as a preset option

* Hide timer setting on AnkiMobile (dae)
2023-09-27 16:10:14 +10:00
Damien Elmes
02d6420893 Fix weight computation progress not showing 2023-09-26 14:02:12 +10:00
Michael Eliachevitch
e226f74e42 More sensible lower FSRS progress indicator precision (#2684)
It's very helpful having a sub-permille precision in a progress
indicator, percent-precision or at most a tenth of a percent should be
sufficient for any indicator.

But in particular the compute-retention progress has 10 steps, i.e. the progress
increases in 10%-intervals (10%, 20%, ...), it *cannot* have sub-decimal
progress-percentages, see 2d5b19b494/src/optimal_retention.rs (L365-L368). So there integer percents should be
enough, everything else is misleading.

The compute-weights progress is currently (as of beta-2) not showing up at all.
Maybe if the bug is fixed it can show sub-percent percentages, so for know I changed that
to 0.1% precision. But I think integer percentages should be fine here as well,
so upon request I can fix that.

Also see my comment on this problem in https://forums.ankiweb.net/t/anki-23-10-beta/34912/39.
2023-09-26 14:01:05 +10:00
Abdo
babce8ec8c Fix wrong mask position after merging groups (#2682) 2023-09-26 13:14:13 +10:00
Damien Elmes
3a6dd627d7 Allow desired retention to be set to 0.7
https://github.com/open-spaced-repetition/fsrs-rs/issues/79#issuecomment-1733779005
2023-09-26 13:03:49 +10:00
Damien Elmes
a5fff918ec Don't show multiple cancel buttons 2023-09-25 16:40:11 +10:00
Damien Elmes
7f787a0e62 Prohibit weight generation when reps < 1000 2023-09-25 16:17:00 +10:00
Damien Elmes
790644de66 UI tweaks
https://forums.ankiweb.net/t/anki-23-10-beta-1/34912/19
2023-09-25 15:54:18 +10:00
Damien Elmes
098fad213c Cap optimal retention simulation to 10 years 2023-09-25 14:34:26 +10:00
Damien Elmes
0fa67a717f Expose deck-then-random option in UI 2023-09-25 11:12:28 +10:00
Damien Elmes
c6df1e5fe7 Fix entire collection being used to calculate weights 2023-09-24 19:42:50 +10:00
Damien Elmes
d2a00948ef Use FSRS difficulty when sorting by ease 2023-09-23 16:20:36 +10:00
Damien Elmes
af171c96d7 Gate graph display on fsrs status 2023-09-23 15:59:02 +10:00
Damien Elmes
0f899efea7 Convert FSRS to a global option
Allowing some decks to be FSRS and some SM-2 will lead to confusing
behavior when sorting on SM-2 or FSRS-specific fields, or when moving
cards between decks.
2023-09-23 14:41:55 +10:00
Damien Elmes
d98a7e7551 Add warning about all clients needing to support FSRS 2023-09-23 14:05:28 +10:00
Damien Elmes
e1216a4a73 Apply Svelte typing fix from Abdo
https://github.com/ankitects/anki/issues/2629#issuecomment-1724740151
2023-09-20 16:02:27 +10:00
Damien Elmes
783172fb59 Fix "Add" button showing when editing I/O note; hide toast 2023-09-19 14:19:51 +10:00
Damien Elmes
ac79aaeca2 Hide show/close buttons on mobile
iOS can't handle text fields that are potentially megabytes big, and
the close button is superfluous
2023-09-19 13:14:54 +10:00
Damien Elmes
cafba25f4c Calculate parameters automatically
Logic derived from d8e2f6a0ff

Closes #2661
2023-09-18 16:43:36 +10:00
Damien Elmes
41220ea61b Use field tags instead of hard-coding occlusion fields
+ Don't protect the comments field

It's not required by our current code. We can remove the protection
from Header and Back Extra in the future too, once we no longer depend
on them.

Closes #2621
2023-09-18 10:10:11 +10:00
Damien Elmes
a1756ea771 Start on a 'get params' button 2023-09-17 12:58:13 +10:00
Damien Elmes
8e2569fd66 Fix mask editor disappearing when saveNow() called
Closes #2619
2023-09-17 11:51:48 +10:00
Damien Elmes
85aecdc8cf Remove the separate chevron in all/one selector 2023-09-17 11:51:48 +10:00