Repository navigation
Conversation
Persist fractional kg/lb values by widening valuesInt to Float[], and update weight inputs to accept step 0.1 decimals without parseInt truncation.
|
@luke-song is attempting to deploy a commit to the Workoutcool Team Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
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.
📝 Description
Weight inputs in workout sets (and admin suggested-set editors) previously used
parseIntandpattern="[0-9]*", so values like 2.5 kg / 7.5 kg (and lb equivalents) could not be entered or kept.This PR:
valuesIntfromInt[]→Float[]onWorkoutSetandProgramSuggestedSetso fractional weights persist (existing integers cast cleanly)step="0.1",inputMode="decimal", andparseFloat(reps/time stay integers)patternon the session weight field so mobile keyboards allow decimals.5)Kept intentionally small and scoped to #99 only (no share-image / #54 / #252 work).
📋 Checklist
🗃️ Prisma Migrations (if applicable)
Migration:
prisma/migrations/20260919000000_allow_decimal_weight_values— castsvaluesInttoDOUBLE PRECISION[]onworkout_setsandprogram_suggested_sets.🧪 How to test
npx prisma migrate deploy/migrate dev) and regenerate client (prisma generate).2.5,7.5,12.5(kg or lbs) — value should stick after blur/finish set (not snap to2/7/12).🔗 Related Issues
Fixes #99