The example box stops claiming to be empty while holding text - #37
Merged
Merged
Conversation
"Empty — however the model would write it" was passed as the TextField's *title*, not its placeholder. A Form renders a title as a label and keeps it there whatever the field contains, so on macOS the sentence sat in the label column above a box with text in it, describing the opposite of what was on screen. Nothing about it was conditional — it is a string literal, so it said "Empty" whether or not the box was. It moves to `prompt:`, which is the placeholder: shown only while the box is empty, which is the one moment the sentence is true. iOS renders a Form TextField's title inside the field, which is why the identical line looked correct there — the same code, saved by a platform convention rather than by saying what it meant. Changed to match, so neither file depends on where a platform decides to put a label. Verified in the running app rather than by reasoning about SwiftUI: with text in the box the label is gone, and with the box cleared the sentence appears inside it in grey with Clear correctly disabled. On iOS, testAPresetFillsTheExampleBoxAndPersists passes against the simulator — the accessibility identifier is untouched, so the box is still found and a preset still fills it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The line above the example box read "Empty — however the model would write it" while the box had text in it.
It is not a status readout. The sentence was passed as the TextField's title, not its placeholder, and a Form renders a title as a label and keeps it there whatever the field contains. Nothing about it was conditional — it is a string literal, so it said "Empty" whether or not the box was. It would have read the same with the old prose wording in the box.
Moving it to
prompt:makes it the placeholder: shown only while the box is empty, which is the one moment the sentence is true.Why iOS is in this diff too
iOS renders a Form TextField's title inside the field, so the identical line looked correct there — the same code, saved by a platform convention rather than by saying what it meant. Both files now pass the sentence as a prompt, so neither depends on where a platform decides to put a label.
Verified in the running app
Not by reasoning about SwiftUI:
testAPresetFillsTheExampleBoxAndPersistspasses against the simulator. The accessibility identifier is untouched, so the box is still found by the test and a preset still fills it.Swift suite: 604 tests, 0 failures.
Not from 0.6.1
The line was introduced in #31 and shipped in 0.6.0.
🤖 Generated with Claude Code