ui: align voice wake forwarding with remote mode

This commit is contained in:
Peter Steinberger
2025-12-07 23:04:51 +01:00
parent 891e1388ba
commit 40a6574b95
2 changed files with 27 additions and 11 deletions

View File

@@ -16,11 +16,22 @@ struct VoiceWakeForwardSection: View {
@Binding var status: VoiceWakeForwardStatus
let onTest: () -> Void
let onChange: () -> Void
var showToggle: Bool = true
var title: String = "Forward wake to host (SSH)"
var subtitle: String = "Send wake transcripts to a remote Clawdis host."
var body: some View {
VStack(alignment: .leading, spacing: 8) {
Toggle(isOn: self.$enabled) {
Text("Forward wake to host (SSH)")
if self.showToggle {
Toggle(isOn: self.$enabled) {
Text(self.title)
}
} else {
Text(self.title)
.font(.callout.weight(.semibold))
Text(self.subtitle)
.font(.footnote)
.foregroundStyle(.secondary)
}
if self.enabled {

View File

@@ -60,15 +60,20 @@ struct VoiceWakeSettings: View {
self.micPicker
self.levelMeter
VoiceWakeForwardSection(
enabled: self.$state.voiceWakeForwardEnabled,
target: self.$state.voiceWakeForwardTarget,
identity: self.$state.voiceWakeForwardIdentity,
command: self.$state.voiceWakeForwardCommand,
showAdvanced: self.$showForwardAdvanced,
status: self.$forwardStatus,
onTest: { Task { await self.checkForwardConnection() } },
onChange: self.forwardConfigChanged)
if self.state.connectionMode == .remote {
VoiceWakeForwardSection(
enabled: Binding.constant(true),
target: self.$state.remoteTarget,
identity: self.$state.remoteIdentity,
command: self.$state.voiceWakeForwardCommand,
showAdvanced: self.$showForwardAdvanced,
status: self.$forwardStatus,
onTest: { Task { await self.checkForwardConnection() } },
onChange: self.forwardConfigChanged,
showToggle: false,
title: "Voice Wake uses remote host",
subtitle: "SSH uses your remote Clawdis settings.")
}
VoiceWakeTestCard(
testState: self.$testState,