Commit cd3b07bb67

cd3b07bb6790fce92111b94b7bdbd980b018f4f2

parent: 6ab3cb748c

Unsigned

cmc <hello@cleberg.net> · 2026-10-24 03:59 UTC

Show the domain input error below the field

Cleared as soon as the field is edited.

Layout: unified · split

DomainDig/ContentView.swift +8
@@ -214,6 +214,7 @@ struct ContentView: View {
214 focusedInputField = newValue == .single ? .singleDomain : .bulkDomains 214 focusedInputField = newValue == .single ? .singleDomain : .bulkDomains
215 } 215 }
216 .onChange(of: viewModel.domain) { _, newValue in 216 .onChange(of: viewModel.domain) { _, newValue in
217 viewModel.domainInputError = nil
217 guard inputMode == .single else { return } 218 guard inputMode == .single else { return }
218 let normalized = newValue.trimmingCharacters(in: .whitespacesAndNewlines) 219 let normalized = newValue.trimmingCharacters(in: .whitespacesAndNewlines)
219 guard normalized != viewModel.searchedDomain else { return } 220 guard normalized != viewModel.searchedDomain else { return }
@@ -318,6 +319,13 @@ struct ContentView: View {
318 viewModel.run() 319 viewModel.run()
319 } 320 }
320 321
322 if let domainInputError = viewModel.domainInputError {
323 Text(domainInputError)
324 .font(appDensity.font(.caption))
325 .foregroundStyle(Color(.statusCritical))
326 .frame(maxWidth: .infinity, alignment: .leading)
327 }
328
321 Button { 329 Button {
322 focusedInputField = nil 330 focusedInputField = nil
323 viewModel.run() 331 viewModel.run()