Commit graph

2283 commits

Author SHA1 Message Date
Luc Mcgrady
a66f8b2b5f
Fix/Layout shift on CardCounts button hover (#3971) 2025-05-05 17:24:34 +10:00
Damien Elmes
c70e9d26c5 Add the ability to hide the forgetting curve from card info 2025-05-05 17:04:15 +10:00
GithubAnon0000
57ecfbe562
REMOVE percentages of x-axis in the answer buttons graph (#3952)
* Allow linebreak between kind and percentage in answer buttons graph. This is BROKEN!

* FIX: percentage is not below kind

* FIX: y-axis wrongly had percentages

* REMOVE debugging console

* run ./check and fix errors

* REMOVE unused comment (commented out code)

* FIX: Percentage Text is cutoff (this removes transition as well)

* FIX: incorrect alignment

* UPDATE variable names to make them more meaningful

* UNDO removing transition

* REMOVE percentage from x-axis

* Revert "UNDO removing transition"

This reverts commit 2652b16bd7.

* RESTORE transition in x-axis
2025-05-05 15:37:24 +10:00
llama
6ff023f6a1
apply min-height to anki-editable directly (#3957) 2025-04-28 06:41:00 +10:00
Luc Mcgrady
ad073ab10c
Feat/CMRR uses simulate config (#3947)
* Added: simulate_request_to_config

* Use SimulateConfig for CMRR

* ./check

* Fix: ComputingRetention

* Use actual cards for optimal_retention
2025-04-27 21:02:37 +10:00
Jarrett Ye
e096c462fa
Feat/FSRS-6 (#3929)
* Feat/FSRS-6

* update comment

* add decay to Card

* ./ninja fix:minilints

* pass check

* fix NaN in evaluation

* remove console

* decay should fallback to 0.5 when it's None.

* Update SimulatorModal.svelte

* Update a few comments

* Update FSRS decay defaults to use constants for better maintainability and clarity

* Update rslib/src/storage/card/data.rs
2025-04-25 16:44:34 +10:00
llama
b5f15491a0
carry over tags when refetching csv metadata (#3938) 2025-04-24 19:18:57 +10:00
Luc Mcgrady
a2e0060470
Chore/Simulator modal i18n (#3927)
* Chore: Simulator i18n

* Buttons should be Title Case (dae)
2025-04-24 19:17:04 +10:00
Arthur Milchior
efaaae8ce4
Cloze button get disabled outside of cloze field (#3879)
* NF: replace `disabled` by `enabled`

This allows to remove the negations and, in my opinion, make the code
easier to understand and edit.

* Cloze button get disabled outside of cloze field

More specifically, if the user focus in a field that is not a cloze
field, the button are still there but appear as disabled. The shortcut
instead of adding the cloze context shows an alert explaining why this
can't be done.

While this message is already displayed when the user tries to add a
note with cloze in non-cloze field, I suspect it will save time to
stop the user as soon as possible from making mistake. This should
make very clear what is authorized and what is not.

It'll also be a reminder of whether the current field is a cloze or
not.

In order to do this, I added a back-end method (that I expect we may
reuse in ankidroid) to get the index of the fields used in cloze. This
set is sent to the note editor, which propagates it where needed.

In mathjax, the cloze symbol is removed when the selected field is not
a cloze field.
2025-04-24 18:37:41 +10:00
GithubAnon0000
aacf8ec774
Add help modal to TR table (#3874)
* Update TrueRetention.svelte adding description

* Update statistics.ftl to add additional info

* Swap TR with DR

* Change string to 'Is expected to'

* Add help modal to TR table

* Add tooltip slot to Graph.svelte (thanks @Luc-Mcgrady)

* Fix lint warning and failing test

* Remove unused code

* removedd on:mount to make eslint happy

* ADD back on:mount

* ADD back code needed for on:mount

* REMOVE openHelpModal() as I couldn't figure out how to make the title clickable

* attempt to ADD clickable title (BROKEN\!)

* Update ts/lib/components/TitledContainer.svelte

Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>

* Update ts/routes/graphs/Graph.svelte

Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>

* Update ts/routes/graphs/TrueRetention.svelte

Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>

* ADD exported onTitleClick as @Luc-Mcgrady suggested

* REMOVE vite.config.ts file

---------

Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>
2025-04-24 18:31:45 +10:00
Damien Elmes
1e74e8e86e
Fix add-on buttons not working in the editor (#3941)
* Fix add-on buttons not working in the editor

* Ensure old listeners are cleaned up

Thanks to iamllama: https://github.com/ankitects/anki/pull/3941#discussion_r2057066283
2025-04-24 15:26:46 +10:00
Damien Elmes
ddb8573e8d
Use CSP to block inline JS content in editor (#3939)
* Revert "Sanitize field content in editor"

This reverts commit 1c156905f8.

* Use CSP to block inline JS content in editor

This blocks inline scripts, scripts in the media folder, and
handlers like onclick in the editor. This is nicer than the previous
solution - it doesn't make any permanent changes, and leaves other
content like SVGs alone. Thanks to Nil Admirari for the suggestion.
2025-04-23 16:21:48 +10:00
Damien Elmes
1a68c9f5d5
Harden access to internal API (#3925)
* Sanitize field content in editor

The editor already strips script tags from fields, but was allowing
through Javascript in things like onclick handlers. We block this now,
as the editor context has access to internal APIs that we don't want to
expose to untrusted third-party code.

* Require an auth token for API access

We were previously inspecting the referrer, but that is spoofable,
and doesn't guard against other processes on the machine.

To accomplish this, we use a request interceptor to automatically
add an auth token to webviews with the right context. Some related
changes were required:

- We avoid storing _page, which was leading to leaks & warning on exit
- At webview creation (or set_kind() invocation), we assign either
an authenticated or unauthenticated web profile.
- Some of our screens initialize the AnkiWebView when calling, e.g.,
aqt.forms.stats.Ui_Dialog(). They then immediately call .set_kind().
This reveals a race condition in our DOM handling code: the webview
initialization creates an empty page with the injected script, which
causes a domDone signal to be sent back. This signal arrives after
we've created another page with .set_kind(), causing our code to think
the DOM is ready when it's not. Then when we try to inject the dynamic
styling, we get an error, as the DOM is not ready yet. In the absence
of better solutions, I've added a hack to set_kind() to deal with this
for now.

* Provide AnkiWebPage init defaults for existing add-on callers

* Inject bridge script when profile set-up skipped

Some add-ons fully override AnkiWebPage.__init__ and thus depend on _setupBridge injecting the JS bridge script.

With this change we account for these cases, while giving add-ons the opportunity to look for solutions that do not require overriding AnkiWebPage.__init__ completely.

* Add some missed pages/endpoints (thanks to iamllama)

* Avoid sending API key for remote resources

Thanks to Abdo for the report

---------

Co-authored-by: Aristotelis P <201596065+aps-amboss@users.noreply.github.com>
2025-04-17 11:15:10 +10:00
Damien Elmes
7969b4061f Bump vite/svelte for latest security fixes 2025-04-15 20:53:26 +10:00
GithubAnon0000
e7fbf159a6
add min-height to fields (#3922)
* add min-height to fields

* 30px → 1.5em

This works with different font sizes too. Now there are no size jumps between empty field / field with string / field with empty html.
2025-04-15 20:24:43 +10:00
Luc Mcgrady
781a23c6c4
Feat/Ignored before card count (#3910)
* GetIgnoredBeforeCount

* get_card_count_with_ignore_before

* Included / total

* Respect search

* Get frontend hooked up

* Fix: Malformed sql and search

* Variable names

* Added: Alert colours

* i18n

* ./check

* Remove console.log

* Fix: Tooltip showing for default value

* Update ftl/core/deck-config.ftl

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

* Fix: Multiple backend calls

* Message: (Approximately)

* Fix: Bouncing info message

* Added: Change delay

* Added: ignore_before_updated

* ./check

* Fix typing, camelCase and improve wording

* Temporarily enable the check on startup

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
2025-04-15 20:21:54 +10:00
llama
9d167feb8f
Remove use of createClassComponent in mathjax-element.ts (#3919)
* replace use of deprecated createClassComponent with mount

* bump esbuild-svelte from 0.8.1 to 0.9.2

* mathjax-element.ts -> mathjax-element.svelte.ts

* move caret after tick
2025-04-13 16:21:22 +10:00
user1823
e546c6d11f
Improve natural unit conversion for a time b/w 360 to 365 days (#3901)
* Improve natural unit conversion for a time b/w 360 to 365 days

Previously, 363 days would be converted to 12.1 months, which is quite confusing because
- a user would think that if the value is more than 12 months, why it isn't displayed in years
- the value is actually less than a year, which is counterintuitive as 12.1 m suggests a value more than a year.

* precise

* Update time.ts to match timespan.rs

* Add another test

* Use average duration of a month instead

* Update time.ts

* Update test_schedv3.py

* Update time.test.ts
2025-04-13 14:26:34 +10:00
GithubAnon0000
332830e5d7
Cleanup old TODO (#3903)
This Todo is no longer needed, since #1503 has been closed.
2025-04-11 20:38:20 +10:00
llama
d9c71a54cf
Allow drag-dropping into plaintext editor (#3902)
* expose field index as data attr on container

* allow drag/dropping into fields' plaintext editors
2025-04-11 19:34:47 +10:00
user1823
0f9216c127
Replace some means in Stats with medians (#3900)
* Display median interval in Stats instead of mean

Median is better suited than mean for reporting skewed data.

* Display median ease in Stats instead of mean

* Update difficulty.ts

* Update ease.ts

* Update statistics.ftl

* Format eases.rs

* Remove unused import

* Change Median back to Average in UI

* Revert "Change Median back to Average in UI"

This reverts commit e0c1e3f8e4.

* Preserve the old translations for now (dae)
2025-04-11 19:29:23 +10:00
ikkz
480e8f5409
style: use consistent input styles (#3894) 2025-04-10 15:51:52 +10:00
user1823
86ed715458
Hide AverageForDaysStudied when studiedPercent = 100 (#3888)
Showing both is redundant when studiedPercent is 100
2025-03-29 05:15:41 +03:00
ikkz
567cd9b9e3
style: add shadow to graph tooltip (#3891) 2025-03-29 05:08:59 +03:00
GithubAnon0000
e7e6a3834b
Center align rows in FSRS simulator (#3882) 2025-03-26 17:21:21 +10:00
GithubAnon0000
a766f511dd
Move TR table upwards (#3873)
* Move TR table upwards

This moves the TR table upwards, before the buttons graph.

Also see: https://forums.ankiweb.net/t/let-s-remove-the-answer-buttons-chart-from-stats/56170/26?u=anon_0000

* Moved hour graph below TR graph
2025-03-25 00:13:51 +07:00
Jarrett Ye
a4e0a0824b
Fix/out of index (#3872) 2025-03-25 00:04:25 +07:00
Luc Mcgrady
79b6f658c3
Feat: Simulator suspend after lapse count (#3837)
* Added: Leech suspend to simulator

* Added: leech threshold spin box

* Update git rev

* Added: Save to preset options

* ./check

* Added: "Advanced settings" dropdown

* Removed: Indent

* Added: Easy days

* Added: Sticky header

* Removed: Easy Day updating without saving

* un-nest disclosure

* bump fsrs

* Update a VSCode setting to match recent releases

* Move Easy Days above the Advanced settings

I think it's a bit more logical to have Advanced come last.

* Ensure graph fits inside screen height

* Bump fsrs version
2025-03-15 17:28:15 +07:00
Luc Mcgrady
cad6e0b0bf
Added: Max interval too low warning. (#3847)
* Added: Max interval too low warning.

* Lower threshold to 180

* Add self to about.py
2025-03-10 16:14:35 +07:00
Jarrett Ye
a6426bebe2
Feat/support load balance and easy days in FSRS simulator (#3829)
* Feat/support load balance and easy days in FSRS simulator

* format

* consider LoadBalancerEnabled

* use fsrs::PostSchedulingFn

* add load balance and easy days to compute_optimal_retention

* move simulator to a pop-over

* fix incorrect simulationNumber when error 500

* Feat: Save to Preset Options

* update tabs when update newPerDay & reviewsPerDay

* don't reset deckSize & daysToSimulate when save options

* fix missing easy days

* plan to support review priority

* Fix graph line rendering with non-scaling stroke

* simplify review priority function with helper wrapper

* fallback to default ReviewPriority for Added & ReverseAdded

* Update ts/routes/deck-options/SimulatorModal.svelte

Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>

* Wrap review priority function in Arc for thread-safe sharing

* more granularity for R sorting

* Add graph smoothing option to FSRS simulator

* Improve graph resize handling in FSRS simulator

* simplify review priority calculation

* Add review order selection to FSRS simulator modal

* Refactor review priority function using macro for conciseness

* Add copyright and license header to SimulatorModal.svelte

* cargo clippy

* ./ninja fix:eslint

* update fsrs-rs

* Update FSRS dependencies and refactor load balancing functions

- Update fsrs-rs dependency to latest commit
- Modify retention and simulator modules to use Arc instead of Box
- Update function signatures and imports in simulator module
- Simplify review card order handling with direct enum usage

* resolve reviewed changes

* replace .unwrap() with ?

* move simulating into SimulatorModal

* add (crate) to interval_to_weekday

* Update FsrsOptions.svelte

* format

---------

Co-authored-by: Luc Mcgrady <lucmcgrady@gmail.com>
2025-02-27 10:53:01 +07:00
GithubAnon0000
00cc1b408a
Increase font size for accessibility (#3832)
Apparently no font size should be lower than 12px, see https://www.boia.org/blog/accessibility-tips-let-users-control-font-size.

With the current 55%, I get a computed font size of 8.25px though. Considering the text shows the helpful message "Press ⁨Enter⁩ to accept, ⁨Shift+Enter⁩ for new line.", I think we should add a minimum font size.
2025-02-21 17:14:15 +07:00
llama
8ec139f62a
Debounce mathjax rendering to avoid stalling (#3827)
* move change-timer to editable

* debounce mathjax rendering
2025-02-21 16:39:11 +07:00
llama
1c8c5a41f5
Cache rendered mathjax to avoid stalling when editing plaintext (#3828)
* add lru-cache

* cache mathjax rendering
2025-02-18 14:41:37 +07:00
Jarrett Ye
59e143ec25
Feat/support load balance and easy days in rescheduling (#3815)
* Feat/support load balance and easy days in rescheduling

* ./ninja fix:minilints

* apply clippy

* reuse calculate_easy_days_modifiers()

* consider LoadBalancerEnabled

* move calculate_easy_days_modifiers out of struct

* improve naming & add comments

* apply clippy

* reschedule if easy days settings are changed

* Minor simplification

* refactor to share code between load balancer and rescheduler

* intervals_and_params -> intervals_and_weights

* find_best_interval -> select_weighted_interval

* cargo clippy

* add warning about easyDaysChanged

* compare arrays directly

* Don't show warning if fsrs+rescehdule is already enabled

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
Co-authored-by: Jake Probst <jake.probst@gmail.com>
2025-02-18 13:44:00 +07:00
GithubAnon0000
8fc822a6e7
Use tilted (filled and unfilled) sticky icons in the cards editor (#3825)
* Update icons.ts to include hollow and solid icons

* Update icons.ts

* Create sticky-pin-hollow.svg

* Create sticky-pin-solid.svg

* Update StickyBadge.svelte to reflect changed icons
2025-02-16 22:24:11 +07:00
GithubAnon0000
689eead99a
Update FsrsOptions.svelte to add margin / gap between simulator buttons (#3822)
* Update FsrsOptions.svelte to add margin / gap between simulator buttons

* Hopefully fix gh test error
2025-02-16 16:30:48 +07:00
GithubAnon0000
1beb0cfa8c
Update NoteEditor.svelte to swap pin and html view. (#3821) 2025-02-16 16:23:22 +07:00
Damien Elmes
038d85b1d9 Further tweaks to easy days
The previous commit added word-wrap, but it was not working after I'd
removed some other tweaks I'd made in testing, that I thought were not
required. I ended up switching to standard table columns and a fixed
layout, so that both the column and row headers will wrap properly.
2025-02-11 17:04:58 +07:00
Damien Elmes
348822a14b Quick hack to improve minimum deck options width
Partial fix for #3796
2025-02-11 16:11:43 +07:00
Jarrett Ye
0d9a11c19b
Add margin to the bottom of forgetting curve (#3805) 2025-02-11 15:46:36 +07:00
Luc Mcgrady
dda5973fdc
Remove forgetting curve radio buttons when only one radio button (#3804) 2025-02-09 15:53:05 +03:00
llama
da8c0f0e9b
clear io image field when resetting in add mode (#3794) 2025-02-06 22:58:49 +07:00
Danika-Dakika
6e7dcad542
Update Deck Options strings to clarify Timers (#3792)
* Update CONTRIBUTORS

added myself

* Update about.py

added myself

* Update scheduling.ftl

timers-related string changes

* Update deck-config.ftl

timers-related string changes

* Update help-page.ts

timers-related string changes
2025-02-06 15:17:30 +07:00
llama
8dea502689
add cut handler in TagInput (#3791) 2025-02-06 14:26:44 +07:00
llama
2cbcd79a84
Cap preview cols to prevent stall when csv is parsed with the wrong delimiter (#3786)
* cap csv import preview table at 1000 columns

* add fluent message

* show warning when preview table columns have been truncated

* simplify fluent message ($count will almost always be a big num)

* _tr -> tr
2025-02-06 14:23:43 +07:00
Luc Mcgrady
dd93691b9c
Added: SpinnerBox percentage symbol. (#3777)
* Added: Padded percentage symbol

* Added: Floating percentage

* ./check

* half finished comment

* Removed: redundant toStringValue function

* Removed: Accidental import

* Improved pointer-events:none

* Improve percentage alignment

* Improve leftmost percentage alignment

* Fix: Percentage sticks to left

* ./check

* Fix: IOS css

* ./check
2025-02-06 14:21:26 +07:00
Luc Mcgrady
93032cdceb
Delete y-axis titles for graphs (#3789)
* Remove simulator y axis labels

* Remove forgetting curve y-axis title

* ./check

* Mark the card-stats string as deprecated as well (dae)
2025-02-06 14:17:39 +07:00
Damien Elmes
169d85883d Reviews graph: orange -> blue
Closes #3764
2025-01-26 17:45:14 +11:00
Jarrett Ye
43e860783b
Fix/re-optimize FSRS if short-term param is weird (#3742)
* Fix/re-optimize FSRS if short-term param is weird

* Reset progress when another run is required (dae)

* only count the same-day steps

* Fix flicker when optimizing again (dae)
2025-01-26 10:42:17 +11:00
Damien Elmes
5883e4eae8 Move Optimize All action into main deck options page
Closes #3696

I have no strong feelings about the message/button wordings or
layout, so if people have better suggestions, they are welcome.
2025-01-25 22:57:05 +11:00
Ross Brown
dc37a28de0
Add translation strings for True Retention table (#3745)
* Add translation strings for True Retention table

* Hard-code strings to make pylint happy
2025-01-25 19:18:43 +11:00
llama
df808727c8
fix changes to tags not being reflected when editing in io mode (#3768) 2025-01-25 10:36:21 +03:00
Arthur Milchior
6c37d5fc70
Add percentage to FSRS spinner (#3679)
* Add percentage to FSRS spinner

This commit add a percentage option in SpinBox and SpinBoxFloatRow, set to False
by default.

If it's true, a percent symbol is added at the end of the line before
the increase/decrease button.

While the value is represented as a percentage without decimal places,
the internal representation is not changed. Which mean that a
multiplier must used to compute the string value, indicate to the
input field the min, max and step, and when updating the result.

* Remove unsightly percentage sign, and update historical retention too

https://github.com/ankitects/anki/pull/3679#issuecomment-2579636981

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2025-01-25 18:17:02 +11:00
llama
8ec94e281c
Remove unfinished polygon when undoing and redoing in IO mode (#3759)
* make removeUnfinishedPolygon return whether a polygon was removed

* treat removing an unfinished polygon as a discrete undo step

* has to be handled when redoing as well, but not as a discrete step
2025-01-25 10:08:47 +03:00
Damien Elmes
2d1c6c64e8 Add a separate route for card info in the sidebar
The move to Sveltekit broke the 'card info during review' add-on and
its descendants. This didn't get noticed in 24.11 due to the old
card-info.js file still being shipped.

I considered adding back the card-info.js generation, but it ended up
being simpler to move parts of the add-on into a separate page instead.
This is a stop-gap solution - in the future I'd like to get us to a
point where such component compositions can be done by add-ons,
and don't need to be done as part of Anki's build process.

Related: #3187
2025-01-24 18:08:11 +11:00
Damien Elmes
774d57cdc8 Restore the missing external congrats page 2025-01-24 16:21:36 +11:00
Ross Brown
5b8d8247f8
Fix True Retention table clipping on overflow (#3735) 2025-01-18 16:00:13 +11:00
Jarrett Ye
ac2b44859e
Feat/add future projection to forgetting curve with today marker (#3732)
* Feat/Add future projection to forgetting curve with today marker

* format

* remove the vertical line
2025-01-18 15:54:53 +11:00
llama
9c0911891d
Fix "Create copy" for IO notes (#3730)
* expose get_image_occlusion_fields

* fix create copy for io

* revert current impl

* passthru original note id when creating copy

* add IOCloningMode

* fix create copy for io
2025-01-17 16:03:00 +11:00
wackbyte
b6afddd181
Reduce use of type casting (#3723) 2025-01-12 20:05:05 +11:00
wackbyte
493320fb33
Unpin svelte and update sveltekit-svg (#3722)
Warnings from enums were fixed in https://github.com/sveltejs/svelte/pull/14192
2025-01-12 18:06:54 +11:00
llama
b6d7bb190d
Fix IO editor always starting in "hide all, guess one" mode (#3709)
* update backend

* set hideAllGuessOne in mask editor instead
2025-01-09 23:14:02 +11:00
Jarrett Ye
c4ad27a2db
Feat/support new cards ignore review limit in simulator (#3707)
* Feat/support new cards ignore review limit in simulator

* ./ninja fix:minilints & ./ninja format

* use published crate

* make newCardsIgnoreReviewLimit reactive

* format

---------

Co-authored-by: Damien Elmes <gpg@ankiweb.net>
2025-01-09 22:49:13 +11:00
llama
f0e67c4cd3
Fix image field not being saved if a mask is created too quickly (#3706)
* commit image field immediately in setupMaskEditor

* use saveFieldNow instead
2025-01-09 22:29:34 +11:00
David Elizalde
1bdd7f706f
Issue 2563 - remove mhchem (#3705)
* Issue 2563 - remove mhchem

* Update CONTRIBUTORS
2025-01-09 22:24:39 +11:00
Luc Mcgrady
59391e96fb
Added colour to simulator tooltip (#3692)
* Added colour to simulator tooltip

* ./check
2025-01-09 21:44:54 +11:00
llama
9499473caa
Fix EasyDays not applying defaults correctly in deck options (#3691)
* fix EasyDays not applying defaults correctly

* remove the svelte-ignore that's no longer needed
2025-01-09 21:32:16 +11:00
Luc Mcgrady
16514727ff
Simulator legend tooltip (#3676)
* Added: Tooltip to simulator legend

* Added: Memorised tooltip

* Add: Per day text

* Added: Group name to tooltip
2025-01-09 20:33:10 +11:00
Arthur Milchior
d7fc98d4d8
Deck options without bridge (#3571)
* NF: Modify CONTRIBUTORS

Just so that I stop getting the warning

* NF: Create `deckOptionsReady`

* NF: rename _close to require_close

The method will have to be used outside of this class, so can't be private

* NF: simplify slightly some code

* NF: remove bridge command from deck options

* Remove unused import

* Remove superfluous comment with a typo
2025-01-08 21:30:30 +11:00
llama
769f302ea8
Fix "discard changes" appearing on deck options (#3689)
* patch original config after a preset is selected for the first time

* update comment
2025-01-07 17:41:52 +03:00
llama
d01d83e2c6
convert floats to single-precision before comparing in isModified (#3686) 2025-01-07 17:13:43 +03:00
Luc Mcgrady
f057ee465d
Prevent simulate button spam (#3670) 2025-01-07 16:58:22 +03:00
Ben Nguyen
d89e6f3bdd
IO: Prevent text masks from flipping (#3672)
* Lock scaling flip when creating new text mask

* Lock scaling flip on existing text masks
2025-01-07 15:43:28 +03:00
llama
4ee6dacaa3
fix card info failing to load with qt5 (#3681) 2025-01-07 15:39:51 +03:00
Ross Brown
9877e22fd2
Tweak how the True Retention stats table displays numbers (#3677)
* Tweak how the True Retention stats table displays numbers

- Always show fractional parts of numbers even if they are 0 (91.0% not 91%).
- Show "N/A" for percentages instead of 0% when there are 0 total reviews.

* Localise percentages correctly
2025-01-04 23:13:32 +03:00
Luc Mcgrady
c985acb9fe
Add memorized option to FSRS simulation graph (#3655)
* Added: Memorized option to graph

* Count -> Reviews

* Added: Margin to radio button input

* Fix: Labels

* ./check

* Check errors?

* bump fsrs to 1.4.6

* ./ninja fix:minilints

* Added: Don't show hidden simulator values.

* Bump to fsrs 1.4.7
2024-12-22 11:40:51 +10:00
Ross Brown
5637390b50
Make the "True Retention" table pretty (#3640)
* Make the True Retention table pretty

* Hide absolute pass/fail table for 'all'

* Run './ninja format'

* Manually run prettier on Svelte 5 components

* Refactor to not use {#snippet}

* Fix lint to pass check:eslint

* Fix lint to pass check:svelte

* Rename t9n -> tr to follow code style

* Replace hard-coded string with a translation string

* Use assertUnreachable(...) for exhaustively matching enum
2024-12-19 00:41:57 +11:00
Jarrett Ye
abef3f39ca
Fix/dataPoint index is off by one day in simulator & remove moving average (#3645)
* Fix/dataPoint index is off by one day in simulator

* remove movingAverage
2024-12-19 00:09:04 +11:00
Luc Mcgrady
482874d4f0
Fix Fsrs simulator input problems (#3642)
* Fix: min value for Additional new cards not 0

* Fix: New cards/day default value not starting value

* Preset defaults for review intervals and per day.

* Fix: "Additional new cards to simulate" localisation

* Revert "Fix: "Additional new cards to simulate" localisation"

This reverts commit 9be61d9f93.
2024-12-18 23:43:51 +11:00
llama
b061da73d3
Replace use of window.postMessage in card info (#3646)
* Use anki.updateCard instead of window.onmessage in card-info

* Make card-info placeholder text grey

---------

Co-authored-by: Abdo <abdo@abdnh.net>
2024-12-18 11:32:07 +03:00
Mani
65fd461ddc
Allow object to move to right edge and bottom edge and allow scroll of note fields when not using IO (#3630)
* allow drag and draw at right and bottom edge of canvas area

* allow scroll in fields, when mask editor hidden

* format code
2024-12-15 19:30:47 +03:00
Damien Elmes
d900506003 Fix 'type error: failed to fetch' in congrats screen
The previously-added catch was not working due to the implicit error
handling of the proto methods.

Closes #2895
2024-12-14 22:51:13 +11:00
llama
b726e28229
Remove use of window.location.href in CardInfoDialog (#3621)
* Replace window.location in CardInfoDialog with load_sveltekit_page

* Fix format

* Fix ForgettingCurve's reactivity

* Props' default args aren't reactive

* Add global _updateCardId fn to card-info

* Use _updateCardId to reactively update card-info

* Fix format

* Fix type

* Use dummy form instead of window global for client-side nav

* Fallback to window.location in case form hasn't been rendered

* Use window.postMessage instead of dummy <form>
2024-12-14 22:45:54 +11:00
OuOu2021
008edbba28
I18n: Improve i18n and multi-platform display of FSRS Simulator (#3611)
* Improve i18n and multi-platform display of FSRS Simulator

* Tweak the graph bounds to avoid overlapping of the y-axis tick values ​​and the y-axis title

* Update CONTRIBUTORS

* I18n for 4 more strings

* Reduce TitledContainer wrapper of fsrs simulator graph to maximize content display area

* Clean unused variables

* Update ftl/core/deck-config.ftl

* Update ftl/core/deck-config.ftl
2024-12-14 21:59:00 +11:00
llama
a2ad0bce55
Fix CardInfoPlaceholder not showing when card id is invalid (#3631)
* Catch bigint parsing error

* Modify CONTRIBUTORS
2024-12-14 21:32:51 +11:00
OuOu2021
cee04bf20c
Apply gradient effect to forgetting curve (#3604)
* Add gradient color for forgetting curve

* Add desiredRetention prop for CardInfo

* update CONTRIBUTORS

* Formatting

* Tweak range of gradient

* Tweak: salmon -> tomato

* Get desired retention of the card from backend

* Add a reference line for desired retention

* Fix: Corrected the steel blue's height & Hide desired retention line when yMin is higher than desiredRetentionY

* Add y axis title

* Show desired retention in the tooltip

* I18n: improve translation and vertical text display

* Revert rotatation&writing-mode of vertical title

* Tweak font-size of y axis title

* Fix: delete old desired retention line when changing duration

* Update ftl/core/card-stats.ftl

---------

Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2024-12-09 17:44:05 +11:00
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