From 311ce83be2e106836aac06d9ad3f5197684ab77a Mon Sep 17 00:00:00 2001 From: Beingpax Date: Mon, 5 Jan 2026 11:40:57 +0545 Subject: [PATCH] olish API provider configuration UI with consistent styling and improved layout --- .../AI Models/APIKeyManagementView.swift | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/VoiceInk/Views/AI Models/APIKeyManagementView.swift b/VoiceInk/Views/AI Models/APIKeyManagementView.swift index a02aeb1..20f3cc4 100644 --- a/VoiceInk/Views/AI Models/APIKeyManagementView.swift +++ b/VoiceInk/Views/AI Models/APIKeyManagementView.swift @@ -142,8 +142,10 @@ struct APIKeyManagementView: View { .help("Reset to default") } } - + if !ollamaModels.isEmpty { + Divider() + Picker("Model", selection: $selectedOllamaModel) { ForEach(ollamaModels) { model in Text(model.name).tag(model.name) @@ -153,16 +155,19 @@ struct APIKeyManagementView: View { aiService.updateSelectedOllamaModel(newValue) } } - - Button("Refresh Connection") { - checkOllamaConnection() - } - + } else if aiService.selectedProvider == .custom { // Custom Configuration inline TextField("API Endpoint URL", text: $aiService.customBaseURL) + .textFieldStyle(.roundedBorder) + + Divider() + TextField("Model Name", text: $aiService.customModel) - + .textFieldStyle(.roundedBorder) + + Divider() + if aiService.isAPIKeyValid { HStack { Text("API Key Set") @@ -173,6 +178,8 @@ struct APIKeyManagementView: View { } } else { SecureField("API Key", text: $apiKey) + .textFieldStyle(.roundedBorder) + Button("Verify and Save") { isVerifying = true aiService.saveAPIKey(apiKey) { success, errorMessage in