feat(kaak): match audio settings layout

This commit is contained in:
illusia committed 2026-10-11 06:49:53 +08:00
1 parent 2fcea5622b
commit 2a80ade08b
10 files changed
+264 -76

No files matched your search

@@ -24,6 +24,7 @@
name="close"
:size="19" /></button></header
><div class="settings-content">
<div class="settings-audio-card">
<section class="settings-section"
><h3
><Icon
@@ -31,18 +32,20 @@
:size="20"
/>
{{ t("inputDevice") }}</h3
><label
class="settings-label"
for="input-device"
>{{ t("microphone") }}</label
><AudioDeviceSelect
id="input-device"
:model-value="selectedInputDeviceId"
:options="inputDeviceOptions"
:label="t('microphone')"
:disabled="!inputDevices.length"
@change="onInputDeviceChange"
/><p
><div class="settings-form-row"
><label
class="settings-label"
for="input-device"
>{{ t("microphone") }}</label
><AudioDeviceSelect
id="input-device"
:model-value="selectedInputDeviceId"
:options="inputDeviceOptions"
:label="t('microphone')"
:disabled="!inputDevices.length"
@change="onInputDeviceChange"
/></div
><p
v-if="audioSettingsError"
class="settings-error"
>{{ localizedMessage(audioSettingsError) }}</p
@@ -84,29 +87,39 @@
:checked="noiseSuppressionEnabled"
:aria-label="t('noiseSuppression')"
@change="onNoiseSuppressionToggle" /></label
><div class="settings-range-row"
><div class="settings-form-row settings-range-form-row"
><label class="settings-label">{{ t("inputVolume") }}</label
><strong>{{ Math.round(inputVolume * 100) }}%</strong></div
><input
class="settings-range"
type="range"
min="0"
max="100"
:value="inputVolume * 100"
:style="rangeStyle(inputVolume, 1)"
:aria-label="t('inputVolume')"
@input="onInputVolume" /><div class="settings-range-row"
><div class="settings-form-control"
><div class="settings-range-row"
><strong>{{ Math.round(inputVolume * 100) }}%</strong></div
><input
class="settings-range"
type="range"
min="0"
max="100"
:value="inputVolume * 100"
:style="rangeStyle(inputVolume, 1)"
:aria-label="t('inputVolume')"
@input="onInputVolume"
/></div
></div
><div class="settings-form-row settings-range-form-row"
><label class="settings-label">{{ t("voxThreshold") }}</label
><strong>{{ (voxThreshold * 100).toFixed(1) }}%</strong></div
><input
class="settings-range"
type="range"
min="1"
max="80"
:value="voxThreshold * 1000"
:style="rangeStyle(voxThreshold, 0.08)"
:aria-label="t('voxThreshold')"
@input="onVoxThreshold" /><div class="audio-level-row"
><div class="settings-form-control"
><div class="settings-range-row"
><strong>{{ (voxThreshold * 100).toFixed(1) }}%</strong></div
><input
class="settings-range"
type="range"
min="1"
max="80"
:value="voxThreshold * 1000"
:style="rangeStyle(voxThreshold, 0.08)"
:aria-label="t('voxThreshold')"
@input="onVoxThreshold"
/></div
></div
><div class="audio-level-row"
><span>{{ t("micLevel") }}</span
><strong>{{ Math.round(micLevel * 100) }}%</strong></div
><div class="audio-level-track"
@@ -147,50 +160,61 @@
:size="20"
/>
{{ t("outputVolume") }}</h3
><label
><div
v-if="outputDeviceSupported"
class="settings-label"
for="output-device"
>{{ t("outputDevice") }}</label
><AudioDeviceSelect
v-if="outputDeviceSupported"
id="output-device"
:model-value="selectedOutputDeviceId"
:options="outputDeviceOptions"
:label="t('outputDevice')"
:disabled="!outputDevices.length"
@change="onOutputDeviceChange"
/><p
class="settings-form-row"
><label
class="settings-label"
for="output-device"
>{{ t("outputDevice") }}</label
><AudioDeviceSelect
id="output-device"
:model-value="selectedOutputDeviceId"
:options="outputDeviceOptions"
:label="t('outputDevice')"
:disabled="!outputDevices.length"
@change="onOutputDeviceChange"
/></div
><p
v-else
class="mode-note"
><Icon
name="info"
:size="16"
/><span>{{ t("outputDeviceUnsupported") }}</span></p
><div class="settings-range-row"
><label class="settings-label">{{ t("speakers") }}</label
><strong>{{ Math.round(outputVolume * 100) }}%</strong></div
><div class="settings-form-row settings-range-form-row"
><label class="settings-label">{{ t("speakers") }}</label
><div class="settings-form-control"
><div class="settings-range-row"
><strong>{{ Math.round(outputVolume * 100) }}%</strong></div
><input
class="settings-range"
type="range"
min="0"
max="100"
:value="outputVolume * 100"
:style="rangeStyle(outputVolume, 1)"
:aria-label="t('outputVolume')"
@input="onOutputVolume"
/></div
></div
><div class="settings-form-row settings-range-form-row"
><label class="settings-label">{{ t("notificationVolume") }}</label
><div class="settings-form-control"
><div class="settings-range-row"
><strong>{{ Math.round(notificationVolume * 100) }}%</strong></div
><input
class="settings-range"
type="range"
min="0"
max="100"
:value="outputVolume * 100"
:style="rangeStyle(outputVolume, 1)"
:aria-label="t('outputVolume')"
@input="onOutputVolume" /><div class="settings-range-row"
><label class="settings-label">{{ t("notificationVolume") }}</label
><strong>{{ Math.round(notificationVolume * 100) }}%</strong></div
><input
class="settings-range"
type="range"
min="0"
max="100"
:value="notificationVolume * 100"
:style="rangeStyle(notificationVolume, 1)"
:aria-label="t('notificationVolume')"
@input="onNotificationVolume"
/><div class="audio-diagnostic"
:value="notificationVolume * 100"
:style="rangeStyle(notificationVolume, 1)"
:aria-label="t('notificationVolume')"
@input="onNotificationVolume"
/></div
></div
><div class="audio-diagnostic"
><span>{{ t("audioStatus") }}</span
><strong>{{
audioContextState === "running"
@@ -211,7 +235,8 @@
:size="16"
/><span>{{ t("audioPrivacy") }}</span></div
></section
> </div
></div
></div
><footer class="settings-footer"
><button
class="primary-button save-button"
+1 -1
View File
@@ -46,7 +46,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
{
id: BUILTIN_KAAK_SKIN_ID,
name: "KAAK",
version: "3.1.45",
version: "3.1.46",
author: "WebSpeak Project",
license: "AGPL-3.0-only",
description: "A KOOK-inspired voice-room workspace with collapsible voice groups, current voice-channel chat, TeamSpeak profile cards, and accessible host-owned voice controls.",
+6 -3
View File
@@ -464,7 +464,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
const file = new File([archive], "kaak-voice.wskin", { type: "application/octet-stream" });
const skin = await importSkinPack(file);
assert.equal(skin.id, "community.kaak-voice");
assert.equal(skin.version, "3.1.45");
assert.equal(skin.version, "3.1.46");
assert.equal(BUILTIN_SKIN_CATALOG.find((entry) => entry.id === skin.id)?.version, skin.version);
assert.equal(skin.schemaVersion, 3);
const home = skin.pluginData?.components.find((component) => component.page === "home");
@@ -567,8 +567,11 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
assert.match(skin.css, /settings-select-menu[\s\S]*?background: #25262a/);
assert.match(skin.css, /settings-select-option[\s\S]*?min-height: 32px/);
assert.match(skin.css, /settings-header h2 \{\s*color: #f2f3f5;\s*font-size: 32px;\s*font-weight: 600;/);
assert.match(skin.css, /settings-section h3 \{\s*color: #eceef0;\s*font-size: 16px;\s*font-weight: 600;/);
assert.match(skin.css, /voice\.audio-settings"] \.settings-label \{\s*font-weight: 400;/);
assert.match(skin.css, /settings-section h3 \{[\s\S]*?color: #eceef0;\s*font-size: 16px;\s*font-weight: 600;/);
assert.match(skin.css, /settings-audio-card \{\s*width: min\(660px, 100%\);[\s\S]*?background: #25262a;[\s\S]*?border-radius: 16px;/);
assert.match(skin.css, /settings-form-row \{\s*display: grid;\s*grid-template-columns: minmax\(0, 268fr\) minmax\(0, 320fr\);[\s\S]*?min-height: 72px;[\s\S]*?padding: 16px 24px;/);
assert.match(skin.css, /@media \(max-width: 680px\) \{[\s\S]*?settings-form-row \{\s*grid-template-columns: minmax\(0, 1fr\);/);
assert.match(skin.css, /voice\.audio-settings"] \.settings-label \{\s*margin: 0;\s*font-weight: 400;/);
assert.match(skin.css, /voice\.audio-settings"] \.settings-select \{[\s\S]*?border-radius: 12px;/);
assert.match(skin.css, /settings-select:hover:not\(:disabled\) \{\s*border-color: #6cbf00;/);
assert.match(skin.css, /voice\.audio-settings"] \.settings-select-menu \{[\s\S]*?padding: 8px;[\s\S]*?border-radius: 12px;[\s\S]*?background: #25262a;[\s\S]*?box-shadow: 0 2px 8px rgba\(0, 0, 0, \.32\);/);