Skip to content

App UI Tweaks - Zod Schemas#907

Merged
CodeWithCJ merged 9 commits intoCodeWithCJ:mainfrom
apedley:app-food-release
Mar 14, 2026
Merged

App UI Tweaks - Zod Schemas#907
CodeWithCJ merged 9 commits intoCodeWithCJ:mainfrom
apedley:app-food-release

Conversation

@apedley
Copy link
Contributor

@apedley apedley commented Mar 14, 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!

Description

UI Tweaks for screenshots for apple review

Related Issue

PR type [ ] Issue [ ] New Feature [ ] Documentation
Linked Issue: #

Checklist

Please check all that apply:

  • [MANDATORY for new feature] Alignment: I have raised a GitHub issue and it was reviewed/approved by maintainers
  • Tests: I have included automated tests for my changes.
  • [MANDATORY for UI changes] Screenshots: I have attached "Before" vs "After" screenshots below.
  • [MANDATORY for Frontend changes] Quality: I have run pnpm run validate (especially for Frontend).
  • Translations: I have only updated the English (en) translation file (if applicable).
  • Architecture: My code follows the existing architecture standards.
  • Database Security: I have updated rls_policies.sql for any new user-specific tables.
  • [MANDATORY - ALL] Integrity & License: I certify this is my own work, free of malicious code(phishing, malware, etc.) and I agree to the License terms.

Screenshots (if applicable)

Before

[Insert screenshot/GIF here]

After

[Insert screenshot/GIF here]

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request focuses on a multi-faceted improvement of the SparkyFitness application, touching both the mobile frontend and the Node.js backend. The primary goal is to refine the mobile app's user interface for a smoother experience and to meet specific requirements for platform reviews. Concurrently, the backend's measurement APIs have been fortified with Zod for enhanced data validation, ensuring greater stability and correctness. Significant effort was also put into updating developer documentation to streamline onboarding and ongoing development across the monorepo.

Highlights

  • Mobile UI/UX Enhancements: Implemented various UI tweaks across the mobile application, including adjustments to date navigators, macro cards, food summaries, and screen layouts, primarily aimed at improving the user experience and preparing for Apple review screenshots.
  • Backend API Validation with Zod: Introduced Zod schemas for robust request validation on key measurement-related API endpoints in the backend, ensuring data integrity and improving API reliability for water intake, check-in measurements, and custom categories/entries.
  • Updated Monorepo Documentation: Completely revamped the AGENTS.md documentation at the repository root to serve as a comprehensive operating guide for developers, and added new package-specific AGENTS.md files for the mobile and server applications, detailing their architectures, commands, and working rules.
  • Expanded iOS HealthKit Seeding: Enhanced the iOS HealthKit data seeding service to include new data types such as flights climbed, dietary water, and body temperature, providing more comprehensive test data for health synchronization features.
  • Dependency Updates: Updated the @kingstinct/react-native-healthkit dependency in the mobile application to version ^13.3.1 and adjusted related configuration.
Changelog
  • AGENTS.md
    • Rewrote the entire file to serve as a repo-root operating guide for coding agents, replacing the previous project documentation structure.
  • SparkyFitnessMobile/AGENTS.md
    • Added a new package-specific AGENTS.md guide for the mobile application, detailing its architecture, commands, and working rules.
  • SparkyFitnessMobile/package.json
    • Updated @kingstinct/react-native-healthkit dependency to ^13.3.1.
    • Removed @expo/config-plugins from dev dependencies.
  • SparkyFitnessMobile/plugins/withNetworkSecurityConfig.ts
    • Updated the import path for expo/config-plugins.
  • SparkyFitnessMobile/src/components/DateNavigator.tsx
    • Added a skipHorizontalPadding prop to control horizontal padding.
    • Adjusted vertical padding for the navigator.
  • SparkyFitnessMobile/src/components/ExerciseProgressCard.tsx
    • Changed the text color for the 'Exercise' label to text-secondary.
  • SparkyFitnessMobile/src/components/ExerciseSummary.tsx
    • Changed the text color for the 'Exercise' label to text-muted.
  • SparkyFitnessMobile/src/components/FoodSummary.tsx
    • Adjusted the spacing and alignment of meal section headers.
    • Changed the background opacity of the calorie count badge to bg-accent-primary/5.
  • SparkyFitnessMobile/src/components/MacroCard.tsx
    • Refactored styling to remove shadow and adjust padding, changing its container appearance.
  • SparkyFitnessMobile/src/components/MacroSummaryCard.tsx
    • Added a new component MacroSummaryCard for displaying macro summaries with animated progress bars.
  • SparkyFitnessMobile/src/components/SwipeableFoodRow.tsx
    • Adjusted the vertical padding of food rows to py-1.5.
  • SparkyFitnessMobile/src/screens/DashboardScreen.tsx
    • Applied skipSafeAreaTop to the DateNavigator component.
    • Changed contentInsetAdjustmentBehavior of the ScrollView to never.
    • Refactored the macro display to be contained within a single bg-surface card with a 'Macronutrients' title.
  • SparkyFitnessMobile/src/screens/DiaryScreen.tsx
    • Applied skipSafeAreaTop to the DateNavigator component.
    • Changed contentInsetAdjustmentBehavior of the ScrollView to never.
  • SparkyFitnessMobile/src/screens/FoodEntryViewScreen.tsx
    • Removed pb-4 padding from the food name Animated.View.
    • Changed the 'Tap to edit nutrition' text color to text-secondary.
    • Repositioned the delete button to be pinned to the bottom of the screen with a top border.
  • SparkyFitnessMobile/src/screens/FoodSearchScreen.tsx
    • Adjusted section header text styling to text-xs and removed tracking-wider.
    • Removed border from the search bar container.
  • SparkyFitnessMobile/src/screens/SettingsScreen.tsx
    • Adjusted ScrollView padding and set contentInsetAdjustmentBehavior to never.
  • SparkyFitnessMobile/src/screens/SyncScreen.tsx
    • Adjusted ScrollView padding and set contentInsetAdjustmentBehavior to never.
    • Increased header bottom margin to mb-5.
    • Adjusted styling for health metric cards, including alignment and text size.
  • SparkyFitnessMobile/src/services/seedHealthData.ios.ts
    • Expanded HealthKit write permissions to include FlightsClimbed, DietaryWater, and BodyTemperature.
    • Added seeding logic for FlightsClimbed quantity samples.
    • Implemented seeding for DietaryWater with multiple entries per day.
    • Implemented seeding for BodyTemperature with one reading per day.
  • SparkyFitnessServer/AGENTS.md
    • Added a new package-specific AGENTS.md guide for the server application, detailing its architecture, commands, and working rules.
  • SparkyFitnessServer/config/swagger.js
    • Updated Swagger definitions for WaterIntake to reflect new water_ml and source fields, and removed total_volume, servings_count, container_id.
    • Updated Swagger definitions for CheckInMeasurement to include neck, waist, hips, steps, height and remove various circumference fields.
    • Updated Swagger definitions for CustomMeasurementCategory to use name instead of category_name and include display_name and frequency.
  • SparkyFitnessServer/routes/measurementRoutes.js
    • Imported Zod schemas for request validation.
    • Integrated Zod schema validation for GET /water-intake/:date parameters.
    • Integrated Zod schema validation for POST /water-intake body.
    • Integrated Zod schema validation for GET /water-intake/entry/:id parameters.
    • Integrated Zod schema validation for PUT /water-intake/:id parameters and body.
    • Integrated Zod schema validation for DELETE /water-intake/:id parameters.
    • Integrated Zod schema validation for POST /check-in body.
    • Integrated Zod schema validation for GET /check-in/latest-on-or-before-date query parameters.
    • Updated Swagger tag for /measurements/check-in/{date} to 'Wellness & Metrics'.
    • Integrated Zod schema validation for GET /check-in/:date parameters.
    • Integrated Zod schema validation for PUT /check-in/:id parameters and body.
    • Integrated Zod schema validation for DELETE /check-in/:id parameters.
    • Integrated Zod schema validation for POST /custom-categories body.
    • Integrated Zod schema validation for POST /custom-entries body.
    • Integrated Zod schema validation for DELETE /custom-entries/:id parameters.
    • Integrated Zod schema validation for PUT /custom-categories/:id parameters and body.
    • Integrated Zod schema validation for DELETE /custom-categories/:id parameters.
    • Integrated Zod schema validation for GET /custom-entries/:date parameters.
    • Integrated Zod schema validation for GET /check-in-measurements-range/:startDate/:endDate parameters.
    • Integrated Zod schema validation for GET /custom-measurements-range/:categoryId/:startDate/:endDate parameters.
  • SparkyFitnessServer/schemas/measurementSchemas.ts
    • Added a new TypeScript file defining Zod schemas for various measurement-related API request bodies and parameters, including UpsertWaterIntakeBodySchema, UpdateWaterIntakeBodySchema, UpsertCheckInBodySchema, UpdateCheckInBodySchema, CreateCustomCategoryBodySchema, UpdateCustomCategoryBodySchema, UpsertCustomEntryBodySchema, DateParamSchema, UuidParamSchema, DateRangeParamSchema, and CustomMeasurementsRangeParamSchema.
  • pnpm-lock.yaml
    • Updated packageExtensionsChecksum.
    • Updated @kingstinct/react-native-healthkit version to 13.3.1 and its peer dependency react-native-nitro-modules to >=0.35.
    • Removed @expo/config-plugins@55.0.6 and @expo/config-types@55.0.5 entries.
    • Updated react-native-health-connect to depend on @expo/config-plugins@54.0.4.
  • pnpm-workspace.yaml
    • Added packageExtensions for @kingstinct/react-native-healthkit@13 to explicitly define its dependency on @expo/config-plugins.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
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

The pull request significantly refactors documentation across the monorepo, introducing new AGENTS.md files at both the root and SparkyFitnessMobile package level to provide structured guidance for coding agents. In the SparkyFitnessMobile app, several UI components were refined for better visual consistency and layout, including adjustments to padding, text colors, and the introduction of a new MacroSummaryCard component using Skia for progress visualization. The FoodEntryViewScreen was updated to pin the delete button to the bottom, and the DashboardScreen, DiaryScreen, SettingsScreen, and SyncScreen were adjusted for safe area insets and scroll behavior. Additionally, the mobile app's HealthKit seeding functionality was expanded to include hydration, body temperature, and flights climbed. On the SparkyFitnessServer side, API endpoints related to measurements (water intake, check-ins, custom measurements) were updated to use Zod schemas for robust input validation, replacing manual checks, and their Swagger documentation was refined to reflect these changes and new fields. A critical issue was identified where the POST /check-in endpoint incorrectly ignored the user_id from the request body, preventing authorized users from creating check-in entries for others, which requires correction to align with intended functionality and consistency with other endpoints. Another minor UI issue was noted on the DashboardScreen where the "Health Trends" title has an unusually large top margin (mt-24), suggesting a potential typo that should be reduced for a more compact layout.

@CodeWithCJ CodeWithCJ merged commit 6010d1d into CodeWithCJ:main Mar 14, 2026
6 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