From 264561cd0dec2054a28b01270a25da7c4f8f946e Mon Sep 17 00:00:00 2001
From: Matthias Metelka <62722460+kleinerpirat@users.noreply.github.com>
Date: Tue, 25 Oct 2022 08:18:50 +0200
Subject: [PATCH] Redesign deck options screen, swap tooltips for help modals
(#2139)
* Redesign deck config, swap tooltips for help modals, link to manual
* Replace canvas-inset with canvas-code for custom scheduling
* Make section header link to manual too
* Include elevation Sass library
* Remove two unused exports
* Fix tabbed spinboxes
* Update ftl/core/deck-config.ftl
* Update ftl/core/deck-config.ftl
* Fix format
* Make border-radius and box-shadow more subtle
* Fix margin for vertical aspect ratio
* Make direct hover on info badge apply effect instantly
* Add redirect line to manual underneath chapter
---
ftl/core/deck-config.ftl | 13 +-
ftl/core/help.ftl | 26 +++
ts/components/Col.svelte | 5 +-
ts/deck-options/AdvancedOptions.svelte | 115 +++++++++++--
ts/deck-options/AudioOptions.svelte | 50 +++++-
ts/deck-options/BUILD.bazel | 3 +
ts/deck-options/BuryOptions.svelte | 71 ++++++--
ts/deck-options/CardStateCustomizer.svelte | 19 ++-
ts/deck-options/ConfigInput.svelte | 38 +++++
ts/deck-options/DailyLimits.svelte | 69 ++++++--
ts/deck-options/DeckOptionsPage.svelte | 2 +-
ts/deck-options/DisplayOrder.svelte | 89 ++++++++--
ts/deck-options/EnumSelectorRow.svelte | 15 +-
ts/deck-options/HelpModal.svelte | 183 +++++++++++++++++++++
ts/deck-options/HelpSection.svelte | 70 ++++++++
ts/deck-options/LapseOptions.svelte | 78 ++++++++-
ts/deck-options/NewOptions.svelte | 77 ++++++++-
ts/deck-options/RevertButton.svelte | 1 +
ts/deck-options/SettingTitle.svelte | 17 ++
ts/deck-options/SpinBoxFloatRow.svelte | 17 +-
ts/deck-options/SpinBoxRow.svelte | 20 ++-
ts/deck-options/StepsInputRow.svelte | 17 +-
ts/deck-options/SwitchRow.svelte | 15 +-
ts/deck-options/TabbedValue.svelte | 20 +--
ts/deck-options/TimerOptions.svelte | 52 +++++-
ts/deck-options/TitledContainer.svelte | 47 +++++-
ts/deck-options/TooltipLabel.svelte | 39 -----
ts/deck-options/deck-options-base.scss | 4 +
ts/deck-options/index.ts | 1 +
ts/deck-options/types.ts | 8 +
30 files changed, 996 insertions(+), 185 deletions(-)
create mode 100644 ftl/core/help.ftl
create mode 100644 ts/deck-options/ConfigInput.svelte
create mode 100644 ts/deck-options/HelpModal.svelte
create mode 100644 ts/deck-options/HelpSection.svelte
create mode 100644 ts/deck-options/SettingTitle.svelte
delete mode 100644 ts/deck-options/TooltipLabel.svelte
create mode 100644 ts/deck-options/types.ts
diff --git a/ftl/core/deck-config.ftl b/ftl/core/deck-config.ftl
index af0007bab..df143ce44 100644
--- a/ftl/core/deck-config.ftl
+++ b/ftl/core/deck-config.ftl
@@ -101,9 +101,13 @@ deck-config-bury-title = Burying
deck-config-bury-new-siblings = Bury new siblings
deck-config-bury-review-siblings = Bury review siblings
deck-config-bury-interday-learning-siblings = Bury interday learning siblings
-deck-config-bury-tooltip =
- Whether other cards of the same note (eg reverse cards, adjacent
- cloze deletions) will be delayed until the next day.
+deck-config-bury-new-tooltip =
+ Whether other `new` cards of the same note (eg reverse cards, adjacent cloze deletions)
+ will be delayed until the next day.
+deck-config-bury-review-tooltip = Whether other `review` cards of the same note will be delayed until the next day.
+deck-config-bury-interday-learning-tooltip =
+ Whether other `learning` cards of the same note with intervals > 1 day
+ will be delayed until the next day.
## Ordering section
@@ -202,6 +206,9 @@ deck-config-show-answer-timer-tooltip =
deck-config-audio-title = Audio
deck-config-disable-autoplay = Don't play audio automatically
+deck-config-disable-autoplay-tooltip =
+ When enabled, Anki will not play audio automatically.
+ It can be played manually by clicking/tapping on an audio icon, or by using the replay audio action.
deck-config-skip-question-when-replaying = Skip question when replaying answer
deck-config-always-include-question-audio-tooltip =
Whether the question audio should be included when the Replay action is
diff --git a/ftl/core/help.ftl b/ftl/core/help.ftl
new file mode 100644
index 000000000..9b34523c8
--- /dev/null
+++ b/ftl/core/help.ftl
@@ -0,0 +1,26 @@
+### Text shown in Help pages
+
+
+## Basic terminology
+
+help-chapter = chapter
+
+## Header
+
+# Tooltip for links to the manual
+help-open-manual-chapter = Open chapter { $name } in Anki manual
+# Displayed underneath chapter title
+help-view-chapter-in-manual = View the { $chapter } on this topic in the official manual.
+
+## Body
+
+# Newly introduced settings may not have an explanation yet
+help-no-explanation =
+ Whoops! There doesn't seem to be an explanation for this setting yet.
+
+ You can help us complete this help page on { $link }.
+
+## Footer
+
+# Link to more detailed information in the manual
+help-for-more-info = For more information, see { $link } in the manual.
diff --git a/ts/components/Col.svelte b/ts/components/Col.svelte
index bb4181f85..8b5f55712 100644
--- a/ts/components/Col.svelte
+++ b/ts/components/Col.svelte
@@ -5,13 +5,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
+{/if}
+
+
diff --git a/ts/deck-options/LapseOptions.svelte b/ts/deck-options/LapseOptions.svelte
index 0bd9e5301..f09642bc4 100644
--- a/ts/deck-options/LapseOptions.svelte
+++ b/ts/deck-options/LapseOptions.svelte
@@ -3,14 +3,20 @@ Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
+ {
+ modal = e.detail.modal;
+ carousel = e.detail.carousel;
+ }}
+ />
- {tr.deckConfigRelearningSteps()}
+
+ openHelpModal(Object.keys(settings).indexOf("relearningSteps"))}
+ >{settings.relearningSteps.title}
@@ -50,9 +101,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
bind:value={$config.minimumLapseInterval}
defaultValue={defaults.minimumLapseInterval}
min={1}
- markdownTooltip={tr.deckConfigMinimumIntervalTooltip()}
>
- {tr.schedulingMinimumInterval()}
+
+ openHelpModal(Object.keys(settings).indexOf("minimumInterval"))}
+ >{settings.minimumInterval.title}
@@ -65,9 +119,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
bind:value={$config.leechThreshold}
defaultValue={defaults.leechThreshold}
min={1}
- markdownTooltip={tr.deckConfigLeechThresholdTooltip()}
>
- {tr.schedulingLeechThreshold()}
+
+ openHelpModal(Object.keys(settings).indexOf("leechThreshold"))}
+ >{settings.leechThreshold.title}
@@ -76,10 +133,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
bind:value={$config.leechAction}
defaultValue={defaults.leechAction}
choices={leechChoices}
- breakpoint="sm"
- markdownTooltip={tr.deckConfigLeechActionTooltip()}
+ breakpoint="md"
>
- {tr.schedulingLeechAction()}
+
+ openHelpModal(Object.keys(settings).indexOf("leechAction"))}
+ >{settings.leechAction.title}
diff --git a/ts/deck-options/NewOptions.svelte b/ts/deck-options/NewOptions.svelte
index 647260daa..48b4515f8 100644
--- a/ts/deck-options/NewOptions.svelte
+++ b/ts/deck-options/NewOptions.svelte
@@ -3,15 +3,21 @@ Copyright: Ankitects Pty Ltd and contributors
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
-->
+ {
+ modal = e.detail.modal;
+ carousel = e.detail.carousel;
+ }}
+ />
- {tr.deckConfigLearningSteps()}
+
+ openHelpModal(Object.keys(settings).indexOf("learningSteps"))}
+ >{settings.learningSteps.title}
@@ -65,9 +116,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
- {tr.schedulingGraduatingInterval()}
+
+ openHelpModal(
+ Object.keys(settings).indexOf("graduatingInterval"),
+ )}>{settings.graduatingInterval.title}
@@ -79,9 +134,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
- {tr.schedulingEasyInterval()}
+
+ openHelpModal(Object.keys(settings).indexOf("easyInterval"))}
+ >{settings.easyInterval.title}
@@ -95,9 +153,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
defaultValue={defaults.newCardInsertOrder}
choices={newInsertOrderChoices}
breakpoint={"md"}
- markdownTooltip={tr.deckConfigNewInsertionOrderTooltip()}
>
- {tr.deckConfigNewInsertionOrder()}
+
+ openHelpModal(Object.keys(settings).indexOf("insertionOrder"))}
+ >{settings.insertionOrder.title}
diff --git a/ts/deck-options/RevertButton.svelte b/ts/deck-options/RevertButton.svelte
index 966fb0b81..97995a70e 100644
--- a/ts/deck-options/RevertButton.svelte
+++ b/ts/deck-options/RevertButton.svelte
@@ -53,6 +53,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
>
{
if (modified) {
diff --git a/ts/deck-options/SettingTitle.svelte b/ts/deck-options/SettingTitle.svelte
new file mode 100644
index 000000000..e65e23de8
--- /dev/null
+++ b/ts/deck-options/SettingTitle.svelte
@@ -0,0 +1,17 @@
+
+
+
+
+
+
diff --git a/ts/deck-options/SpinBoxFloatRow.svelte b/ts/deck-options/SpinBoxFloatRow.svelte
index a95db9ce8..3de3fd868 100644
--- a/ts/deck-options/SpinBoxFloatRow.svelte
+++ b/ts/deck-options/SpinBoxFloatRow.svelte
@@ -6,22 +6,23 @@
import Col from "../components/Col.svelte";
import Row from "../components/Row.svelte";
import SpinBox from "../components/SpinBox.svelte";
+ import ConfigInput from "./ConfigInput.svelte";
import RevertButton from "./RevertButton.svelte";
- import TooltipLabel from "./TooltipLabel.svelte";
export let value: any;
export let defaultValue: any;
export let min = 0;
export let max: number | undefined = undefined;
- export let markdownTooltip: string;
-
-
-
+
+
+
-
-
-
+
+
+
+
+
diff --git a/ts/deck-options/SpinBoxRow.svelte b/ts/deck-options/SpinBoxRow.svelte
index 3ebea4fd0..50e0311c5 100644
--- a/ts/deck-options/SpinBoxRow.svelte
+++ b/ts/deck-options/SpinBoxRow.svelte
@@ -6,22 +6,26 @@
import Col from "../components/Col.svelte";
import Row from "../components/Row.svelte";
import SpinBox from "../components/SpinBox.svelte";
+ import ConfigInput from "./ConfigInput.svelte";
import RevertButton from "./RevertButton.svelte";
- import TooltipLabel from "./TooltipLabel.svelte";
export let value: any;
export let defaultValue: any;
export let min = 0;
export let max: number | undefined = undefined;
- export let markdownTooltip: string;
-
-