Repository navigation
Add a weight goal with trend and estimated arrival date - #13
Merged
Merged
Conversation
libtesseract ships no arm64 simulator slice. SwiftyTesseract answers
that by excluding arm64 from every simulator build, which leaves an
Intel-only app that current iOS simulators refuse to install ("needs to
be updated").
On Apple Silicon simulators only:
- the Podfile drops that arm64 exclusion and leaves out the two
SwiftyTesseract files that call into libtesseract;
- the OCR plugin builds without libtesseract and answers a scan with an
error.
Label scanning therefore does not work in the simulator. Device builds
are unchanged.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Users can set a target weight on the Weight screen (web and mobile) and see how they are doing against it: progress from where they started, weekly pace, a trend line and goal line on the chart, and the date the current pace reaches the goal. - API: new WeightGoal table (target, start weight, set date). GET /api/weights now also returns the goal and trend; PUT and DELETE /api/weights/goal set and remove it, behind the existing weights:create permission. - The pace is a least-squares line through the last 30 days of weigh-ins, so one odd reading does not swing the date. It widens to 90 days when those span under a week, and gives no estimate with less than a week of data, when moving away from the goal, or when the goal is more than three years out. - Moving the target further the same way keeps the progress made; a goal in the other direction restarts from the current weight. - Web and mobile: goal card with set, edit and remove; the chart gains a dotted goal line, a dashed trend line projected ahead, and a marker where the two meet. English and Hebrew. The mobile weigh-in list also used a hardcoded "kg"; it now uses the translated unit. Needs the 20261115120000_weight_goal migration. Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
What
Users can set a target weight on the Weight screen (web and mobile) and see how they are doing against it:
A second commit makes the iOS app build and run on Apple Silicon simulators, which was needed to check the mobile screen.
How the estimate works
The logic is
weightTrendinapps/api/src/domain.ts, shared by both clients through the API.API
WeightGoaltable (target, start weight, set date). Needs migration20261115120000_weight_goal.GET /api/weightsnow also returnsgoalandtrend.PUT /api/weights/goalandDELETE /api/weights/goalset and remove the goal. They reuse the existingweights:createpermission rather than adding a new one.Simulator build
libtesseracthas no arm64 simulator slice, and SwiftyTesseract excludes arm64 from every simulator build, leaving an Intel-only app that current simulators refuse to install. On Apple Silicon simulators only, the Podfile drops that exclusion and leaves out the two wrapper files that call Tesseract, and the OCR plugin answers a scan with an error. Label scanning does not work in the simulator; device builds are unchanged.Testing
weightTrendunit tests (on track, window choice, too little data, off track, reached in both directions); typecheck andnpm testpass.flutter analyzeandflutter testpass. Run on the iPhone 18 Pro simulator: set a goal, validation error, edit form. Device build (flutter build ios --debug --no-codesign) succeeds.Not checked: the on-track view on a simulator or device (the test account has one weigh-in), the Hebrew layout on web, and a run on a physical iPhone.
🤖 Generated with Claude Code