From 22539933bf433c36d41f0e3c69599525b1e0856e Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Tue, 30 Sep 2025 22:43:02 +0100 Subject: [PATCH 01/11] Feat/Disable parameter editing until right clicked 3 times --- ftl/core/deck-config.ftl | 1 + ts/routes/deck-options/ParamsInput.svelte | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index 1e193dc04..3c8e0d0c1 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -383,6 +383,7 @@ deck-config-which-deck = Which deck would you like to display options for? deck-config-updating-cards = Updating cards: { $current_cards_count }/{ $total_cards_count }... deck-config-invalid-parameters = The provided FSRS parameters are invalid. Leave them blank to use the default parameters. +deck-config-manual-parameter-edit-warning = The parameters should only be generated with the optimize button. Manually editing them is heavily advised against. deck-config-not-enough-history = Insufficient review history to perform this operation. deck-config-must-have-400-reviews = { $count -> diff --git a/ts/routes/deck-options/ParamsInput.svelte b/ts/routes/deck-options/ParamsInput.svelte index d046c5e84..9917cbf64 100644 --- a/ts/routes/deck-options/ParamsInput.svelte +++ b/ts/routes/deck-options/ParamsInput.svelte @@ -46,6 +46,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html input.value = stringValue; } } + + const UNLOCK_EDIT_COUNT = 3; + let rightClickCount = 0; + function onRightClick() { + rightClickCount += 1; + if (rightClickCount == UNLOCK_EDIT_COUNT) { + alert(tr.deckConfigManualParameterEditWarning()); + } + } @@ -56,6 +65,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html on:blur={update} class="w-100" placeholder={render(defaults)} + disabled={rightClickCount < UNLOCK_EDIT_COUNT} + on:contextmenu={onRightClick} > From 82de2078f520468b63a3defec8fda36840ae283b Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Fri, 3 Oct 2025 23:18:40 +0100 Subject: [PATCH 04/11] Change placeholder to text --- ftl/core/deck-config.ftl | 3 +++ ts/routes/deck-options/FsrsOptions.svelte | 6 +----- ts/routes/deck-options/ParamsInput.svelte | 3 +-- ts/routes/deck-options/ParamsInputRow.svelte | 3 +-- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index bc6514de0..dfbc8ee56 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -383,6 +383,9 @@ deck-config-which-deck = Which deck would you like to display options for? deck-config-updating-cards = Updating cards: { $current_cards_count }/{ $total_cards_count }... deck-config-invalid-parameters = The provided FSRS parameters are invalid. Leave them blank to use the default values. +deck-config-placeholder-parameters = + Default parameters + (Press "{deck-config-optimize-button}" periodicaly to allow fsrs to better adjust to your memory) deck-config-manual-parameter-edit-warning = The parameters should only be modified using the optimize button. Manually editing them is heavily advised against. deck-config-not-enough-history = Insufficient review history to perform this operation. deck-config-must-have-400-reviews = diff --git a/ts/routes/deck-options/FsrsOptions.svelte b/ts/routes/deck-options/FsrsOptions.svelte index 48124771f..080917491 100644 --- a/ts/routes/deck-options/FsrsOptions.svelte +++ b/ts/routes/deck-options/FsrsOptions.svelte @@ -387,11 +387,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
- + openHelpModal("modelParams")}> {tr.deckConfigWeights()} diff --git a/ts/routes/deck-options/ParamsInput.svelte b/ts/routes/deck-options/ParamsInput.svelte index 47cad05ff..a19274e78 100644 --- a/ts/routes/deck-options/ParamsInput.svelte +++ b/ts/routes/deck-options/ParamsInput.svelte @@ -7,7 +7,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html import * as tr from "@generated/ftl"; export let value: number[]; - export let defaults: number[]; let stringValue: string; let taRef: HTMLTextAreaElement; @@ -64,7 +63,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html value={stringValue} on:blur={update} class="w-100" - placeholder={render(defaults)} + placeholder={tr.deckConfigPlaceholderParameters()} readonly={clickCount < UNLOCK_EDIT_COUNT} on:click={onClick} > diff --git a/ts/routes/deck-options/ParamsInputRow.svelte b/ts/routes/deck-options/ParamsInputRow.svelte index 864bc4fbc..07081ac49 100644 --- a/ts/routes/deck-options/ParamsInputRow.svelte +++ b/ts/routes/deck-options/ParamsInputRow.svelte @@ -10,11 +10,10 @@ export let value: number[]; export let defaultValue: number[]; - export let defaults: number[]; - + From f7b857887d37c9086568b5dafe1ad390ec3272a2 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Fri, 3 Oct 2025 23:23:08 +0100 Subject: [PATCH 05/11] use diabled agaain --- ts/routes/deck-options/ParamsInput.svelte | 25 +++++++++++++---------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/ts/routes/deck-options/ParamsInput.svelte b/ts/routes/deck-options/ParamsInput.svelte index a19274e78..3ba109343 100644 --- a/ts/routes/deck-options/ParamsInput.svelte +++ b/ts/routes/deck-options/ParamsInput.svelte @@ -58,15 +58,18 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html - + + +
+ +
From d8fcc44fe537c8c59b4dcf938de2eb93082245b5 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Fri, 3 Oct 2025 23:32:28 +0100 Subject: [PATCH 06/11] Add warning box --- ts/routes/deck-options/ParamsInput.svelte | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ts/routes/deck-options/ParamsInput.svelte b/ts/routes/deck-options/ParamsInput.svelte index 3ba109343..fe0567c40 100644 --- a/ts/routes/deck-options/ParamsInput.svelte +++ b/ts/routes/deck-options/ParamsInput.svelte @@ -5,6 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html @@ -71,6 +74,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html >
+ +