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"); 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/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 { 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/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; } 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} +
- diff --git a/ts/routes/deck-options/SimulatorModal.svelte b/ts/routes/deck-options/SimulatorModal.svelte index 546f840d6..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()} @@ -447,19 +441,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()}