Skip to content

The example box stops claiming to be empty while holding text - #37

Merged
bojieli merged 1 commit into
mainfrom
fix/example-box-label-stops-saying-empty
Sep 6, 2026
Merged

bojieli merged 1 commit into
mainfrom
fix/example-box-label-stops-saying-empty

Conversation

@bojieli

@bojieli bojieli commented Sep 6, 2026

Copy link
Copy Markdown
Owner

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:

  • macOS, box with text — the contradictory label is gone and the box sits directly under the preset buttons.
  • macOS, box cleared — the sentence appears inside the box in grey, and Clear is correctly disabled.
  • iOStestAPresetFillsTheExampleBoxAndPersists passes 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

"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>
@bojieli
bojieli merged commit c29cbda into main Sep 6, 2026
13 checks passed
@bojieli
bojieli deleted the fix/example-box-label-stops-saying-empty branch September 6, 2026 16:03
@bojieli bojieli mentioned this pull request Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant