mirror of
https://github.com/ankitects/anki.git
synced 2026-01-13 14:03:55 -05:00
Add: Frontend
This commit is contained in:
parent
233c5c19a9
commit
b7bd1e05ee
3 changed files with 38 additions and 6 deletions
|
|
@ -7,7 +7,10 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
ComputeRetentionProgress,
|
||||
type ComputeParamsProgress,
|
||||
} from "@generated/anki/collection_pb";
|
||||
import { SimulateFsrsReviewRequest } from "@generated/anki/scheduler_pb";
|
||||
import {
|
||||
CMRRTarget,
|
||||
SimulateFsrsReviewRequest,
|
||||
} from "@generated/anki/scheduler_pb";
|
||||
import {
|
||||
computeFsrsParams,
|
||||
evaluateParams,
|
||||
|
|
@ -94,6 +97,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
newCardsIgnoreReviewLimit: $newCardsIgnoreReviewLimit,
|
||||
easyDaysPercentages: $config.easyDaysPercentages,
|
||||
reviewOrder: $config.reviewOrder,
|
||||
target: CMRRTarget.memorised,
|
||||
});
|
||||
|
||||
const DESIRED_RETENTION_LOW_THRESHOLD = 0.8;
|
||||
|
|
|
|||
|
|
@ -18,21 +18,23 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
import { renderSimulationChart } from "../graphs/simulator";
|
||||
import { computeOptimalRetention, simulateFsrsReview } from "@generated/backend";
|
||||
import { runWithBackendProgress } from "@tslib/progress";
|
||||
import type {
|
||||
ComputeOptimalRetentionResponse,
|
||||
SimulateFsrsReviewRequest,
|
||||
SimulateFsrsReviewResponse,
|
||||
import {
|
||||
CMRRTarget,
|
||||
type ComputeOptimalRetentionResponse,
|
||||
type SimulateFsrsReviewRequest,
|
||||
type SimulateFsrsReviewResponse,
|
||||
} from "@generated/anki/scheduler_pb";
|
||||
import type { DeckOptionsState } from "./lib";
|
||||
import SwitchRow from "$lib/components/SwitchRow.svelte";
|
||||
import GlobalLabel from "./GlobalLabel.svelte";
|
||||
import SpinBoxFloatRow from "./SpinBoxFloatRow.svelte";
|
||||
import { reviewOrderChoices } from "./choices";
|
||||
import { CMRRTargetChoices, reviewOrderChoices } from "./choices";
|
||||
import EnumSelectorRow from "$lib/components/EnumSelectorRow.svelte";
|
||||
import { DeckConfig_Config_LeechAction } from "@generated/anki/deck_config_pb";
|
||||
import EasyDaysInput from "./EasyDaysInput.svelte";
|
||||
import Warning from "./Warning.svelte";
|
||||
import type { ComputeRetentionProgress } from "@generated/anki/collection_pb";
|
||||
import Item from "$lib/components/Item.svelte";
|
||||
|
||||
export let shown = false;
|
||||
export let state: DeckOptionsState;
|
||||
|
|
@ -410,6 +412,18 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
{#if computingRetention}
|
||||
<div>{computeRetentionProgressString}</div>
|
||||
{/if}
|
||||
|
||||
<Item>
|
||||
<EnumSelectorRow
|
||||
choices={CMRRTargetChoices()}
|
||||
bind:value={simulateFsrsRequest.target}
|
||||
defaultValue={CMRRTarget.memorised}
|
||||
>
|
||||
<SettingTitle>
|
||||
{"Target: "}
|
||||
</SettingTitle>
|
||||
</EnumSelectorRow>
|
||||
</Item>
|
||||
</details>
|
||||
|
||||
<button
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import {
|
|||
DeckConfig_Config_ReviewCardOrder,
|
||||
DeckConfig_Config_ReviewMix,
|
||||
} from "@generated/anki/deck_config_pb";
|
||||
import { CMRRTarget } from "@generated/anki/scheduler_pb";
|
||||
import * as tr from "@generated/ftl";
|
||||
|
||||
import type { Choice } from "$lib/components/EnumSelector.svelte";
|
||||
|
|
@ -199,6 +200,19 @@ export function questionActionChoices(): Choice<DeckConfig_Config_QuestionAction
|
|||
];
|
||||
}
|
||||
|
||||
export function CMRRTargetChoices(): Choice<CMRRTarget>[] {
|
||||
return [
|
||||
{
|
||||
label: "Memorized (Default)",
|
||||
value: CMRRTarget.memorised,
|
||||
},
|
||||
{
|
||||
label: "Stability (Experimental)",
|
||||
value: CMRRTarget.stability,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
function difficultyOrders(fsrs: boolean): Choice<DeckConfig_Config_ReviewCardOrder>[] {
|
||||
const order = [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue