Capture growth weight as pounds and ounces - #293
Merged
Conversation
The growth form only accepted a single decimal weight, which is awkward
for the way baby weights are actually reported ("7 lb 4 oz"). When the
weight unit is lb, the form now shows a companion oz field and combines
the pair into the decimal pounds value we already persist, so nothing
changes in the API or schema.
Stored pound weights are split back into lb + oz when editing, and are
displayed as "7 lb 4 oz" on the entry cards and the weight stat tile.
Other units keep the existing single-field behavior.
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01TmBPUwpgaXgFNxxeXChutK
mike12806
marked this pull request as ready for review
August 5, 2026 14:46
mike12806
enabled auto-merge (squash)
August 5, 2026 14:46
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
The Add/Edit Measurement dialog only accepted a single decimal weight, which doesn't match how baby weights are actually reported ("7 lb 4 oz"). When the weight unit is
lb, the form now shows a companionozfield.How
client/src/utils/weight.tswithlbOzToPounds,poundsToLbOz, andformatWeight.weightstays a single number with aweight_unit.<value> <unit>rendering and single-field entry.lbhides and clears the oz field.Testing
client/test/weight.test.ts— conversion and formatting, including round-trips and the 16 oz carry.client/test/GrowthWeight.test.tsx— dialog behavior: lb + oz saves 7.25, oz-only saves 0.75, blank saves null, oz field hidden for metric units, and an existing 7.25 lb entry renders as "7 lb 4 oz" and round-trips through edit.tsc --noEmitpass. Layout verified at 390px width — the Unit dropdown stays aligned with the Height and Head Circumference rows.Generated by Claude Code