From fbae99bb27be855c8d9b7e4166e6f0c89c7c8c41 Mon Sep 17 00:00:00 2001 From: Beingpax Date: Tue, 8 Jul 2025 12:41:59 +0545 Subject: [PATCH] refactor: Relocate text formatting toggle and rename ModelSettingsView --- .../Views/AI Models/ModelManagementView.swift | 2 +- ...ationView.swift => ModelSettingsView.swift} | 18 +++++++++++++++++- VoiceInk/Views/Settings/SettingsView.swift | 7 ------- 3 files changed, 18 insertions(+), 9 deletions(-) rename VoiceInk/Views/{PromptCustomizationView.swift => ModelSettingsView.swift} (83%) diff --git a/VoiceInk/Views/AI Models/ModelManagementView.swift b/VoiceInk/Views/AI Models/ModelManagementView.swift index 69e0098..aac9559 100644 --- a/VoiceInk/Views/AI Models/ModelManagementView.swift +++ b/VoiceInk/Views/AI Models/ModelManagementView.swift @@ -112,7 +112,7 @@ struct ModelManagementView: View { .padding(.bottom, 12) if isShowingSettings { - PromptCustomizationView(whisperPrompt: whisperPrompt) + ModelSettingsView(whisperPrompt: whisperPrompt) } else { VStack(spacing: 12) { ForEach(filteredModels, id: \.id) { model in diff --git a/VoiceInk/Views/PromptCustomizationView.swift b/VoiceInk/Views/ModelSettingsView.swift similarity index 83% rename from VoiceInk/Views/PromptCustomizationView.swift rename to VoiceInk/Views/ModelSettingsView.swift index 54348f9..a94c003 100644 --- a/VoiceInk/Views/PromptCustomizationView.swift +++ b/VoiceInk/Views/ModelSettingsView.swift @@ -1,8 +1,9 @@ import SwiftUI -struct PromptCustomizationView: View { +struct ModelSettingsView: View { @ObservedObject var whisperPrompt: WhisperPrompt @AppStorage("SelectedLanguage") private var selectedLanguage: String = "en" + @AppStorage("IsTextFormattingEnabled") private var isTextFormattingEnabled = true @State private var customPrompt: String = "" @State private var isEditing: Bool = false @@ -61,6 +62,21 @@ struct PromptCustomizationView: View { .stroke(Color.secondary.opacity(0.2), lineWidth: 1) ) } + + Divider().padding(.vertical, 4) + + HStack { + Toggle(isOn: $isTextFormattingEnabled) { + Text("Automatic text formatting") + } + .toggleStyle(.switch) + + InfoTip( + title: "Automatic Text Formatting", + message: "Apply intelligent text formatting to break large block of text into paragraphs." + ) + } + } .padding() .background(Color(NSColor.controlBackgroundColor)) diff --git a/VoiceInk/Views/Settings/SettingsView.swift b/VoiceInk/Views/Settings/SettingsView.swift index d1c3551..ee4486c 100644 --- a/VoiceInk/Views/Settings/SettingsView.swift +++ b/VoiceInk/Views/Settings/SettingsView.swift @@ -14,7 +14,6 @@ struct SettingsView: View { @StateObject private var deviceManager = AudioDeviceManager.shared @ObservedObject private var mediaController = MediaController.shared @AppStorage("hasCompletedOnboarding") private var hasCompletedOnboarding = true - @AppStorage("IsTextFormattingEnabled") private var isTextFormattingEnabled = true @State private var showResetOnboardingAlert = false @State private var currentShortcut = KeyboardShortcuts.getShortcut(for: .toggleMiniRecorder) @@ -95,12 +94,6 @@ struct SettingsView: View { } .toggleStyle(.switch) .help("Automatically mute system audio when recording starts and restore when recording stops") - - Toggle(isOn: $isTextFormattingEnabled) { - Text("Automatic text formatting") - } - .toggleStyle(.switch) - .help("Apply intelligent text formatting with proper paragraphs and sentence structure to transcribed text") } }