fix: improve voice playback, diagnostics and workspace controls

This commit is contained in:
illusia committed 2026-11-13 19:49:31 +08:00
1 parent 72d7e6e013
commit e82116239a
34 files changed
+502 -147

No files matched your search

+12 -13
View File
@@ -50,15 +50,14 @@
@input="onInputVolume"
/>
<div class="dock-panel-divider"></div>
<label class="dock-switch-row"
><span
><strong>{{ t("noiseSuppression") }}</strong></span
><input
type="checkbox"
:checked="noiseSuppressionEnabled"
:aria-label="t('noiseSuppression')"
@change="onNoiseSuppressionToggle"
/></label>
<label class="dock-switch-row">
<span><strong>{{ t("noiseSuppression") }}</strong></span>
<select class="noise-suppression-level" :value="noiseSuppressionLevel" :aria-label="t('noiseSuppression')" @change="onNoiseSuppressionChange">
<option value="off">{{ t("noiseSuppressionOff") }}</option>
<option value="standard">{{ t("noiseSuppressionStandard") }}</option>
<option value="strong">{{ t("noiseSuppressionStrong") }}</option>
</select>
</label>
</div>
</div>
<div
@@ -132,12 +131,12 @@ import type { useVoiceWebSocket } from "../../composables/useVoiceWebSocket.js";
import type { useWebClientAudioControls } from "../../composables/useWebClientAudioControls.js";
const props = defineProps<{
model: Pick<ReturnType<typeof useVoiceWebSocket>, "microphoneMuted" | "inputVolume" | "outputVolume" | "outputMuted" | "noiseSuppressionEnabled" | "accompanimentActive">;
controls: Pick<ReturnType<typeof useWebClientAudioControls>, "toggleMicrophone" | "toggleNoiseSuppression" | "onInputVolume" | "onOutputVolume" | "onNoiseSuppressionToggle" | "toggleAccompaniment">;
model: Pick<ReturnType<typeof useVoiceWebSocket>, "microphoneMuted" | "inputVolume" | "outputVolume" | "outputMuted" | "noiseSuppressionLevel" | "accompanimentActive">;
controls: Pick<ReturnType<typeof useWebClientAudioControls>, "toggleMicrophone" | "toggleNoiseSuppression" | "onInputVolume" | "onOutputVolume" | "onNoiseSuppressionChange" | "toggleAccompaniment">;
t: (key: string) => string;
rangeStyle: (value: number, max: number) => Record<string, string>;
}>();
const { microphoneMuted, inputVolume, outputVolume, outputMuted, noiseSuppressionEnabled, accompanimentActive } = props.model;
const { toggleMicrophone, onInputVolume, onOutputVolume, onNoiseSuppressionToggle, toggleAccompaniment } = props.controls;
const { microphoneMuted, inputVolume, outputVolume, outputMuted, noiseSuppressionLevel, accompanimentActive } = props.model;
const { toggleMicrophone, onInputVolume, onOutputVolume, onNoiseSuppressionChange, toggleAccompaniment } = props.controls;
const emit = defineEmits<{ settings: []; outputMute: [] }>();
</script>
@@ -76,16 +76,14 @@
/>
{{ microphoneMuted ? t("unmuteMic") : t("muteMic") }}</button
></div
><label
class="noise-suppression-toggle settings-form-row"
><span
><strong>{{ t("noiseSuppression") }}</strong
><small>{{ t("noiseSuppressionHint") }}</small></span
><input
type="checkbox"
:checked="noiseSuppressionEnabled"
:aria-label="t('noiseSuppression')"
@change="onNoiseSuppressionToggle" /></label
><label class="settings-form-row">
<span><strong>{{ t("noiseSuppression") }}</strong><small>{{ t("noiseSuppressionHint") }}</small></span>
<select class="noise-suppression-level" :value="noiseSuppressionLevel" :aria-label="t('noiseSuppression')" @change="onNoiseSuppressionChange">
<option value="off">{{ t("noiseSuppressionOff") }}</option>
<option value="standard">{{ t("noiseSuppressionStandard") }}</option>
<option value="strong">{{ t("noiseSuppressionStrong") }}</option>
</select>
</label
><div class="settings-form-row settings-range-form-row"
><label class="settings-label">{{ t("inputVolume") }}</label
><div class="settings-form-control"
@@ -265,7 +263,7 @@ type AudioSettingsState = Pick<ReturnType<typeof useVoiceWebSocket>,
| "audioPermission"
| "audioContextState"
| "microphoneMuted"
| "noiseSuppressionEnabled"
| "noiseSuppressionLevel"
| "inputVolume"
| "outputVolume"
| "voxThreshold"
@@ -277,7 +275,7 @@ type AudioSettingsState = Pick<ReturnType<typeof useVoiceWebSocket>,
type AudioSettingsControls = Pick<ReturnType<typeof useWebClientAudioControls>,
| "settingsError"
| "onInputVolume"
| "onNoiseSuppressionToggle"
| "onNoiseSuppressionChange"
| "onOutputVolume"
| "onVoxThreshold"
| "onNotificationVolume"
@@ -310,7 +308,7 @@ const {
audioPermission,
audioContextState,
microphoneMuted,
noiseSuppressionEnabled,
noiseSuppressionLevel,
inputVolume,
outputVolume,
voxThreshold,
@@ -322,7 +320,7 @@ const {
const {
settingsError: audioSettingsError,
onInputVolume,
onNoiseSuppressionToggle,
onNoiseSuppressionChange,
onOutputVolume,
onVoxThreshold,
onNotificationVolume,
@@ -33,15 +33,21 @@
><div
><strong>{{ t("voiceStatus") }}</strong
><small>{{ t("voiceStatusHint") }}</small></div
><button
><div class="performance-panel-tools"><button
type="button"
class="performance-refresh"
:title="t('exportAudioTrace')"
:aria-label="t('exportAudioTrace')"
:disabled="!traceEvents.length"
@click="exportTrace"
><Icon name="download" :size="15" /></button><button
type="button"
class="performance-refresh"
:title="t('measureNow')"
:aria-label="t('measureNow')"
:disabled="performanceRunning"
@click="refreshPerformanceProbe"
><Icon
name="refresh"
:size="15" /></button
><Icon name="refresh" :size="15" /></button></div
></header>
<div
class="voice-status-summary"
@@ -147,6 +153,7 @@
: t("voiceStatusWaiting")
}}</p
>
<p class="performance-status">{{ t("backgroundVoiceHint") }} · {{ t("audioTraceHint") }}</p>
<section
v-if="showScreenShare && screenShareWebRtcStats.peers.length"
class="webrtc-stats"
@@ -224,7 +231,7 @@ import type { useWebClientPerformance } from "../../composables/useWebClientPerf
import type { ScreenShareWebRtcStats } from "../../composables/useVoiceWebSocket.js";
const props = defineProps<{ model: ReturnType<typeof useWebClientPerformance>; screenShareWebRtcStats: ScreenShareWebRtcStats; showScreenShare?: boolean; t: (key: string) => string }>();
const showScreenShare = props.showScreenShare !== false;
const { panelOpen: performancePanelOpen, running: performanceRunning, stats: performanceStats, togglePanel: togglePerformancePanel, refresh: refreshPerformanceProbe } = props.model;
const { panelOpen: performancePanelOpen, running: performanceRunning, stats: performanceStats, traceEvents, togglePanel: togglePerformancePanel, refresh: refreshPerformanceProbe, exportTrace } = props.model;
const root = ref<HTMLElement | null>(null);
const trigger = ref<HTMLButtonElement | null>(null);
const t = props.t;