Name the profile default in the reset wording

This commit is contained in:
Fisto
2026-09-22 19:48:23 +02:00
parent a20a7de93f
commit 63def53f28
3 changed files with 18 additions and 6 deletions
+12 -2
View File
@@ -2145,7 +2145,7 @@ function buildProfileSliders() {
const slider = el("input", { type: "range", min: String(min), max: String(max), step: "1" });
slider.id = `tts-profile-${key}`;
slider.dataset.key = key;
slider.title = "Double-click to reset to the engine default";
slider.title = "Double-click to reset to the profile default";
const value = el("span", { class: "vk-mono vk-dim", text: "default" });
root.append(
@@ -2200,14 +2200,20 @@ function fillProfileControls() {
const slider = $(`#tts-profile-${key}`);
if (!slider) continue;
const engineDefault = state.profileDefaults?.[key];
if (typeof stored[key] === "number") {
slider.value = stored[key];
slider.dataset.dirty = "1";
} else {
const engineDefault = state.profileDefaults?.[key];
if (typeof engineDefault === "number") slider.value = engineDefault;
slider.dataset.dirty = "";
}
slider.title =
typeof engineDefault === "number"
? `Double-click to reset to the profile default (${engineDefault})`
: "Double-click to reset to the profile default";
const value = slider.parentElement?.querySelector(".vk-mono");
if (value) value.textContent = slider.dataset.dirty === "1" ? slider.value : "default";
}
@@ -2287,6 +2293,10 @@ function syncVoiceControls(voices, selected) {
const expressive = !!voice?.supportsExpression;
state.profileDefaults = voice?.profileDefaults ?? {};
state.expressionDefault = typeof voice?.expressionDefault === "number" ? voice.expressionDefault : null;
$("#tts-expression").title =
typeof state.expressionDefault === "number"
? `Double-click to reset to the profile default (${state.expressionDefault})`
: "Double-click to reset to the profile default";
if (expressive) fillProfileControls();
{
+1 -1
View File
@@ -568,7 +568,7 @@
<section class="vk-profile-section">
<div class="vk-section-head">
<span class="vk-rail-label vk-rail-label-flat">Voice character</span>
<span class="vk-mono vk-dim">within 2 snaps to default · double-click a slider to reset it</span>
<span class="vk-mono vk-dim">within 2 of the profile default snaps to default · double-click a slider to reset it</span>
</div>
<div id="tts-profile-sliders" class="vk-profile-grid"></div>
<div class="vk-profile-row">