Commit graph

2297 commits

Author SHA1 Message Date
BlueGreenMagick
3b99ae4b91
Fix deck options button twitching on hover (#3623)
* Fix options page tab button text twitching on hover

* Fix options help modal button layout shifting on hover
2024-12-09 16:12:36 +11:00
Luc Mcgrady
d6ffaa921f
Add "No reviews to optimize" message (#3610)
* Separate failed message from optimal

* No reviews only

* Fix: Can't block optimize if not optimal

* Wording change

* Update ftl/core/deck-config.ftl

* Simplify code (dae)
2024-12-09 15:21:58 +11:00
Ben Nguyen
a4626bf48e
Remove infinite spinning icon for reset parameters dropdown and add a question mark (#3603)
* Add question mark to popup words

* Remove spinning icon

* Formatting
2024-12-07 00:41:34 +11:00
Luc Mcgrady
6524a24a89
Slider easy day gui (#3605)
* Slider easy day gui

* Removed: Borders

* Added: Bottom borders
2024-12-07 00:34:56 +11:00
Ben Nguyen
496d76e478
Hide progress text when done (#3609) 2024-12-06 02:53:24 +03:00
Sawan Sunar
f6a3e98ac3
fix deck button not clickable in stats screen (#3602)
Changed z-index of the underlying spinner
2024-12-02 19:34:39 +03:00
Abdo
2cd6b1c3b7
Fix congrats screen not refreshing (#3594) 2024-11-24 20:52:56 +10:00
Jarrett Ye
9a013d8601
Fix/FSRS progress sometime shows 0 reviews (#3591)
* Fix/FSRS progress sometime shows 0 reviews

* wait for progress_thread

* set 200ms timeout
2024-11-24 20:52:12 +10:00
Abdo
2cbb648456
Fix editor width changing as tag completions shown (#3574)
* Fix editor width changing as tag completions shown

* Avoid @render for now

* Ignore eslint warning
2024-11-18 01:11:21 +10:00
Damien Elmes
b646f09c68
Add descending retrievability (#3559)
* "relative overdueness" -> "retrievability ascending"

* Add 'retrievability descending'
2024-11-08 22:53:13 +10:00
Jake Probst
487b38b06c
include backlog cards in today in future due graph (#3379)
* include backlog cards in today in future due graph

when backlog option is not checked

* Don't add the backlog to today when backlog disabled

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2024-11-07 09:06:07 +10:00
Abdo
eb393aeaee
Warn if no day is set to Normal (#3557) 2024-11-07 08:35:39 +10:00
Abdo
4dcbcdb0ce
Escape special search characters in preset name (#3554) 2024-11-07 08:32:00 +10:00
Damien Elmes
8d9251e7e5 Remove FSRS client warning
https://forums.ankiweb.net/t/anki-24-10-beta/49989/290
2024-10-26 20:38:05 +10:00
Damien Elmes
97b729c5d4 Fix another non reactive property warning
I waited for the PR check to pass first, but it failed to catch this,
presumably as newly-added files don't trigger the existing checks to
re-run.
2024-10-26 19:48:48 +10:00
Jarrett Ye
eacd5bf908
Feat/add a toggle in the simulator to display time or review count (#3523)
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2024-10-26 19:42:57 +10:00
Jarrett Ye
1aa734ad28
Fix/set default easyDaysPercentages when switch preset (#3526) 2024-10-26 19:38:37 +10:00
user1823
7500beaba3
Fix calculation of daily load (#3516)
* Fix calculation of daily load

* Daily load in reviews/day
2024-10-26 19:05:01 +10:00
Damien Elmes
7e9da83d2c Update vitest and unpin vite 2024-10-26 18:41:59 +10:00
Damien Elmes
014620ab65
Update to stable Svelte 5 release (#3513)
* Update to stable Svelte 5 release

This causes a bunch of warnings to be omitted:

ts/routes/graphs/RangeBox.svelte:52:18
Warn: Properties of objects and arrays are not reactive unless in runes mode. Changes to this property will not cause the reactive statement to update (svelte)
                break;
            case RevlogRange.All:
                $days = 0;

They are triggered on enum references, and it appears to be a bug.
May need to report it to Svelte?

* Deps update

* Silence spurious errors + fix a real one

https://github.com/sveltejs/svelte/issues/13811
2024-10-26 18:21:45 +10:00
Damien Elmes
2eee54ef41 Add missing translation
https://forums.ankiweb.net/t/translation-not-working-for-days-to-simulate/50992/2
2024-10-22 23:58:24 +10:00
Damien Elmes
6adbd922f7 Rename remaining 'weights' references to 'params' 2024-10-21 18:13:23 +10:00
Damien Elmes
c45fa518d2 Use separate field to store FSRS params
Will allow the user to keep using old params with older clients
2024-10-21 18:13:23 +10:00
Jarrett Ye
26ae51fafd
Create a new kind of revlog entry for reschedule cards on change (#3508)
* create a new kind of revlog entry for Reschedule cards on change

* add comments

* exclude the rescheduled case in reviews graph
2024-10-21 16:47:01 +10:00
Jarrett Ye
b0eb2a2b97
Feat/Estimated Total Knowledge By Note & Daily Load (#3507)
* Feat/Estimated Total Knowledge By Note & Daily Load

* Update rslib/src/stats/graphs/retrievability.rs

* Update rslib/src/stats/graphs/future_due.rs
2024-10-21 15:19:42 +10:00
Hikaru Y.
694a5089a9
Fix 'Discard changes' dialog appearing even when no changes are made (#3495)
* Fix 'Discard changes' dialog appearing even when no changes are made

https://forums.ankiweb.net/t/anki-24-10-beta/49989/166

* Fix geometry of deck options window not being saved

evt.accept() does not seem to trigger reject().
2024-10-16 00:47:33 +10:00
Cy Pokhrel
8f4cab6a1a
Fix editor loses focus when toggling list if list item empty (#3483)
* fix editor loses focus when toggling list if list item empty

* fix CONTRIBUTORS
2024-10-16 00:38:35 +10:00
Jarrett Ye
f00211df35
add get_revlogs API && fix the style of tooltipText of ReviewsGraph (#3490)
* add get_revlogs API

* fix tooltipText of ReviewsGraph

the style of true-retention shouldn't affect the style of tooltipText of ReviewsGraph

* More verbose wording (dae)
2024-10-12 14:49:14 +10:00
Damien Elmes
40f9e0dc7a Fix true retention table dimensions
https://forums.ankiweb.net/t/anki-24-10-beta/49989/118
2024-10-11 23:57:47 +10:00
Damien Elmes
b3a85a6515 Revert "Decide if element is bold by getComputedStyle (#2453) (#2579)"
This reverts commit 9ced6be03e.

Caused a regression:
https://forums.ankiweb.net/t/anki-24-10-beta/49989/150
2024-10-11 23:34:50 +10:00
Hikaru Y.
e79060487b
Fix broken tag editor in Svelte 5 (#3488)
* Fix temporary disappearance of a tag

https://forums.ankiweb.net/t/anki-24-10-beta/49989/47

* Fix incorrect behavior after tag deletion

* Fix tag addition/selection buttons becoming invisible

Once tags were selected, subsequent deselection or selection did not
mount 'TagAddButton' or 'TagsSelectedButton' components.
2024-10-11 23:21:00 +10:00
Tomas Fabrizio Orsi
d4a3e4828b
ts/src/app.html: Changed from favicon.png to favicon.ico (#3485)
Signed-off-by: Tomas Fabrizio Orsi <torsi@fi.uba.ar>
2024-10-11 22:25:58 +10:00
Jarrett Ye
a982720a42
Feat/Easy Days (#3442)
* Feat/Easy Days

* format

* add easy_days_percentages to deck_config

* configure Easy Days via table

* remove unused code

* add translatable strings & add default of easy days

* don't check easy_days_percentages when deserialize

* pass test::all_reserved_fields_are_removed

* consider next_day_at when interval_to_weekday

* remove y-axis-title created in last simulation

* EstimatedTotalKnowledge should be integer

* Reorder deck option sections (dae)

- Move FSRS to bottom left, to move it closer to the top, and so
the left and right columns appear roughly balanced when FSRS is
enabled.
- Move Easy Days above Advanced

* Don't crash if wrong number of days (dae)

* Use lower field number (dae)

Repeated fields are more compactly stored in the first 15 fields.
2024-10-11 19:47:44 +10:00
Hikaru Y.
407e2dc43b
Fix issues with 'Discard changes' confirmation dialog (#3478)
* Prevent memory leak

* Fix deck option changes not detected until focus is lost

* Accurately determine if there are any pending changes

This makes it so that the confirmation dialog appears when it should,
and not when it shouldn't.
2024-10-06 14:21:00 +10:00
Damien Elmes
80ebdf1988 Flip order of question/answer actions, and ascending/descending ease
https://forums.ankiweb.net/t/anki-24-10-beta/49989/53
2024-10-04 20:52:20 +10:00
Damien Elmes
85f034b144 Split true retention into multiple tables; display vertically
This prevents the page scrolling off screen on small devices. This is
a quick fix, and further tweaks to the layout are welcome.
2024-10-04 17:04:22 +10:00
mmjang
9ced6be03e
Decide if element is bold by getComputedStyle (#2453) (#2579)
* Decide if element is bold by getComputedStyle (#2453)

* Use getComputedStyle() for italics too (dae)
2024-10-02 19:37:40 +10:00
Taylor Obyen
d6aa95950d
Fix occlusion drift again (#3443)
* Fix occlusion drift

* Fix image editor occasionally not loading fully

* Fix occlusion disassociation when browsing

* Address oversights

* Fix translucent modifier applies to newly created shapes incorrectly

* Fix i-text turns yellow upon immediate note change

* Fix image occlusion hot keys not disabled when typing

* Improve text label creation experience

* Remove redundant functions

* Fix error when adding occlusion (dae)
2024-10-02 17:19:52 +10:00
Jarrett Ye
59969f62f5
polish graphs of simulator, true retention table and forgetting curve (#3448)
* polish graphs of simulator and forgetting curve

* True Retention: decrease precision of percentages

* apply uniform sampling rate to forgetting curve

* don't display time, only date when maxDays >= 365

* don't floor the totalDaysSinceLastReview

* correct cramming condition

* improve code-style

* polish ticks & tooltip of simulator

* remove unused import

* fix minor error of daysSinceFirstLearn

* filter out revlog entries from before the reset

https://forums.ankiweb.net/t/anki-24-10-beta/49989/63?u=l.m.sherlock

* use Math.ceil for windowSize

* fill currentColor for legend text

* remove mix-blend-mode: multiply

* tune the position of legend
2024-10-01 00:22:30 +10:00
Taylor Obyen
fdc69505e9
Fix incorrect canvas bounds calculations (#3457)
* Fix incorrect canvas bounds calculations

* Fix contributors

* Set variables to be constant
2024-10-01 00:03:38 +10:00
Jarrett Ye
79592730ee
Feat/forgetting curve in card info (#3437)
* add elapsed time into revlog-table

* add stability into revlog-table

* add Graph of forgetting curve

* fix eslint

* add radio buttons of timeRange

* add revlog filter && return [] for new card

* format

* translatable string & disable if using SM-2

* elapsedTime should skip manual or filtered review

* add HoverColumns

* fix eslint

* add stability to tooltip & use timeSpan

* reuse translatable strings

* distinguish daysSinceFirstLearn and elapsedDaysSinceLastReview

* Date x-axis & toLocaleString

* Temporarily hide elapsed/stability columns (dae)

https://github.com/ankitects/anki/pull/3437#issuecomment-2378851900
2024-09-27 19:32:40 +10:00
Damien Elmes
cf17ca2f84 Revert "Fix occlusion rounding bug (#3400)"
This reverts commit 96ff4f1a4a.

This change broke adding of new occlusions on desktop:

JS error /_anki/js/editor.js:100016 Uncaught TypeError: Cannot read properties of undefined (reading 'getBoundingRect')
2024-09-25 20:04:35 +10:00
Damien Elmes
221d995180 Fix header/extra fields being collapsed on mobile
+ use a class, since this element is repeated
2024-09-25 19:51:19 +10:00
Damien Elmes
a4002783a5 Fix Back Extra field not being added 2024-09-25 19:51:19 +10:00
Damien Elmes
740d95d53f Fix inability to save occlusions on mobile 2024-09-25 19:51:18 +10:00
Abdo
bf46a5f08c
Update to Svelte 5 (#3292)
* Update to Svelte 5

* Fix `<tr> is invalid inside <table>`

* Update sveltekit-svg to match svelte version

Fixes deck options failing to load, and a bunch of warnings with
./yarn dev

* Fix graph tooltips

* Fix editor loading

* Fix MathJax editor not loading

* Formatting

* Fix new formatting errors

* Merge remote-tracking branch 'origin/main' into svelte5

* Remove slot inside EditorToolbar

I think this is just stray code left over from a refactor, but I'm
not 100% sure.

Fixes
Error: Object literal may only specify known properties, and 'children' does not exist in type '{ size: number; wrap: boolean; api?: Partial<EditorToolbarAPI> | undefined; }'. (ts)
<div class="note-editor">
    <EditorToolbar {size} {wrap} api={toolbar}>
        <slot slot="notetypeButtons" name="notetypeButtons" />

* Fix component typing error

* Comment out svelte/internal exports, so editor loads

* Fix image occlusions in editor

* Revert "Remove slot inside EditorToolbar"

This reverts commit b3095e07ac,
which prevented the Preview button from showing in the browser.

This will break our tests again.

* Update vite

* Disable routes/tmp for now

* Fix references issue in routes/tmp
2024-09-25 18:49:07 +10:00
Jarrett Ye
3912db30bb
Feat/true retention stats (#3425)
* Feat/true retention stats

* ./ninja fix:minilints

* use translatable strings & update style

* remove card couts & add more translatable strings

* Update statistics.ftl

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

* add Estimated total knowledge (cards)

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
2024-09-22 19:00:27 +10:00
Ben Nguyen
c2f3e63b90
Bug with “A 100 day interval will become X days.” (#3432)
* add name to about page

* use two decimal retention for calculations

* Update CONTRIBUTORS

* format

* Update CONTRIBUTORS

* Update CONTRIBUTORS

* Update CONTRIBUTORS
2024-09-22 18:24:32 +10:00
Arthur Milchior
b08e454f57
If deck options are modified, ask before closing (#3410)
* If deck options are modified, ask before closing

This imitates the way the note editor behaves. If a user assumes by
error that chanhges are automatically saved, it ensures they won't
lose them.

Also, this will eventually allows to have the same feature on
AnkiDroid. While, currently, we always ask the user whether they want
to close the deck options, even when there are no modification, which
seems to regularly frustate users (including myself).

I'm new to Svelte, please let me know whether there is a better way to
obtain the information from Svelte state that I missed.

Note that I ensured that only a boolean can be obtained. I didn't
cause the whole state to be accessible. May be useful for some
add-ons, I guess, but risks breaking too much things.

Regarding the deckoptions.py, I tried to imitate addcards.py way to
check whether the add card view can be closed. Reusing the same
function and variable name when possible.

* Update qt/aqt/deckoptions.py (dae)
2024-09-22 18:07:24 +10:00
Abdo
847f3f6714
Fix FSRS progress update issues (#3420)
* Delay optimal FSRS params alert to ensure progress updates are reported

* Ensure progress updates arrive synchronously
2024-09-20 21:18:02 +10:00
Taylor Obyen
96ff4f1a4a
Fix occlusion rounding bug (#3400)
* Fix occlusion rounding bug

* Fix contributors
2024-09-20 20:48:44 +10:00
Luke Bartholomew
1b7123aa94
Add comment about the usage of the input field in the statistics page (#3394) (#3398)
* Add comment about the usage of the input field in the statistics page (#3394)

* Fix formatting issues (#3394)

* Update ts/routes/graphs/RangeBox.svelte

Co-authored-by: Mike Hardy <github@mikehardy.net>

* Update ts/routes/graphs/RangeBox.svelte

Co-authored-by: Mike Hardy <github@mikehardy.net>

---------

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
Co-authored-by: Mike Hardy <github@mikehardy.net>
2024-09-20 20:47:04 +10:00
Abdo
21df287579
Fix minimum interval warning shown when FSRS is enabled (#3409) 2024-09-11 02:21:49 +07:00
Abdo
880c7d366c
Fix graph averages (#3406)
* Fix graph averages

* Fix formatting
2024-09-11 02:18:53 +07:00
Jarrett Ye
34809f2520
Fix/simulator crashes if no history (#3405)
* Fix/simulator crashes if no history

* ./ninja format

* remove (experimental) from ComputeOptimalRetention

* update to fsrs-rs v1.2.2
2024-09-10 23:15:33 +07:00
Damien Elmes
b241ab9492
Dependency updates (#3403)
* Bump Python deps

Primarily for flask-cors CVE

* Bump TS deps; pin license checker

Current checker is missing the binary
https://github.com/RSeidelsohn/license-checker-rseidelsohn/issues/118

* Update Rust deps

Hyper and axum are held back as we currently make use of the older
http library that reqwest pulls in
2024-09-04 12:21:50 +07:00
Abdo
58e25f12b2
Fix Svelte exports not working in Deck Options (#3382) 2024-08-29 19:12:18 +07:00
bpnguyen107
3661333185
Move 'ignore reviews before' to advanced (#3381)
* moved ignore setting to advanced

* Update CONTRIBUTORS

* Match width of other text inputs (dae)

The width was inconsistent before as well, but moving it next to
text inputs made it more obvious.
2024-08-29 19:11:56 +07:00
Damien Elmes
a179da3827
Update dprint (#3376)
* Update amd64 docker container to Debian 11

This bumps the minimum required glibc to 2.29, which is 2019
Ubuntu/Fedora, and 2021 Debian.

Also remove the unused download of ninja

* Update to latest dprint

Unblocked by the glibc upgrade
2024-08-22 18:24:56 +07:00
Jarrett Ye
8ed9f49bdc
Feat/FSRS Simulator (#3257)
* test using existed cards

* plot new and review

* convert learning cards & use line chart

* allow draw multiple simulations in the same chart

* support hide simulation

* convert x axis to Date

* convert y from second to minute

* support clear last simulation

* remove unused import

* rename

* add hover/tooltip

* fallback to default parameters

* update default value and maximum of deckSize

* add "processing..."

* fix mistake
2024-08-22 15:34:19 +07:00
Dillon Baldwin
a2b4b57390
Added name to contributors list as well as addressed issue #3343. Ran ninja check and the build compiled successfully. (#3345) 2024-08-07 16:15:50 +07:00
sorata
5216fa959e
Update AutoAdvance.svelte (#3313) 2024-07-21 20:49:42 +07:00
user1823
dccb7c9b27
Update references to tooltip strings (#3312)
* Update string reference

* Update FsrsOptionsOuter.svelte
2024-07-21 17:24:41 +07:00
sorata
087f957a36
Update Tooltip (#3288)
* Update Tooltip

updated the tooltips as described here: https://forums.ankiweb.net/t/update-tooltips/46849

* Update CONTRIBUTORS

* Update deck-config.ftl

* fixed punctuation, stylistic incoherence, etc.

* Update deck-config.ftl

https://github.com/open-spaced-repetition/fsrs4anki/pull/667

* Changed string requires new key (dae)

* Minor tweaks to tense for clarity (dae)

https://github.com/ankitects/anki/pull/3288#issuecomment-2223384500
2024-07-21 16:44:37 +07:00
Damien Elmes
194f35617d Switch mask editor to non-conflicting shortcut
In the absence of better ideas, I've added alt

Closes #3276 and #3278
2024-07-21 13:05:56 +07:00
Pedro Schreiber
799912cfe3
keep-text-in-occlusion (#3277) 2024-07-20 17:48:37 +07:00
Abdo
d108bff862
Fix remaining accessibility warnings (#3241)
* Remove unused build var

* Fix accessibility warnings in CollapseLabel

* Fix accessibility warnings in PlainTextBadge

* Add ARIA role to Autocompleteitem

* Fix accessibility warnings in HandleBackground

* Fix accessibility warnings in HandleControl

* Fix accessibility warnings in EditorField

* Fix accessibility warnings in RichTextBadge

* Fix accessibility warnings in StickyBadge

* Remove ignored a11y warnings
2024-07-10 19:55:08 +07:00
Damien Elmes
2a52639cd3 Update web deps
Vite held back, as current version is breaking the build
2024-07-06 18:40:37 +07:00
Abdo
fa47e905c5
Restore $deckOptions (#3265)
* Restore $deckOptions

* Avoid error in logs when using ./yarn dev or mobile clients (dae)
2024-06-28 19:38:18 +07:00
Abdo
6232d0aec8
Fix deck config input's background color regression (#3258)
* Fix deck config input's background color regression

* Move styles to base stylesheet
2024-06-28 18:52:51 +07:00
Jarrett Ye
6d13221ae5
Remove threshold of compute minimum recommended retention (#3246)
* remove threshold of compute minimum recommended retention

* update tool tip of compute-optimal-retention

* cargo clippy --fix

* Update FsrsOptionsOuter.svelte

* Remove 'from 0 cards' reference (dae)
2024-06-28 18:26:39 +07:00
Damien Elmes
0d8d816a0c Include error message text on page
Also remove the '500' h1 from the error

Closes #3248
2024-06-24 15:35:47 +07:00
Abdo
4221e54390
Fix image occlusion flicker caused by setupI18n() (#3253) 2024-06-24 08:48:49 +01:00
Abdo
9dc3b10fe9
Fix deck config input's background color in Qt5 (#3243) 2024-06-22 10:43:34 +01:00
Damien Elmes
e41c4573d7 Formatting fix 2024-06-20 20:43:43 +07:00
Damien Elmes
a8e3b46edd Fix deck options failing to show on Qt 5.14
https://forums.ankiweb.net/t/mac-intel-options-screen-doesnt-work-on-version-24-06-2-qt5/45819/8
2024-06-20 20:29:36 +07:00
Abdo
548066f92c
Fix missing i18n module in IO review screen (#3223) 2024-06-06 11:20:40 +01:00
Abdo
4ab0db3127
Another try at fixing IO events issue (#3210) 2024-05-28 10:29:21 +01:00
Mani
c2d565ee4f
do not recreate page when toggle button used (#3208) 2024-05-24 10:47:18 +01:00
Abdo
abacdcaeda
Fix future due search missing cards on last day (#3206) 2024-05-24 10:46:38 +01:00
Damien Elmes
c4cd8808f3 Fix import order 2024-05-17 17:11:28 +07:00
Damien Elmes
d64ea23e11 Enable svelte preprocess 2024-05-17 17:01:49 +07:00
Damien Elmes
f639c3660a Revert "Revert "Revert "Preserve HTML formatting inside clozes (#3038)"""
This reverts commit 9c733848b8.
2024-05-17 11:51:09 +07:00
Abdo
998b91c1fe
Fix IO event handlers being run on normal notes (#3195) 2024-05-15 12:48:58 +01:00
Abdo
50772eeece
Fix '366 of 365 days studied' (#3182)
* Fix '366 of 365 days studied'

* Apply nicing when GraphRange.AllTime is selected
2024-05-06 23:50:27 +10:00
RumovZ
8ad65d40ff
Clean up #3167 (#3186)
* Revert changes to ButtonToolbar from #3167

Flex gap is still not fully supported.
Keeps a small margin increase.

* Add margin to deck config header

* Move StickyHeader into import-page
2024-05-01 20:08:19 +10:00
Mani
995d7b1fa5
fix polygon tool draw (#3184) 2024-05-01 20:03:27 +10:00
RumovZ
9418bd9c7d
Improve and unify web dialog styling (#3167)
* Rework ChangeNotetypePage with existing components

* Use disabled Select instead of LabelButton

* Don't use  button for unclickable arrow

* Rework ImportLogPage with existing components

* Improve deck options styling

* Align spacing in ChangeNotetypePage further

* Use StickyContainer on ImportPage

* Format
2024-05-01 17:49:57 +10:00
Abdo
22ac77896f
Show review count for Evaluate/Optimize button (#3170)
* Revert "Show review count with FSRS evaluation results (#3165)"

This reverts commit b7e782c7e1.

* Show review count for Evaluate/Optimize button
2024-05-01 17:02:59 +10:00
Abdo
573af9cd4c
Use key instead of code in type-in field (#3166)
* Use key instead of code in type-in field

* Use event.key for Enter
2024-05-01 16:59:11 +10:00
Pedro Schreiber
074becc0ce
Add keyboard shortcuts for empty cards and toggle mask on image occlusion (#3136)
* Add keyboard shortcuts for empty cards and toggle mask on image occlusion

- add shortcut for empty cards
- add shortcut for toggle mask
- set tooltips with shortcuts

use unused shortcut for empty cards

* remove unnecessary shortcut added in main.py

* change empty cards shortcut and try to fix CI error in CONTRIBUTORS

* change shortcut for empty cards for universal support
2024-04-25 17:19:38 +10:00
Abdo
b7e782c7e1
Show review count with FSRS evaluation results (#3165) 2024-04-25 17:10:41 +10:00
Jarrett Ye
2c9accf595
update optimal retention and parameters tooltip (#3148)
* update optimal retention and parameters tooltip

* Revert "update optimal retention and parameters tooltip"

This reverts commit 32fdc5c1c3.

* update optimal retention and parameters tooltip

* check num of revlogs at first

* use new translation string

* Update deck-config.ftl

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

* Update deck-config.ftl

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

* Update deck-config.ftl

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

* Update ftl/core/deck-config.ftl

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>

* fix position of translation string

* Update deck-config.ftl

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>

* Update deck-config.ftl

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>

* Update deck-config.ftl

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2024-04-24 02:38:52 +01:00
RumovZ
790c52f012
Svg icon (#3135)
* Add sveltekit-svg plugin to fix svg icon styling

Closes #3127.

* Unify svg icon usage

Moves all icons into ts/lib/components/icons.ts and uses a single component to render
them both with eslint and svelte-kit.

* Fix spinning revert icon not being centered

* Use svg earth icon for global label

* Add tooltip to global label icon

* Remove eslint-plugin-simple-import-sort

Imports are already sorted by dprint with conflicting rules.
2024-04-24 02:37:31 +01:00
Mani
f0f9535200
fix io draw in mobile client (#3160) 2024-04-23 22:39:26 +10:00
Damien Elmes
a188a59646 Fix adding/saving I/Os on mobile 2024-04-22 20:58:26 +10:00
Abdo
c62e2d8df0
Fix spacebar causing stutter when editing cards (#3150)
* Fix spacebar causing stutter when editing cards

* Remove IO toolbar event handlers on unmount

* Remove nested keydown handlers
2024-04-19 19:13:56 +10:00
RumovZ
ebc6c0847a
HMR on Windows (#3144)
* Enable hot module reloading on Windows

* Update VSC launch.json and tasks.json

* Bind vite server to 127.0.0.1 (dae)

Our frontend connects via IP, and on Windows, this fails if the server
is bound to 'localhost' instead.
2024-04-17 21:23:34 +10:00
Abdo
351aa96dfc
Fix IO text size in review screen (#2986)
* Store relative font size

* Handle multi-line text

Thanks to @glutanimate
2024-04-17 20:45:40 +10:00
Damien Elmes
e66adcca38 alertOnError should default to true
Regressed in svelte-kit port
2024-04-17 20:13:37 +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
Abdo
e486d6b513
Improve typing of custom fabric.Object properties (#3134)
* Ensure increasing ordinals of new masks

* Add fabric.d.ts

* Revert "Ensure increasing ordinals of new masks"

This reverts commit dedfeec9ad.
2024-04-13 08:36:08 +01:00
Mani
477f932f35
fix select all and change ordinal in edit mode in io (#3109)
* fix select all and change ordinal in edit mode in io

* make ordinal undefined for all shapes in group/ungroup

* fix group shapes and some ui fixes

* Don't add node_modules/* to dprint deps

* use minimum ordinal when shape merged, use max ordinal++ when ungrouped, in add mode no ordinal preset so NaN

* use state for ungroup shape

* maintain existing ordinal in editing mode

* fix order of ordinal in ungroup shape

* refactor: remove for loop, use forEach
2024-04-11 08:08:07 +01:00
Abdo
29bdc47482
Fix IO text masks being grouped (#3128) 2024-04-10 08:36:00 +01:00
Abdo
642f29cf5e
Fix IO mask position slightly off in edit mode (#3121) 2024-04-08 16:40:22 +01:00
Damien Elmes
3033b54890 Another attempt at fixing rounding issue with optimal retention
Also use the previously-added translation.
2024-04-05 18:22:45 +07:00
Mani
038a0189d0
highlight io shapes in answer side (#3098) 2024-03-31 10:14:11 +01:00
Abdo
31e2dc1409
Fix some cloze handling regressions (#3086)
* Place cursor inside empty clozes

* Remove empty <li> after being added
2024-03-31 10:01:17 +01: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
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
6e1ae5231b Update optimal retention tooltip, and add a few extra translations 2024-03-28 16:02:05 +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
Damien Elmes
0c02c669c1 Fix spurious warning when comparing optimal and desired retention 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
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
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
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
Damien Elmes
de8b81ca7a Fix consolas not being used in editor 2024-03-10 12:52:53 +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
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
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
631088cdca
Fix alert not appearing when FSRS parameters input is focused (#3053) 2024-03-05 06:43:57 +00: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
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
Kieran Black
d2ae0d9ada
fix text input custom style wiping out base user style (#3031) 2024-02-26 13:07:45 +07:00
Abdo
6843d65ed1
Check required review count for FSRS after filtering (#3019)
* Check for required review count for FSRS after filtering

* Remove unreachable check

* Update minimum review count in optimal retention calculation

* Fix review check in optimal retention routine too
2024-02-24 14:53:38 +07:00
Abdo
0018f126ea
Fix misaligned image occlusions in RTL languages (#3018) 2024-02-22 11:10:36 +07:00
Abdo
00c67fc0c7
Show message if current FSRS parameters are optimal (#3014)
* Show message if current FSRS parameters are optimal

* Fix message shown with default parameters

* Use alert()
2024-02-22 11:09:17 +07:00
Luc Mcgrady
8b18a08b3b
FSRS - Ignore revlogs before date while optimizing (#2922)
* Added: Date input button

* Added: ignoreDate to config

* Added: Backend

* Optimize function passes value

* Fix: Spelling

* Moved: filter logic from revlog_for_srs to update_memory_state

* fmt

* Copyright header

* ./check

* Fix: Test

* Renamed: Ignore_date -> Ignore_before_date

* Neaten parameters

* evaluate weights

* ./check

* Optimize all presets

* Added: Label localizations

* Removed globe label

* Added: Tooltip

* Changed error type

* fmt

* Moved filter to own function

* missing function call replacement

* Fix: Typo

* Apply suggestions from code review

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>

* timestamp * 1000 -> timestamp_millis

* ignoreBefore -> ignore_before

* clarified ignore_before variables

* i64 -> TimestampMillis

* Un-traitified remove_revlogs_before

* Added: ms == 0 guard

* Added: Ignore_before affects scheduling

* Moved filter to fsrs_items_for_training

* removed filter from revlog_for_srs

* Tuple -> UpdateMemoryStateEntry

* Removed unused function

* Removed superfluous _ms from variables

* cid -> id

* Different ignore method

* Added: Unit test

* cid -> id

* Test: Exact ms edge case

* ./check

* Fix: re-learns could be before ignore date in cards without learning steps

* getignoreRevlogsBeforeMs -> getIgnoreRevlogsBeforeMs

* Removed pub(crate)

* Clarified unit test

* last_learn_entry -> first_of_last_learn_entries

* @user1823's method

* IOS fix

* ./check

* Fix: width defined twice
2024-02-22 11:01:10 +07:00
Lucas Scharenbroch
97dcb776de
Refactor text attribute button components (#3012)
* Factor out common code in bold/italic/underline/sub/sup buttons

* Update exclusiveNames' states on click

* Update exclusiveNames' states on keyboard shortcut
2024-02-18 13:09:05 +07:00
Lucas Scharenbroch
b80057440e
Fix visual behavior of modal buttons in editor (#3009)
* Fix behavior of justification buttons

* Make list buttons update each other when clicked
2024-02-14 20:35:37 +10:00
Abdo
4ef389b580
Keep previous FSRS parameters if they get worse when optimizing (#2996)
* Update to fsrs-rs 0.3.0

* Keep previous FSRS parameters if they get worse when optimizing
2024-02-11 16:26:04 +10:00
Abdo
80c14aa6e9
Maintain original IO cloze order in editing mode (#2987)
* Maintain original IO cloze order in editing mode

* Fix ordinal propery name
2024-02-07 13:42:47 +10:00
Lucas Scharenbroch
146a3d936e
Fix corner rounding of alignment buttons in editor (#2989)
* Fix corner rounding of alignment buttons in editor

* Fix formatting

* Fix cascading button-rounding issues
2024-02-07 13:11:14 +10:00
Jarrett Ye
2fffe4b7ba
update FSRS to v0.2.0 (#2977)
* update FSRS to v0.2.0

* update comments

* ./ninja fix:minilints

* 1000 -> 400 in translation (dae)
2024-01-30 16:27:12 +10:00
Mani
ec3698502b
add select all tool (#2981)
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2024-01-30 15:43:15 +10:00
Pedro Lameiras
5849fc6f64
Make image occlusion's option buttons tabbable (#2966)
* Make image occlusion's option buttons tabbable

* Added myself to contributors

* Removed two-way binding
2024-01-29 12:49:28 +10:00
Abdo
0291847712
Fix Image field not hidden until user selects an image (#2960) 2024-01-23 14:24:12 +10:00
Abdo
eab5c02251
Add by creation date review sort order (#2957)
* Add by creation date review sort order

* Order by template after nid in ReverseAdded of filtered decks too
2024-01-21 20:29:19 +10:00
user1823
ee68da51b0
More precise percent of days studied (#2889)
* More precise percent of days studied

* Use localizedNumber & Format

* Update reviews.ts

* Update reviews.ts

* Update reviews.ts
2024-01-21 20:25:50 +10:00
Abdo
fe5ba1cce7
Fix MathJax editor not opening when navigating into blocks (#2953) 2024-01-19 16:06:27 +10:00
Abdo
8afd6480cb
Fix title of Auto Advance section (#2949) 2024-01-19 15:48:30 +10:00
Damien Elmes
db1aecd3d8 Ignore congrats fetch errors
The congrats page fetches data once a minute, and onRefreshTimer()
reloads the page once every 10 minutes. If a data fetch is in flight
when the page reload happens, it can cause a 'failed to fetch' error
to occur.

Closes #2895
2024-01-19 15:28:54 +10:00
Aristotelis
db9aaba929
Make tags and tag suggestions able to be styled by add-ons (#2941)
* Expose tag name to add-ons via data attribute

* Expose autocomplete items to add-ons as data attributes

* Use common data-addon* prefix for attributes
2024-01-18 10:09:06 +10:00
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