mirror of
https://github.com/ankitects/anki.git
synced 2026-01-14 06:23:57 -05:00
Merge remote-tracking branch 'upstream/main' into Feat/90%-dr-message
This commit is contained in:
commit
cc3eb832a2
11 changed files with 30 additions and 21 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -2295,7 +2295,7 @@ dependencies = [
|
|||
[[package]]
|
||||
name = "fsrs"
|
||||
version = "4.0.0"
|
||||
source = "git+https://github.com/open-spaced-repetition/fsrs-rs.git?rev=53784503103169ca6c0702ae2a6d5c84c3d42269#53784503103169ca6c0702ae2a6d5c84c3d42269"
|
||||
source = "git+https://github.com/open-spaced-repetition/fsrs-rs.git?rev=33ec3ee4d5d73e704633469cf5bf1a42e620a524#33ec3ee4d5d73e704633469cf5bf1a42e620a524"
|
||||
dependencies = [
|
||||
"burn",
|
||||
"itertools 0.14.0",
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ rev = "184b2ca50ed39ca43da13f0b830a463861adb9ca"
|
|||
[workspace.dependencies.fsrs]
|
||||
# version = "3.0.0"
|
||||
git = "https://github.com/open-spaced-repetition/fsrs-rs.git"
|
||||
rev = "53784503103169ca6c0702ae2a6d5c84c3d42269"
|
||||
rev = "33ec3ee4d5d73e704633469cf5bf1a42e620a524"
|
||||
# path = "../open-spaced-repetition/fsrs-rs"
|
||||
|
||||
[workspace.dependencies]
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ except AttributeError:
|
|||
appVersion = _version
|
||||
appWebsite = "https://apps.ankiweb.net/"
|
||||
appWebsiteDownloadSection = "https://apps.ankiweb.net/#download"
|
||||
appDonate = "https://apps.ankiweb.net/support/"
|
||||
appDonate = "https://docs.ankiweb.net/contrib.html"
|
||||
appShared = "https://ankiweb.net/shared/"
|
||||
appUpdate = "https://ankiweb.net/update/desktop"
|
||||
appHelpSite = HELP_SITE
|
||||
|
|
|
|||
|
|
@ -222,9 +222,11 @@ def show(mw: aqt.AnkiQt) -> QDialog:
|
|||
"🦙 (siid)",
|
||||
"Mukunda Madhav Dey",
|
||||
"Adnane Taghi",
|
||||
"Anon_0000",
|
||||
)
|
||||
)
|
||||
|
||||
allusers = [user.replace(" ", " ") for user in allusers]
|
||||
abouttext += "<p>" + tr.about_written_by_damien_elmes_with_patches(
|
||||
cont=", ".join(allusers) + f", {tr.about_and_others()}"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -32,12 +32,14 @@ impl Card {
|
|||
force_reset: bool,
|
||||
) {
|
||||
let new_due = (today + days_from_today) as i32;
|
||||
let new_interval =
|
||||
if force_reset || !matches!(self.ctype, CardType::Review | CardType::Relearn) {
|
||||
days_from_today
|
||||
} else {
|
||||
self.interval
|
||||
};
|
||||
let fsrs_enabled = self.memory_state.is_some();
|
||||
let new_interval = if fsrs_enabled {
|
||||
self.interval.saturating_add_signed(new_due - self.due)
|
||||
} else if force_reset || !matches!(self.ctype, CardType::Review | CardType::Relearn) {
|
||||
days_from_today
|
||||
} else {
|
||||
self.interval
|
||||
};
|
||||
let ease_factor = (ease_factor * 1000.0).round() as u16;
|
||||
|
||||
self.schedule_as_review(new_interval, new_due, ease_factor);
|
||||
|
|
|
|||
|
|
@ -30,19 +30,21 @@ impl Collection {
|
|||
|
||||
let (average_secs, total_secs) = average_and_total_secs_strings(&revlog);
|
||||
let timing = self.timing_today()?;
|
||||
let days_elapsed = self
|
||||
let seconds_elapsed = self
|
||||
.storage
|
||||
.time_of_last_review(card.id)?
|
||||
.map(|ts| timing.next_day_at.elapsed_days_since(ts))
|
||||
.map(|ts| timing.now.elapsed_secs_since(ts))
|
||||
.unwrap_or_default() as u32;
|
||||
let fsrs_retrievability = card
|
||||
.memory_state
|
||||
.zip(Some(days_elapsed))
|
||||
.zip(Some(seconds_elapsed))
|
||||
.zip(Some(card.decay.unwrap_or(FSRS5_DEFAULT_DECAY)))
|
||||
.map(|((state, days), decay)| {
|
||||
FSRS::new(None)
|
||||
.unwrap()
|
||||
.current_retrievability(state.into(), days, decay)
|
||||
.map(|((state, seconds), decay)| {
|
||||
FSRS::new(None).unwrap().current_retrievability_seconds(
|
||||
state.into(),
|
||||
seconds,
|
||||
decay,
|
||||
)
|
||||
});
|
||||
|
||||
let original_deck = if card.original_deck_id == DeckId(0) {
|
||||
|
|
|
|||
|
|
@ -303,7 +303,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
/>
|
||||
|
||||
<HandleLabel>
|
||||
{#if isSizeConstrained}
|
||||
{#if isSizeConstrained && !shrinkingDisabled}
|
||||
<span>{`(${tr.editingDoubleClickToExpand()})`}</span>
|
||||
{:else}
|
||||
<span>{actualWidth}×{actualHeight}</span>
|
||||
|
|
|
|||
|
|
@ -339,8 +339,11 @@ export function renderForgettingCurve(
|
|||
1,
|
||||
);
|
||||
let text = tooltipText(d);
|
||||
const desiredRetentionPercent = desiredRetention * 100;
|
||||
if (y2 >= lineY - 10 && y2 <= lineY + 10) {
|
||||
text += `<br>${tr.cardStatsFsrsForgettingCurveDesiredRetention()}: ${desiredRetention.toFixed(2)}`;
|
||||
text += `<br>${tr.cardStatsFsrsForgettingCurveDesiredRetention()}: ${
|
||||
desiredRetentionPercent.toFixed(0)
|
||||
}%`;
|
||||
}
|
||||
showTooltip(text, x1, y1);
|
||||
})
|
||||
|
|
|
|||
|
|
@ -116,7 +116,6 @@ function initCanvas(): fabric.Canvas {
|
|||
modifiedPolygon(canvas, evt.target);
|
||||
undoStack.onObjectModified();
|
||||
}
|
||||
saveNeededStore.set(true);
|
||||
});
|
||||
canvas.on("text:editing:entered", function() {
|
||||
textEditingState.set(true);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
import { fabric } from "fabric";
|
||||
import { get } from "svelte/store";
|
||||
|
||||
import { opacityStateStore } from "../store";
|
||||
import { opacityStateStore, saveNeededStore } from "../store";
|
||||
import type { Size } from "../types";
|
||||
|
||||
export const SHAPE_MASK_COLOR = "#ffeba2";
|
||||
|
|
@ -244,6 +244,7 @@ const setShapePosition = (
|
|||
}
|
||||
|
||||
object.setCoords();
|
||||
saveNeededStore.set(true);
|
||||
};
|
||||
|
||||
export function enableUniformScaling(canvas: fabric.Canvas, obj: fabric.Object): void {
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class UndoStack {
|
|||
|
||||
private push(): void {
|
||||
const entry = JSON.stringify(this.canvas?.toJSON(["id"]));
|
||||
if (entry === this.stack[this.stack.length - 1]) {
|
||||
if (entry === this.stack[this.index]) {
|
||||
return;
|
||||
}
|
||||
this.stack.length = this.index + 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue