Commit graph

2320 commits

Author SHA1 Message Date
Luc Mcgrady
ae6cf98f40
Fix/unapplied scss (#4103)
* deck options + change notetype

* graphs

* image occlusion

* congrats

* imports

* ./check

* style

* $lib

* delete unused index.ts files
2025-06-27 16:28:35 +07:00
Luc Mcgrady
630bdd3189
Fix/Optimize button alignment (#4117)
* Fix/Button alignment

* add hr
2025-06-25 16:44:47 +03:00
llama
06195d1268
add bottom and right margins to account for focus outline (#4115) 2025-06-25 14:15:45 +03:00
llama
a73f1507ba
use KeyboardEvent.key instead of code (#4114) 2025-06-25 14:08:25 +03:00
user1823
5cc3a2276b
Fix repeated ticks in reviews graph (#4108)
Regressed in #4086
2025-06-21 19:17:18 +07:00
user1823
bbf533b172
Update the default value of FSRS-6 decay in forgetting curve (#4096)
Changed in 037345fd57
2025-06-19 13:25:30 +07:00
user1823
44f3bbbbc9
Limit study time to hours in reviews graph (#4086)
* Add maxUnit argument to naturalUnit

* Limit study time to hours in reviews graph

Relevant discussions:
- https://forums.ankiweb.net/t/reviews-graph-units-of-total-time-studied-suggestion/61237
- https://forums.ankiweb.net/t/why-does-anki-display-study-time-in-months/37722
- https://forums.ankiweb.net/t/poll-use-hours-in-total-time-stats/62076
- https://github.com/ankitects/anki/pull/3901#issuecomment-2973161601

* Use the new approach for native stability in Card Info

* Use a simpler approach
2025-06-18 14:34:58 +07:00
llama
5cb191d624
Fix IO text labels' fill attr being saved even if default colour (#4083)
* move exporting of fill attr to subclasses

* set text colour for new labels
2025-06-16 13:07:05 +03:00
Luc Mcgrady
6004616672
Feat/Health check tooltip (#4068)
* Feat/Health check tooltip

* Update ftl/core/deck-config.ftl

* split deckConfigHealthCheckTooltip

* wording change

* separate "(slow)"

* Add title to health check messages
2025-06-13 10:42:47 +07:00
Luc Mcgrady
83131cb48e
Feat/Message at 100% progress for optimize (#4069) 2025-06-11 13:31:17 +07:00
sorata
fe750dba9f
style hr element (#4067) 2025-06-11 13:02:08 +07:00
Sunong2008
ccc9d9027a
Delay retention workload info display after FSRS optimization alerts (#4066)
* Update FsrsOptions.svelte

* Update CONTRIBUTORS

* Make it full width too, so it doesn't resize when transitioning past 90

* Make sure the Warning appears after the alert

* Update FsrsOptions.svelte

* Update FsrsOptions.svelte

* Update FsrsOptions.svelte
2025-06-11 13:01:47 +07:00
sorata
e5d34fbb18
Update default styles (#4060)
* add margin for hr

* add line height to default styles

* update my email

* change margin to 1em
2025-06-08 11:24:46 +07:00
Luc Mcgrady
55ecbc1125
Feat/Health check (#4047)
* Message on low log loss

* make console.log permanent

* Added: Health check option

* disable button

* change health check conditions

* i18n

* ./check

* Apply suggestions from code review

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

* delete shadowed fsrs

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

Co-authored-by: llama <gh@siid.sh>

* Update ftl/core/deck-config.ftl

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

* anon's suggestions

* snake_case

* capital slow

* make global

* on by default

* Adjusted loss values

* Show message on pass

* ./check

* ComputeParamsRequest

* update coefficients

* update thresholds

* fix thresholds

* Apply suggestions from code review

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
Co-authored-by: llama <gh@siid.sh>
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
2025-06-06 12:43:33 +07:00
llama
174b199164
Add IO mask colour fill tool (#4048)
* add fill tool

* add fill tool logic

* open colour picker on fill tool activation

* refactor/add fill attr to io clozes

* fill masks in editor

* fill text and inactive masks in reviewer

* fix lint

* remove debug option
2025-06-04 11:45:34 +07:00
GithubAnon0000
27c1ed1899
FIX diacrititcs being cutoff in input card templates (#4049) 2025-06-03 16:27:32 +07:00
Luc Mcgrady
bbac90d97d
Fix/Invalid parameter counts saveable (#4052)
* Add frontend check for parameters

* Fix backend

* ./check

* Fix: Wrong type
2025-06-03 16:27:04 +07:00
Jarrett Ye
2de0c79ba5
Feat/evaluate FSRS with time series split (#3962) 2025-06-03 15:26:33 +07:00
Luc Mcgrady
06c0e4c14a
Fix/CMRR style (#4043) 2025-06-01 13:18:35 +07:00
Abdo
14b8a8ad0d
Fix new card sort order not reacting to changes in gather order (#4039) 2025-05-30 13:05:36 +07:00
Luc Mcgrady
f29bcb743b
Feat/Desired retention warning improvements (#3995)
* Feat/90% desired retention warning

* Update ftl/core/deck-config.ftl

* show on newly enabled

* Show warning on focus

* Never hide warning

* Display relative change

* Add: Separate warning for too long and short

* Revert unchanged text changes

* interval -> workload

* Remove dead code

* fsrs-rs/@L-M-Sherlock's workload calculation

* Added: delay

* CONSTANT_CASE

* Fix: optimized state

* Removed "Processing"

* Remove dead code

* 1 digit precision

* bump fsrs-rs

* typo

* Apply suggestions from code review

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

* Improve rounding

* improve comment

* rounding <1%

* decrease rounding precision

* bump ts-fsrs

* use actual cost values

* ./check

* typo

* include relearning

* change factor wording

* simplify sql

* ./check

* Apply suggestions from code review

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

* Fix: missing search_cids

* @dae's style patch

* Fix: Doesn't update on arrow keys change

* force two lines

* center two lines

---------

Co-authored-by: user1823 <92206575+user1823@users.noreply.github.com>
2025-05-27 13:07:21 +10:00
llama
16c5eaf00a
don't show "double click to expand" when it's not possible (#4030) 2025-05-22 23:21:08 +10:00
llama
420cd237df
fix io undo logic error (#4027) 2025-05-22 23:11:04 +10:00
GithubAnon0000
ec513dfde7
Fix DR not being in percent in the forgetting curve (#4024)
* FIX DR not displayed as % in forgetting curve

* Run ./check and fix errors found by it

* Round DR to full number
2025-05-22 22:54:35 +10:00
llama
d39284e101
Fix IO masks not saving when scaled (#4021)
* trigger save after modifying object

* remove redundant save

already called by undoStack.onObjectModified or setShapePosition
2025-05-22 21:43:38 +10:00
llama
31d877f20d
place caret after mathjax element on overlay close event (#4016) 2025-05-19 13:43:01 +10:00
spiritualfather
63fd1ffbff
upgrade esbuild versions (#4011)
* upgrade esbuild versions

* Update license file
2025-05-19 13:25:05 +10:00
Luc Mcgrady
ed13a351b9
Fix/Prevent manual resize of params input (#4008) 2025-05-19 13:10:47 +10:00
llama
97b12b420a
Resize fsrs params input to fit content (#3999)
* resize param input on value change

* resize on window resize
2025-05-15 16:41:30 +10:00
llama
a2a1f597be
Style the fsrs params input (#3997)
* style textarea and date inputs

* remove redundant date input styling
2025-05-15 16:30:17 +10:00
llama
4e1a901738
Clarify field separator being a guess when importing csv (#3996)
* clarify that the initially selected field separator is a guess

* explain why the field seperator setting might be locked
2025-05-15 16:26:51 +10:00
GithubAnon0000
37dfbca094
UPDATE answer button graph tooltip to include I) answer button name and II) description of what "correct" means (#3979)
* ADD name of the button after button number (1 → again...)

* ADD info string to explain what 'correct' means

* Run ./check and make it happy

* Apply suggestion from @dae to make text shorter
2025-05-15 14:54:51 +10:00
llama
1c69333210
don't scale border width along with existing masks (#3991) 2025-05-12 01:49:29 +03:00
llama
c33974f6ab
Fix polygons closing when clicking existing masks while editing IO (#3990)
* fix polygons closing when clicking existing masks while editing io

* disallow selecting new polygons

* update CONTRIBUTORS

* preserve ids when pushing canvas state to undo stack

* rehandle tool changes after undoing/redoing

the polygon tool makes all objects unselectable, which isn't
preserved when restoring the canvas state after an undo/redo
2025-05-10 16:32:44 +10:00
llama
573f59fab1
Allow rotating IO masks (#3987)
* Revert "Disable rotation globally"

This reverts commit 22736238c1.

* alt. impl for hiding rotation marker when selecting/ungrouping

* (de)serialise angles

* rotate masks in reviewer

* update bounds checking

* floats.ts -> lib.ts

* add convenience fns

* store mask angles (deg) in steps of 10000

* update CONTRIBUTORS
2025-05-10 16:21:33 +10:00
llama
5cc44b3f68
Make IO polygon markers centred and transparent (#3989)
* make polygon markers centred and transparent

* centre active line

* set perPixelTargetFind per object, and not on the canvas

otherwise it can't be overridden for a specific object
see 4c305baae6/src/canvas.class.js (L786)
2025-05-09 00:20:00 +10:00
GithubAnon0000
dcc6000f70
Properly align label and radio input in the stats window (#3977)
* Properly align label and radio input in the stats window

* use margin-inline-end instead of margin-right to support RTL
2025-05-05 18:10:58 +10:00
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