diff --git a/Sources/DoNotTypeApp/SettingsView.swift b/Sources/DoNotTypeApp/SettingsView.swift index 0d9202f..a2791c3 100644 --- a/Sources/DoNotTypeApp/SettingsView.swift +++ b/Sources/DoNotTypeApp/SettingsView.swift @@ -1351,10 +1351,18 @@ private struct TranscriptStyleSection: View { .disabled(model.dictationExample.isEmpty) } } + // The sentence goes in `prompt:`, not in the title. A TextField's first argument is + // its *label*, which a Form renders beside or above the field and keeps there whatever + // the field contains — so a title reading "Empty — …" sat above a box with text in it + // and flatly contradicted the thing it was describing. `prompt:` is the placeholder: + // it shows only while the box is empty, which is the one moment the sentence is true. TextField( - "Empty — however the model would write it", - text: $model.dictationExample, axis: .vertical + "Your example", + text: $model.dictationExample, + prompt: Text("Empty — however the model would write it"), + axis: .vertical ) + .labelsHidden() .lineLimit(4...12) .textFieldStyle(.roundedBorder) .accessibilityIdentifier("dictation-example") diff --git a/ios/App/SettingsView.swift b/ios/App/SettingsView.swift index 8c9e21f..09f7865 100644 --- a/ios/App/SettingsView.swift +++ b/ios/App/SettingsView.swift @@ -279,10 +279,17 @@ struct SettingsView: View { .disabled(model.dictationExample.isEmpty) .accessibilityIdentifier("preset-clear") } + // `prompt:` rather than the title, to say what this string is instead of relying on + // the platform to guess. iOS happens to render a Form TextField's title inside the + // field, so this looked right here while the identical line on macOS put "Empty — …" + // in the label column, where it stayed above a box with text in it. TextField( - "Empty — however the model would write it", - text: $model.dictationExample, axis: .vertical + "Your example", + text: $model.dictationExample, + prompt: Text("Empty — however the model would write it"), + axis: .vertical ) + .labelsHidden() .lineLimit(4...12) .accessibilityIdentifier("dictation-example") Text(