refactor: Relocate text formatting toggle and rename ModelSettingsView

This commit is contained in:
Beingpax 2025-07-08 12:41:59 +05:45
parent 2c34225c88
commit fbae99bb27
3 changed files with 18 additions and 9 deletions

View File

@ -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

View File

@ -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))

View File

@ -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")
}
}