Skip to content

fix(ios): a value typed into the profile stays typed, and says it was entered by you - #239

Merged
ma3u merged 1 commit into
mainfrom
ios/profile-edits-stick
Sep 20, 2026
Merged

ma3u merged 1 commit into
mainfrom
ios/profile-edits-stick

Conversation

@ma3u

@ma3u ma3u commented Sep 20, 2026

Copy link
Copy Markdown
Owner

A weight typed by hand reverted to the one read from the reports a moment later, which is the opposite of what a field is for.

The cause

The fields were seeded with State(initialValue:) inside ProfileView.init, and a sheet's content closure is rebuilt more than once. Each rebuild re-ran the initialiser and put the stored value back over the edit.

The field accepted the keystrokes and showed them until the next redraw, which reads like a binding problem and is not one. Recorded in docs/gotchas.md.

They are seeded once now, in onAppear, guarded by a flag. The initialiser stores the lets and nothing else.

An edit now means what it says

Typing a figure means it was measured now. So its date moves to today, and the row stops claiming the value came from a report: it says entered by you instead.

Typing the old figure back puts both claims back as they were, because that is no longer an edit.

Saving already files each measurement under its own date, so a corrected weight lands on today rather than on the day the old one was measured.

Gates

Gate Result
swift test 239 tests, 42 suites
Scripts/run-ui-tests.sh 23 tests, 0 failures
check-localization.sh 242 strings, every prose string has German

A new UI test types into the weight field, checks the field holds it, checks the row says it was entered by you, and checks it is still there after the screen has been rebuilt. It fails against the old code.

Installed on the phone.

Refs #186.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LFMtTkqc3btcaWNur2A93P

… entered by you

A weight typed by hand reverted to the one read from the reports a moment
later, which is the opposite of what a field is for.

The fields were seeded with `State(initialValue:)` inside the initialiser, and
a sheet's content closure is rebuilt more than once. Each rebuild re-ran the
initialiser and put the stored value back over the edit. The field accepted
the keystrokes and showed them until the next redraw, which reads like a
binding problem and is not one.

They are seeded once now, in `onAppear`, guarded by a flag. The initialiser
stores the `let`s and nothing else.

And an edit means what it says. Typing a figure means it was measured now, so
its date moves to today and the row stops claiming the value came from a
report: it says "entered by you" instead. Typing the old figure back puts both
claims back as they were, because that is no longer an edit.

Saving already files each measurement under its own date, so a corrected
weight now lands on today rather than on the day the old one was measured.

Refs #186.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LFMtTkqc3btcaWNur2A93P
@ma3u
ma3u merged commit 9f69fb9 into main Sep 20, 2026
@ma3u
ma3u deleted the ios/profile-edits-stick branch September 20, 2026 22:06
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