Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions Sources/DoNotTypeApp/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
11 changes: 9 additions & 2 deletions ios/App/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading