From b16439fc9c2201b940ac5f2b8286ca13aa012cca Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Mon, 7 Jul 2025 09:10:24 +0100 Subject: [PATCH 1/6] Feat/Confirmation box for save options to preset (#4172) --- ftl/core/deck-config.ftl | 1 + ts/routes/deck-options/SimulatorModal.svelte | 30 +++++++++++--------- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl index a091dccef..01eac3369 100644 --- a/ftl/core/deck-config.ftl +++ b/ftl/core/deck-config.ftl @@ -514,6 +514,7 @@ deck-config-advanced-settings = Advanced Settings deck-config-smooth-graph = Smooth graph deck-config-suspend-leeches = Suspend leeches deck-config-save-options-to-preset = Save Changes to Preset +deck-config-save-options-to-preset-confirm = Overwrite the options in your current preset with the options that are currently set in the simulator? # Radio button in the FSRS simulation diagram (Deck options -> FSRS) selecting # to show the total number of cards that can be recalled or retrieved on a # specific date. diff --git a/ts/routes/deck-options/SimulatorModal.svelte b/ts/routes/deck-options/SimulatorModal.svelte index 546f840d6..9ac28636b 100644 --- a/ts/routes/deck-options/SimulatorModal.svelte +++ b/ts/routes/deck-options/SimulatorModal.svelte @@ -447,19 +447,23 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html class="btn {computing ? 'btn-warning' : 'btn-primary'}" disabled={computing} on:click={() => { - $config.newPerDay = simulateFsrsRequest.newLimit; - $config.reviewsPerDay = simulateFsrsRequest.reviewLimit; - $config.maximumReviewInterval = simulateFsrsRequest.maxInterval; - $config.desiredRetention = simulateFsrsRequest.desiredRetention; - $newCardsIgnoreReviewLimit = - simulateFsrsRequest.newCardsIgnoreReviewLimit; - $config.reviewOrder = simulateFsrsRequest.reviewOrder; - $config.leechAction = suspendLeeches - ? DeckConfig_Config_LeechAction.SUSPEND - : DeckConfig_Config_LeechAction.TAG_ONLY; - $config.leechThreshold = leechThreshold; - $config.easyDaysPercentages = [...easyDayPercentages]; - onPresetChange(); + if (confirm(tr.deckConfigSaveOptionsToPresetConfirm())) { + $config.newPerDay = simulateFsrsRequest.newLimit; + $config.reviewsPerDay = simulateFsrsRequest.reviewLimit; + $config.maximumReviewInterval = + simulateFsrsRequest.maxInterval; + $config.desiredRetention = + simulateFsrsRequest.desiredRetention; + $newCardsIgnoreReviewLimit = + simulateFsrsRequest.newCardsIgnoreReviewLimit; + $config.reviewOrder = simulateFsrsRequest.reviewOrder; + $config.leechAction = suspendLeeches + ? DeckConfig_Config_LeechAction.SUSPEND + : DeckConfig_Config_LeechAction.TAG_ONLY; + $config.leechThreshold = leechThreshold; + $config.easyDaysPercentages = [...easyDayPercentages]; + onPresetChange(); + } }} > {tr.deckConfigSaveOptionsToPreset()} From b205008a5e6990fdfbe90dee5f10b779b3222787 Mon Sep 17 00:00:00 2001 From: Alexander Bocken <32177905+AlexBocken@users.noreply.github.com> Date: Mon, 7 Jul 2025 10:16:00 +0200 Subject: [PATCH 2/6] respect env var UV_BINARY with OFFLINE_BUILD being set (#4170) * respect env var UV_BINARY with OFFLINE_BUILD being set * cleanup formatting, fix import * Fix build error (dae) --- build/configure/src/python.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/build/configure/src/python.rs b/build/configure/src/python.rs index 9d5e9057e..e43bceeb3 100644 --- a/build/configure/src/python.rs +++ b/build/configure/src/python.rs @@ -1,8 +1,6 @@ // Copyright: Ankitects Pty Ltd and contributors // License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -use std::env; - use anyhow::Result; use ninja_gen::action::BuildAction; use ninja_gen::archives::Platform; @@ -125,7 +123,14 @@ impl BuildAction for BuildWheel { } fn files(&mut self, build: &mut impl FilesHandle) { - build.add_inputs("uv", inputs![":uv_binary"]); + if std::env::var("OFFLINE_BUILD").ok().as_deref() == Some("1") { + let uv_path = + std::env::var("UV_BINARY").expect("UV_BINARY must be set in OFFLINE_BUILD mode"); + build.add_inputs("uv", inputs![uv_path]); + } else { + build.add_inputs("uv", inputs![":uv_binary"]); + } + build.add_inputs("", &self.deps); // Set the project directory based on which package we're building @@ -222,15 +227,19 @@ struct Sphinx { impl BuildAction for Sphinx { fn command(&self) -> &str { - if env::var("OFFLINE_BUILD").is_err() { - "$uv sync --extra sphinx && $python python/sphinx/build.py" - } else { + if std::env::var("OFFLINE_BUILD").ok().as_deref() == Some("1") { "$python python/sphinx/build.py" + } else { + "$uv sync --extra sphinx && $python python/sphinx/build.py" } } fn files(&mut self, build: &mut impl FilesHandle) { - if env::var("OFFLINE_BUILD").is_err() { + if std::env::var("OFFLINE_BUILD").ok().as_deref() == Some("1") { + let uv_path = + std::env::var("UV_BINARY").expect("UV_BINARY must be set in OFFLINE_BUILD mode"); + build.add_inputs("uv", inputs![uv_path]); + } else { build.add_inputs("uv", inputs![":uv_binary"]); // Set environment variable to use the existing pyenv build.add_variable("pyenv_path", "$builddir/pyenv"); From 1ca31413f7d3a1897edf50955954702ce6612ca5 Mon Sep 17 00:00:00 2001 From: GithubAnon0000 <160563432+GithubAnon0000@users.noreply.github.com> Date: Mon, 7 Jul 2025 08:23:39 +0000 Subject: [PATCH 3/6] FIX revert button is visible for screenreaders (#4174) --- ts/lib/components/RevertButton.svelte | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ts/lib/components/RevertButton.svelte b/ts/lib/components/RevertButton.svelte index a1d6af06d..08376e7e6 100644 --- a/ts/lib/components/RevertButton.svelte +++ b/ts/lib/components/RevertButton.svelte @@ -76,7 +76,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html } .hide :global(.badge) { - opacity: 0; + display: none; cursor: initial; } From 3d6b4761e4a0904b40be37a1744bb6a2ed6fb3b3 Mon Sep 17 00:00:00 2001 From: Kevin Nakamura Date: Mon, 7 Jul 2025 08:44:39 +0000 Subject: [PATCH 4/6] Try unix terminals in roughly most specific to least specific. (#4177) --- qt/launcher/src/platform/unix.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/qt/launcher/src/platform/unix.rs b/qt/launcher/src/platform/unix.rs index 0df33838f..2e55f2b69 100644 --- a/qt/launcher/src/platform/unix.rs +++ b/qt/launcher/src/platform/unix.rs @@ -9,17 +9,23 @@ use anyhow::Result; pub fn relaunch_in_terminal() -> Result<()> { let current_exe = std::env::current_exe().context("Failed to get current executable path")?; - // Try terminals in order of preference + // Try terminals in roughly most specific to least specific. + // First, try commonly used terminals for riced systems. + // Second, try the minimalist/compatibility terminals. + // Finally, try terminals usually installed by default. let terminals = [ - ("x-terminal-emulator", vec!["-e"]), - ("gnome-terminal", vec!["--"]), - ("konsole", vec!["-e"]), - ("xfce4-terminal", vec!["-e"]), + // commonly used for riced systems ("alacritty", vec!["-e"]), ("kitty", vec![]), + // minimalistic terminals for constrained systems ("foot", vec![]), ("urxvt", vec!["-e"]), ("xterm", vec!["-e"]), + ("x-terminal-emulator", vec!["-e"]), + // default installs for the most common distros + ("xfce4-terminal", vec!["-e"]), + ("gnome-terminal", vec!["--"]), + ("konsole", vec!["-e"]), ]; for (terminal_cmd, args) in &terminals { From d3e1fd1f807000e2f3f1b6ebfc9043f11a20ae15 Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Mon, 7 Jul 2025 09:46:52 +0100 Subject: [PATCH 5/6] Feat/Replace easy day table with display:grid (#4179) * Feat/Replace easy day table with grid * Add max width --- ts/routes/deck-options/EasyDaysInput.svelte | 105 ++++++++++---------- 1 file changed, 54 insertions(+), 51 deletions(-) diff --git a/ts/routes/deck-options/EasyDaysInput.svelte b/ts/routes/deck-options/EasyDaysInput.svelte index a7c13e2e2..fb5d9cd2d 100644 --- a/ts/routes/deck-options/EasyDaysInput.svelte +++ b/ts/routes/deck-options/EasyDaysInput.svelte @@ -20,53 +20,64 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html -
- - - - - - - - - - - {#each easyDays as day, index} - - - - - {/each} - -
- {tr.deckConfigEasyDaysMinimum()} - - {tr.deckConfigEasyDaysReduced()} - - {tr.deckConfigEasyDaysNormal()} -
{day} - -
+
+
+ + {tr.deckConfigEasyDaysMinimum()} + {tr.deckConfigEasyDaysReduced()} + {tr.deckConfigEasyDaysNormal()} + + {#each easyDays as day, index} + {day} +
+ +
+ {/each} +
- From 8a3b72e6e5342364db283a98cdda5af9a228a66f Mon Sep 17 00:00:00 2001 From: Luc Mcgrady Date: Mon, 7 Jul 2025 10:21:46 +0100 Subject: [PATCH 6/6] Fix/Help modal appears behind simulator modal (#4171) * Fix/Help modal appears behind simulator modal * Correct help modal keys (Doesn't work) --- ts/lib/components/HelpModal.svelte | 5 +++++ ts/routes/deck-options/SimulatorModal.svelte | 20 +++++++------------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/ts/lib/components/HelpModal.svelte b/ts/lib/components/HelpModal.svelte index 5fff619df..cf6292537 100644 --- a/ts/lib/components/HelpModal.svelte +++ b/ts/lib/components/HelpModal.svelte @@ -181,6 +181,11 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html margin-bottom: 1.5rem; } + .modal { + z-index: 1066; + background-color: rgba($color: black, $alpha: 0.5); + } + .modal-title { margin-inline-end: 0.75rem; } diff --git a/ts/routes/deck-options/SimulatorModal.svelte b/ts/routes/deck-options/SimulatorModal.svelte index 9ac28636b..c9bf2b702 100644 --- a/ts/routes/deck-options/SimulatorModal.svelte +++ b/ts/routes/deck-options/SimulatorModal.svelte @@ -296,7 +296,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html min={0} max={9999} > - openHelpModal("simulateFsrsReview")}> + openHelpModal("newLimit")}> {tr.schedulingNewCardsday()} @@ -307,7 +307,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html min={0} max={9999} > - openHelpModal("simulateFsrsReview")}> + openHelpModal("reviewLimit")}> {tr.schedulingMaximumReviewsday()} @@ -327,9 +327,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html min={1} max={36500} > - openHelpModal("simulateFsrsReview")} - > + openHelpModal("maximumInterval")}> {tr.schedulingMaximumInterval()} @@ -339,9 +337,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html defaultValue={$config.reviewOrder} choices={reviewOrderChoices($fsrs)} > - openHelpModal("simulateFsrsReview")} - > + openHelpModal("reviewSortOrder")}> {tr.deckConfigReviewSortOrder()} @@ -351,7 +347,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html defaultValue={$newCardsIgnoreReviewLimit} > openHelpModal("simulateFsrsReview")} + on:click={() => openHelpModal("newCardsIgnoreReviewLimit")} > - openHelpModal("simulateFsrsReview")} - > + openHelpModal("leechAction")}> {tr.deckConfigSuspendLeeches()} @@ -387,7 +381,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html max={9999} > openHelpModal("simulateFsrsReview")} + on:click={() => openHelpModal("leechThreshold")} > {tr.schedulingLeechThreshold()}