Preview voice profile edits and confirm profiles from their tab

This commit is contained in:
Storm Dragon committed 2026-11-15 18:29:24 -05:00
1 parent e20319f776
commit 317303adb7
12 files changed
+165 -44

No files matched your search

+5 -1
View File
@@ -97,7 +97,11 @@ func new_session(settings config.Settings, order []string, title string, applica
form.Tabs = append(form.Tabs, tab)
}
if !application {
form.Tabs = append(form.Tabs, settings.VoiceProfiles.Tab())
profiles := settings.VoiceProfiles.Tab()
profiles.Controls = append(profiles.Controls,
interaction.Control{ID: "ok", Label: "OK", Kind: interaction.Button, Action: "save"},
interaction.Control{ID: "cancel", Label: "Cancel", Kind: interaction.Button, Action: "cancel"})
form.Tabs = append(form.Tabs, profiles)
}
return interaction.New_session(form)
}
+4 -1
View File
@@ -38,9 +38,12 @@ func TestSettingsFormCoversSchemaAndReturnsIsolatedDraft(t *testing.T) {
t.Fatal(got)
}
values := session.Values()
if len(values) != 65 {
if len(values) != 67 {
t.Fatal("missing settings or buttons", len(values))
}
if values["voice-profiles.ok"].Action != "save" || values["voice-profiles.cancel"].Action != "cancel" {
t.Fatal("profile changes cannot be confirmed or discarded on their tab")
}
unchanged, err := Settings(session, base)
if err != nil || !reflect.DeepEqual(unchanged, base) {
t.Fatal(unchanged, err)