Add the ability to hide the forgetting curve from card info

This commit is contained in:
Damien Elmes 2025-05-05 17:03:57 +10:00
parent bcb28f0a85
commit c70e9d26c5
2 changed files with 5 additions and 3 deletions

View file

@ -15,6 +15,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let stats: CardStatsResponse | null = null;
export let showRevlog: boolean = true;
export let showCurve: boolean = true;
$: fsrsEnabled = stats?.memoryState != null;
$: desiredRetention = stats?.desiredRetention ?? 0.9;
@ -41,7 +42,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<Revlog revlog={stats.revlog} {fsrsEnabled} />
</Row>
{/if}
{#if fsrsEnabled}
{#if fsrsEnabled && showCurve}
<Row>
<ForgettingCurve revlog={stats.revlog} {desiredRetention} {decay} />
</Row>

View file

@ -12,6 +12,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
export let data: PageData;
const showRevlog = $page.url.searchParams.get("revlog") !== "0";
const showCurve = $page.url.searchParams.get("curve") !== "0";
globalThis.anki ||= {};
globalThis.anki.updateCardInfos = async (card_id: string): Promise<void> => {
@ -25,11 +26,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<center>
{#if data.currentInfo}
<h3>Current</h3>
<CardInfo stats={data.currentInfo} {showRevlog} />
<CardInfo stats={data.currentInfo} {showRevlog} {showCurve} />
{/if}
{#if data.previousInfo}
<h3>Previous</h3>
<CardInfo stats={data.previousInfo} {showRevlog} />
<CardInfo stats={data.previousInfo} {showRevlog} {showCurve} />
{/if}
</center>