Skip to content

App: Calorie Calc + Food Settings - OFF Fallback Preference#1092

Merged
CodeWithCJ merged 7 commits intoCodeWithCJ:mainfrom
apedley:app-cal-food-settings
Apr 7, 2026
Merged

App: Calorie Calc + Food Settings - OFF Fallback Preference#1092
CodeWithCJ merged 7 commits intoCodeWithCJ:mainfrom
apedley:app-cal-food-settings

Conversation

@apedley
Copy link
Copy Markdown
Contributor

@apedley apedley commented Apr 7, 2026

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

What problem does this PR solve?
(Keep it concise. 1–2 sentences.)

Could not set any user preferences via mobile app

How did you implement the solution?
Added select user preferences across 2 new settings screens. Calorie Settings and Food Search Settings.

Linked Issue: #

How to Test

  1. Change settings on web app or mobile
  2. View change on other platform
  3. Enable OFF barcode fallback
  4. Scan item not in default barcode providers db
  5. Get OFF result

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/ or src/):

  • [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.

Screenshots

Click to expand

Before

before
Screenshot 2026-04-07 at 12 17 20 AM

After

Screenshot 2026-04-07 at 12 17 20 AM

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.

Copy link
Copy Markdown
Contributor

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

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 introduces dedicated settings screens for calorie goal management and food search configuration. Key additions include the CalorieSettingsScreen for adjusting TDEE and activity levels, and the FoodSettingsScreen for managing data providers and barcode scanning behavior. The update also extends the backend preference repository and food search API to support these new configurations, including a database migration for OpenFoodFacts fallback settings. Review feedback suggests optimizing performance by avoiding unnecessary array spreads in component props, preventing potential animation glitches from nested layout transitions, and improving the robustness of dynamic color styling.

@CodeWithCJ CodeWithCJ merged commit e6e7a30 into CodeWithCJ:main Apr 7, 2026
7 checks passed
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.

2 participants