Commit Graph

1996 Commits

Author SHA1 Message Date
Abdo
cc81db0f9d
Fix undo handling of group and some other IO tools (#2931)
* Fix undo handling of group and some other IO tools

* Emit change signal inside onObjectModified

* Fix group lost after moving group then undoing

* Skip undo entry if canvas has not changed

The onObjectModified() call I added in a previous commit to deleteDuplicateTools results in a duplicate undo entry for the delete tool. Checking for duplicate entries seems simpler than having to think about where onObjectModified() should be called exactly

* Fix extra undo entry added after ungroup
2024-01-09 11:19:46 +10:00
Abdo
5d1fc9a591
Flip indent/outdent buttons for RTL (#2930) 2024-01-09 11:09:53 +10:00
Damien Elmes
bfea56c470 Clear out old FSRS progress as new operation starts
https://forums.ankiweb.net/t/inconsistent-number-of-reviews-when-clicking-optimize/39275/6
2024-01-08 13:23:25 +10:00
Mani
ddabbddeb1
add padding to control corner to shapes (#2919) 2024-01-01 14:08:24 +10:00
Mani
6608baa9da
fix: enable keyboard in mobile io note editor (#2916) 2023-12-28 18:00:07 +10:00
Jarrett Ye
0266de60b3
use new formula to calc ivl in getRetentionWarning (#2911)
* use new formula to calc ivl in getRetentionWarning

* format

* Use consistent casing (dae)
2023-12-27 12:26:58 +10:00
Damien Elmes
2b763ee0b2 Exclude suspended cards from FSRS optimizing
https://forums.ankiweb.net/t/anki-23-12-beta/37771/155
2023-12-25 09:40:24 +10:00
Abdo
f2e9c73b31
Do not close web pages when Esc is pressed and a modal is open (#2894)
* Prefer key over keyCode

* Do not close TS pages on Esc when floating elements are open

* Close pop-up when Escape is pressed regardless of keepOnKeyup

* Close help modals when Escape is pressed

* Avoid duplicate handling of Esc in WithFloating

* Formatting

* Handle closing of preset management modals

* Reset text input modal to initial value
2023-12-21 13:59:52 +10:00
Damien Elmes
9b00425209 Hack around overflow in some languages
The problem at the moment is that the two left buttons are not part
of the scrollable area on the right, and the scrollable area has been
manually positioned. We would need to move the buttons into the toolbar
area, and then hide them when using the desktop editor. For now, I've
just added wrapping/smaller text instead.

https://forums.ankiweb.net/t/image-occlusion-editor-buttons-overlap-in-some-languages/38499
2023-12-18 13:34:05 +10:00
user1823
c4656ccc44
Correct the description of FSRS Difficulty in Stats (#2888)
* Correct the description of FSRS difficulty

* Update DifficultyGraph.svelte

* Update statistics.ftl
2023-12-14 12:48:58 +10:00
Gustaf-C
1b0ccfd243
Change link to manual in help screen from icon to text (#2886)
* Change help screen link to manual from icon to text

* Fix auto advance manual link (dae)
2023-12-13 09:03:05 +10:00
Damien Elmes
129157eb21 Better approximate average retention/ease/difficulty
Our average calculation is based on pre-binned values, so it's not
entirely accurate, but using the midpoint of the bin brings us closer.
In the future we can solve this by calculating it on the Rust end instead.
2023-12-12 15:09:13 +10:00
Damien Elmes
00da2ac27b Fix unwanted border on macOS
https://forums.ankiweb.net/t/anki-23-12-beta/37771/106
2023-12-12 14:43:48 +10:00
Damien Elmes
980594252d Move globe icon into separate Svelte file
Confirmed correct layout in RTL mode.

I experimented with adding a tooltip as well, as suggested in
https://forums.ankiweb.net/t/anki-23-12-beta/37771/82, but it's
confusing as we already change the mouse cursor/underline when the user
hovers over a label. Given the help text universally starts with
"affects the entire collection", I think that's good enough.
2023-12-12 12:33:31 +10:00
Damien Elmes
70ee28b559 Fix underscores in MathJax breaking rendering
Report:
https://forums.ankiweb.net/t/anki-23-12-beta/37771/51

\ln ^{\alpha} x \text{______} x^{\beta}\text{______}a^{x}

Cause:
https://github.com/mathjax/MathJax/issues/2566#issuecomment-727579057
2023-12-11 15:00:56 +10:00
Damien Elmes
50796e53b4 Give a hint about optimizing all presets 2023-12-11 14:27:17 +10:00
Damien Elmes
1ec769f1ae Fix some issues with toggle mask shortcut
- We were registered another event handler for each card, which was a
resource leak, and would lead to the shortcut failing on every second card
due to the even number of toggles.
- We were allowing toggleMasks() to run even when the button wasn't visible
(e.g., when showing the question side of a card)
2023-12-11 14:02:19 +10:00
Damien Elmes
9933e2ab54 Split "auto advance" into a separate section 2023-12-11 13:47:34 +10:00
Damien Elmes
8157d88038 Invert seconds to show question/answer; tweak wording
The previous wording could be interpreted as 'time until showing question'
or 'time that question should be shown'. I'd intended the latter, and
I didn't notice that the original implementation was doing the former.
2023-12-11 13:40:44 +10:00
Damien Elmes
699a63b85a Allow decimal timer delays 2023-12-11 13:17:04 +10:00
Damien Elmes
4f10a2818f Fix incorrect search being used when evaluating parameters
https://forums.ankiweb.net/t/anki-23-12-beta/37771/89
2023-12-11 13:09:48 +10:00
Damien Elmes
b36f367030 Fix revert icon position in RTL 2023-12-11 09:20:10 +10:00
RumovZ
c11e40b11b
Fix Select component not reacting to changed list (#2885)
* Fix Select component not reacting to changed list

Fixes #2882.

* Add msys to path on Windows in VSC settings
2023-12-11 09:12:34 +10:00
Abdo
6f3550464d
Fix IO note count (#2884) 2023-12-10 12:55:47 +10:00
Damien Elmes
93738d1656 Don't allow HTML in Select fields
If there's somewhere where we do need it, we should make it opt-in,
as stripping is the safe default.

Closes #2883
2023-12-10 12:47:21 +10:00
Abdo
548aca5b4f
Persist mask group scaling (#2878)
* Persist mask group scaling

Handles the first issue in #2876

* Fix selection resizing
2023-12-10 10:02:47 +10:00
Damien Elmes
97f43fbd45 Further speed up deck options load
Profiling revealed that binding to clientWidth for each component in
the deck options was taking up a sizable amount of time, due to the
inefficient way it's implemented: https://github.com/sveltejs/svelte/issues/7583

In one case, we can instead defer checking clientWidth until we go to
display the popover. In the other case, we can achieve the revert button
positioning a different way.

The last change dropped the speed index in Chrome from 1.4s to 1s; this
change brings it down to 0.7s.

Also fixed the hovered select element from jiggling due to a different
border width when hovering.
2023-12-08 15:10:35 +10:00
Damien Elmes
f10a29a93d Make help button more obvious, and remove hover animations
There's been a fair bit of talk on the forums about users not discovering
the help info, so this will hopefully make finding it easier.

Ideally we'd use a single var(--fg), but it feels a bit too strong in
light mode.

The animations we were showing on hover/focus made the UI feel
laggy. This has come up before, and we already disable them for buttons.
I experimented with removing the transitions (but keeping the change on
hover) - it feels much more responsive, but I also didn't feel that it
was contributing anything useful - the user knows where they've placed
the mouse or cursor, and the extra movement feels like a bit of a
distraction. Happy to discuss if people feel differently, though.
2023-12-08 13:39:56 +10:00
Damien Elmes
29e98721b5 Fix slow deck options performance
column-count was causing progressively-worse performance. By switching
to manual left/right column assignment, we get faster performance and
retain the top-to-bottom/left-to-right flow.

This also removes the outer DynamicallySlottable, which as far as I'm
aware, is not used by any add-ons.

Closes #2877
2023-12-08 12:09:26 +10:00
Damien Elmes
7664248550 Add a globe icon to global icons
Currently 80% of voters favor the globe, so I'm going to tentatively
call it.

https://forums.ankiweb.net/t/activating-fsrs-on-one-preset-activates-it-on-all-presets/36947/16
2023-12-08 11:18:13 +10:00
Akash Reddy
a5bdb28849
Fix Mathjax can only be pasted once (#2869)
* Fix mathjax can be pasted only once

* Update about.py

* Update CONTRIBUTORS

* fix formatting
2023-12-05 10:01:25 +10:00
Hikaru Y
820b833a43
Fix image overlay not closing when clicking outside on Qt6.6 (#2861)
* Add type to createEventDispatcher

* Fix image overlay not closing when clicking outside on Qt6.6

Use Event.composedPath() instead of obsolete Event.path
https://chromestatus.com/feature/5726124632965120
2023-12-04 14:57:03 +10:00
Abdo
e2e9e37a31
Fix some RTL issues in help modals (#2857)
* Fix RTL position of close button in help modals

* Fix position of active button's border

* Fix margin of modal's title

* Fix alignment of modal buttons' text

* Add missing translation
2023-12-01 15:07:44 +10:00
Abdo
dc3bd3efde
Replace css_browser_selector with our own implementation (#2854)
* Replace css_browser_selector

* Add classes to root element instead of body

* Export addBrowserClasses() in reviewer_extras for mobile clients (dae)

* Avoid setting .mac on iOS devices (dae)
2023-11-30 10:57:33 +10:00
Damien Elmes
7252dd56b6 Fix inability to save deck options when FSRS not enabled 2023-11-27 13:34:42 +10:00
Damien Elmes
123474c455 Update TS deps
Due to a change in svelte-check 3.5.2 (likely https://github.com/sveltejs/language-tools/pull/2146),
we can no longer have composite enabled, as svelte-check spits out errors
about files in other project references not being listed in included files.
This should hopefully not make a difference to us, as we weren't taking
advantage of TypeScript's project compilation, as svelte-check doesn't support
it, and we use esbuild for JS conversion.
2023-11-27 13:34:42 +10:00
Damien Elmes
0b8443032e Fix JS proto definitions not getting tree-shaken 2023-11-27 13:34:42 +10:00
Damien Elmes
8b6abd3f8f Switch FSRS reschedule to a global option; don't persist
A global is easier to use in conjunction with the 'optimize all' action.
The value is no longer persisted, as doing so makes it too easy for users
to generate a lot of revlog entries when playing with different FSRS
weights/retention settings, such as in https://forums.ankiweb.net/t/possible-syncing-limitation-by-fsrs-manual-scheduling-data-accumulation/37610
2023-11-27 11:24:31 +10:00
Damien Elmes
452e012c71 Add option to calculate all weights at once 2023-11-27 11:24:31 +10:00
Damien Elmes
c67f510b9a Update to latest FSRS 2023-11-27 11:24:31 +10:00
Mani
046ae539fb
fix: shortcut update and shape corner transparent (#2847)
* fix: shortcut update and shape corner transparent

* no outline when using shortcut
2023-11-25 16:05:45 +10:00
Mani
be1f889211
fixes: remove unfinished shapes, remove selectable and make shapes remain inside canvas (#2809)
* remove unfinished polygon and remove selectable for shapes in polygon mode

* make group and polygon position remain inside canvas area

* click through transparent area in grouped object

* add some shortcuts for basic usages

* tools button icon in center & switch mode border

* fix load svg image

* basic rtl support, panzoom have issues in rtl mode

* better zoom option both in ltr and rtl

* handle zoom event in mask editor

* add h button to handle toggle mask

* add more mime type

* use capital M (shift+m) for toggle mask

* allow io shortcuts in mask editor only

* make other shapes also remain in canvas bound area

* better zoom implementation, zoom from center
add zoom to resize event listener

* add a border to corner to handle blend of control

* add refresh button to go to  selection menu

* add tooltip to shortcuts and also add shortcut for other tools

* make opacity remain in same state when toggled on

* opacity for group/ungroup objects

* update shortcuts implementation
2023-11-24 14:06:40 +10:00
Ben Olson
9a301665a4
Improve keyboard handling and accessibility for Select.svelte and refactor (#2811)
* resolve TagAddButton a11y
better comments to document tagindex reasoning

* resolved a11y for TagsSelectedButton
allow focus to TagsSelectedButton with Shift+Tab and Enter or Space to show popover

* safely ignore a11y warning as container for interactables is not itself interactable

* Update CONTRIBUTORS

* quick fix syntax

* quick fix syntax

* quick fix syntax

* quick fix syntax

* resolved a11y in accordance with ARIA APG Disclure pattern

* resolved a11y
ideally should replace with  with
a11y-click-events-have-key-events is explicitly ignored as the alternative (adding ) seems more clunky

* resolved SpinBox a11y
cannot focus on these buttons, so no key event handling needed (keyboard editting already possible by just typing in the field)
widget already properly follows ARIA APG Spinbutton pattern

* cleanup

* onEnterOrSpace() function implemented as discussed in #2787 and #2564

* I think this is the main keyboard handling of Select
Still need to fix focus and handle roles and attributes

* fixed the keyboard interaction

focus is janky because you need to wait until after the listed options load and for some reason that needs a tiny delay on onMount
I think this technically violates a11y, but it really doesn't since the delay is literally zero. But the code still needs it to happen.

* Select and SelectOption reference the same focus function

* SelectOption moved inside Select
+ started roles and a11y

* quick syntax and such changes

* finish handling roles and attributes

* fixed keyboard handling and only visual focus

* cleanup and slight refactoring

* fixed syntax

* what even is this?

* bug fixes + revert key selection

* fixed scrolling

* better control scrolling and focus

* Adjusted selection
Up/Down Arrows: start selection on active option
Enter/Space/Click: no initial selection, down arrow to first option, up arrow to last option

* Only set selected the first time Select is opened, all subsequent times use the previous selected
2023-11-21 14:23:18 +10:00
Hikaru Y
8de5cf9690
Fix misalignment of IO masks in Qt5 when image is vertically long (#2829)
* Revert "Fix I/O not showing in Qt5"

This reverts commit c478689e5a.

* Fix misalignment of IO masks in Qt5 when image is vertically long

Also, as in Qt6, constrain the IO image to fit in the viewport.
2023-11-16 10:30:54 +10:00
Abdo
390935d4ea
Persist FSRS weights search in preset (#2827) 2023-11-14 11:47:08 +10:00
Ben Olson
7bcb57b89e
Resolve a11y for tag options buttons (#2787)
* resolve TagAddButton a11y
better comments to document tagindex reasoning

* resolved a11y for TagsSelectedButton
allow focus to TagsSelectedButton with Shift+Tab and Enter or Space to show popover

* safely ignore a11y warning as container for interactables is not itself interactable

* Update CONTRIBUTORS

* quick fix syntax

* quick fix syntax

* quick fix syntax

* quick fix syntax

* resolved a11y in accordance with ARIA APG Disclure pattern

* resolved a11y
ideally should replace with  with
a11y-click-events-have-key-events is explicitly ignored as the alternative (adding ) seems more clunky

* resolved SpinBox a11y
cannot focus on these buttons, so no key event handling needed (keyboard editting already possible by just typing in the field)
widget already properly follows ARIA APG Spinbutton pattern

* cleanup

* onEnterOrSpace() function implemented as discussed in #2787 and #2564

* quick syntax and such changes
2023-11-14 11:40:04 +10:00
Damien Elmes
c478689e5a Fix I/O not showing in Qt5
Images still gets stretched, because Qt5 doesn't support the aspect-ratio
CSS property, but it's better than nothing.

https://forums.ankiweb.net/t/possible-occulusion-issue-on-ver-23-10-and-the-solution/36894
2023-11-13 15:31:50 +10:00
RumovZ
39a60bc3a4
Allow applying limits of inactive parents (#2824)
* Allow applying limits of inactive parents

* Tweak label/help text (dae)
2023-11-13 14:30:19 +10:00
RumovZ
f200d6248e
Allow im-/exporting with or without deck configs (#2804)
* Allow im-/exporting with or without deck configs

Closes #2777.

* Enable webengine remote debugging in launch.json

* Reset deck limits and counts based on scheduling

Also:
- Fix `deck.common` not being reset.
- Apply all logic only depending on the source collection in the
gathering stage.
- Skip checking for scheduling and only act based on whether the call
wants scheduling. Preservation of filtered decks also depends on all
original decks being included.
- Fix check_ids() not covering revlog.

* Fix importing legacy filtered decks w/o scheduling

* Disable 'include deck options' by default, and fix tab order (dae)

* deck options > deck presets (dae)
2023-11-13 13:54:41 +10:00
Damien Elmes
d9e5c85686 Fix some build steps being re-run a second time unnecessarily 2023-11-13 13:35:54 +10:00