Skip to content

fix: allow decimal values for exercise duration#1664

Merged
CodeWithCJ merged 1 commit into
CodeWithCJ:mainfrom
apedley:exercise-duration-decimal
Jun 28, 2026
Merged

fix: allow decimal values for exercise duration#1664
CodeWithCJ merged 1 commit into
CodeWithCJ:mainfrom
apedley:exercise-duration-decimal

Conversation

@apedley

@apedley apedley commented Jun 28, 2026

Copy link
Copy Markdown
Contributor

Tip

Help us review and merge your PR faster!
Please ensure you have completed the Checklist below.
For Frontend changes, please run pnpm run validate to check for any errors.
PRs that include tests and clear screenshots are highly preferred!
Note: AI-generated descriptions must be manually edited for conciseness. Do not paste raw AI summaries.

Description

Duration of exercise (sets, cardio) was not allowing values to be have decimal places
There was some drift between the backup sql and migrations. Now a new migration fixes them and changes these columns from int to numeric

Linked Issue: Closes #1497

How to Test

  1. Create exercise entry
  2. Put in duration with decimal

PR Type

  • Issue (bug fix)
  • New Feature
  • Refactor
  • Documentation

Checklist

All PRs:

  • [MANDATORY - ALL] Integrity & License: I certify this is my own work, free of malicious code, and I agree to the License terms.

New features only:

  • [MANDATORY for new feature] Alignment: I have raised a GitHub issue and it was reviewed/approved by maintainers or it was approved on Discord.

Frontend changes (SparkyFitnessFrontend/):

  • [MANDATORY for Frontend changes] Quality: I have run pnpm run validate and it passes.
  • [MANDATORY for Frontend changes] Translations: I have only updated the English (en) translation file.

Backend changes (SparkyFitnessServer/):

  • [MANDATORY for Backend changes] Code Quality: I have run typecheck, lint, and tests. New files use TypeScript, new endpoints have Zod schemas, and new endpoints include tests.
  • [MANDATORY for Backend changes] Database Security: I have updated rls_policies.sql for any new user-specific tables.

UI changes (components, screens, pages):

  • [MANDATORY for UI changes] Screenshots: I have attached Before/After screenshots below.

Mobile changes (SparkyFitnessMobile/):

  • [MANDATORY for Mobile changes] Tested on device or emulator: I have verified the changes work on iOS or Android.

Screenshots

Click to expand

Before

before

After

after

Notes for Reviewers

Optional — use this for anything that doesn't fit above: known tradeoffs, areas you'd like specific feedback on, qustions you have or context that helps reviewers.

@github-actions github-actions Bot added backend bug Something isn't working frontend mobile labels Jun 28, 2026
@github-actions

github-actions Bot commented Jun 28, 2026

Copy link
Copy Markdown

PR Validation Results

Change Detection

  • 🖥️ Frontend changes detected
  • ⚙️ Backend changes detected
  • 📱 Mobile changes detected

✅ All checks passed. Thank you!

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables fractional (decimal) durations for exercise entries, sets, and workout templates across the database, web frontend, and mobile applications. Key changes include migrating database duration columns from integer to numeric, adopting a NumericInput component in the web frontend, updating mobile input keyboards to decimal-pad, and adjusting the mobile display logic to handle non-integer durations. Feedback was provided on the mobile detail screen to display durations with up to two decimal places instead of rounding to one, ensuring consistency with the web application's precision.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread SparkyFitnessMobile/src/screens/ActivityDetailScreen.tsx
@apedley apedley force-pushed the exercise-duration-decimal branch from 54c01e3 to ab998b1 Compare June 28, 2026 01:05
@CodeWithCJ CodeWithCJ merged commit 9c5ccbd into CodeWithCJ:main Jun 28, 2026
9 checks passed
@CodeWithCJ

Copy link
Copy Markdown
Owner

How will the decimal points be treated?
1.30 to indicate one min and 35 seconds or 1.5 ? And also does any changes to report tab?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Exercise Duration only accepts whole numbers (integers) in minutes

2 participants